Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

SJ Categories Accordion compatibility with PHP 8 / Joomla 4
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: SJ Categories Accordion compatibility with PHP 8 / Joomla 4

SJ Categories Accordion compatibility with PHP 8 / Joomla 4 3 years, 2 months ago #45321

Hello,

We are actually testing our websites for PHP 8 and noticed that SJ Categories Accordion raise an error : 0 - Call to undefined function create_function()

Could you please tell us if you plan to make it compatible with this PHP version and with Joomla 4 ?

Thanks in advance for your help and have a nice day.

Re: SJ Categories Accordion compatibility with PHP 8 / Joomla 4 3 years, 2 months ago #45335

  • thuygtn
Dear appnweb,

Please go to the file: modules\mod_sj_categories_accordion\core\helper.php and find:
case 'title':
usort($cats, create_function('$a, $b', 'return strnatcasecmp( $a->title, $b->title);'));
break;
case 'created':
usort($cats, create_function('$a, $b', 'return $a->created_time < $b->created_time;'));
break;

Edit to:

case 'title':
usort($cats, function($a, $b){return strnatcasecmp( $a->title, $b->title);});
break;
case 'created':
usort($cats, function($a, $b) {return $a->created_time < $b->created_time;});
break;

Please see screenshot:
prnt.sc/1sa2a7z

Thanks

Re: SJ Categories Accordion compatibility with PHP 8 / Joomla 4 3 years, 2 months ago #45355

Sorry for the late answer, I was away from the office.

I just tried but it does not work and seems to break syntax as it raises error :syntax error, unexpected token ")", expecting "{"

I had a look at it in my editor and the first usort() seems to be the cause. I tried to attach a screenshot of it but it seems the file field does not work.

By the way, could you please tell me what are your plans regarding Joomla 4 ?

Because I may need to migrate this website in a near future which means a PHP 8 fix is not really useful if no Joomla 4 compatible version is planned.

Thanks in advance for your help and have a nice day.
  • Page:
  • 1
Time to create page: 0.20 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes