NPM Resource Changed PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Jaimin2687
Jaimin2687
16 Jan 2026

Pull Request for Issue #44728

this PR adds accessibility attributes (name, id, aria-labelledby) to form elements in the PHPDebugBar settings panel that are dynamically generated by the vendor library.
Problem
The PHPDebugBar settings panel contains form elements (select dropdowns, checkboxes, text inputs) that lack name and id attributes. This causes browser DevTools warnings:

"A form field element should have an id or name attribute"

These warnings indicate accessibility issues that prevent programmatic access to form controls and create barriers for assistive technologies.

Solution

Since the form elements are generated by the vendor library (php-debugbar), which should not be modified, this fix injects the required attributes via Joomla's debug plugin JavaScript after the debugbar initializes.

The implementation uses:

  • MutationObserver to detect when the debugbar is added to the DOM
  • Fallback mechanisms for immediate check and window load event
  • Semantic attribute generation based on label text (e.g., phpdebugbar-theme, phpdebugbar-hide-empty-tabs)

Testing Instructions

  1. Enable the Debug System plugin in Joomla administrator
  2. Load any page (frontend or backend)
  3. Open browser DevTools (F12) → Console tab
  4. Verify no warnings about form elements missing name/id attributes
  5. Open the PHPDebugBar settings (gear icon) and inspect the form elements
  6. Confirm each select, checkbox, and input has proper name, id, and aria-labelledby attributes

Before fix:

[DOM] A form field element should have an id or name attribute

After fix:
No warnings related to PHPDebugBar form elements.

Technical Details

Files Changed

File Description
build/media_source/plg_system_debug/js/debug.es6.js Source JavaScript with accessibility fix
media/plg_system_debug/js/debug.js Compiled JavaScript
media/plg_system_debug/js/debug.min.js Minified JavaScript

New Functions

  • addAccessibleAttributesToForm(settingsForm) - Adds name, id, and aria-labelledby attributes to form elements
  • fixDebugBarFormAttributes() - Sets up MutationObserver and fallbacks to apply the fix

Related Issues

Fixes #44728


image
avatar Jaimin2687 Jaimin2687 - open - 16 Jan 2026
avatar Jaimin2687 Jaimin2687 - change - 16 Jan 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jan 2026
Category JavaScript Repository NPM Change
avatar Jaimin2687 Jaimin2687 - change - 16 Jan 2026
Labels Added: NPM Resource Changed PR-5.4-dev
avatar brianteeman
brianteeman - comment - 16 Jan 2026

Wouldnt it be better to contribute these accessibility fixes upstream to the phpdebugbar repo

avatar richard67 richard67 - change - 16 Jan 2026
The description was changed
avatar richard67 richard67 - edited - 16 Jan 2026
avatar richard67 richard67 - change - 16 Jan 2026
Title
[GH-44728] Fix missing name/id attributes on PHPDebugBar settings form elements
[5.4] Fix missing name/id attributes on PHPDebugBar settings form elements
avatar richard67 richard67 - edited - 16 Jan 2026
avatar Jaimin2687
Jaimin2687 - comment - 16 Jan 2026

Wouldnt it be better to contribute these accessibility fixes upstream to the phpdebugbar repo

Thank you for the clarification, Brian. I wasn't aware that these media files were auto-generated or that this specific component was upstream. I will close this PR and check the upstream repository instead. Thanks for the guidance!

avatar Jaimin2687 Jaimin2687 - change - 16 Jan 2026
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2026-01-16 11:38:42
Closed_By Jaimin2687
avatar Jaimin2687 Jaimin2687 - close - 16 Jan 2026

Add a Comment

Login with GitHub to post a comment