0

I get lots of notices for components/com_content/helpers/legacyrouter.php, like:

"/home/xxx/domains/xxxxxx/public_html/cc_j34/components/com_content/helpers/legacyrouter.php on line 95\nPHP message: PHP Notice: Undefined index: view in "

I guess that bots are searching for links that don't exist anymore. At the end they get a 404, but I think the legacyrouter shouldn't give this warning.

The code, changed for 3.8.2 is:

    if ($menuItem !== null
        && $menuItem->query['view'] == $query['view']
        && isset($menuItem->query['id'], $query['id'])
        && $menuItem->query['id'] == (int) $query['id'])

with "&& $menuItem->query['view'] == $query['view']" as line 95.

Could it be possible that this 'view' is not set? In 3.8.2. a check was added for the query['id'].

Any hint of how to check and fix this....?

Thnx.

1

I have the same problem (I use Joomla 3.8.3) and I just found a solution.

The problem is in the exact code that you wrote. You have to change it to:

if ($menuItem !== null
            && isset($menuItem->query['view'])
            && $menuItem->query['view'] == $query['view']
            && isset($menuItem->query['id'], $query['id'])
            && $menuItem->query['id'] == (int) $query['id'])

Actually you have to add the line:

&& isset($menuItem->query['view'])

(This code exists in the file "components\com_content\helpers\legacyrouter.php".)

It seems that they forgot to check the existence of the variable $menuItem->query['view'].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.