?
avatar thednp
thednp
17 Mar 2021

Steps to reproduce the issue

  • Set a description="Some description" property for any field type
  • Investigate the markup of the field, the field label has id="jform_params_FIELD_NAME-lbl" while the field description has id="jform[params][FIELD_NAME]-desc". These values are taken from cassiopeia default template style as an example but I'm sure this issue applies in general to all field types in any form.
  • Both label and description aren't following a common pattern, see below.

Expected result

IMO all fields should follow a strict pattern that doesn't confuse developers

  • <label id="jform_params_FIELD_NAME_lbl"> - all underscore
  • <input id="jform_params_FIELD_NAME"> - all underscore
  • <div id="jform_params_FIELD_NAME_desc"> - all underscore

If this change is too dramatic, at least this would make it more consistent:

  • <label id="jform_params_FIELD_NAME-lbl"> - same pattern
  • <input id="jform_params_FIELD_NAME"> - all underscore
  • <div id="jform_params_FIELD_NAME-desc"> - same pattern

Actual result

  • <label id="jform_params_FIELD_NAME-lbl"> - not all underscore, mixed, no pattern
  • <input id="jform_params_FIELD_NAME"> - all underscore, CHECKED, correct pattern
  • <div id="jform[params][FIELD-NAME]-desc"> - not all underscore, brackets, no pattern, total FAIL

System information (as much as possible)

Joomal 4.0 beta 7.

Additional comments

Not having a correct pattern for field description id could potentially break or otherwise disrupt anything to do with accessibility as well as confuse devs into fixing/patching something that's incorrect in the core FormField code.

@dgrammatiko suggested an overhaul of all field types to be converted to web components, if that happens, it should also take into account this issue right here.

avatar thednp thednp - open - 17 Mar 2021
avatar joomla-cms-bot joomla-cms-bot - change - 17 Mar 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Mar 2021
avatar thednp thednp - change - 17 Mar 2021
The description was changed
avatar thednp thednp - edited - 17 Mar 2021
avatar thednp thednp - change - 17 Mar 2021
The description was changed
avatar thednp thednp - edited - 17 Mar 2021
avatar thednp
thednp - comment - 17 Mar 2021

After a quick investigation, it turns out the issue is with renderfield.php#L35.

Should I commit a PR with necessary changes?

avatar brianteeman
brianteeman - comment - 17 Mar 2021

Please dont. This will massively break sites for no benefit. This is working perfectly as it is

avatar thednp thednp - change - 17 Mar 2021
The description was changed
avatar thednp thednp - edited - 17 Mar 2021
avatar thednp thednp - change - 17 Mar 2021
The description was changed
avatar thednp thednp - edited - 17 Mar 2021
avatar thednp thednp - change - 17 Mar 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-03-17 08:10:05
Closed_By thednp
avatar thednp thednp - close - 17 Mar 2021
avatar thednp
thednp - comment - 17 Mar 2021

As you wish.

Add a Comment

Login with GitHub to post a comment