Post by lankylad » Wed Nov 16, 2022 5:09 pm

I upgraded my Opencart Version from V3.0.3.2 to V3.0.3.8 using the upgrade script. The patches were all applied successfully, and Opencart was working correctly. I then upgraded PHP from 7.4.33 to 8.1.12 and started to get the error message:

Unknown: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in OpenCart\storage\modification\system\engine\action.php on line 65

on the Homepage of the shop and Admin.

Any suggestions?

New member

Posts

Joined
Fri Nov 01, 2019 5:11 pm

Post by johnp » Wed Nov 16, 2022 7:23 pm

Where did you download 3.0.3.8 from? The Opencart website?

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by JNeuhoff » Wed Nov 16, 2022 8:38 pm

OpenCart 3.0.3.8 doesn't support PHP 8.x versions. Use the 3.0.x.x_Maintenance branch instead which works with PHP 8.0, 8.1 and 8.2, and is backward-compatible with OC 3.0.3.8.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by lankylad » Wed Nov 16, 2022 10:27 pm

Apologies, I should have said that I downloaded the 3.0.x.x_Maintenance branch

New member

Posts

Joined
Fri Nov 01, 2019 5:11 pm

Post by ADD Creative » Thu Nov 17, 2022 8:01 pm

Check you don't have any missing files. That error could be caused by a missing controller file that is being call by a route, pre_action or an event.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by xxvirusxx » Fri Nov 18, 2022 6:40 pm

lankylad wrote:
Wed Nov 16, 2022 5:09 pm
Unknown: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in OpenCart\storage\modification\system\engine\action.php on line 65
Try to refresh ocmod modifications. If doesn't work ocmod extensio issue

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by lankylad » Sun Dec 18, 2022 12:36 am

I found my way around this problem by replacing NULL with 0 for INT and '' for STRING. But now I'm getting the message:

Return type of Twig_Node::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in OpenCart\system\library\template\Twig\Node.php on line 222

and

Return type of Twig_Node::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in OpenCart\system\library\template\Twig\Node.php on line 227

Any ideas?

New member

Posts

Joined
Fri Nov 01, 2019 5:11 pm

Post by JNeuhoff » Sun Dec 18, 2022 2:02 am

lankylad wrote:
Sun Dec 18, 2022 12:36 am
I found my way around this problem by replacing NULL with 0 for INT and '' for STRING. But now I'm getting the message:

Return type of Twig_Node::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in OpenCart\system\library\template\Twig\Node.php on line 222

and

Return type of Twig_Node::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in OpenCart\system\library\template\Twig\Node.php on line 227

Any ideas?
Yes, it's because of using an old twig version. Just override your OpenCart files with the ones from the 3.0.x.x_Maintenance branch, and these errors should all disappear.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by straightlight » Sun Dec 18, 2022 7:49 am

opencart-3 already uses the upgraded vendor folder packages as per MB.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 41 guests