• Home
  • Get help
  • Ask a question
Last post 18 min ago
Posts last week 89
Average response time last week 30 min
All time posts 67734
All time tickets 10466
All time avg. posts per day 21

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#5499 – PHP Notices with "Menu headings" and some new sub-menues

Posted in ‘sh404SEF’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Saturday, 29 December 2018 19:08 UTC
hajo70
 I run a simple site using Protostar and Joomla's standard menu module. In order to achieve a better user experience I've done two things:
1. bought an extension in order to get more flexibility for my menues (note that the issues below occur without this extension installed)
2. changed my menu structure from :
Menu item=>Intro article for X
Sub menu item=>Detail article 1 for X
Sub menu item=> Detail article 2 for X
Menu item=>Intro article for Y
Sub menu=>Detail article 1 for Y
...

to:
Menu item=>Menu heading for X (that is I convert the existing "Menu item X" from being a "Single article" menu to "System link-Menu heading")
Sub menu item=>Intro article for X (that is I add a new "Single article" menu a place it directly under the menu heading)
Sub menu item=>Detail article 1 for X
Sub menu item=> Detail article 2 for X
Menu item=>Menu heading for Y
Sub menu item=>Intro article for Y
....


Question 1
In -some cases- the newly created Sub menu item and its connected Intro article creates the following errors:

PHP Notice: Undefined index: option in [path]\components\com_content\views\article\view.html.php on line 245
PHP Stack trace:
PHP 1. {main}() [path]\index.php:0
PHP 2. Joomla\CMS\Application\CMSApplication->execute() [path]\index.php:49
PHP 3. Joomla\CMS\Application\SiteApplication->doExecute() [path]\libraries\src\Application\CMSApplication.php:196
PHP 4. Joomla\CMS\Application\SiteApplication->dispatch() [path]\libraries\src\Application\SiteApplication.php:233
PHP 5. Joomla\CMS\Component\ComponentHelper::renderComponent() [path]\libraries\src\Application\SiteApplication.php:194
PHP 6. Joomla\CMS\Component\ComponentHelper::executeComponent() [path]\libraries\src\Component\ComponentHelper.php:377
PHP 7. require_once() [path]\libraries\src\Component\ComponentHelper.php:402
PHP 8. Joomla\CMS\MVC\Controller\BaseController->execute() [path]\components\com_content\content.php:43
PHP 9. ContentController->display() [path]\libraries\src\MVC\Controller\BaseController.php:710
PHP 10. Joomla\CMS\MVC\Controller\BaseController->display() [path]\components\com_content\controller.php:118
PHP 11. ContentViewArticle->display() [path]\libraries\src\MVC\Controller\BaseController.php:672
PHP 12. ContentViewArticle->_prepareDocument() [path]\components\com_content\views\article\view.html.php:208
PHP Notice: Undefined index: option in [path]\components\com_content\views\article\view.html.php on line 253
PHP Stack trace:
PHP 1. {main}() [path]\index.php:0
PHP 2. Joomla\CMS\Application\CMSApplication->execute() [path]\index.php:49
PHP 3. Joomla\CMS\Application\SiteApplication->doExecute() [path]\libraries\src\Application\CMSApplication.php:196
PHP 4. Joomla\CMS\Application\SiteApplication->dispatch() [path]\libraries\src\Application\SiteApplication.php:233
PHP 5. Joomla\CMS\Component\ComponentHelper::renderComponent() [path]\libraries\src\Application\SiteApplication.php:194
PHP 6. Joomla\CMS\Component\ComponentHelper::executeComponent() [path]\libraries\src\Component\ComponentHelper.php:377
PHP 7. require_once() [path]\libraries\src\Component\ComponentHelper.php:402
PHP 8. Joomla\CMS\MVC\Controller\BaseController->execute() [path]\components\com_content\content.php:43
PHP 9. ContentController->display() [path]\libraries\src\MVC\Controller\BaseController.php:710
PHP 10. Joomla\CMS\MVC\Controller\BaseController->display() [path]\components\com_content\controller.php:118
PHP 11. ContentViewArticle->display() [path]\libraries\src\MVC\Controller\BaseController.php:672
PHP 12. ContentViewArticle->_prepareDocument() [path]\components\com_content\views\article\view.html.php:208
PHP Notice: Undefined index: option in [path]\components\com_content\views\article\view.html.php on line 253
PHP Stack trace:
PHP 1. {main}() [path]\index.php:0
PHP 2. Joomla\CMS\Application\CMSApplication->execute() [path]\index.php:49
PHP 3. Joomla\CMS\Application\SiteApplication->doExecute() [path]\libraries\src\Application\CMSApplication.php:196
PHP 4. Joomla\CMS\Application\SiteApplication->dispatch() [path]\libraries\src\Application\SiteApplication.php:233
PHP 5. Joomla\CMS\Component\ComponentHelper::renderComponent() [path]\libraries\src\Application\SiteApplication.php:194
PHP 6. Joomla\CMS\Component\ComponentHelper::executeComponent() [path]\libraries\src\Component\ComponentHelper.php:377
PHP 7. require_once() [path]\libraries\src\Component\ComponentHelper.php:402
PHP 8. Joomla\CMS\MVC\Controller\BaseController->execute() [path]\components\com_content\content.php:43
PHP 9. ContentController->display() [path]\libraries\src\MVC\Controller\BaseController.php:710
PHP 10. Joomla\CMS\MVC\Controller\BaseController->display() [path]\components\com_content\controller.php:118
PHP 11. ContentViewArticle->display() [path]\libraries\src\MVC\Controller\BaseController.php:672
PHP 12. ContentViewArticle->_prepareDocument() [path]\components\com_content\views\article\view.html.php:208

These do not occur if I set "Enable URL optimization" to "No". I know that these are only "Notices" and can be hidden but I assume they are a result of an error somewhere and I would like to correct it. Any idea?



URL: https://xxxx.com
userid: xxxx
pw: xxxx
Menues on this test site are still based on Protostar and standard Joomla menu module and are not converted as described above. You can see the converted menu structure on https://www.xxxx.com but then with JMB Tree as menu module. You can play around freely on this test-site.



Question 2 (let me know if I should open this as a separate ticket)
During my testing I found that:
- search.html has close to 130 duplicates
- two articles have 3 duplicates
- close to 30 articles have 2 duplicates
- around 100 articles have 1 duplicates

You can see them on the test site.
How come and what can I do about it, just delete the URLs and their duplicates and hope that they don't come back, or...?!
Are the PHP Notices above connected to this?



Question 3 (which I assume is candidate for a separate ticket and should be taken later, when the above is sorted out. let me know!)
On my live site (https://www.xxxx.com) I have updated the menues as per above and installed the extension JMB Tree Pro. It has been up a week and when I recently checked the "404 requests" I can see that I have a lot of internal 404s coming from URLs that consists of strange combinations of article categories that I use for the URL-construction. Google search doesn't report any such errors and I cannot recreate them myself.

How come? Can the PHP Notices or duplicates above be connected to this?
Sunday, 30 December 2018 10:18 UTC
hajo70
An example of how to re-create the PHP Notices:
The menu "History of the car" is a "Singel article" menu, pointing to the article "History of the car". I want to make that menu item a "Menu heading" and move the article to a sub-menu below it:

1. Create a new sub menu to "History of the car", called "Introduction", as a "Singel article" menu pointing to the article "History of the car". No Notice is created.

2. Change the menu "History of the car" to a "Menu heading". PHP Notices are directly created in the error log in the root:
"PHP Notice: Undefined index: option in /home/mbcomlcx/test.xxxx.com/components/com_content/views/article/view.html.php on line 245 [and 253]"
As I've understood it, a new Notice is created every time a user clicks the new "Introduction" article

3. Since the menu isn't clickable, change the menu module to "Show sub-menu items=Yes". And yes, it looks awful and that was the reason I went for JMB Tree Pro. And yes, you can move the menu module to Protostar's Navigation position and it looks slightly better etc, but the PHP Notices still occur.
Monday, 31 December 2018 09:43 UTC
wb_weeblr
Hi

These do not occur if I set "Enable URL optimization" to "No".
And under no circumstances this means that sh404SEF is causing that issue..

Simply sh404SEF does not use at all menu items to build URLs. That's one of the major SEO issue in Joomla and one of the reasons sh404SEF was created a very long time ago.

1. bought an extension in order to get more flexibility for my menues (note that the issues below occur without this extension installed)
What happens however is that this extension creates the menu items in the database and it does not properly fill the "option" database column as evidenced by the error message:

PHP Notice: Undefined index: option in [path]\components\com_content\views\article\view.html.php on line 245


so whether you disable the extension or uninstall it entirely does not matter: as long as you have a menu item created with it, you will get the error.

I would suggest talking to the extension developer and ask him under which circumstances they may not fill the "option" column in the menu database table.

Question 2:
How come and what can I do about it, just delete the URLs and their duplicates and hope that they don't come back, or...?!
They should come back. If they do and are listed as duplicates then all is working and you do not have a problem. That's exactly the Joomla issue I was mentioning above: Joomla creates many, many duplicates. sh404SEF makes sure they are all grouped under one single public SEF URLs and that search engines specifically never see all that duplicate content.
If you did not have sh404SEF, all those "duplicates" would be separate URLs going to the same content. Pretty bad SEO-wise.

Quesiton 3:
On my live site (https://www.xxxx.com) I have updated the menues as per above and installed the extension JMB Tree Pro. It has been up a week and when I recently checked the "404 requests" I can see that I have a lot of internal 404s coming from URLs that consists of strange combinations of article categories that I use for the URL-construction. Google search doesn't report any such errors and I cannot recreate them myself.



How come? Can the PHP Notices or duplicates above be connected to this?
Hard to say without facts, that is a single example of such URLs. Most likely, I'd say that the menu extension is not always using the Joomla API for building URLs and it likely creates them from javascript, assuming Joomla SEF is operating. This would explain why Google does not seem them, because they do not execute all javascript.

Best regards


 
Monday, 31 December 2018 10:18 UTC
hajo70
Regarding your response on Question 1
The error has nothing to do with the new menu extension. The error can be recreated also in "pure" environments, like https://test.xxxx.com, where the new extension hasn't been installed. It is only Joomla and its standard menu module, Protostar and sh404sef involved.

There is a github article on a similar theme, https://github.com/joomla/joomla-cms/issues/22973?!


Regarding Quesiton 2
Great! If I do a "Delete with duplicates" I assume I have to save any aliases used and paste them into the new SEF URL when it is created?! Or how does that work.


Regarding Quesiton 3
Ok, thanks
Monday, 31 December 2018 10:44 UTC
wb_weeblr
Hi

Question 1: sorry about that, I thought you said that you disabled it. Well, the Github issue explains it (aside from the usual crap we get from some joomla developers about "creating invalid links", I'll try reply to that altough the issue has been closed) and it seems a fix in Joomla is on its way.

Question 2: If you delete any URL, it will be created again next time Joomla or an extension needs it to be displayed on a page. There is nothing to do, URLs are created/recorded as visitors reach your pages and links are needed to display those pages.

Best regards
 
Monday, 31 December 2018 12:01 UTC
hajo70
As I understand the github article the fix is regarding the error/notice output with the full path to the site and that it should be prevented. The underlaying error, something with menu id's and "Menu heading" (I'm not a technical guy...), they still blame sh404sef for it and are not planning to do anything about!?? If that is correctly understood by me, you cannot handle that in sh404sef?!
Monday, 31 December 2018 12:10 UTC
wb_weeblr
Hi

As I understand the github article the fix is regarding the error/notice output with the full path to the site and that it should be prevented. The underlaying error, something with menu id's and "Menu heading" (I'm not a technical guy...), they still blame sh404sef for it and are not planning to do anything about!??
That's not at all what the Github issue says.

The issues says that this error does not happen when only using Joomla SEF. It then says (altough in an incorrect manner when it comes to sh404SEF as sh404SEF itself does NOT change menu item ids) that the issue may happen if an extension uses menu items differently than Joomla.

What it means is that Joomla always assumed that the "Option" field is present. When it's not, the notice appears. So the fix is to test whether the "option" field is present before trying to use it, not assuming it'll always be there (because it'll be there when using stock Joomla but extensions can make it not be there).

So that's the fix that PhilTaylor implemented and hopefully it'll be in next release.

Best regards
 
Monday, 31 December 2018 12:19 UTC
hajo70
Ahh.... Ok, thanks for the explanation. Finally, after some weeks search, I understand what is going on and why. Makes me more comfortable in my solution :-)!
Monday, 31 December 2018 12:58 UTC
wb_weeblr
Hi

Well, that's one of those situations where having a notice is actually not really an issue. Except for the fact it'll fill up PHP logs and make looking at them a bit more complex.

Best regards
 
Tuesday, 15 January 2019 05:34 UTC
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.