Skip to content

A11y: distinct aria-label for duplicate form landmarks (aria_landmark_name_unique) - #3367

Open
vivi-the-going-merry[bot] wants to merge 4 commits into
masterfrom
fix/issue-6695-landmark-name-unique
Open

vivi-the-going-merry[bot] wants to merge 4 commits into
masterfrom
fix/issue-6695-landmark-name-unique

Conversation

@vivi-the-going-merry

@vivi-the-going-merry vivi-the-going-merry Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What was broken

Two admin pages each render two <form> elements with no accessible name, so screen reader users can't tell them apart when jumping between landmarks (IBM Equal Access rule aria_landmark_name_unique):

  • Styles page (?page=formidable-styles): the style settings form and the live style preview form.
  • Import/Export page (?page=formidable-import): the Import form and the Export form.

Confirmed against a real CI run's IBM checker log: exactly these 4 violations, 2 per page.

The same 4 <form> elements also each need a unique accessible label, not just any label (IBM rule aria_form_label_unique) — the fix below covers both rules on the same lines, confirmed by re-running the IBM checker post-fix.

What changed

Added a distinct aria-label to each form:

  • Style settings form: "Style settings"
  • Style preview form: "Form preview" — the preview reuses the same general-purpose form renderer used site-wide on the front end, so the label is only injected for this one render via a temporary add_filter/remove_filter pair on the existing frm_form_attributes hook (same mechanism FrmAntiSpam already uses), not a change to the shared front-end template.
  • Import form: "Import" (reuses the page's own existing translated heading string)
  • Export form: "Export" (same)

Markup/PHP only — no CSS or JS changes.

How it was verified

Added PHPUnit tests (tests/phpunit/styles/test_FrmStylesController.php, tests/phpunit/xml/test_FrmXMLController.php) that render the real markup and assert each page's two <form> tags have distinct, non-empty aria-label values. Confirmed red before the fix (empty accessible name) and green after, against the real local PHPUnit rig. PHPCS clean. Self-reviewed (3 parallel lenses: correctness, security, simplify) — extracted the duplicated assertion logic into a shared FrmUnitTest::assert_form_landmarks_have_unique_names() helper.

CI's own E2E run (checkIbmAccessibility against every admin page) confirms zero aria_landmark_name_unique and zero aria_form_label_unique violations on this branch.

Closes Strategy11/formidable-pro#6695
Closes Strategy11/formidable-pro#6697

🤖 Generated with Claude Code

The Styles edit page renders two <form> elements (style settings, live
preview) and the Import/Export page renders two more (Import, Export) -
all four shared no accessible name, tripping the IBM Equal Access
aria_landmark_name_unique rule. Give each a distinct aria-label.

Closes Strategy11/formidable-pro#6695
Both new tests asserted the same thing (distinct, non-empty aria-label
per <form>) with duplicated regex/assertion logic.
@vivi-the-going-merry vivi-the-going-merry Bot added run analysis run e2e tests Run the Cypress end-to-end suite on this PR labels Sep 17, 2026
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

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

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b0d7f30a-06ec-4e34-920d-e773fb3eab2a

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

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.

@deepsource-io

deepsource-io Bot commented Sep 17, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in e404085...c75e345 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 Sep 17, 2026 9:50p.m. Review ↗
JavaScript Sep 17, 2026 9:50p.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.

…ist view

render_style_page() reads $_GET (form/style_id) to pick 'edit' vs 'list';
a leftover value from another test would silently render the list view's
single form instead, making this fail for the wrong reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants