?
avatar markovanderpuil
markovanderpuil
8 Nov 2018

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.

Expected result

It should not show the notices.

Actual result

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`

System information (as much as possible)

Windows & Linux. PHP 7.2 possibly others.

Additional comments

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.

avatar markovanderpuil markovanderpuil - open - 8 Nov 2018
avatar joomla-cms-bot joomla-cms-bot - change - 8 Nov 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Nov 2018
avatar SharkyKZ
SharkyKZ - comment - 8 Nov 2018

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?

avatar markovanderpuil
markovanderpuil - comment - 8 Nov 2018

I was thinking the same thing, is it okay if Joomla generates notices if the url is changed? (manually or by a plugin/module)

avatar mbabker
mbabker - comment - 8 Nov 2018

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.

avatar PhilETaylor
PhilETaylor - comment - 12 Nov 2018

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...

avatar PhilETaylor
PhilETaylor - comment - 12 Nov 2018

PR #23045

avatar Quy Quy - change - 12 Nov 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-11-12 02:05:24
Closed_By Quy
avatar joomla-cms-bot joomla-cms-bot - change - 12 Nov 2018
Closed_By Quy joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 12 Nov 2018
avatar joomla-cms-bot
joomla-cms-bot - comment - 12 Nov 2018

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/22973

Add a Comment

Login with GitHub to post a comment