Skip to content

[Issue] Fix wrong format error DHL shipping label #31032

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #31021: Fix wrong format error DHL shipping label


Fix "The response is in wrong format." error while generating dhl shipping label. When product name has unicode characters substr() is sending � in causing erros dhl syntax errors.

Description (*)

DHL shipping.log produces error "Error in parsing request XML:The element type "PieceContents" must be terminated by the matching end-tag "</PieceContents>"."

This is caused in our use case by substr() not supporting multibyte characters in product name.

Preconditions

  1. Magento 2.4-develop
  2. Magento DHL settings and Store Settings set for USA address
  3. A Customer with a valid United Kingdom address

Steps to reproduce (*)

  1. create a product with product name "Φυστίκι Ψημένο με Αλάτι Συσκευασία"
  2. place an order with dhl shipping method (having debug mode will help trace dhl error response)
  3. try to ship order with "create shipping label" checkbox checked
  4. while requesting label creation you get "The response is in wrong format."

Expected result

Shipping Label should be created

Actual Result

"The response format is wrong" error message appears
wrong_format

Note from Engcom ❗

We are able to get the error message with a product named Product

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: DhlFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: ready for confirmationPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions