postnl / postnl-magento2

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 61 forks source link

[BUG] Printing packing slips throws an exception #383

Closed Webwijs closed 4 months ago

Webwijs commented 4 months ago

Print packing slips gives error

To Reproduce Steps to reproduce the behavior:

  1. Go to a shipment in the Magento 2 admin
  2. Click on PostNL - Print packing slip

image

Expected result The packing slip files are downloaded.

Actual result

Error: Call to a member function getLabelFileFormat() on string in /****/vendor/tig/postnl-magento2/Controller/Adminhtml/PdfDownload.php:213

Workaround Add !is_string($label) to the if-clause:

if (!is_string($label) && $label->getLabelFileFormat() !== LabelTypeSettings::TYPE_PDF)

Screenshots

JorisPostNL commented 4 months ago

Hi @Webwijs,

Thank you for bringing this to our attention. We are aware of this bug, and are currently working on a hotfix to solve this problem. We hope to release this hotfix soon.

Kind regards Joris PostNL Support