Checkout Related Plugin - 500 error after upgrade to J4

  • Posts: 303
  • Thank you received: 18
  • Hikashop Business
1 year 1 month ago #351198

-- HikaShop version -- : 4.7.2
-- Joomla version -- : 4.3.0
-- PHP version -- : 8.1

After upgrading to from J3 -> J4, I noticed many php errors when trying to access the HikaShop configuration. I was able to isolate it to just the checkout related plugin.

select::optgroup not found.



Please let me know if you need any additional information or backend credentials.

Attachments:

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

  • Posts: 26045
  • Thank you received: 4007
  • MODERATOR
1 year 1 month ago #351208

Hello,

Please re-download the plugin in order to have the fix.
We fixed that issue several months ago but it looks like we had an issue with the upload of the latest version.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 303
  • Thank you received: 18
  • Hikashop Business
1 year 1 month ago #351213

Thanks Jerome! After installing new version, i no longer get the 500 errors. However, i did see a php warning come up that i can toggle with the checkout related plugin being published:

Warning: Undefined array key "value" in ****/libraries/src/HTML/Helpers/Select.php on line 494

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

  • Posts: 26045
  • Thank you received: 4007
  • MODERATOR
1 year 1 month ago #351247

Hello,

Where do you have that warning ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 303
  • Thank you received: 18
  • Hikashop Business
1 year 1 month ago #351250

The warnings are showing up "Configuration -> Checkout -> Checkout Configuration"



I'm assuming it's something specific to the checkout related step panels.

Attachments:
Last edit: 1 year 1 month ago by mojooutdoors-holden.

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

  • Posts: 26045
  • Thank you received: 4007
  • MODERATOR
1 year 1 month ago #351286

Hello,

Thank you for the screenshot.
There is indeed an issue with the HikaShop core which cannot handle "groupedlist" content with Joomla 4.

One possibility is to modify the file "checkout_related_class.php" in order to replace the content

	$values[] = array(
		'text' => $optGroup,
		'items' => $ret
	);
By
	$values[] = $ret;
But you'll loose the "template" detail in Joomla 4.

The other possibility is to fix the HikaShop core in order to handle groupedlist for J4 ; or to add a new type of content specially for grouped lists.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 303
  • Thank you received: 18
  • Hikashop Business
1 year 1 month ago #351396

I think the second fix is more robust, but i'll implement your first option for now.

FYI: the latest version of the plugin is broken on Joomla 3.10.11

plugins/hikashop/checkout_related/checkout_related_class.php
Line: 77
Error: in_array(): Argument #2 ($haystack) must be of type array, null given

This breaks the whole backend configuration area, as well as, all checkout pages.

Last edit: 1 year 1 month ago by mojooutdoors-holden.

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

  • Posts: 26045
  • Thank you received: 4007
  • MODERATOR
1 year 1 month ago #351399

Hello,

I update the plugin with the corresponding fix.
It also contains the modification for "groupedlist" in HikaShop checkout workflow system.

Thus, it requires a small modification in the current version of HIkaShop (until the next release which will include the patch).
File : "administrator/components/com_hikashop/types/checkout_workflow.php"
Replace

	case 'list':
		if(!isset($s['values']))
			break;
		$ret .= JHTML::_('select.genericlist',  $s['values'], $name, 'class="inputbox no-chzn" data-checkout-param="'.$k.'" onchange="window.checkoutWorkflowEditor.onChange(this);"', 'value', 'text', $v);
		break;
By
	case 'list':
		if(!isset($s['values']))
			break;
		$ret .= JHTML::_('select.genericlist',  $s['values'], $name, 'class="inputbox no-chzn" data-checkout-param="'.$k.'" onchange="window.checkoutWorkflowEditor.onChange(this);"', 'value', 'text', $v);
		break;
	case 'groupedlist':
		if(!isset($s['values']))
			break;
		if(!HIKASHOP_J40)
			$ret .= JHTML::_('select.genericlist',  $s['values'], $name, 'class="inputbox no-chzn" data-checkout-param="'.$k.'" onchange="window.checkoutWorkflowEditor.onChange(this);"', 'value', 'text', $v);
		else
			$ret .= JHTML::_('select.groupedlist',  $s['values'], $name, array('list.attr'=>'class="custom-select" data-checkout-param="'.$k.'" onchange="window.checkoutWorkflowEditor.onChange(this);"', 'group.id' => 'id', 'list.select' => array($v)));
		break;

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 303
  • Thank you received: 18
  • Hikashop Business
1 year 1 month ago #351537

Unfortunately this change does not resolve the error in Joomla 3.10.11:

0: in_array(): Argument #2 ($haystack) must be of type array, null given

Last edit: 1 year 1 month ago by mojooutdoors-holden.

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

  • Posts: 26045
  • Thank you received: 4007
  • MODERATOR
1 year 1 month ago #351542

Hello,

As mentioned previously ; There is the fix for your issue regarding the fact that the variable $exclude_categories can be NULL instead of being an empty array.
The fix check if the variable is empty and force it with an empty array, to avoid the error.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.091 seconds
Powered by Kunena Forum