netresearch / dhl-module-shipping-m2

This extension is in legacy status since 04/2020 and will run out of maintenance and support after a short transition period. You can find the official replacement extension here https://github.com/netresearch/dhl-shipping-m2. It includes the latest and greatest possible range of functions that DHL is currently offering.
30 stars 20 forks source link

ZIP code in wrong field after editing address #54

Closed ngolatka closed 5 years ago

ngolatka commented 5 years ago

Bug description When editing the shipping address for a shipment to a DHL Postfiliale (German post office), the receiver's ZIP code ends up in the wrong request field. It is copied to the receiver city field, which overwrites the city name.

The DHL Versenden API throws this error as a result:

weak validation error: Der angegebene Ort passt nicht zur Postleitzahl

Steps to reproduce

  1. Create an order to a DHL Postfiliale using the regular Magento checkout, and make a deliberate mistake (e.g. non-existing post office number) to provoke a failure.
  2. Try to create a DHL label, which should fail.
  3. Correct the shipping address in the admin panel.
  4. Again, try to create a DHL label.
  5. Look at the request in the debug.log. The receiver city is filled with the ZIP code.

This problem only occurs when shipping to a DHL Postfiliale. It does not occur for DHL Packstations, Paketshops, or regular postal addresses.

Expected behavior The ZIP code and city name should not get mixed up when editing the shipping address.

Environment

ngolatka commented 5 years ago

This is a known issue in module version 0.10.1. It will be fixed in future versions (more precisely in the lib-shipping-mx which is used by the DHL Shipping module).

If you can't wait for the next release, apply the following fix manually:

The mistake is rather obvious. Correct it like this:

public function getCity()
{
    return $this->city;
}
moehrenzahn commented 5 years ago

This should be fixed by today's 0.10.2 release which includes a new version of the lib-shipping-mx: https://github.com/netresearch/dhl-lib-shipping-mx/releases/tag/0.11.1