? Release Blocker PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar conseilgouz
conseilgouz
24 Mar 2023

Pull Request for Issue #40182 .

Summary of Changes

In version 4.2.9, $this->router->app is being used instead of $this->app.

Testing Instructions

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

Actual result BEFORE applying this Pull Request

ERROR 0 - Call to a member function getInput() on null in ...\libraries\src\Component\Router\Rules\NomenuRules.php:82

Expected result AFTER applying this Pull Request

No error

avatar joomla-cms-bot joomla-cms-bot - change - 24 Mar 2023
Category Libraries
avatar conseilgouz conseilgouz - open - 24 Mar 2023
avatar conseilgouz conseilgouz - change - 24 Mar 2023
Status New Pending
avatar joomdonation
joomdonation - comment - 24 Mar 2023

Testing Instructions

  1. Use Joomla 4.3 nightly build
  2. Create at least one article
  3. Create an instance of Articles - Latest module
  4. 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.
  5. Try to access to an article from Articles - Latest module above

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.

avatar conseilgouz conseilgouz - change - 24 Mar 2023
Labels Added: PR-4.3-dev
avatar conseilgouz conseilgouz - change - 24 Mar 2023
The description was changed
avatar conseilgouz conseilgouz - edited - 24 Mar 2023
avatar joomdonation
joomdonation - comment - 24 Mar 2023

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();
avatar conseilgouz
conseilgouz - comment - 24 Mar 2023

No, bug has been introduced by #39029
So, input() lines have to become getInput().

avatar conseilgouz
conseilgouz - comment - 24 Mar 2023

Just updating line 82 causes line 83 crash : ERROR 0 - Object of type Joomla\CMS\Input\Input is not callable.....

avatar joomdonation
joomdonation - comment - 24 Mar 2023

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

avatar conseilgouz
conseilgouz - comment - 24 Mar 2023

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.

avatar conseilgouz
conseilgouz - comment - 24 Mar 2023

Lines 83 to 85 have been updated to be consistent with pr #39029

avatar joomdonation
joomdonation - comment - 24 Mar 2023

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.

avatar conseilgouz
conseilgouz - comment - 24 Mar 2023

I tried PR as we discussed :

  1. just updating line 82 to $input = $this->router->app; works, with no other change (but it is not consistent with PR #39029 )
  2. Updating line 82 as you suggested causes an error on line 83
avatar joomdonation
joomdonation - comment - 24 Mar 2023

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

avatar conseilgouz
conseilgouz - comment - 24 Mar 2023

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.

avatar conseilgouz conseilgouz - change - 24 Mar 2023
The description was changed
avatar conseilgouz conseilgouz - edited - 24 Mar 2023
avatar joomdonation joomdonation - test_item - 24 Mar 2023 - Tested successfully
avatar joomdonation
joomdonation - comment - 24 Mar 2023

I have tested this item successfully on 6c948fa


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

avatar conseilgouz
conseilgouz - comment - 24 Mar 2023

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.

avatar conseilgouz conseilgouz - change - 24 Mar 2023
Title
fix #40182
[4.3] fix #40182
avatar conseilgouz conseilgouz - edited - 24 Mar 2023
avatar conseilgouz conseilgouz - change - 24 Mar 2023
Title
[4.3] fix #40182
[4.3] fix for #40182
avatar conseilgouz conseilgouz - edited - 24 Mar 2023
avatar conseilgouz conseilgouz - change - 24 Mar 2023
Title
[4.3] fix for #40182
[4.3] fix for #40182 : error in router in NomenuRules
avatar conseilgouz conseilgouz - edited - 24 Mar 2023
avatar conseilgouz conseilgouz - change - 24 Mar 2023
Title
[4.3] fix for #40182 : error in router in NomenuRules
[4.3] fix for #40182 : Router error in NomenuRules
avatar conseilgouz conseilgouz - edited - 24 Mar 2023
avatar sdwjoomla sdwjoomla - test_item - 24 Mar 2023 - Tested successfully
avatar sdwjoomla
sdwjoomla - comment - 24 Mar 2023

I have tested this item successfully on 6c948fa


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

avatar Quy Quy - change - 24 Mar 2023
Status Pending Ready to Commit
avatar Quy
Quy - comment - 24 Mar 2023

RTC


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

avatar obuisard obuisard - close - 24 Mar 2023
avatar obuisard obuisard - merge - 24 Mar 2023
avatar obuisard obuisard - change - 24 Mar 2023
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
avatar obuisard
obuisard - comment - 24 Mar 2023

Thank you @conseilgouz for the fix!

Add a Comment

Login with GitHub to post a comment