? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
10 Nov 2019

Pull Request for Issue #27009

Summary of Changes

Wrong copy/paste of a J4 useless case from 3.x. :)

Testing Instructions

See #27009

avatar infograf768 infograf768 - open - 10 Nov 2019
avatar infograf768 infograf768 - change - 10 Nov 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Nov 2019
Category Modules Administration
avatar richard67 richard67 - test_item - 10 Nov 2019 - Tested successfully
avatar richard67
richard67 - comment - 10 Nov 2019

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.

avatar ChristineWk ChristineWk - test_item - 10 Nov 2019 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 10 Nov 2019

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.

avatar richard67 richard67 - change - 10 Nov 2019
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 10 Nov 2019

RTC


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

avatar infograf768 infograf768 - change - 10 Nov 2019
Labels Added: ?
avatar Quy Quy - change - 10 Nov 2019
Labels Added: ?
avatar infograf768
infograf768 - comment - 11 Nov 2019

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?

avatar Quy
Quy - comment - 11 Nov 2019
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 = '&nbsp;<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.

avatar Quy Quy - change - 11 Nov 2019
Status Ready to Commit Pending
avatar infograf768
infograf768 - comment - 11 Nov 2019

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.

avatar infograf768 infograf768 - change - 11 Nov 2019
Labels Removed: ?
avatar Quy
Quy - comment - 11 Nov 2019

So icon="file-alt" will have no effect/be ignored for menus?

avatar infograf768
infograf768 - comment - 12 Nov 2019

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:

Screen Shot 2019-11-12 at 08 34 01

instead of
Screen Shot 2019-11-12 at 08 35 52

Will now modify Menu.php as we do not need the else in the submenu module.

Note:

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

avatar Quy Quy - test_item - 13 Nov 2019 - Tested successfully
avatar Quy
Quy - comment - 13 Nov 2019

I have tested this item successfully on f5f1546


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

avatar infograf768 infograf768 - change - 13 Nov 2019
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 13 Nov 2019

Back to RTC as the last change is simple.


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

avatar infograf768 infograf768 - change - 13 Nov 2019
Labels Added: ?
avatar HLeithner HLeithner - change - 14 Nov 2019
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
avatar HLeithner HLeithner - close - 14 Nov 2019
avatar HLeithner HLeithner - merge - 14 Nov 2019
avatar HLeithner
HLeithner - comment - 14 Nov 2019

thanks

Add a Comment

Login with GitHub to post a comment