You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show a message when a builder save exceeds post_max_size - #3625
Fixes the Lite half of Strategy11/formidable-pro#6921.
What was broken
When the builder's Update request is larger than PHP's post_max_size, PHP drops the whole body. $_POST arrives empty, route() takes the edit action from the URL and redraws the builder from the database. Every change is lost and nothing tells the user. With "Load and save form builder page with AJAX" on, admin-ajax.php answers 400 0 and the JS quietly resubmits the same oversized form, which fails the same way.
What changed
FrmFormsController::route(): an empty POST on the edit/update action that is larger than post_max_size now redraws the builder with a message that names the limit and links to the server-limits docs. update() is skipped on purpose; it would also add a misleading permission/nonce error because the nonce was dropped too.
submitBuild() error handler (js/src/admin/admin.js and the compiled js/formidable_admin.js, hand-patched because the bundle isn't byte-reproducible): a 413, or a 400 with body 0, no longer resubmits. It clears the saving state, keeps the edits on screen and shows a modal (frm_admin_js.save_too_large). Other failures still fall back to the normal submit.
PHPUnit: test_post_exceeds_max_size covers oversized-empty, at-limit, parsed-POST and GET cases.
How verified
php -l on the changed PHP files, node --check on the patched bundle.
The patched minified handler was run in a node harness with fake e/Re/a/qi: 413 and 400+0 show the modal, 400+other and 500 still resubmit.
CI: see checks on this PR.
Not done: a live before/after screenshot. The preview env (Playground/PHP-wasm) can't set post_max_size, so the oversized request can't be reproduced there.
Not in this PR
formidable-pro#6922 (max_input_vars on the front end) is a separate fix.
PHP drops the whole body of an oversized POST, so the builder redrew
from the database with no message. Detect the empty POST and redraw
with an error instead.
Refs Strategy11/formidable-pro#6921
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A 400 with body 0 or a 413 means the request never reached the handler,
so resubmitting the form the normal way loses the edits too.
Refs Strategy11/formidable-pro#6921
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
We reviewed changes in c5b435b...3a7a12b on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
We reviewed changes in c5b435b...3a7a12b on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
❌ Patch coverage is 33.33333% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.38%. Comparing base (c95bdaa) to head (3a7a12b). ⚠️ Report is 113 commits behind head on master.
Not labeled franky-review yet: this changes rendered output (a new builder error message and modal) and I couldn't capture the before/after image the PR template requires. The preview env runs PHP in WASM and can't set post_max_size, so the oversized request can't be reproduced there. Checks: PHPUnit green on all four PHP versions; ESLint, Stylelint, PHPCS, PHPStan, Mago, Rector and PHP CS Fixer pass. Psalm fails on master already (MissingPureAnnotation across the repo, nothing on these lines). DeepSource JS/PHP report blocking issues I can't read without a login. Needs someone with a real PHP-FPM site and post_max_size = 64K to confirm the message and add the screenshot, then add franky-review.
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
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.
Fixes the Lite half of Strategy11/formidable-pro#6921.
What was broken
When the builder's Update request is larger than PHP's
post_max_size, PHP drops the whole body.$_POSTarrives empty,route()takes theeditaction from the URL and redraws the builder from the database. Every change is lost and nothing tells the user. With "Load and save form builder page with AJAX" on,admin-ajax.phpanswers 4000and the JS quietly resubmits the same oversized form, which fails the same way.What changed
FrmFormsController::route(): an empty POST on theedit/updateaction that is larger thanpost_max_sizenow redraws the builder with a message that names the limit and links to the server-limits docs.update()is skipped on purpose; it would also add a misleading permission/nonce error because the nonce was dropped too.submitBuild()error handler (js/src/admin/admin.jsand the compiledjs/formidable_admin.js, hand-patched because the bundle isn't byte-reproducible): a 413, or a 400 with body0, no longer resubmits. It clears the saving state, keeps the edits on screen and shows a modal (frm_admin_js.save_too_large). Other failures still fall back to the normal submit.test_post_exceeds_max_sizecovers oversized-empty, at-limit, parsed-POST and GET cases.How verified
php -lon the changed PHP files,node --checkon the patched bundle.e/Re/a/qi: 413 and 400+0show the modal, 400+other and 500 still resubmit.post_max_size, so the oversized request can't be reproduced there.Not in this PR
formidable-pro#6922(max_input_varson the front end) is a separate fix.Closes Strategy11/formidable-pro#6921
🤖 Generated with Claude Code