?
avatar obuisard
obuisard
20 Aug 2020

What needs to be fixed

For modules, for instance, when the xml configuration file contains fieldsets inside a fieldset, the top fieldset attribute 'description' is ignored when rendered. Only fieldsets without fieldset children have their description rendered.

Why this should be fixed

Because fieldset descriptions are important and help users understand what is the content of the tab.

How would you fix it

With just a few additional lines of code in the joomla.edit.params layout.

if (!$hasChildren) { [1] } else { [2] }
where
[1] existing code: create fieldset html tag, add legend and div (if description exists)
[2] additional code: add the div if a description exists

Side Effects expected

Rendering of the fieldset description attribute.

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

Let me first correct layouts/joomla/edit/params.php for the [1] part as it is wrong
then, after merge, let's discuss this here.
To help, please suggest the code to add IN CORE to create the situation you describe.

avatar infograf768
infograf768 - comment - 21 Aug 2020

Here is the PR to test
#30435

avatar obuisard
obuisard - comment - 21 Aug 2020

Thank you!

avatar infograf768
infograf768 - comment - 21 Aug 2020

To help, please suggest the code to add IN CORE to create the situation you describe.

@obuisard

avatar obuisard
obuisard - comment - 21 Aug 2020

What I am suggesting:

// Directly add a fieldset if we have no children
if (!$hasChildren)
{
...
} else {
    // 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>';
    }
}
avatar infograf768 infograf768 - change - 21 Aug 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-08-21 16:36:32
Closed_By infograf768
avatar infograf768 infograf768 - close - 21 Aug 2020
avatar infograf768
infograf768 - comment - 21 Aug 2020

Looks like you posted 2 issues for the same problem.
I close this one and keep #30433

avatar obuisard
obuisard - comment - 21 Aug 2020

Sorry, I misunderstood.
Both issues are different. One is for the top fieldset (which result in tabs) and one is for fieldsets inside a tab.
I created 2 posts because I assumed one suggestion might be accepted but not the other.

avatar infograf768 infograf768 - change - 21 Aug 2020
Status Closed New
Closed_Date 2020-08-21 16:36:32
Closed_By infograf768
avatar infograf768 infograf768 - reopen - 21 Aug 2020
avatar infograf768
infograf768 - comment - 21 Aug 2020

I am confused. Sorry. Reopening.

avatar obuisard
obuisard - comment - 21 Aug 2020

I cannot find a use case in the core, but I do have the issue in third-party extensions.
In the following example, this third-party extension has a description for the tab 'Picture' (top-most fieldset) but it does not show if there are several children fieldsets inside the tab.
The fix would allow the description to show while it does not now.

Missing 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">
[some fields]
</fieldset>
<fieldset name="filtering_child2" label="Child 2">
[the remaining fields]
</fieldset>

</fieldset>

Without the updated code, the description won't show. With the updated code, it will.

avatar obuisard
obuisard - comment - 21 Aug 2020

I am confused. Sorry. Reopening.

Sorry about the confusion, I hope it is more clear now.

avatar infograf768
infograf768 - comment - 22 Aug 2020

I combined both #30433 and here
Please test
#30450

closing

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

Add a Comment

Login with GitHub to post a comment