mojo_redirect

  • Posts: 9
  • Thank you received: 1
1 week 6 days ago #360434

-- HikaShop version -- : 5.0.4
-- Joomla version -- : 4.4.4
-- PHP version -- : 8.1

When click on "System" in Admin panel in eror log php we have:
[19-Apr-2024 14:45:42] WARNING: [pool www] child 417442 said into stderr: "NOTICE: PHP message: PHP Warning: Trying to access array offset on value of type null in /var/www/site/administrator/components/com_installer/src/Model/DatabaseModel.php on line 180"

I found a problem with pkg mojo_redirect.
If you create a folder sql/updates in the /plugins/system/mijo_redirect folder
then a WARNING is not logged.

Please Log in or Create an account to join the conversation.

  • Posts: 81568
  • Thank you received: 13078
  • MODERATOR
1 week 6 days ago #360437

Hi,

Thank you for you feedback. The problem is actually in the administrator/components/com_installer/src/Model/DatabaseModel.php file.
The code

$folderTmp = (string) $installationXML->update->schemas->schemapath[0];
assumes that any extension installed has either a sql/updates folder or a schemas node in the XML file of the extension.
This mijo_redirect plugin adds nothing to the database, so it doesn't requires a sql/updates folder nor a schemas node in the XML file.
The Joomla documentation on how to create a plugin for Joomla 4 also doesn't mention anything about this:
docs.joomla.org/J4.x:Creating_a_Plugin_for_Joomla
So it's actually the file administrator/components/com_installer/src/Model/DatabaseModel.php which needs to be modified.
The line
if ($installationXML !== null) {
just before the line of the notice should be changed to something like this :
if ($installationXML !== null && isset($installationXML->update->schemas->schemapath)) {

I would recommend reporting the issue on Joomla's github:
github.com/joomla/joomla-cms/issues

Last edit: 1 week 6 days ago by nicolas.
The following user(s) said Thank You: bvitl

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
1 week 6 days ago #360447

I now uninstalled the plugin and remove folders sql/updates and then reinstalled it.
WARNING is not logged also.

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum