This is the official Magento 2 extension for the logistics company PostNL. Add shipping options and parcelshops to your checkout. Create labels with track and trace functionality from the backend.
58
stars
60
forks
source link
[BUG] Passing null to parameter #1 of type string is deprecated in Plugin/Shipment/ShippingBuilder.php on line 37 #385
Have an order without a shipping method (Not fully sure how to create such an order, but the order causing the issue on our side has the status 'cancelled' plus the field can be null in the database)
Expected result
No exception is thrown
Actual result
An exception is thrown and the GraphQL query is aborted
[2024-07-03T09:02:50.017338+00:00] report.ERROR: Deprecated Functionality: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /data/web/uat_magento_2/vendor/tig/postnl-magento2/Plugin/Shipment/ShippingBuilder.php on line 37
GraphQL (30:13)
29: customer {
30: orders(pageSize: $pageSize, currentPage: $currentPage) {
^
31: total_count
[] []
Workaround
Manually updating/patching the following line to cast $method to a string
To Reproduce Steps to reproduce the behavior:
Expected result No exception is thrown
Actual result
An exception is thrown and the GraphQL query is aborted
Workaround
Manually updating/patching the following line to cast
$method
to a stringhttps://github.com/postnl/postnl-magento2/blob/1e8f126ea3e3062cfbbc592c43fd1eb640592c8b/Plugin/Shipment/ShippingBuilder.php#L37
Screenshots
Please complete the following information