J4 Issue ?
avatar 810
810
24 Apr 2019

Steps to reproduce the issue

Install kunena 6.1 alpha 2
Go to menu - mainmenu

Expected result

When clicking on publish item, the icon should be green.

Actual result

The view said the item is unpublished, but when you open the menu item, you will see its published.

image

System information (as much as possible)

Joomla! 4.0.0-alpha9-dev Development [ Amani ] 19-April-2019 09:23 GMT
PHP Version | 7.3.2

Additional comments

avatar 810 810 - open - 24 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 24 Apr 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Apr 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 24 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Apr 2019
Status New Discussion
avatar chetanmadaan
chetanmadaan - comment - 24 Apr 2019

Hi,

I tested and wasn't able to reproduce on default Joomla install. My best guess it has something to do with Kunena, which we shouldn't be worried about.

Thanks,
Chetan

avatar 810
810 - comment - 24 Apr 2019

Its a joomla issue.
Please create a Menu Item Alias on mainmenu, then you will see the issue.

avatar chetanmadaan
chetanmadaan - comment - 25 Apr 2019

Hello,

My bad, I thought you said Kunena so it must have something to do with Kunena. I'll check again.

avatar chetanmadaan
chetanmadaan - comment - 25 Apr 2019

It's working just fine. Can't reproduce this.
2019-04-25_12-03-05

avatar 810 810 - change - 28 Apr 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-04-28 01:13:40
Closed_By 810
avatar 810
810 - comment - 28 Apr 2019

looks like a local issue then.

avatar 810 810 - close - 28 Apr 2019
avatar 810 810 - close - 28 Apr 2019
avatar SharkyKZ
SharkyKZ - comment - 30 Apr 2019

Reopen please. I can reproduce this issue. It was introduced with #24416, specifically this part https://github.com/joomla/joomla-cms/pull/24416/files#diff-94f7ebd2e6d116a7e0e4e66ae94f5e06R173.

avatar SharkyKZ
SharkyKZ - comment - 30 Apr 2019

@chetanmadaan please use the latest nightly.

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Apr 2019
Status Closed New
Closed_Date 2019-04-28 01:13:40
Closed_By 810
avatar franz-wohlkoenig franz-wohlkoenig - reopen - 30 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - reopen - 30 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 May 2019
Status New Discussion
avatar infograf768
infograf768 - comment - 9 May 2019
avatar infograf768
infograf768 - comment - 9 May 2019

I can reproduce when creating a Menu Item Alias or system links in general, not any other it seems.

avatar alikon
alikon - comment - 9 May 2019

confirm, but weird

avatar infograf768
infograf768 - comment - 10 May 2019

I can apparently solve it here by modifying the model
/administrator/components/com_menus/Model/ItemsModel.php line 277 +
from

		$query->select(
			'CASE ' .
				' WHEN a.type = ' . $db->quote('component') . ' THEN a.published+2*(e.enabled-1) ' .
				' WHEN a.type = ' . $db->quote('url') . ' AND a.published != -2 THEN a.published+2 ' .
				' WHEN a.type = ' . $db->quote('url') . ' AND a.published = -2 THEN a.published-1 ' .
				' WHEN a.type = ' . $db->quote('alias') . ' AND a.published != -2 THEN a.published+4 ' .
				' WHEN a.type = ' . $db->quote('alias') . ' AND a.published = -2 THEN a.published-1 ' .
				' WHEN a.type = ' . $db->quote('separator') . ' AND a.published != -2 THEN a.published+6 ' .
				' WHEN a.type = ' . $db->quote('separator') . ' AND a.published = -2 THEN a.published-1 ' .
				' WHEN a.type = ' . $db->quote('heading') . ' AND a.published != -2 THEN a.published+8 ' .
				' WHEN a.type = ' . $db->quote('heading') . ' AND a.published = -2 THEN a.published-1 ' .
				' WHEN a.type = ' . $db->quote('container') . ' AND a.published != -2 THEN a.published+8 ' .
				' WHEN a.type = ' . $db->quote('container') . ' AND a.published = -2 THEN a.published-1 ' .
			' END AS published '
		);

to

		$query->select(
			'CASE ' .
				' WHEN a.type = ' . $db->quote('component') . ' THEN a.published+2*(e.enabled-1) ' .
				' WHEN a.type = ' . $db->quote('url') . '  THEN a.published ' .
				' WHEN a.type = ' . $db->quote('alias') . '  THEN a.published ' .
				' WHEN a.type = ' . $db->quote('separator') . '  THEN a.published ' .
				' WHEN a.type = ' . $db->quote('heading') . '  THEN a.published ' .
				' WHEN a.type = ' . $db->quote('container') . '  THEN a.published ' .
			' END AS published '
		);

Since 1.7 we were using the MenusHtmlMenus state() method to display the state on the grid.
It considered the $enabled status of the component and displayed a tip
Screen Shot 2019-05-10 at 09 28 37

Therefore not sure of the code above for the component as the helper method is not present anymore in 4.0

avatar infograf768
infograf768 - comment - 10 May 2019

Note:
if we do not need anymore $enabled for the component, we could simplify the whole query select by taking off the CASE, simply using:

		$query->select(
			$this->getState(
				'list.select',
				$db->quoteName(
					array(
						'a.id', 'a.menutype', 'a.title', 'a.alias', 'a.note', 'a.path', 'a.link', 'a.type', 'a.parent_id',
						'a.level', 'a.published', 'a.component_id', 'a.checked_out', 'a.checked_out_time', 'a.browserNav',
						'a.access', 'a.img', 'a.template_style_id', 'a.params', 'a.lft', 'a.rgt', 'a.home', 'a.language',
						'a.client_id', 'a.publish_up', 'a.publish_down'
					)
				)
			)
		);

What do you think?

avatar infograf768
infograf768 - comment - 11 May 2019

Just found out we still have the state() method in Service/HTML/Menus.php.
Shall we keep the method or just delete it too?

avatar infograf768
infograf768 - comment - 11 May 2019

With former code we do get a tip, although wrongly displayed
Screen Shot 2019-05-11 at 08 40 02

avatar infograf768
infograf768 - comment - 12 Jun 2019

Please test #25185
closing this issue

avatar infograf768 infograf768 - change - 12 Jun 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-06-12 10:02:36
Closed_By infograf768
avatar infograf768 infograf768 - close - 12 Jun 2019
avatar infograf768
infograf768 - comment - 13 Jun 2019

Please test this new one
#25197

Add a Comment

Login with GitHub to post a comment