Skip to content

A11y: dedupe ids colliding between advanced/quick style settings (aria_id_unique) - #3368

Open
vivi-the-going-merry[bot] wants to merge 1 commit into
masterfrom
fix/issue-6696-aria-id-unique
Open

vivi-the-going-merry[bot] wants to merge 1 commit into
masterfrom
fix/issue-6696-aria-id-unique

Conversation

@vivi-the-going-merry

Copy link
Copy Markdown
Contributor

What was broken

The style-editor page's "Advanced Settings" accordion sections and its "Quick Settings" panel both render into the DOM unconditionally (CSS toggles which is visible), so four ids were reused between a quick-settings control and its advanced-settings equivalent for the same underlying field — frm_field_pad, frm_field_margin, frm_border_radius — plus a fourth, frm_fieldset_color, reused between the General and Form Title accordion sections (a copy-paste leftover: the Form Title instance actually controls title_color, not a fieldset border color). Confirmed against a real CI IBM checker log format: exactly 4 duplicate-id violations (IBM Equal Access rule aria_id_unique), matching this count.

What changed

  • Renamed the quick-settings trio with the frm_style_qsettings_ prefix already used by 4 sibling controls in the same file (classes/views/styles/_quick-settings.php).
  • Renamed the Form Title id to frm_title_color (classes/views/styles/_form-title.php), matching its own field name and its sibling frm_title_size/frm_title_margins ids.
  • Updated the matching <label for="..."> attributes alongside each renamed id.

No id referenced by JS (js/admin/style.js's getElementById('frm_field_pad')) was touched — it already resolved to the (unchanged) accordion element in document order before this fix, since the accordion renders before Quick Settings; behavior there is unchanged. The "advanced settings mirrors quick settings" live sync is keyed on field name, not DOM id, so it's unaffected too.

Markup-only — no CSS or JS changes.

How it was verified

Added a PHPUnit test (tests/phpunit/styles/test_FrmStylesController.php) rendering the real style-editor page markup and asserting each of the 4 originally-colliding ids, plus the 4 renamed ids, appears exactly once — via a small reusable assert_no_duplicate_element_ids() helper added to the shared FrmUnitTest base class. Confirmed red (2 occurrences) before the fix, green after, against the real local PHPUnit rig. PHPCS clean.

Self-reviewed with 2 parallel Agent-tool lenses (correctness, reuse/simplification) against this diff — both confirmed no issues; correctness lens specifically traced the getElementById question above to confirm no behavior change, and one lens's suggestion (also assert the new renamed ids, not just the old ones — guards against a future "fix by deletion" regression) was applied.

Closes Strategy11/formidable-pro#6696

🤖 Generated with Claude Code

The style-editor page's "Advanced Settings" accordion sections and its
"Quick Settings" panel both render into the DOM unconditionally (CSS
toggles which is visible), so four ids were reused between a quick-settings
control and its advanced-settings equivalent for the same underlying
field: frm_field_pad, frm_field_margin, and frm_border_radius. A fourth,
frm_fieldset_color, was reused between the General and Form Title
accordion sections — a copy-paste leftover, since the Form Title instance
actually maps to the title_color field, not a fieldset border color.

Renamed the quick-settings trio with the frm_style_qsettings_ prefix
already used by four sibling controls in the same file, and renamed the
Form Title one to frm_title_color to match its own field and its sibling
frm_title_size/frm_title_margins ids. No id referenced by JS
(getElementById('frm_field_pad')) was touched, so behavior is unchanged.

Closes Strategy11/formidable-pro#6696
@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 run tests 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: c7f9097f-7be5-4dce-83b3-c9b0be60dc83

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...aa4902f 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 10:46p.m. Review ↗
JavaScript Sep 17, 2026 10:46p.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.

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.57%. Comparing base (d0ffb93) to head (aa4902f).
⚠️ Report is 827 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3368      +/-   ##
============================================
+ Coverage     28.36%   28.57%   +0.21%     
- Complexity     9806     9844      +38     
============================================
  Files           160      160              
  Lines         32921    33022     +101     
============================================
+ Hits           9339     9437      +98     
- Misses        23582    23585       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

priority: low run analysis run e2e tests Run the Cypress end-to-end suite on this PR run tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants