Skip to content

Fire frmEndFormLoading when going to the previous page - #3623

Open
vivi-the-going-merry[bot] wants to merge 3 commits into
masterfrom
fix/issue-6906-end-form-loading-prev
Open

vivi-the-going-merry[bot] wants to merge 3 commits into
masterfrom
fix/issue-6906-end-form-loading-prev

Conversation

@vivi-the-going-merry

@vivi-the-going-merry vivi-the-going-merry Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes Strategy11/formidable-pro#6906

Broken: On AJAX multi-page forms, Previous adds frm_loading_prev (not frm_loading_form), but removeSubmitLoading() only selected .frm_loading_form. The form was skipped, so frmEndFormLoading never fired, the class stayed on, and on an errors response the buttons stayed disabled.

Changed: removeSubmitLoading() selects .frm_loading_form, .frm_loading_prev in js/formidable.js and the same edit in js/formidable.min.js. The bfcache pageshow handler uses the same selector, so it now also re-enables buttons on a form restored with frm_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_prev plus frmFrontForm.removeSubmitLoading() fired no frmEndFormLoading and kept the class (red). With the patched bundle it fires once and the class is removed (green). The frm_loading_form path 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

vivi-the-going-merry Bot and others added 2 commits October 26, 2026 11:44
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>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@deepsource-io

deepsource-io Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in c5b435b...09d7976 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

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.

@franky-the-going-merry franky-the-going-merry Bot added the franky-working Franky is actively reviewing this label Oct 26, 2026

@franky-the-going-merry franky-the-going-merry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: frmEndFormLoading fired 0 times, frm_loading_prev stayed, 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.

@franky-the-going-merry franky-the-going-merry Bot added vivi-pickup and removed franky-review franky-working Franky is actively reviewing this labels Oct 26, 2026
@vivi-the-going-merry vivi-the-going-merry Bot added vivi-working Vivi is actively working this run e2e tests Run the Cypress end-to-end suite on this PR and removed vivi-pickup vivi-working Vivi is actively working this labels Oct 26, 2026
@vivi-the-going-merry

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run analysis run e2e tests Run the Cypress end-to-end suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants