Make sure the view exists before adding it to the menu lookup array, remove PHP Notices#18564
Conversation
|
Anyone who has tested this PR can login at https://issues.joomla.org/tracker/joomla-cms/18564 and mark the test as successful. |
|
I have tested this item ✅ successfully on 16c361c This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18564. |
|
In your video, after clicking the Save button, the |
|
Yes, view I do not have other idea how to test old menu item that currently does not exists. This is only a example (a way) to create a menu item that for now does not exist, like with view After you create invalid menu item, means with view that is invalid then you get php notices - on front end - before PR. |
|
I have tested this item ✅ successfully on 16c361c This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18564. |
|
RTC after two successful tests. |
Other solution for the same problem as in #17323, #18043
Summary of Changes
Do not add view name to the menu
lookuparray if the view does not exists.Remove PHP Notice:
Notice: Undefined index: loginx in .../libraries/src/Component/Router/Rules/MenuRules.php on line 216Notice: Trying to get property of non-object in .../libraries/src/Component/Router/Rules/MenuRules.php on line 216Testing Instructions
Install joomla.
Go to backend and edit a menu item.
Change name of view in the link field and save.

Please see attached video. I used FF Inspector (Ctrl + Shift + C)
Go to frontend in order to see changes.
Before PR there are 2 php notices, after PR they disappear.
Expected result
No PHP Notices
Actual result
PHP Notices.
Documentation Changes Required
No