Skip to content

Commit 0600244

Browse files
teganboldGovind Sharma
authored andcommitted
Fix issue causing attribute not loading with getList
As specified in issue #17759, CustomerRepository::getList() is unexpectedly returning NULL, when CustomerRepository::get() is correctly returning the value. Specifying the attribute as billing_company instead of company removes the conflict.
1 parent 56b9c6c commit 0600244

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public function getList(SearchCriteriaInterface $searchCriteria)
365365
->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
366366
->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
367367
->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left')
368-
->joinAttribute('company', 'customer_address/company', 'default_billing', null, 'left');
368+
->joinAttribute('billing_company', 'customer_address/company', 'default_billing', null, 'left');
369369

370370
$this->collectionProcessor->process($searchCriteria, $collection);
371371

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ public function testGetList()
740740
->willReturnSelf();
741741
$collection->expects($this->at(7))
742742
->method('joinAttribute')
743-
->with('company', 'customer_address/company', 'default_billing', null, 'left')
743+
->with('billing_company', 'customer_address/company', 'default_billing', null, 'left')
744744
->willReturnSelf();
745745
$this->collectionProcessorMock->expects($this->once())
746746
->method('process')

0 commit comments

Comments
 (0)