Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0][Cassiopea] Wrong ItemId: Call to a member function getParams() on null #30812

Closed
bato3 opened this issue Sep 30, 2020 · 8 comments
Closed

Comments

@bato3
Copy link

bato3 commented Sep 30, 2020

Steps to reproduce the issue

Go to article (without mod_rewrite) with wrong itemid
/index.php?option=com_content&view=article&id=187&Itemid=64

Expected result

HTTP 200 / 404

Actual result

HTTP 500
0 Call to a member function getParams() on null

System information (as much as possible)

Additional comments

From stack is line 29 in template/cassiopea/index.php

$pageclass = $menu->getParams()->get('pageclass_sfx');

My quick fix:

$pageclass = empty($menu)?'':$menu->getParams()->get('pageclass_sfx');

is not working completely correctly because the breadcrumbs are not working properly (shows the home page)

@joomla-cms-bot joomla-cms-bot changed the title [4.0][Cassiopea] Wrong ItemId: Call to a member function getParams() on null [4.0][Cassiopea] Wrong ItemId: Call to a member function getParams() on null Sep 30, 2020
@richard67
Copy link
Member

I can't reprodue that here on a clean, current 4.0-dev with blog sample data, SEF URLS=off, no URL rewriting. And I know at least one other contributor who can't reproduce.

Could you provide some more information about your configuration regarding SEO options in Global Configuration, and if you have an .htaccess file and so on.

How does it normally work for you when having a 404? Do you see the template's error.php, or do you see the server's generic error page? Or have you set up custom error pages?

The more relevant information we get, the better we can reproduce it.

@richard67
Copy link
Member

Information required as stated in my previous comment.


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

@chmst
Copy link
Contributor

chmst commented Sep 30, 2020

In general, a Joomla site has as at least one menuItem and no matter where you are there is always an active menuItem. Can you describe in detail how you got this error?

@bato3
Copy link
Author

bato3 commented Oct 1, 2020

This is probably some sort of bug due to migration issues. I am happy to prepare database dumps to illustrate the problem.

After migration, I have a few problems:

@sakiss
Copy link
Contributor

sakiss commented Oct 15, 2020

I confirm that.
It can also happen if you try to access an article without a sef url.
E.g. /index.php/component/content/article/70-quick-icons

@Quy
Copy link
Contributor

Quy commented Oct 15, 2020

Please test PR #31100

@Quy Quy closed this as completed Oct 15, 2020
@richard67
Copy link
Member

Re-opening the issue because the pull request #31100 has been closed. We can close the issue again as soon as there is a new pull-request.

@richard67
Copy link
Member

New pull request is #31156 . Please test. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants