NOT PHP 8.1 compatible: passing null to parameter (explode deprecation)
wssweb opened this issue · 0 comments
wssweb commented
Preconditions (*)
- Magento 2.4.5-p4
- PHP 8.1^
- /mageplaza/module-same-order-number (any version)
Steps to reproduce (*)
- Have magento 2 running on PHP 8.1
- Installed module-same-order-number via composer
- try to invoice an order
Expected result (*)
- Order invoices successfully
- no system log errors
Actual result (*)
- Order fails to invoice
- syslog displays:
main.CRITICAL: Exception: Deprecated Functionality: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home/html/vendor/mageplaza/module-same-order-number/Helper/Data.php on line 45 in /home/html/vendor/magento/framework/App/ErrorHandler.php:62
Solution (*)
Modify /vendor/mageplaza/module-same-number/Helper/Data.php line 45
old:
$this->applyForOption = explode(',', $this->getConfigGeneral('apply', $storeId));
new:
$this->applyForOption = explode(',', (string)$this->getConfigGeneral('apply', $storeId));