No Code Attached Yet bug
avatar Kubik-Rubik
Kubik-Rubik
21 Sep 2021

Steps to reproduce the issue

With the command php cli/joomla.php list, you get a list of all available CLI commands.

The script throws a PHP notice if the system plugin "System - Page Cache" is enabled:

Notice: Undefined index: HTTP_HOST in /xxx/libraries/src/Uri/Uri.php on line 103

Expected result

No errors, regardless of what plugins are activated.

Actual result

See the error above.

System information (as much as possible)

Joomla! 4.0.3, PHP 7.x & 8.x

avatar Kubik-Rubik Kubik-Rubik - open - 21 Sep 2021
avatar Kubik-Rubik Kubik-Rubik - change - 21 Sep 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 21 Sep 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Sep 2021
avatar brianteeman
brianteeman - comment - 21 Sep 2021

Confirmed

avatar Quy Quy - change - 22 Sep 2021
Labels Added: bug
avatar Quy Quy - labeled - 22 Sep 2021
avatar alikon alikon - change - 2 Oct 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-10-02 08:04:29
Closed_By alikon
avatar alikon alikon - close - 2 Oct 2021
avatar alikon
alikon - comment - 2 Oct 2021

please test #35722

avatar anibalsanchez
anibalsanchez - comment - 17 Oct 2021

From my comment in #35722:

About #35625, the problem is that the php cli/joomla.php list is firing the "System - Page Cache" when it's called from the console. Why would a console application fire the "System - Page Cache" plugin? It shouldn't. By default, a console application doesn't have to interact with the site cache.

The joomla console application calls to PluginHelper::importPlugin('system'); to initialize all system plugins. So, the problem seems to be that the "System - Page Cache" plugin tries to read the URI when it is executed in the console context. In my opinion, the plugin should do nothing and ignore the execution if it is the console context.

PS: Now commenting in the right issue ;-)

Add a Comment

Login with GitHub to post a comment