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
classes/views/frm-fields/front-end/gdpr/gdpr-field.php's disabled-notice branch (shown when GDPR is disabled, to users who can edit forms) wraps its notice in a <div role="group" aria-labelledby="frm-gdpr-accept-<id>">. No element in that branch has that id — only the enabled branch's checkbox input does, and the two branches are mutually exclusive. So the reference pointed at nothing, leaving the group with no accessible name for assistive tech.
Dropped the aria-labelledby attribute from that div. role="group" with no name is valid ARIA; there's nothing in that branch it could correctly point to.
Added tests/phpunit/fields/test_FrmFieldGdpr.php:
disabled branch: asserts no aria-labelledby is printed, and the notice text still shows
enabled branch (regression guard): asserts aria-labelledby/matching id are still there, unaffected
Verified
Local PHPUnit (9.6, PHP 8.5) against wordpress-develop:
New test failed on unmodified master (reproducing the dangling reference), passed after the fix.
Full --group fields run (116 tests): 1 pre-existing failure, also present on unmodified master — PHP 8.5 deprecation text leaking into test_FrmFieldCombo::test_print_input_atts's output, unrelated to this change.
FYI, out of scope
The disabled branch's <label for="frm-gdpr-accept-<id>"> also points at that same missing id. Same class of issue, but #3478 only asked about aria-labelledby on the div, so left as-is.
The reason will be displayed to describe this comment to others. Learn more.
Approving. Dropping aria-labelledby from the disabled-notice <div> is the right fix: nothing in that branch carries frm-gdpr-accept-<id> (only the enabled branch's checkbox does, and the branches are mutually exclusive), and an unnamed role="group" is valid. hide_gdpr_field() reads enable_gdpr, so both new tests really drive the branch they claim, and the enabled-branch test guards against over-deleting. Tests restore the enable_gdpr global in tearDown(). PHPUnit passes on PHP 7.4 and 8; php -l is clean on both files (the CI syntax check was cancelled by a newer run, not failed).
Generalization check: the other aria-labelledby references in classes/ that use static ids (frm-previewDrop, frm-navbarDrop, frm_captcha_type_label, frm-onboarding-consent-tracking-list) all resolve to an element with that id. The _label-suffixed ones (combo-fields, address-field, FrmFieldType.php:256) point at the field label and are outside this diff; I did not check them.
One correction to the PR description's "FYI": the disabled branch's <label> no longer has a for attribute on master (7426abbb0 dropped it, and the existing test in this file asserts it), so there is no second dangling reference to follow up on.
Not verified: I did not run the new tests locally or with a screen reader; the evidence is the CI run plus tracing the template.
Correction to my Approve at 4ae67390d: I wrote that the cancelled check was only the PHP syntax job. Re-checking the check runs for this head, PHPCS, PHP CS Fixer, PHPStan, Rector, ESLint, Stylelint and both PHP-syntax jobs are all cancelled (the Inspections runs from 2026-09-24 12:46Z were cancelled and never re-ran). Only PHPUnit (PHP 7.4/8), Psalm, Mago, Oxlint and typos actually completed, all green. So my approval covers the code (template change and the two new tests, read and traced) but not lint/static analysis on the 74 new test lines.
Needed before merge: re-run the cancelled jobs (or push a no-op merge of master, which is 87 commits ahead) and confirm they pass. Routing this back to vivi-pickup for that; no change requested to the code itself.
The reason will be displayed to describe this comment to others. Learn more.
Re-review at 4ae6739 (unchanged head since my 09-28 approve). Approve on the code; the PR now needs a rebase before it can merge.
Lint/static analysis, the gap from my last note, is closed. Vivi's re-run at 22:11Z on this head: Inspections x4 (PHPCS, PHP CS Fixer, Rector, ESLint), PHPStan, Mago, Oxlint, PHP Syntax Check and Stylelint are all success. PHPUnit (7.4 and 8) and Psalm were already green. The code review itself is unchanged: aria-labelledby removed from the disabled-notice <div>, enabled-branch checkbox untouched, two new tests drive the branches they claim.
Needs a rebase: GitHub reports CONFLICTING. git merge-tree against current master shows one conflict, tests/phpunit/fields/test_FrmFieldGdpr.php. Master's 149cfce86 ("Try to support new versions of PHPUnit") added #[\PHPUnit\Framework\Attributes\Group]/CoversClass attributes at the top of that class. Resolve by keeping master's class header and re-adding this PR's setUp/tearDown, the two new tests and render_gdpr_field(). The new tests' @covers FrmFieldType::include_front_field_input docblocks should get the attribute equivalent if the surrounding tests on master use one. After the rebase, php -l and phpunit --filter test_FrmFieldGdpr on the merged file are enough to re-confirm.
I did not run the tests locally; the evidence is CI on this head and a trace of the template.
Merged master (no force-push). One conflict in test_FrmFieldGdpr.php: kept master class header, kept this PR setUp/tearDown and tests, dropped the method-level covers docblock now that the class carries CoversClass. php -l clean.
We reviewed changes in 3a1aadc...7beada3 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.
Access to an undefined property FrmSettings::$enable_gdpr
This issue is raised when an attempt is made to access an undefined property.
This may not have been intended, and it is advisable to give the code another look to make sure the property is defined in the scope it is used in.
The reason will be displayed to describe this comment to others. Learn more.
Access to an undefined property FrmSettings::$enable_gdpr
This issue is raised when an attempt is made to access an undefined property.
This may not have been intended, and it is advisable to give the code another look to make sure the property is defined in the scope it is used in.
The reason will be displayed to describe this comment to others. Learn more.
Access to an undefined property FrmSettings::$enable_gdpr
This issue is raised when an attempt is made to access an undefined property.
This may not have been intended, and it is advisable to give the code another look to make sure the property is defined in the scope it is used in.
We reviewed changes in 3a1aadc...7beada3 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
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.
Re-review at 7beada3 (Vivi merged master into the branch; the PR's own diff is still the same two files). Approve.
Conflict resolved.test_FrmFieldGdpr.php kept master's class header (CoversClass) and this PR's setUp/tearDown and two new tests. mergeable is now MERGEABLE. The PR diff against master is gdpr-field.php (-1 aria-labelledby) plus the test file, nothing else.
CI at this head: PHPUnit 7.4 / 8.0 / 8.2 / 8.4, Psalm, PHPStan, Mago, PHPCS, PHP CS Fixer, Rector, ESLint, Stylelint, Oxlint, both PHP-syntax jobs and typos are all green.
Before/after run (this was missing from my earlier approvals, which were source-traced): I ran --filter test_FrmFieldGdpr in the wordpress-develop harness with the PR checked out.
PR template: 4 tests, 8 assertions, OK.
Same run with gdpr-field.php swapped back to master's version: test_disabled_notice_has_no_dangling_aria_labelledby fails (the other three pass). PHPUnit printed the failure message garbled (a known quirk when a file under test changes), so I am going on the red/green flip, not the message text.
So the new test catches the original bug, and the enabled branch still renders aria-labelledby="frm-gdpr-accept-544" with the matching id.
DeepSource PHP is red with "undefined property FrmSettings::$enable_gdpr" and "undefined method assertStringContainsString" on the new test lines. Both are false positives: enable_gdpr is a magic property that the existing tests in this file already use, and DeepSource cannot see the PHPUnit base class. Not blocking.
Not verified: no screen reader or browser render; the evidence is the test run on the real template plus CI.
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.
What was broken
classes/views/frm-fields/front-end/gdpr/gdpr-field.php's disabled-notice branch (shown when GDPR is disabled, to users who can edit forms) wraps its notice in a<div role="group" aria-labelledby="frm-gdpr-accept-<id>">. No element in that branch has that id — only the enabled branch's checkbox input does, and the two branches are mutually exclusive. So the reference pointed at nothing, leaving the group with no accessible name for assistive tech.Found by franky-review on #3465, filed as #3478.
What changed
Dropped the
aria-labelledbyattribute from that div.role="group"with no name is valid ARIA; there's nothing in that branch it could correctly point to.Added
tests/phpunit/fields/test_FrmFieldGdpr.php:aria-labelledbyis printed, and the notice text still showsaria-labelledby/matchingidare still there, unaffectedVerified
Local PHPUnit (9.6, PHP 8.5) against
wordpress-develop:master(reproducing the dangling reference), passed after the fix.--group fieldsrun (116 tests): 1 pre-existing failure, also present on unmodifiedmaster— PHP 8.5 deprecation text leaking intotest_FrmFieldCombo::test_print_input_atts's output, unrelated to this change.FYI, out of scope
The disabled branch's
<label for="frm-gdpr-accept-<id>">also points at that same missing id. Same class of issue, but #3478 only asked aboutaria-labelledbyon the div, so left as-is.Closes #3478
🤖 Generated with Claude Code