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

getCarrier() must be of the type string or null error when creating shipment #477

Closed
bojanni opened this issue Sep 12, 2020 · 11 comments
Closed
Assignees
Labels
bug Something isn't working In progress Next version

Comments

@bojanni
Copy link

bojanni commented Sep 12, 2020

Describe the bug
Error when creating consigment

To Reproduce
Steps to reproduce the behavior:

  1. Go to a placed order with status processing
  2. Click on shipment
  3. Scroll down to place the shipment
  4. See error

fatal error: Uncaught TypeError: Return value of MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter::getCarrier() must be of the type string or null, boolean returned in /home//public_html/vendor/myparcelnl/sdk/src/Adapter/DeliveryOptions/AbstractDeliveryOptionsAdapter.php:88 Stack trace: #0 /home//public_html/vendor/myparcelnl/magento/Model/Sales/TrackTraceHolder.php(167): MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter->getCarrier() #1 /home//public_html/vendor/myparcelnl/magento/Observer/NewShipment.php(105): MyParcelNL\Magento\Model\Sales\TrackTraceHolder->convertDataFromMagentoToApi(Object(Magento\Sales\Model\Order\Shipment\Track), Array) #2 /home/bvdhe1de/public_html/vendor/myparcelnl/magento/Observer/NewShipment.php(79): MyParcelNL\Magento\Observer\NewShipment->setMagentoAndMyParcelTrack(Object(Magento\Sales\Model\Order\Shipment)) #3 /home//public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): MyParcelNL\Magento\Ob in /home/***/public_html/vendor/myparcelnl/sdk/src/Adapter/DeliveryOptions/AbstractDeliveryOptionsAdapter.php on line 88

Expected behavior
The shipment to be created sccesfully

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: CENTOS 7
  • Browser Opera / Edge / Chrome
  • MyParcel Plugin version 4.1.2
  • MyParcel SDK version 5.2.1

Additional context
It look like creating a shipment from the grid works. But more testing is required

looks like the same error from here #464 (comment)

@CoenPonsen1984
Copy link

CoenPonsen1984 commented Sep 28, 2020

Did you manage to solve this issue? After updating to MyParcel 4.1.2 we get this error message. We can only create shipments on the order grid (we are successfully creating consignments) but no longer on the order page itself.

@bojanni
Copy link
Author

bojanni commented Sep 29, 2020

Hi.
No, we reverted back to 3.4 because of the various issues with 4.1.2

@RichardPerdaan
Copy link
Member

Yesterday a new version of the MyParcel plugin was released. This version should solve this problem.
This is why I will close the issue.

My advice is to use ven version 4.1.3

@CoenPonsen1984
Copy link

Shouldn't be closed issues persist

@gerben86
Copy link
Contributor

gerben86 commented Nov 9, 2020

Same issue overhere, Did you find a solution @CoenPonsen1984 or @bojanni ?

@bojanni
Copy link
Author

bojanni commented Nov 11, 2020

@gerben86 we found that this error occurs when we tried to create labels for orders that were placed with an older version the plugin installed. Orders placed with >v4.1.2 installed don't cause errors anymore in our store.

@gerben86
Copy link
Contributor

@gerben86 we found that this error occurs when we tried to create labels for orders that were placed with an older version the plugin installed. Orders placed with >v4.1.2 installed don't cause errors anymore in our store.

Yes, we encountered the samething. But it's sad that the plugin didn't take care of those, normal, situations.

@gjportegies
Copy link

gjportegies commented Dec 30, 2020

One of our customers is experiencing this issue as well on MyParcel 4.1.4

Magento 2.3.5-p2
MyParcel 4.1.4
MyParcel SDK 5.2.4

2020/12/30 14:25:10 [error] 3041053#3041053: *12901626 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Return value of MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter::getCarrier() must be of the type string or null, bool returned in /home/domains//vendor/myparcelnl/sdk/src/Adapter/DeliveryOptions/AbstractDeliveryOptionsAdapter.php:88
Stack trace:
#0 /home/domains//vendor/myparcelnl/magento/Model/Sales/TrackTraceHolder.php(171): MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter->getCarrier()
#1 /home/domains//vendor/myparcelnl/magento/Observer/NewShipment.php(105): MyParcelNL\Magento\Model\Sales\TrackTraceHolder->convertDataFromMagentoToApi(Object(Magento\Sales\Model\Order\Shipment\Track), Array)
#2 /home/domains//vendor/myparcelnl/magento/Observer/NewShipment.php(79): MyParcelNL\Magento\Observer\NewShipment->setMagentoAndMyParcelTrack(Object(Magento\Sales\Model\Order\Shipment))
#3 /home/domains//vendor/magento/fram" while reading response header from upstream, client: <ip-address>, server: www., request: "POST //admin/order_shipment/save/order_id/114/key/<key>/ HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "www.", referrer: "/admin/order_shipment/new/order_id/114/key/<key>/"

@RichardPerdaan
Copy link
Member

Today I managed to reproduce this problem. I am now working on the solution for this.

The fix will be included in the next version of the MyParcel plugin (4.1.5-beta.2)

@RichardPerdaan RichardPerdaan self-assigned this Jan 21, 2021
@gjportegies
Copy link

@RichardPerdaan any information on when the next version will be released?

@RichardPerdaan
Copy link
Member

Solved in 4.1.6-beta.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working In progress Next version
Development

No branches or pull requests

5 participants