Skip to content

fix: an empty validated field inside an invisible column no longer blocks submit (6.4.x) - #250

Closed
RensTillmann wants to merge 1 commit into
release/6.4.xfrom
fix/required-invisible-column-6.4
Closed

RensTillmann wants to merge 1 commit into
release/6.4.xfrom
fix/required-invisible-column-6.4

Conversation

@RensTillmann

@RensTillmann RensTillmann commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

On 6.4.0xx a form with an empty field that has a validation rule (for example numeric or email) inside a column set to invisible is rejected by the server with "Please fill in all required fields.", although the browser accepted it: validate_form skips fields under an invisible column (has_hidden_parent() defaults includeInvisibleColumns to true), but the payload still submits them and SUPER_Ajax::collect_required_fields() enrolled them as required.

Fix: collect_required_fields() skips the subtree of a column whose invisible is true, matching the browser. Hidden fields and the payload JS are unchanged.

Replaces the 6.4 part of closed #219 (which targeted the archived stable branch). LTS is not affected: its has_hidden_parent() has no invisible-column check, so client and server already agree there.

Base branch

release/6.4.x: bug fix for the beta channel (frozen: security and bug fixes only). Not needed on lts/6.3.x (see above).

Tests

PHPUnit, new Test_Super_Forms_Required_Fields_Invisible_Column (g16-phpunit:wp7.1.1-php8.2 + MariaDB 11.4):
  without the fix: 2 failures (field "amount" in an invisible column is enrolled)
  with the fix:    OK (5 tests, 10 assertions)
Full PHPUnit suite with the fix: OK, 617 tests, 10295 assertions, 1 skipped
node --test tests/test-validation-client.cjs: 42 pass, 0 fail
run-validation-compatibility.py --group layout (real submit_form, SQLite dev bootstrap):
  without the fix: 26/28 (layout-invisible-column-validated-empty and its flat twin fail)
  with the fix:    28/28

Changelog: src/docs/changelog.md gets an "Unreleased - Version 6.4.010-beta" section with one Fix line.

Merge

Draft: for QA and the next 6.4.0xx release session; not merged by the author.

@RensTillmann

Copy link
Copy Markdown
Owner Author

The fix is already released in 6.4.010 (release PR #299, merged 21 Oct 2026): src/includes/class-ajax.php line 8694 skips invisible columns in collect_required_fields(). This PR's two repo tests were not part of that release and stay on this branch. The browser suite covers this on 6.4.010 (invisible-column.spec.ts, 2 tests passed).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant