Skip to content

Fix regressions from PRs merged since 7.1.1 - #3766

Open
Crabcyborg wants to merge 5 commits into
masterfrom
fix/deferred-settings-logic-options
Open

Crabcyborg wants to merge 5 commits into
masterfrom
fix/deferred-settings-logic-options

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes regressions found while auditing the Lite and Pro PRs merged since v7.1.1.

What changed

  • Conditional logic and calculation lists on large forms (from Load builder settings near the viewport and streamline field previews #3741). Settings far from the viewport now load only when needed, so choosing a far away radio field as a logic field left the value dropdown empty, and saving stored a rule with no value. The dropdown now refills once the source field's settings load, keeping the chosen value. The calculation field list refreshes once the settings it checks for excluded options arrive. When a dependent field's settings fail to load during a choice rename, the logic remap is queued and replayed on that field's rows once its settings load.
  • Field cache race and multisite (from Cache one field list per form and read it once per request #3758). The field sources and field chunks are separate transients, so two requests rebuilding at once could pair one's sources with the other's fields and misclassify fields as repeater or embedded fields for up to 6 hours. The sources are now saved with a signature of their field list and rebuilt on mismatch. Caches written before this change are rebuilt once. The per-request cache is keyed by blog as well as form.
  • New frm_entry_meta_unchanged action (from Skip entry meta updates when the value has not changed #3734). The frm_update_entry_meta filter runs before the unchanged check, so a listener keeping state from it never heard back when the write was skipped. The companion fix in formidable-code-field (https://github.com/Strategy11/formidable-code-field/pull/3) listens to it.
  • Release builds (from Cache webpack builds and drop the dev server reload #3763). npm run build -- --no-cache passed the flag to every add-on's own build script, and sass rejects it, which stopped the formidable-surveys release. The script now removes node_modules/.cache/webpack before building. It also runs npm ci in Lite when Lite's closure compiler is missing, since Pro and other add-ons minimize with it. The webpack cache now also resets when .browserslistrc or package.json changes, so a cached build cannot commit stale bundles.
  • UseSharedTranslationDomain sniff. Language packs leave JS only strings out of Lite's PHP translations, so add-on strings moved to the formidable domain because Lite used them only in JS showed in English. The sniff now ignores .pot entries whose references are all scripts. Pro's fix: https://github.com/Strategy11/formidable-pro/pull/7051.

Merge note: once the sniff change is on master, these add-ons report UsePluginDomain errors until phpcbf --sniffs=Formidable.Translations.UseSharedTranslationDomain is run on them: cart (2), events (2), image-editor (3), media-field (1), projects (1), quizzes (1), rating-icons (1). Pro is handled in its companion PR.

Testing

  1. Open the builder for a form with more than 100 fields. Select a field near the top, add a conditional logic rule and choose a radio field far down the form. The value dropdown fills with its options within a second. Before this change it stayed empty.
  2. On the same form, block admin-ajax.php?action=frm_load_field_settings for one far field whose logic uses a choice field (devtools request blocking), rename that choice, unblock, then select the far field. Its logic row shows the new value.
  3. ~/test.sh --filter 'test_FrmFieldTransientCache|test_FrmField|test_FrmEntryMeta'. The new tests fail without the fix.
  4. npm run test:js passes (88). php phpcs-sniffs/tests/run.php passes.
  5. In the builder, change .browserslistrc to ie 11 and run npm run build:js twice with the cache. js/frm_testing_mode.js has no arrow functions on the second build.

Verified locally: PHPUnit for FrmField (200 tests) and FrmEntryMeta (14), JS tests, phpcs, phpstan, php-cs-fixer, rector and mago on the changed PHP files, and the first two testing steps in a headless browser on form 650. Not run: an actual add-on release build.

🤖 Generated with Claude Code

Crabcyborg and others added 5 commits November 27, 2026 16:34
Settings far from the viewport load only when needed, so code that
read another field's settings before they arrived found nothing.

Refill a logic value dropdown once its source field's settings load,
keeping the chosen value, and refresh the calculation field list once
the settings it checks for excluded options arrive.

When a dependent field's settings fail to load during a choice
rename, queue the logic remap and replay it on that field's rows when
its settings load later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The field sources and the field chunks are saved in separate
transients, so two requests building the list at once could store
one's sources with the other's fields. Save a signature of the field
list with the sources and rebuild when it does not match.

Key the per-request cache by blog as well as form, so a list loaded
before switch_to_blog() is not reused for another blog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The frm_update_entry_meta filter runs before the unchanged check, so
a listener that keeps state from it never heard back when the write
was skipped. Fire frm_entry_meta_unchanged on the skip path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm passed --no-cache to every add-on's own build script, and sass
rejects it, which stopped the formidable-surveys release. Remove the
webpack cache folder before building instead.

Install Lite's dependencies when its closure compiler is missing,
since add-ons minimize with it.

Clear the webpack cache when .browserslistrc or package.json changes,
so a cached build cannot keep stale bundles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lite loads JS strings from JSON translations, and language packs
leave them out of the PHP translations, so an add-on string moved to
the formidable domain because Lite used it only in JS showed in
English. Skip .pot entries whose references are all scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 32b46de and eb3571a.

Files selected for processing: 9

  • bin/build-plugin.sh
  • classes/models/FrmEntryMeta.php
  • classes/models/FrmField.php
  • js/formidable_admin.js
  • js/src/admin/admin.js
  • phpcs-sniffs/Formidable/Sniffs/Translations/UseSharedTranslationDomainSniff.php
  • tests/phpunit/entries/test_FrmEntryMeta.php
  • tests/phpunit/fields/test_FrmFieldTransientCache.php
  • webpack.config.js
  • 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

@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 non-blocking notes and one gap I could not close (below).

Tests run: phpunit -c phpunit.xml --filter 'test_FrmFieldTransientCache|test_FrmEntryMeta' at eb3571a → 25 OK (90 assertions); --filter test_FrmField → 200 OK; node --test tests/js/*.test.mjs → 88 pass. Three mutants each fail their test: signature check ignored (test_sources_from_another_field_list_are_rebuilt), do_action removed (test_update_entry_metas_skips_unchanged_values), blog ID dropped from the request-cache key (test_request_cache_is_kept_per_blog). php-cs-fixer is clean on all five changed PHP files. CI skipped PHPCS, PHPStan, Mago, ESLint, Oxlint and Cypress at this head. I ran ESLint on admin.js (only two "rule definition not found" errors from my local sonarjs install). I could not run PHPCS (the harness vendor has no WPCS).

Checked and fine: the field-cache signature, the frm_entry_meta_unchanged action placement, the .pot parsing in the sniff, and the build-plugin.sh change (bash -n clean, lite_dir is resolved before the cd). I probed the sniff on a synthetic .pot: JS-only entries are dropped, and mixed, no-reference and msgctxt entries are kept. On the real languages/formidable.pot the sniff now loads 2,734 msgids against 2,905 before.

Not verified, please close it:

  • Live repro of the logic/calc regressions. I built a 133-field form in the preview env, with a radio at the far end, and set the logic field to it. The value dropdown filled on both master's bundle and this PR's bundle, even with a 3s server delay on frm_load_field_settings. The far field's settings were already in the page when I chose it, so I never reached the empty-dropdown state. That proves nothing for or against the fix. Testing step 2 (hold the request for one far field) is the one that would reach it. Install the hold before page scripts run, because my override installed after load missed requests that were already queued. The pendingLogicUpdates replay and the calc-list refresh are source-reviewed only.
  • bin/build-plugin.sh was not run as a release build (the description says the same).
  • Committed bundle: js/formidable_admin.js contains the new source. A local rebuild in my scratch path differs at least in webpack module ids, and I did not prove full equivalence.

Non-blocking:

  • The sniff change has no fixture in phpcs-sniffs/tests/fixtures, although the repo has a harness for that.
  • test_request_cache_is_kept_per_blog only checks the key's shape. It never calls switch_to_blog, so the multisite behaviour is untested.

@franky-the-going-merry franky-the-going-merry Bot removed franky-review franky-working Franky is actively reviewing this labels Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant