magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

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

Closed m2-assistant[bot] closed 3 years ago

m2-assistant[bot] commented 3 years ago

This issue is automatically created based on existing pull request: magento/magento2#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 :exclamation:

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

m2-assistant[bot] commented 3 years ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

magento-engcom-team commented 3 years ago

:white_check_mark: Confirmed by @engcom-Bravo Thank you for verifying the issue. Based on the provided information internal tickets MC-39723 were created

Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

magento-engcom-team commented 3 years ago

Hi @m2-assistant[bot]. Thank you for your report. The issue has been fixed in magento/magento2#31021 by @vpsnak in 2.4-develop branch Related commit(s):

The fix will be available with the upcoming 2.4.3 release.