?
avatar obuisard
obuisard
21 Aug 2020

What needs to be fixed

When fieldsets are children of a fieldset, descriptions are not rendered, if they exist.
This is the case, for instance, when configuring module instances.

Why this should be fixed

To better inform the users. Having a possible description explaining the use of the fields within the fieldset can improve understanding.
It will also be consistent with com_config which allows for descriptions for all fieldsets.

How would you fix it

In the joomla.edit.params layout, add a bloc for the fieldset description if it has a parent and is not a grand child.

Side Effects expected

None.

avatar obuisard obuisard - open - 21 Aug 2020
avatar joomla-cms-bot joomla-cms-bot - change - 21 Aug 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Aug 2020
avatar obuisard
obuisard - comment - 21 Aug 2020

Code suggested:

if (!$isGrandchild && $hasParent)
{
	echo '<fieldset id="fieldset-' . $name . '" class="options-form ' . (!empty($fieldSet->class) ? $fieldSet->class : '') . '">';
	echo '<legend>' . $label . '</legend>';

	// Include the description when available
	if (isset($fieldSet->description) && trim($fieldSet->description))
	{
		echo '<div class="alert alert-info">';
		echo '<span class="fas fa-info-circle" aria-hidden="true"></span><span class="sr-only">' . Text::_('INFO') . '</span> ';
		echo Text::_($fieldSet->description);
		echo '</div>';
	}

	echo '<div class="column-count-md-2 column-count-lg-3">';
}
avatar infograf768
infograf768 - comment - 21 Aug 2020

I know the possible code ;)
I meant how to test it? Please suggest a modification in a module to have such fieldsets.
Thanks

avatar infograf768
infograf768 - comment - 21 Aug 2020
avatar obuisard
obuisard - comment - 21 Aug 2020

There is no use case in the core.
What I suggest is to be able to show a description in any fieldset like in the following example:

Possible fieldset child description

avatar obuisard
obuisard - comment - 21 Aug 2020

To test in the core:

  • open the mod_articles_category.xml
  • in the fieldset 'filtering' separate the fields by putting them inside 2 fieldsets
  • add a description attribute to the fieldset 'filtering'
<fieldset name="filtering" label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_FILTERING_LABEL" description="Top most description">

<fieldset name="filtering_child1" label="Child 1" description="Child description 1">
[some fields]
</fieldset>
<fieldset name="filtering_child2" label="Child 2" description="Child description 2">
[the remaining fields]
</fieldset>

</fieldset>

Without the updated code, the descriptions won't show. With the updated code, they will.

avatar infograf768 infograf768 - change - 22 Aug 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-08-22 07:47:22
Closed_By infograf768
avatar infograf768 infograf768 - close - 22 Aug 2020
avatar infograf768
infograf768 - comment - 22 Aug 2020

Closing as we have patch
#30450

for both here and #30433

Add a Comment

Login with GitHub to post a comment