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

Null exception when using custom shipping method with Magento 2.4.4+ #14

Open
the-line opened this issue Mar 10, 2023 · 0 comments
Open

Comments

@the-line
Copy link

When using a custom shipping method with the option "Eigen verzendopties via parcelpro.nl" the shipment cannot be send correctly to ParcelPro.

When clicking on the "Zending aanmelden" option in a order, the following error message is given:

Exception #0 (Exception): Deprecated Functionality: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/parcelpro/shipment/Controller/Adminhtml/Shipment/Index.php on line 154

This is because the response body of ParcelPro doesn't contain a barcode. Therefore the call to substr with the empty value of $response_body['Barcode'] value will trigger this exception.

This only happens when running PHP 8.1 which is required for Magento 2.4.4 and newer. Previous version of Magento are out of support and therefore running PHP 7.4 is not a option.

@the-line the-line changed the title Null exception when using custom shipping method Null exception when using custom shipping method with Magento 2.4.4+ Mar 10, 2023
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