Pending
Not before # 18564

User tests: Successful: Unsuccessful:

avatar chivitli
chivitli
28 Jul 2017

I just noticed that error log on one of my sites quickly grew to over 100 MB. It was always the same error:

Trying to get property of non-object in /*******/public_html/libraries/cms/component/router/rules/menu.php on line 179.

I was not the only one with this problem, here is a related post on the forum: https://forum.joomla.org/viewtopic.php?t=949743

It would happen for example if when migrating from an old version you had a menu of type "Content Section", and it wouldn't matter that the menu isn't displayed anywhere on the new version. It may happen under some other circumstances as well. The change I made should keep the condition of the if statement unchanged, except that it won't throw an error if the variable is uninitialized.

Pull Request for Issue # .

Summary of Changes

Testing Instructions

Expected result

Actual result

Documentation Changes Required

avatar joomla-cms-bot joomla-cms-bot - change - 28 Jul 2017
Category Libraries
avatar chivitli chivitli - open - 28 Jul 2017
avatar chivitli chivitli - change - 28 Jul 2017
Status New Pending
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Nov 2017
Status Pending Needs Review
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 1 Nov 2017

Status is set on "Needs Review".

avatar csthomas
csthomas - comment - 2 Nov 2017

IMO the fix should look like

diff --git a/libraries/src/Component/Router/Rules/MenuRules.php b/libraries/src/Component/Router/Rules/MenuRules.php
index 34bd9b1e58..973d01095c 100644
--- a/libraries/src/Component/Router/Rules/MenuRules.php
+++ b/libraries/src/Component/Router/Rules/MenuRules.php
@@ -202,7 +202,7 @@ class MenuRules implements RulesInterface
 
                        foreach ($items as $item)
                        {
-                               if (isset($item->query) && isset($item->query['view']))
+                               if (isset($item->query['view'], $views[$item->query['view']]))
                                {
                                        $view = $item->query['view'];

because such view does not exist and can not be added to menu lookup at all.

avatar johannesveje
johannesveje - comment - 13 Nov 2017

Any updates on how long it will be till this 8 chars, 3½ month old fix will be implemented ? I hope the time isn't proportional to the size of the commit for other problems.

avatar brianteeman
brianteeman - comment - 13 Nov 2017

Every pull request needs at least two human tests to confirm the issue and fix

avatar johannesveje
johannesveje - comment - 13 Nov 2017

So right now all that is missing is one human confirming the fix? The issue have been reported multiple times: #18123 and #18043 . The last one also have a confirmed fix, which might even work better than this one.

avatar csthomas
csthomas - comment - 13 Nov 2017

I have created another solution for the same problem. Welcome to test #18564.
You can test it in your own way.

If no PR will be tested by two testers, none of them will be merged.

avatar johannesveje
johannesveje - comment - 13 Nov 2017

Yay one more solution \o/

avatar csthomas
csthomas - comment - 13 Nov 2017

@johannesveje If you want any changes in joomla you should test some of them at https://issues.joomla.org/tracker/joomla-cms/

avatar johannesveje
johannesveje - comment - 13 Nov 2017

I'll create a solution myself when I get the time ?

avatar Quy
Quy - comment - 15 Nov 2017

@csthomas Can this be closed?

avatar csthomas
csthomas - comment - 15 Nov 2017

I think so or after #18564 will be merged.

avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Nov 2017
Rel_Number 0 18564
Relation Type Not before
avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Nov 2017
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2017-11-15 16:20:22
Closed_By franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 15 Nov 2017
avatar joomla-cms-bot joomla-cms-bot - change - 15 Nov 2017
Closed_Date 2017-11-15 16:20:22 2017-11-15 16:20:23
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 15 Nov 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Nov 2017

closed as stated above.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17323.

Add a Comment

Login with GitHub to post a comment