Error on update to 6.5

  • Posts: 205
  • Thank you received: 7
  • Hikashop Business
2 hours 52 minutes ago #372308

-- HikaShop version -- : 6.5
-- Joomla version -- : 6.1.1
-- PHP version -- : 8.3
-- Error-message(debug-mod must be tuned on) -- : Error: Cannot redeclare com_install() (previously declared in /home/heleyupu/public_html/tmp/hika/install.hikashop.php:27)
Symfony\Component\ErrorHandler\Error\
FatalError
Show exception properties
in /home/heleyupu/public_html/administrator/components/com_payzen/script.install.php (line 40)
}}// Joomla 1.5.if (function_exists('com_install')) { function com_install() { $installClass = new com_payzenInstallerScript(); $installClass->install(); }}

hello i have a problem on update to 6.5
i have this error

This message contains confidential information

thanks for any help

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

  • Posts: 85761
  • Thank you received: 14064
  • MODERATOR
1 hour 24 minutes ago #372311

Hi,

This is a bug in the PayZen component (com_payzen), not in HikaShop. The HikaShop update is only what brings it to the surface.

The fatal error comes from this file on your site:
administrator/components/com_payzen/script.install.php

Around line 38 it has the old Joomla 1.5 installer function with a reversed test:

if (function_exists('com_install')) {
	function com_install() {
		...
	}
}

This declares com_install() only when a function of that name already exists, which is exactly the case where it must not declare it again. HikaShop's installer defines its own com_install() (correctly guarded with !function_exists), so during the update both files are loaded in the same request, PayZen's reversed test passes, and PHP stops with "Cannot redeclare com_install()".

The fix is to add the missing ! so the function is declared only when it does not already exist:
if (!function_exists('com_install')) {
	function com_install() {
		...
	}
}

Edit that single line, then run the HikaShop update again and it will complete normally. It is also worth reporting this to the PayZen / Lyra team so they correct it in their component, or updating com_payzen if a newer version is available.
I'll send them a message about it. I would recommend you do the same.

We'll also look at changing the code of HikaShop on our end for the next version so that this cannot happen even with this faulty code in place.

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

  • Posts: 205
  • Thank you received: 7
  • Hikashop Business
1 hour 21 minutes ago #372312

thanks for your prompt support ! that works

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

Time to create page: 0.057 seconds
Powered by Kunena Forum