? ? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
13 Jun 2019

Pull Request for Issue #24721
Replaces #25185

Summary of Changes

Correcting System Links menu items icon
Adding a badge to inform user when a component is disabled.

Testing Instructions

Make sure you have created a System Links menu item (URL, Heading, Separator, Alias).
Create a Newsfeeds menu item and disable the Newsfeeds component in Extensions->Manage
Parameter a menu item to be published in the future.
Parameter a menu item to stop publishing in the past

Before patch

Clicking on the status icon of a system links menu item has no effect
No way to know if the component of an existing menu item is disabled or not.

After patch

Contrary to #25185 publish_down and publish-up are respected.
If a component is disabled, the Manager will now display a badge "Component disabled"

Screen Shot 2019-06-13 at 13 53 17

Note

Status icon tip as well as title tip display are not modified as this requires love and care in another PR.

@810 @SharkyKZ

avatar infograf768 infograf768 - open - 13 Jun 2019
avatar infograf768 infograf768 - change - 13 Jun 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Jun 2019
Category Administration com_menus Language & Strings
avatar 810
810 - comment - 13 Jun 2019

I have tested this item successfully on c0c48f5


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

avatar 810
810 - comment - 13 Jun 2019

I have tested this item successfully on c0c48f5


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

avatar 810 810 - test_item - 13 Jun 2019 - Tested successfully
bc39221 13 Jun 2019 avatar infograf768 cs
avatar infograf768 infograf768 - change - 13 Jun 2019
Labels Added: ? ?
avatar SharkyKZ
SharkyKZ - comment - 13 Jun 2019

This is very inefficient as we're running a DB query for every item.

avatar infograf768
infograf768 - comment - 13 Jun 2019

Tried my best. I guess I will just give up. No idea how to make it more efficient.
As for “prepared statement” use, would it make the query more efficient ?

avatar SharkyKZ
SharkyKZ - comment - 13 Jun 2019

If we're fine with removing custom strings/states here, select component status (e.enabled) in the model query and use that.

Otherwise, the complete solution is probably to copy-paste in JHtmlJgrid::published() into Joomla\Component\Menus\Administrator\Service\HTML\Menus::published() and adapt it to custom states.

avatar alikon
alikon - comment - 13 Jun 2019

As for “prepared statement” use, would it make the query more efficient ?

unfortunately not, it help to prevent SQL Injection

avatar infograf768
infograf768 - comment - 14 Jun 2019

@SharkyKZ
Corrected by using existing model query. Adding the publish_down and publish_up to the custom strings/state would just make such a tip too complicated.

@alikon
As I deleted the new method, no use anymore for a prepare statement.

@810
Sorry, please test again.

avatar 810
810 - comment - 14 Jun 2019

I have tested this item successfully on 409e60f


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

avatar 810 810 - test_item - 14 Jun 2019 - Tested successfully
avatar Quy
Quy - comment - 14 Jun 2019

The following were removed but not in the language file.

COM_MENUS_EXTENSION_UNPUBLISHED_ENABLED
COM_MENUS_EXTENSION_PUBLISHED_DISABLED
COM_MENUS_EXTENSION_UNPUBLISHED_DISABLED

avatar Quy
Quy - comment - 15 Jun 2019

Please advise if issue #19874 is related.

avatar infograf768
infograf768 - comment - 15 Jun 2019

Please advise if issue #19874 is related.

I do not think so. Here is the process:

In 3.x we use the override menus.state (and publish_down as well as publish_up do not exist).

In case the component exists, is disabled and the item is Published we have a warning icon.

Screen Shot 2019-06-15 at 08 31 17

In case the component exists, is disabled and the item is Unpublished we have a trash icon.

Screen Shot 2019-06-15 at 08 36 38

In 4.0, with this PR, we get an Unpublished icon in both cases WITH the new badge when the component is disabled and specific icons for published/unpublished or publish_up and publish_down when enabled.

Filtering by Published/Unpublished will work fine whatever the status of the component.

The case of the unexisting component ( #19874 ), this both for 3.x and 4.0, is not dealt with the same way: it is done in the View itself. It defaults to using the Unpublished icon and adds the following text below the Menu Item title as it just sets the value to $item->item_type:

else
					{
						if (preg_match("/^index.php\?option=([a-zA-Z\-0-9_]*)/", $item->link, $result))
						{
							$value = JText::sprintf('COM_MENUS_TYPE_UNEXISTING', $result[1]);
						}
						else
						{
							$value = JText::_('COM_MENUS_TYPE_UNKNOWN');
						}
					}
					break;

This PR adds a badge "Component not found." in this case for 4.0.

Basically JHtmlJGrid does not deal either with enabled or unexisting.

avatar Quy
Quy - comment - 15 Jun 2019

Should the badge display at the same location as Hidden?

avatar infograf768
infograf768 - comment - 16 Jun 2019

@Quy

Should the badge display at the same location as Hidden?

I have replied on this here:
#25197 (comment)

avatar Quy
Quy - comment - 16 Jun 2019

I have tested this item successfully on 29318a1


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

avatar Quy Quy - test_item - 16 Jun 2019 - Tested successfully
avatar infograf768 infograf768 - change - 17 Jun 2019
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 17 Jun 2019

RTC as last changes since @810 tested concerned only deleting some unsused lang strings.


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

avatar infograf768
infograf768 - comment - 17 Jun 2019

RTC as last changes since @810 tested concerned only deleting some unsused lang strings.


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

avatar infograf768 infograf768 - change - 17 Jun 2019
Labels Added: ?
avatar infograf768
infograf768 - comment - 21 Jun 2019

@wilsonge
Merge?

avatar roland-d roland-d - change - 23 Jun 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-06-23 08:50:26
Closed_By roland-d
avatar roland-d roland-d - close - 23 Jun 2019
avatar roland-d roland-d - merge - 23 Jun 2019
avatar roland-d
roland-d - comment - 23 Jun 2019

Thank you.

Add a Comment

Login with GitHub to post a comment