-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
This issue is automatically created based on existing pull request: #35773: Add note to setCustomer on quote about quote addresses removal
Description (*)
While working on one of the features, we noticed that the method \Magento\Quote\Model\Quote::setCustomer
not only sets the customer but also copies data from the customer to quote AND REMOVES QUOTE ADDRESSES, which is not obvious at all.
Removing of this behavior probably will cause the issue for the code that relies on this behavior, so I think we can't do that in the class and interface marked with @api
tag.
The last thing caused a pretty big issue for us on checkout, as we missed checking the details of the implementation for the setCustomer
method and thought it was just a regular setter.
I would like to deprecate it, but I didn't find any alternative to replace it fully w/o doing the only needed thing, so don't do that now.
Also, I can't add a new method to this class since it's marked with @api
tag that will cause the SVC failure, require additional approval process, etc.
Just an idea - Maybe we should deprecate the getCustomer
and setCustomer
methods with getCustomerId
and getCustomerId
alternatives?
Note: the methods getCustomer
and setCustomer
also declared in \Magento\Quote\Api\Data\CartInterface
, I belive we should deprecate them as well.
Related Pull Requests
Fixed Issues (if relevant)
- N/A
Manual testing scenarios (*)
- ...
Questions or comments
Contribution checklist (*)
- Pull request has a meaningful description of its purpose
- All commits are accompanied by meaningful commit messages
- All new or changed code is covered with unit/integration tests (if applicable)
- README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- All automated tests passed successfully (all builds are green)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status