?
avatar eddiekonczal
eddiekonczal
28 Oct 2019

What needs to be fixed

Custom fields are not displayed properly within definition lists. The definition lists include only <dd> elements, and not the corresponding <dt> elements.

Why this should be fixed

Without this fix, definition lists will violate the WCAG 2.0 accessibility standard "Ensures <dl> elements are structured correctly".

When not empty, element does not have at least one <dt> element followed by at least one <dd> element

c.f. https://dequeuniversity.com/rules/axe/3.2/definition-list?application=AxeChrome

How would you fix it

$content needs to be separated into separate elements: the field name (which should populate the dt element) and the field value (which should populate the dd element)

Side Effects expected

avatar eddiekonczal eddiekonczal - open - 28 Oct 2019
avatar joomla-cms-bot joomla-cms-bot - change - 28 Oct 2019
Title
[3.9] [com_fields] <dl> elements must only directly contain properly-ordered <dt> and <dd> groups, <script> or <template> elements
[3.9] [com_fields] elements must only directly contain properly-ordered and groups, or elements
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Oct 2019
avatar eddiekonczal eddiekonczal - change - 28 Oct 2019
The description was changed
avatar eddiekonczal eddiekonczal - edited - 28 Oct 2019
avatar eddiekonczal eddiekonczal - change - 28 Oct 2019
The description was changed
avatar eddiekonczal eddiekonczal - edited - 28 Oct 2019
avatar eddiekonczal eddiekonczal - change - 28 Oct 2019
The description was changed
avatar eddiekonczal eddiekonczal - edited - 28 Oct 2019
avatar eddiekonczal eddiekonczal - change - 28 Oct 2019
The description was changed
avatar eddiekonczal eddiekonczal - edited - 28 Oct 2019
avatar eddiekonczal eddiekonczal - change - 28 Oct 2019
The description was changed
avatar eddiekonczal eddiekonczal - edited - 28 Oct 2019
avatar eddiekonczal eddiekonczal - change - 28 Oct 2019
Title
[3.9] [com_fields] elements must only directly contain properly-ordered and groups, or elements
[3.9] [4.0] [com_fields] elements must only directly contain properly-ordered and groups, or elements
avatar eddiekonczal eddiekonczal - edited - 28 Oct 2019
avatar eddiekonczal eddiekonczal - edited - 29 Oct 2019
avatar eddiekonczal eddiekonczal - change - 29 Oct 2019
The description was changed
avatar eddiekonczal eddiekonczal - change - 29 Oct 2019
The description was changed
avatar eddiekonczal eddiekonczal - edited - 29 Oct 2019
avatar eddiekonczal
eddiekonczal - comment - 29 Oct 2019

Below is one way to make the code accessible. There is probably a better way to do this - if the <dt> and <dd> elements could be shown on the same line with a colon separating them,

  1. Insert at line 64 of components/com_fields/layouts/fields/render.php:

    $showLabel = $field->params->get('showlabel');
    $label = JText::_($field->label);
    $value = $field->value;

  2. (Optional) Suppress hidden labels:

Add new lines 75 - 80:

// If label should be hidden, suppress it
if ($showLabel == 0)   {$label = '';}
  1. Modify $output statement (formerly line 72, now line 81):

    $output[] = '<dt class="field-label ' . $class . '">' . $label . '</dt>' . '<dd class="field-value ' . $class . '">' . $value . '</dd>'; }

avatar brianteeman
brianteeman - comment - 18 Jan 2020

Sorry this slipped my attention. I will take a look hopefully tomorrow

avatar brianteeman
brianteeman - comment - 19 Jan 2020

Sorry this cannot be fixed at a core level in Joomla 3.9 without significant backwards breaking changes.

I have created an issue for Joomla 4 and will be working over the next week to resolve this

avatar joomla-cms-bot joomla-cms-bot - edited - 19 Jan 2020
avatar joomla-cms-bot joomla-cms-bot - change - 19 Jan 2020
Closed_By brianteeman joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 19 Jan 2020
avatar brianteeman brianteeman - change - 19 Jan 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-01-19 12:01:06
Closed_By brianteeman
avatar joomla-cms-bot
joomla-cms-bot - comment - 19 Jan 2020
avatar brianteeman
brianteeman - comment - 19 Jan 2020

See 27567


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26849.

Add a Comment

Login with GitHub to post a comment