? ? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
1 Mar 2021

Pull Request for Issue #32456.

Summary of Changes

don't show items from disabled component in mod_submenu

Testing Instructions

see #32456.

Actual result BEFORE applying this Pull Request

see #32456.

Expected result AFTER applying this Pull Request

no items from disabled components are shown

alterrnative to #32539

let's see how many ? i got ?

avatar alikon alikon - open - 1 Mar 2021
avatar alikon alikon - change - 1 Mar 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Mar 2021
Category Modules Administration
avatar Fedik
Fedik - comment - 1 Mar 2021

this actually looks much better than #32539
because ComponentHelper already have a pre-loaded list of available components.

avatar alikon alikon - change - 1 Mar 2021
Labels Added: ?
avatar Fedik
Fedik - comment - 2 Mar 2021

btw, we have similar in mod_menu also ?

// Exclude item if is not enabled
if ($item->element && !ComponentHelper::isEnabled($item->element))
{
$parent->removeChild($item);
continue;
}

so all should be good

avatar richard67 richard67 - change - 2 Mar 2021
Title
less code
[4.0] Hide disabled components in mod_submenu
avatar richard67 richard67 - edited - 2 Mar 2021
avatar richard67
richard67 - comment - 2 Mar 2021

@alikon I was so free to change the title for you so we later have a better commit message when merging the PR.

avatar particthistle particthistle - test_item - 2 Mar 2021 - Tested unsuccessfully
avatar particthistle
particthistle - comment - 2 Mar 2021

I have tested this item ? unsuccessfully on abd61d4

Before applying patch, "Manage" list on System Dashboard had 9 items:
Extensions, Languages, Content Languages, Language Overrides, Content Security Policy, Plugins, Redirects, Site Modules, Administrator Modules

After applying patch, without turning off any components, some items disappeared:
Languages, Content Languages, Language Overrides

It seems these three Language related items are not following the same configuration as the other items in the list.

As Language component is a protected one, it can't be disabled, but I'm not sure why it's not otherwise appearing.

Aside from the Language items, the PR works as expected when I turned off either CSP or Redirects as two items available to disable in that dashboard module.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32555.
avatar joomdonation
joomdonation - comment - 2 Mar 2021

@particthistle I think the error here is not related to this PR. I don't understand how menu presets work, but someone familiar with that concept should check https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_menus/presets/system.xml#L127-L149 to see why element="com_language", not element="com_languages" (I think it is typos). One that issue is fixed, the error you reported here won't happen.

avatar richard67
richard67 - comment - 2 Mar 2021

@particthistle I think the error here is not related to this PR. I don't understand how menu presets work, but someone familiar with that concept should check https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_menus/presets/system.xml#L127-L149 to see why element="com_language", not element="com_languages" (I think it is typos). One that issue is fixed, the error you reported here won't happen.

@joomdonation @particthistle Who wants to make a PR?

avatar joomla-cms-bot joomla-cms-bot - change - 2 Mar 2021
Category Modules Administration Administration com_menus Modules
avatar alikon
alikon - comment - 2 Mar 2021

better to do it in this pr imho
please test again

avatar particthistle particthistle - test_item - 3 Mar 2021 - Tested successfully
avatar particthistle
particthistle - comment - 3 Mar 2021

I have tested this item successfully on 9511451

All good this time around.

Glad it was something easy for you to resolve @alikon as I wouldn't have known where to start to fix that up.


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

avatar toivo toivo - test_item - 3 Mar 2021 - Tested successfully
avatar toivo
toivo - comment - 3 Mar 2021

I have tested this item successfully on 9511451

Tested successfully in Beta8-dev of 3 March in Wampserver 3.2.4 using PHP 8.0.2.


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

avatar richard67 richard67 - change - 3 Mar 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 3 Mar 2021

RTC


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

avatar wilsonge wilsonge - change - 5 Mar 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-03-05 12:38:19
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 5 Mar 2021
avatar wilsonge wilsonge - merge - 5 Mar 2021
avatar wilsonge
wilsonge - comment - 5 Mar 2021

LGTM. Nice work everyone!

Add a Comment

Login with GitHub to post a comment