Ubject: PHP 8.1 deprecation/warning notices in CS-Cart 4.19 SP1 (Smarty & fn.options.php)

Hi all,

Running CS-Cart 4.19 SP1 on PHP 8.1, and getting the following recurring notices in the error log:

PHP Deprecated: Automatic conversion of false to array is deprecated in /app/Tygh/SmartyEngine/Blocks/Styles.php on line 305
PHP Deprecated: Automatic conversion of false to array is deprecated in /app/Tygh/SmartyEngine/Blocks/Styles.php on line 307
PHP Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /app/lib/vendor/smarty/smarty/src/Extension/CallbackWrapper.php on line 29
PHP Warning: Undefined array key 162 in /app/functions/fn.options.php on line 962

These all look like PHP 8.1 compatibility issues in core files (Smarty engine wrapper + product options handling) rather than anything in my custom code. Has anyone else hit these on 4.19 SP1 with PHP 8.1? Is there a known official patch/hotfix, or should these be reported as bugs? Trying to figure out if it’s safe to just suppress them or if there’s an actual underlying data issue (e.g. with product option combinations) causing the fn.options.php warning specifically.

Thanks in advance.

Lulu

Hello

All three come from core, not from your code.

The first two are cosmetict

fn.options.php:962 is the one about your data.

Fix from the admin panel: product → Options → Exceptions, add a dummy exception, then delete it. Adding one rebuilds every exception of that product, deleting removes only that row. Back up the table first.

And do not delete and re-add the option to fix this - deleting an option also deletes every exception that contains it

The first two are safe to silence with error_reporting.

Best regards
Robert

Hi Robert
Thanks
Merci beaucoup
Lulu

Hello Lulu

You are welcome :slight_smile:

Best regards
Robert