User tests: Successful: Unsuccessful:
Pull Request for Issue #24721
Replaces #25185
Correcting System Links menu items icon
Adding a badge to inform user when a component is disabled.
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
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.
Contrary to #25185 publish_down and publish-up are respected.
If a component is disabled, the Manager will now display a badge "Component disabled"
Status icon tip as well as title tip display are not modified as this requires love and care in another PR.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_menus Language & Strings |
I have tested this item
| Labels |
Added:
?
?
|
||
This is very inefficient as we're running a DB query for every item.
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 ?
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.
As for “prepared statement” use, would it make the query more efficient ?
unfortunately not, it help to prevent SQL Injection
I have tested this item
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
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.
In case the component exists, is disabled and the item is Unpublished we have a trash icon.
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.
Should the badge display at the same location as Hidden?
Should the badge display at the same location as Hidden?
I have replied on this here:
#25197 (comment)
I have tested this item
| Status | Pending | ⇒ | Ready to Commit |
RTC as last changes since @810 tested concerned only deleting some unsused lang strings.
RTC as last changes since @810 tested concerned only deleting some unsused lang strings.
| Labels |
Added:
?
|
||
| 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 |
Thank you.
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.