fix(address): makes address id available in actionAfterUpdateCustomer…
…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. |
Hello @Dreimus!
This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community!
@PululuK
Hi @Dreimus! I think it can be done here.
Hi @Dreimus
What do you think about @Arman-Hosseini suggestion? It makes sense to me, what do you think?
Ping @Dreimus :))
@kpodemski Seems to be a good choise. I approve !
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