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

[BUG] Passing null to parameter #1 of type string is deprecated in Plugin/Shipment/ShippingBuilder.php on line 37 #385

Open
DuckThom opened this issue Jul 3, 2024 · 2 comments

Comments

@DuckThom
Copy link

DuckThom commented Jul 3, 2024

To Reproduce
Steps to reproduce the behavior:

  1. 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

strpos($method, 'tig_postnl') !== false &&

Screenshots

image
image

** Please complete the following information**

  • Magento version: 2.4.5-p8
  • PHP version: 8.1.18
  • TIG PostNL version: 1.15.2
@downforce80
Copy link

downforce80 commented Jul 8, 2024

We had the same issue when creating a magento admin order in the backend with shipping method postNL.

Magento ver. 2.4.4-p9
PostNL version: 1.15.2

rbouma pushed a commit to rbouma/postnl-magento2 that referenced this issue Aug 5, 2024
@rbouma
Copy link

rbouma commented Aug 5, 2024

We have the same issue for a placed order that have no shipment method selected. By opening the admin it breaks on the strpos.

added a fix in #387

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

No branches or pull requests

3 participants