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
Support repeater paths inside embedded forms - #3602
Support repeater fields inside embedded forms by preserving the full nested item_meta path when reading submitted values, checking whether values were posted, and writing validated values. Resolve nested frontend field IDs, including Other inputs and combo subfields, while ignoring form and row metadata.
Add FrmEntryMetaPathHelper and regression tests for nested reads and writes, malformed paths, sibling-row preservation, backslashes, and legacy parent arguments. The generated frontend script matches a fresh build. These are the existing local changes, separated without behavior changes.
Lite PHPUnit: 947 tests, 4,845 assertions, no failures. The runner reports 3 skipped tests, 3 incomplete tests, 99 notices, and one configuration deprecation.
Companion Pro branch: 13 embedded repeater tests with 42 assertions pass. Its AJAX regression passes separately with 4 assertions. The harness verifies that it loads the companion branch.
Source and generated JavaScript each pass 13 field ID checks. The generated file matches Closure Compiler output.
PHP syntax, PHPCS, PHP-CS-Fixer, Rector, scoped Mago lint, full-plugin PHPStan, Oxlint, typos, and whitespace checks pass. ESLint exits successfully with four warnings on unchanged lines. Full-plugin Mago analysis exits successfully with two warnings outside this change.
Full-plugin Psalm reports four errors. An isolated checkout of unchanged master reports the same four errors, concerning WordPress stubs and an existing deprecated function.
Reviewed the changed submission paths and frontend handling. No new security concern was identified.
Remaining verification
Keep this draft alongside the Pro draft until browser verification covers adding and removing nested rows, required validation, conditional logic, Other choices, totals, page navigation, and saved-entry editing. Browser verification was not run in this session.
We reviewed changes in ab4ee48...a4feb25 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.
The reason will be displayed to describe this comment to others. Learn more.
Approve, with two non-blocking notes below.
Live before/after (preview env, Lite + Pro companion #6881 loaded; same seeded form: parent form → embedded form → repeater with a required text field):
Base (master Lite + master Pro): the embedded repeater's input renders as item_meta[7][0][6], outside the embed's item_meta[8][0]... path. A submit with the field filled saved the repeater rows as a top-level 7 meta on the parent entry instead of under the embed. A direct FrmEntryValidate::validate call with the correctly nested payload returned a false REQUIRED_MSG for a filled field and created a phantom item_meta[7] key.
PR (#3602 + #6881): input renders as item_meta[8][0][7][0][6]. Empty submit shows the required error on the right field (frm_field_6-7-0_container, screenshot below). Filled submit saves with no error, and the entry chain nests correctly (parent field 8 → embed entry → repeater entry → hello). Validate with the filled nested payload returns no errors and no phantom key; the empty payload errors only on the empty row.
Backslash loss in a sibling row (A \ B → A B) happens identically on base, so it is not a regression from this PR.
Not exercised: add/remove rows, conditional logic, Other choices, combo subfields, totals, page navigation, editing a saved entry, multiple rows through the browser. The new JS branch was only hit for a plain text field. Run only against the PR's own two-PR pairing: Lite alone changes nothing (nothing in Lite sets item_meta_path), and Pro #6881 needs this Lite helper, so this should merge first. CI is all skipping because the PR is a draft, so PHPUnit/PHPCS/PHPStan have not run on GitHub; I read the diff and the source but did not run the PHPUnit file or the lint tools myself.
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: the early return at line 535 (if ( ! $args['parent_field_id'] ) { return; }, not in this diff) is the legacy argument, but the lines below it are now path-aware. A caller that passes only item_meta_path (the way Pro's new code calls get_posted_meta) hits an undefined-index notice here, and with parent_field_id empty it returns before the path is ever used. Pro #6881 happens to pass both today. Make that guard match the path logic so the two can't drift: if ( empty( $args['parent_field_id'] ) && empty( $args['item_meta_path'] ) ) { return; }.
The "Other" branch also has no test; test_FrmEntryMetaPathHelper covers read/write/malformed/legacy but not set_other_repeating_vals with a path. A short case with $_POST['item_meta'][10][0]['other'][30] would cover it.
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: path is a new option on a widely used function, but it isn't in $defaults or the docblock, and FrmEntryMetaPathHelper::get_posted_row() is its only caller. Either add 'path' => array() to $defaults and document it, or keep the walk inside FrmEntryMetaPathHelper so get_simple_request stays as it was. The existing contract (wp_unslash after the lookup) is preserved either way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Support repeater fields inside embedded forms by preserving the full nested
item_metapath when reading submitted values, checking whether values were posted, and writing validated values. Resolve nested frontend field IDs, including Other inputs and combo subfields, while ignoring form and row metadata.Add
FrmEntryMetaPathHelperand regression tests for nested reads and writes, malformed paths, sibling-row preservation, backslashes, and legacy parent arguments. The generated frontend script matches a fresh build. These are the existing local changes, separated without behavior changes.This is the Lite companion to https://github.com/Strategy11/formidable-pro/pull/6881. The field lifecycle hooks for the parent/child relations index remain separate in #3595.
Validation
Remaining verification
Keep this draft alongside the Pro draft until browser verification covers adding and removing nested rows, required validation, conditional logic, Other choices, totals, page navigation, and saved-entry editing. Browser verification was not run in this session.