Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT PHP 8.1 compatible: passing null to parameter (explode deprecation) #13

Open
wssweb opened this issue Aug 18, 2023 · 0 comments
Open

Comments

@wssweb
Copy link

wssweb commented Aug 18, 2023

Preconditions (*)

  1. Magento 2.4.5-p4
  2. PHP 8.1^
  3. /mageplaza/module-same-order-number (any version)

Steps to reproduce (*)

  1. Have magento 2 running on PHP 8.1
  2. Installed module-same-order-number via composer
  3. try to invoice an order

Expected result (*)

  1. Order invoices successfully
  2. no system log errors

Actual result (*)

  1. Order fails to invoice
  2. 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));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant