Post by todavy » Sun Jun 20, 2021 8:54 pm

OpenCart 3.0.3.7 / Apache 2.4.48 / PHP8

The special price page (https://www.yourdomain.com/index.php?ro ... ct/special) doesn't work (HTTP ERROR 500) in PHP version 8. When I changed to PHP7.4 the page worked. Server Error code below:

Code: Select all

Sun Jun 20 14:12:25.752147 2021] [lsapi:error] [pid 3495101:tid 139675406227200] [client 83.253.14.34:0] [host www.[my domain].com] Backend fatal error: PHP Fatal error: Uncaught ValueError: Unknown format specifier "r" in /home/[my account]/domains/[my domain].com/public_html/catalog/controller/product/special.php:66\nStack trace:\n#0 /home/[my account]/domains/[my domain].com/public_html/catalog/controller/product/special.php(66): sprintf()\n#1 /home/[my account]/domains/[my domain].com/public_html/system/engine/action.php(79): ControllerProductSpecial->index()\n#2 /home/[my account]/domains/[my domain].com/public_html/catalog/controller/startup/router.php(25): Action->execute()\n#3 /home/[my account]/domains/[my domain].com/public_html/system/engine/action.php(79): ControllerStartupRouter->index()\n#4 /home/[my account]/domains/[my domain].com/public_html/system/engine/router.php(67): Action->execute()\n#5 /home/[my account]/domains/[my domain].com/public_html/system/engine/router.php(56): Router->execute()\n#6 /home/[my account]/domains/[my domain].com/public_html/system/framework.php(169): Router->dispatch()\n#7 /home/[my account]/domains/[my domain].com/public_html/system/startup.php(104): require_once('/home/[my account]/d...')\n#8 /home/[my account]/domains/[my domain].com/public_html/index.php(19): start()\n#9 {main}\n thrown in /home/[my account]/domains/[my domain].com/public_html/catalog/controller/product/special.php on line 66\n, referer: https://www.[my domain].com/
[Sun Jun 20 14:12:58.268979 2021] [lsapi:error] [pid 3538256:tid 139675330692864] [client 185.189.48.17:0] [host www.[my domain].com] Backend fatal error: PHP Fatal error: Uncaught ValueError: Unknown format specifier "r" in /home/[my account]/domains/[my domain].com/public_html/catalog/controller/product/special.php:66\nStack trace:\n#0 /home/[my account]/domains/[my domain].com/public_html/catalog/controller/product/special.php(66): sprintf()\n#1 /home/[my account]/domains/[my domain].com/public_html/system/engine/action.php(79): ControllerProductSpecial->index()\n#2 /home/[my account]/domains/[my domain].com/public_html/catalog/controller/startup/router.php(25): Action->execute()\n#3 /home/[my account]/domains/[my domain].com/public_html/system/engine/action.php(79): ControllerStartupRouter->index()\n#4 /home/[my account]/domains/[my domain].com/public_html/system/engine/router.php(67): Action->execute()\n#5 /home/[my account]/domains/[my domain].com/public_html/system/engine/router.php(56): Router->execute()\n#6 /home/[my account]/domains/[my domain].com/public_html/system/framework.php(169): Router->dispatch()\n#7 /home/[my account]/domains/[my domain].com/public_html/system/startup.php(104): require_once('/home/[my account]/d...')\n#8 /home/[my account]/domains/[my domain].com/public_html/index.php(19): start()\n#9 {main}\n thrown in /home/[my account]/domains/[my domain].com/public_html/catalog/controller/product/special.php on line 66\n
Last edited by todavy on Sun Jun 20, 2021 11:20 pm, edited 1 time in total.

New member

Posts

Joined
Tue Jun 10, 2014 5:00 pm

Post by straightlight » Sun Jun 20, 2021 9:09 pm

If not using an extension affecting this file, create a new issue on the Github Opencart repository to address the issue.

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

Post by todavy » Sun Jun 20, 2021 9:24 pm

I did that first, and they told me to put it here also:
https://github.com/opencart/opencart/issues/9722

New member

Posts

Joined
Tue Jun 10, 2014 5:00 pm

Post by straightlight » Sun Jun 20, 2021 9:45 pm

The reason why you were told to post in here instead of Github is because the issue could not be reproduced. You're probably reporting a server-specific issue regardless if by reverting back to PHP 7.4 then works afterwards. See on another decent host server if the issue can be reproduced with PHP 8.

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

Post by todavy » Sun Jun 20, 2021 9:54 pm

Thanks. I'll try that.

New member

Posts

Joined
Tue Jun 10, 2014 5:00 pm

Post by ADD Creative » Sun Jun 20, 2021 10:22 pm

Check text_compare in catalog/language/<your languages>/product/special.php.

www.add-creative.co.uk


Expert Member

Posts

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

Post by todavy » Sun Jun 20, 2021 11:13 pm

Beers and cheers Add Creative! Problem solved!

I had mistakenly changed "%s% to %r in the special.php file
$_['text_compare'] = 'Product Compare (%r)';
$_['text_compare'] = 'Product Compare (%s)';

Mysterious that it worked oin PHP7.4 and not PHP8 though. It must be more strict language I guess.
Last edited by todavy on Sun Jun 20, 2021 11:20 pm, edited 1 time in total.

New member

Posts

Joined
Tue Jun 10, 2014 5:00 pm

Post by straightlight » Sun Jun 20, 2021 11:16 pm

Extension. Now that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your first post.

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

Post by todavy » Sun Jun 20, 2021 11:21 pm

Thanks, just wondered how this was marked solved here. Its the first post I do for some years here.

New member

Posts

Joined
Tue Jun 10, 2014 5:00 pm
Who is online

Users browsing this forum: No registered users and 28 guests