Repository navigation
Fire frmEndFormLoading when going to the previous page - #3623
vivi-the-going-merry[bot] wants to merge 3 commits into
Conversation
removeSubmitLoading only selected .frm_loading_form, so a form carrying frm_loading_prev was skipped and never cleared. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Oct 26, 2026 5:51p.m. | Review ↗ | |
| JavaScript | Oct 26, 2026 5:51p.m. | Review ↗ |
Important
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.
There was a problem hiding this comment.
Approve with one non-blocking note.
Bug reproduced and fixed live. Preview env (Lite only, PR's formidable.min.js vs base's), form preview page in a real browser: put frm_loading_prev on the form, disabled the submit button, called frmFrontForm.removeSubmitLoading( $form, 'enable' ).
- Base:
frmEndFormLoadingfired 0 times,frm_loading_prevstayed, button stayed disabled. - PR: fired once, class removed, button re-enabled.
Checked: js/formidable.js and js/formidable.min.js carry the same selector change (the min has it in both places). Both .frm_loading_form and .frm_loading_prev are removed together by the existing classList.remove, and showLoadingIndicator() already treats the two classes as equivalent. The paypal/square/stripe scripts only ever add or remove frm_loading_form themselves, so no sibling has the same gap. Psalm is red with MissingPureAnnotation across stripe/ and other files untouched by this diff.
Note (non-blocking): the new Cypress spec is not run by CI (E2E Test is skipped without the run e2e tests label) and I did not run it either; I ran its same calls and assertions by hand as above. It also walks the whole builder (template, field, settings) only to get a form key, then calls removeSubmitLoading() directly, so it does not exercise a real Previous click. It would fail on base, so it is a valid regression guard; add the run e2e tests label once to see it green.
Not exercised: the bfcache pageshow change through a real back-button restore, a real Pro page-break Previous click, PHPUnit/Cypress, review skills (two-line diff read in full), visual/screenshot.
|
Added run e2e tests per the note. The new spec (frmEndFormLoadingOnPrev.cy.js) passes in CI (shard 1). Shard 2 fails in admin-a11y.cy.js on the sale banner dismiss link (link-name), a file this PR does not touch. No code change. |
Closes Strategy11/formidable-pro#6906
Broken: On AJAX multi-page forms, Previous adds
frm_loading_prev(notfrm_loading_form), butremoveSubmitLoading()only selected.frm_loading_form. The form was skipped, sofrmEndFormLoadingnever fired, the class stayed on, and on an errors response the buttons stayed disabled.Changed:
removeSubmitLoading()selects.frm_loading_form, .frm_loading_previnjs/formidable.jsand the same edit injs/formidable.min.js. The bfcachepageshowhandler uses the same selector, so it now also re-enables buttons on a form restored withfrm_loading_prev(not exercised through a real back-button restore). Added a Cypress spec for the Previous state.Verified: In a Playground preview env (Lite master), a form with
frm_loading_prevplusfrmFrontForm.removeSubmitLoading()fired nofrmEndFormLoadingand kept the class (red). With the patched bundle it fires once and the class is removed (green). Thefrm_loading_formpath is unchanged. The new Cypress spec was not run locally. Page-break Previous itself is Pro-only, so the spec triggers the state directly.🤖 Generated with Claude Code