fix(formit): filter AJAX config before session/cache writes#310
Open
Ibochkarev wants to merge 1 commit into
Open
fix(formit): filter AJAX config before session/cache writes#310Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
Ibochkarev
force-pushed
the
fix/issue-308-serialization
branch
from
July 23, 2026 05:20
37cbd50 to
46b418b
Compare
Keep only scalar snippet properties before storing FormIt config for AJAX handling in session and MODX cache. Fixes HTTP 500 on PHP 8.4.
Ibochkarev
force-pushed
the
fix/issue-308-serialization
branch
from
July 23, 2026 05:25
46b418b to
252f198
Compare
Ibochkarev
marked this pull request as ready for review
July 23, 2026 05:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filter FormIt snippet config before session and MODX file cache writes for AJAX.
Since 5.2.0,
Request::prepare()stored the full$this->configfor AJAX tokens. On PHP 8.4 that payload can hold Closures, objects, resources, and internal arrays. Session shutdown throwsSerialization of 'Closure' is not allowed. MODX cache writes throwvar_export does not handle circular references. After the first FormIt render, any request with that session returns HTTP 500.getStorableAjaxConfig()inRequest.phpkeeps null and scalar snippet properties.lexiconsandpermissionsrebuild whenaction.phpcreates a new FormIt instance.pageIdstaysint|null.bootstrap.phpunchanged.Version 5.2.5.
Fixes #308