User tests: Successful: Unsuccessful:
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Administration |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Labels |
Added:
?
|
Apply same fix here?
https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/modules/mod_submenu/Menu/Menu.php#L181
Looks like we do not need that else at all here. To test I added some menus not containing any home page.
Can you confirm?
if ($iconImage)
{
if (substr($iconImage, 0, 6) == 'class:' && substr($iconImage, 6) == 'icon-home')
{
$iconImage = '<span class="home-image icon-featured" aria-hidden="true"></span>';
$iconImage .= '<span class="sr-only">' . Text::_('JDEFAULT') . '</span>';
}
elseif (substr($iconImage, 0, 6) == 'image:')
{
$iconImage = ' <span class="badge badge-secondary">' . substr($iconImage, 6) . '</span>';
}
else
{
$iconImage = '<span>' . HTMLHelper::_('image', $iconImage, null) . '</span>';
}
}
Here is the attribute icon="file-alt"
in the XML file. It is not an image file, thus, the blank image tag.
Removing the code suggested in this PR would discard the value which probably is not the desired result.
For image:
, I would not expect it to be wrapped in a span as a badge.
The above code has to be rewritten.
Status | Ready to Commit | ⇒ | Pending |
For image:, I would not expect it to be wrapped in a span as a badge.
I am not sure you understood that part.
It specially deals with menus containing a home page in multilang.
Please look at the presets where image: corresponds to precise kind of sql.
sql_select="a.id, a.title, a.menutype, CASE COALESCE(SUM(m.home), 0) WHEN 0 THEN '' WHEN 1 THEN CASE m.language WHEN '*' THEN 'class:icon-home' ELSE CONCAT('image:', l.lang_code) END ELSE 'image:mod_languages/icon-16-language.png' END AS icon"
and further
icon="{sql:icon}"
The badge replaces the flag we have in 3x.
As far as the else is concerned, it is useless imho in the dashboard part (your last comment https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/modules/mod_submenu/Menu/Menu.php#L181 ) and I will remove it.
In this PR or another one. if another one please set this again as rtc.
Labels |
Removed:
?
|
So icon="file-alt"
will have no effect/be ignored for menus?
So icon="file-alt" will have no effect/be ignored for menus?
Apparently yes, when using the alternate or default presets. What is used in these is $iconClass
.
I guess we could take off these icon="whatever"
in these presets, except evidently for the menus containing the Homes using the specific sql with icon="{sql:icon}"
It is used though in the other presets when displayed as default dashboard or module added to dashboard.
Just test taking icon="list"
off in menus.xml preset and you will get:
Will now modify Menu.php
as we do not need the else in the submenu module.
if we decide to take off in another PR the useless icon(s) in the alternate and default presets, we will not need any more to have the else with $iconImage = '';
in default_submenu.php
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Back to RTC as the last change is simple.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-14 10:16:34 |
Closed_By | ⇒ | HLeithner |
thanks
I have tested this item✅ successfully on 375a1bb
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27036.