?
avatar milen-k
milen-k
4 Oct 2017

Steps to reproduce the issue

Go to the menu items page:
joomla.example.com/administrator/index.php?option=com_menus&view=items
Choose a menu from the - Select menu - search tools dropdown.
Then go and edit the chosen menu:
joomla.example.com/administrator/index.php?option=com_menus&view=menu&layout=edit&id=<id of the menu type chosen in the previous page's search filter>
Change the menu's Menu Type.
Now go back to the first page. It crashes with a 500 Joomla error and there is no way to view the menu items anymore unless (I guess) logging out and logging back in or resetting the server session or reverting the menu type of the chosen menu to its old value.

Expected result

The joomla.example.com/administrator/index.php?option=com_menus&view=items page should work with the updated menu type in the filter or at least the filter should get reset.

Actual result

The joomla.example.com/administrator/index.php?option=com_menus&view=items page becomes unusable.

System information (as much as possible)

systeminfo-2017-10-03T17-39-37+03-00.txt

Additional comments

Worst case scenario the strict check for existing menu type should be removed from:
administrator/components/com_menus/models/items.php:150 (removing the second parameter from the call to MenusModelItems::getMenu() thus leaving the default value of false and preventing the raising of a fatal error)
...and reset the menu type filter user, app and view state by adding a fallback case in:
administrator/components/com_menus/models/items.php:159

else { // WE ALSO ADD A CASE WHICH RESETS THE FILTERS TO THEIR DEFAULT VALUES
	$app->input->set('limitstart', 0);
	$app->input->set('menutype', '');
	$app->setUserState($this->context . '.menutype', '');
	$this->setState('menutypetitle', '');
	$this->setState('menutypeid', '');
}

A better approach would be to add awareness for the user state to:
administrator/components/com_menus/models/menu.php:194 MenusModelMenu::save() method and update the user state with the new menu type value.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar milen-k milen-k - open - 4 Oct 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Oct 2017
avatar brianteeman
brianteeman - comment - 4 Oct 2017

Confirmed

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Oct 2017
Status New Confirmed
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Oct 2017

Status changed on issue Tracker on "Confirmed".

avatar izharaazmi
izharaazmi - comment - 7 Oct 2017

For me the error handling looks natural as far as how Joomla works.

After the steps mentioned above, we indeed get that error. However, navigating to any other link, or "All Menu Items".

Going just to that particular link doesn't work because changing the menutype has made that link void. If we are using custom admin menu, we need to change the link too. If using presets it is updated automatically.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 7 Oct 2017

@izharaazmi so its expected Behaviour?

avatar izharaazmi
izharaazmi - comment - 7 Oct 2017

To me yes. Someone may want to review my opinion though.

avatar brianteeman
brianteeman - comment - 7 Oct 2017

No it's not expected behaviour. The problem is that the filter has been stored and you cannot get to a page to reset it

avatar milen-k
milen-k - comment - 13 Oct 2017

@izharaazmi the administration is not supposed to break down and spit out an obscure 500 error and render one of its pages unusable. Given the fact that it is also very easy to fix I don't see a reason to advocate leaving this bug lingering to manifest in one of the most used core components of Joomla!.

avatar izharaazmi
izharaazmi - comment - 13 Oct 2017

Fix coming.

avatar izharaazmi
izharaazmi - comment - 14 Oct 2017

Please test #18336

avatar zero-24 zero-24 - change - 14 Oct 2017
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2017-10-14 08:09:08
Closed_By zero-24
avatar zero-24 zero-24 - close - 14 Oct 2017
avatar zero-24
zero-24 - comment - 14 Oct 2017

Closing as there is a PR #18336 Thanks

Add a Comment

Login with GitHub to post a comment