Here's an example of the issue: Joomla Project
Apparently a lot of users have this issue: If you google: joomla Notice: Undefined index: option in view.html.php line 245 253
This is probably related to using "fixed" urls where there is no query option in the menu item. I'm using a very popular plugin 'sh404sef' to get search engine friendly urls. Apparently this causes the option key to be dropped from menu->query.
It should not show the notices.
The following Notices show on the page:
`Notice: Undefined index: option in D:\xampp\htdocs\joomla\components\com_content\views\article\view.html.php on line 245
Notice: Undefined index: option in D:\xampp\htdocs\joomla\components\com_content\views\article\view.html.php on line 253
Notice: Undefined index: option in D:\xampp\htdocs\joomla\components\com_content\views\article\view.html.php on line 253
Notice: Undefined index: option in D:\xampp\htdocs\joomla\components\com_content\views\article\view.html.php on line 253`
Windows & Linux. PHP 7.2 possibly others.
I would suggest checking with:
isset($menu->query['option'])
on lines 245 and 253
I haven't contributed yet, but I could try and make a pull request for this.
Labels |
Added:
?
|
I was thinking the same thing, is it okay if Joomla generates notices if the url is changed? (manually or by a plugin/module)
Honestly, if an extension is manipulating the core data structure and removing what can be considered mandatory bits of data, then I would call it a bug in those extensions and not something that core needs to defensively code around.
I would say that the core has to handle this - regardless of its cause. Because not handling it can output error messages to the screen - Joomla has proudly developed to standards that dont output warnings/notice like this and can run with error_reporting on maximum
The example given shows that Joomla is outputting a notice with the full path to the site - a minor information disclosure
For the sake of a simple isset or array_key_exists check...
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-11-12 02:05:24 |
Closed_By | ⇒ | Quy |
Closed_By | Quy | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/22973
sh404sef is known for generating invalid URLs. In this case it's adding System Link type menu item ID to internal URLs. Does this issue need fixing in core if it can only be reproduced by manually altering the URL?