J3 Issue ?
avatar jbjhjm
jbjhjm
16 Apr 2019

Steps to reproduce the issue

Create a new Menu named Hidden and set the menutype to "hidden".
Add a menu item to that menu.
Open a template style and check the menu associations tab.

Expected result

A visible checkbox to associate the template style with the created menu item.

Actual result

No checkbox visible. Reason for that is the menu alias will be added to the Input tag as a class - without any prefix. So it becomes input[type=checkbox].hidden which is a class used by bootstrap to hide stuff.

Issue is present in 3.9.5.

avatar jbjhjm jbjhjm - open - 16 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 16 Apr 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Apr 2019
avatar infograf768 infograf768 - change - 16 Apr 2019
Title
Style - Menuitem Associations: Checkboxes disappear when the menu alias is named "hidden"
Style - Menuitem Assignement: Checkboxes disappear when the menu alias is named "hidden"
avatar infograf768 infograf768 - edited - 16 Apr 2019
avatar infograf768 infograf768 - change - 16 Apr 2019
Title
Style - Menuitem Associations: Checkboxes disappear when the menu alias is named "hidden"
Style - Menuitem Assignement: Checkboxes disappear when the menu alias is named "hidden"
avatar infograf768
infograf768 - comment - 16 Apr 2019

Modified "Associations" to "Assignment" as these are different functions. ;)

I confirm the behavior.
Screen Shot 2019-04-16 at 11 05 28

Not much we can do imho. We "could" prevent using "hidden" as menu type, but are we sure it is the only Menu Type that we should not accept?

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Apr 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 16 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Apr 2019
Status New Confirmed
avatar infograf768
infograf768 - comment - 16 Apr 2019

If we add around https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_menus/models/menu.php#L216

		if ($data['menutype'] == 'hidden')
		{
			$this->setError(JText::sprintf('COM_MENU_MENU_TYPE_FORBIDDEN', $data['menutype']));

			return false;
		}

and the lang string,
COM_MENU_MENU_TYPE_FORBIDDEN="The Menu Type \"%s\" is forbidden. Please use another Menu Type."

we can get:

Screen Shot 2019-04-16 at 11 35 26

I just wonder if there are other terms that should be forbidden.

avatar infograf768
infograf768 - comment - 16 Apr 2019

@HLeithner
What do you think?

avatar HLeithner
HLeithner - comment - 16 Apr 2019

sounds wrong, why I'm not allowed to create a menu type "hidden" I think I created many of them.

The checkbox gets the menu name as class attribute and hidden has a special meaning. I'm not sure why the menu alias is in the class of the checkbox... maybe prefixing it or removing it...

avatar infograf768
infograf768 - comment - 16 Apr 2019

Indeed. The code is
class="chk-menulink <?php echo $type->menutype; ?>"

But would not changing that break B/C?

avatar ReLater
ReLater - comment - 16 Apr 2019

I would prefix it with something like
class="chk-menulink <?php echo 'menutype-' . $type->menutype; ?>"

We need 3 prefixes then in code of edit_assignment.php

And because it's a bug that must be fixed I wouldn't care about B/C in this case.

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Apr 2019
Status Confirmed Discussion
avatar ReLater
ReLater - comment - 16 Apr 2019

Or creating an override for the ISIS template for edit_assignment.php with these changes.

avatar brianteeman
brianteeman - comment - 20 Apr 2019

is there even a need to have the menutype in the class name?

The menutype exists for the javascript to identify the checkbox and not for any styling. So that can easily and correctly be changed to a data- attribute instead.

As for b/c this is only in the admin ui AND rendered markup is not part of the B/C policy

avatar brianteeman
brianteeman - comment - 20 Apr 2019

OR the code could be written exactly the same as the selector in the module assignment

avatar HLeithner
HLeithner - comment - 22 Apr 2019

@brianteeman can you create a pr for this? I would suggest do the same as in module assignment

avatar brianteeman
brianteeman - comment - 23 Apr 2019

sorry i dont have time to do anything on j3

avatar Quy Quy - change - 6 Jul 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-07-06 15:59:09
Closed_By Quy
avatar Quy Quy - close - 6 Jul 2019
avatar Quy
Quy - comment - 6 Jul 2019

Please test PR #25454.


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

Add a Comment

Login with GitHub to post a comment