PrestaShop icon indicating copy to clipboard operation
PrestaShop copied to clipboard

fix(address): makes address id available in actionAfterUpdateCustomer…

Open Dreimus opened this issue 3 years ago • 7 comments

…AddressFormHandler hook.

As the "Form is handled based on Order ID because that's the order that needs update", the actionAfterUpdateCustomerAddressFormHandler does not have the address ID available in actionAfterUpdateCustomerAddressFormHandler hook when editing an address from the Order Detail pop-in. In order to provide the needed ID, I added the id_address inside the form_data array.

@see: https://github.com/PrestaShop/PrestaShop/issues/26878

Questions Answers
Branch? develop
Description? As the "Form is handled based on Order ID because that's the order that needs update", the actionAfterUpdateCustomerAddressFormHandler does not have the address ID available in actionAfterUpdateCustomerAddressFormHandler hook when editing an address from the Order Detail pop-in. In order to provide the needed ID, I added the id_address inside the form_data array.
Type? bug fix / improvement
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #26878.
How to test? Register a module with the actionAfterUpdateCustomerAddressFormHandler hook, edit an existing order and update the delivery or invoice address, in the $param['form_data'], a new id_address field is available with the edited Address ID.
Possible impacts? the module developers no longer has to instantiate the order and evaluate the addressType to retrieve by themselves the edited address with the order->id_address_delivery or id_address_invoice.

Dreimus avatar Jul 29 '22 13:07 Dreimus

Hello @Dreimus!

This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community!

prestonBot avatar Jul 29 '22 13:07 prestonBot

@PululuK

Dreimus avatar Jul 29 '22 13:07 Dreimus

Hi @Dreimus! I think it can be done here.

Arman-Hosseini avatar Jul 30 '22 15:07 Arman-Hosseini

Hi @Dreimus

What do you think about @Arman-Hosseini suggestion? It makes sense to me, what do you think?

kpodemski avatar Sep 16 '22 14:09 kpodemski

Ping @Dreimus :))

kpodemski avatar Oct 28 '22 22:10 kpodemski

@kpodemski Seems to be a good choise. I approve !

Dreimus avatar Dec 09 '22 08:12 Dreimus

Hi @Dreimus

This is yet another great PR coming from you that is close to being in the core! Could you follow @Arman-Hosseini suggestion and move the code? If the tree of us agree that it's a good decision, let's do that :D

kpodemski avatar Jan 12 '23 22:01 kpodemski