User tests: Successful: Unsuccessful:
Pull Request for Issue #40182 .
In version 4.2.9, $this->router->app is being used instead of $this->app.
Use Joomla 4.3 nightly build
Create at least one article
Create an instance of Articles - Latest module
Change Home menu item to link to Featured Contacts menu item type. If you have any menu items link to com_content before, please unpublish it or make them 'hidden'
Try to access to an article from Articles - Latest module above
ERROR 0 - Call to a member function getInput() on null in ...\libraries\src\Component\Router\Rules\NomenuRules.php:82
No error
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
Labels |
Added:
PR-4.3-dev
|
Oh, No. You are making more changes than needed. All you need to do is change line 82 from:
$input = $this->app->getInput();
To
$input = $this->router->app->getInput();
Just updating line 82 causes line 83 crash : ERROR 0 - Object of type Joomla\CMS\Input\Input is not callable.....
Line 83 crash because you also made change to that line. If you just make change to line 82 as I mentioned, it will work well
Line 83 crash because you also made change to that line. If you just make change to line 82 as I mentioned, it will work well
No, original line 83 contains if ($view->parent_key && $input->get($view->parent_key)) {
If I use your line, it crashes as $input is a method and not an object.
If I use your line, it crashes as $input is a method and not an object.
$input is an object. Not method. Like 82, if you make change as mentioned, will return application input object
$input = $this->router->app->getInput();
$this->router->app
returns the application object. And calling $this->router->app->getInput();
will return input object, not a method. You can follow the testing instructions which provided to test the result yourself.
Your code does not work. I applied the changes (which I know it's wrong) and see some notices and 404 not found error:
Notice
: Object of class Joomla\CMS\Input\Input could not be converted to float in
libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php
on line
435
Notice
: Object of class Joomla\CMS\Input\Input could not be converted to int in
\libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php
on line
435
I just tried following your testing instructions and, indeed, your single line works.
But, when I try it with Phocadownload component, it blows up.
May be a phocadownload issue.
I'm doing some more research on this.
I have tested this item
For information, hidden components behave like no-menu components
After some more testing, I was not able to reproduce error on line 83 with other components (including phocadownload). I must have dreamt it...
So this PR only contains one line.
Title |
|
Title |
|
Title |
|
Title |
|
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-03-24 22:30:52 |
Closed_By | ⇒ | obuisard | |
Labels |
Added:
?
Release Blocker
|
Thank you @conseilgouz for the fix!
Testing Instructions
Actual result BEFORE applying this Pull Request
You get fatal error: ERROR 0 - Call to a member function getInput() on null in ...\libraries\src\Component\Router\Rules\NomenuRules.php:82
$this->app is not initialized
Expected result AFTER applying this Pull Request
No error. The article is being displayed properly.