-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Customer model - getPrimaryAddresses without primary billing address #1096
Comments
@ihor-sviziev, thank you posting this issue, but could you provide a way how we can get this fatal? Do you use native Magento workflows? Or is it a result of some customizations? |
@vpelipenko I got this issue in my own module, it contains cloning of customer model, which firing this method. |
@ihor-sviziev, how can we reproduce this issue? What should we do for that? |
@vpelipenko use code like this: //Customer ID which has selected shipping address and NOT selected billing address
$customerId = '1';
$customer = $this->_objectManager->create('Magento\Customer\Model\Customer');
$customer->load($customerId);
//This part will cause fatal error
$primaryAddresses = $customer->getPrimaryAddresses();
//This part also will cause fatal error
$newCustomer = clone $customer; |
Ok. Thanks. We will try to check it. |
Issue is closed, because PR #1097 is created instead. |
* Fixed bugs * Wrong capitalization of the label names (the sentence-style capitalization instead of the headline style) * Inconsistency in the labels in the Admin panel * Customer menu tabs aren't displayed as selected for the child pages * An issue with the Active item in the navigation menu in the Blank and Luma themes * Incorrect price alignment during checkout in the Blank and Luma themes * Broken field "URL" in the Downloadable product in the Admin panel * GitHub issues and requests: * [#1096] (magento/magento2#1096) -- Customer model - getPrimaryAddresses without primary billing address * [#1114] (magento/magento2#1114) -- GA bug * [#1116] (magento/magento2#1116) -- Incorrect use of implode() * [#1126] (magento/magento2#1126) -- Fixed occurrences of implode with wrong argument order * [#1128] (magento/magento2#1128) -- Change wording for long operation warning
* Fixed bugs * Wrong capitalization of the label names (the sentence-style capitalization instead of the headline style) * Inconsistency in the labels in the Admin panel * Customer menu tabs aren't displayed as selected for the child pages * An issue with the Active item in the navigation menu in the Blank and Luma themes * Incorrect price alignment during checkout in the Blank and Luma themes * Broken field "URL" in the Downloadable product in the Admin panel * GitHub issues and requests: * [#1096] (magento/magento2#1096) -- Customer model - getPrimaryAddresses without primary billing address * [#1114] (magento/magento2#1114) -- GA bug * [#1116] (magento/magento2#1116) -- Incorrect use of implode() * [#1126] (magento/magento2#1126) -- Fixed occurrences of implode with wrong argument order * [#1128] (magento/magento2#1128) -- Change wording for long operation warning
- MAGETWO-53431 [GITHUB] SOAP API Encoding Object has no 'label' property #4630 - MAGETWO-58652 [GitHub] REST API multiselect attribute values are sent in an incompatible format and cannot be cleared #6120 - MAGETWO-62567 Make static file versioning number not based on timestamp - MAGETWO-63741 [FT] Magento\Catalog\Test\TestCase\Product\CreateSimpleProductEntityTest fails on CI
Once you have customer model with primary shipping, but wo primary billing and try to execute getPrimaryAddresses method - you got fatal error.
It's happening because there no checking that you have primary billing.
https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/Model/Customer.php#L722
This issue also exists in Magento CE 1.9.1.
How to fix it:
The text was updated successfully, but these errors were encountered: