Skip to content

Commit 9084182

Browse files
author
Michael Logvin
committed
Merge branch 'MAGETWO-28011' of github.corp.ebay.com:magento-firedrakes/magento2ce into MAGETWO-28011
2 parents a92a54a + 23a3a13 commit 9084182

File tree

4 files changed

+15
-42
lines changed

4 files changed

+15
-42
lines changed

app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ protected function _construct()
9191
$this->_queueLinkTable = $this->getTable('newsletter_queue_link');
9292
$this->_storeTable = $this->getTable('store');
9393

94-
// defining mapping for fields represented in several tables
95-
$this->_map['fields']['customer_lastname'] = 'customer_lastname_table.value';
96-
$this->_map['fields']['customer_firstname'] = 'customer_firstname_table.value';
9794
$this->_map['fields']['type'] = $this->getResource()->getReadConnection()->getCheckSql(
9895
'main_table.customer_id = 0',
9996
1,
@@ -145,37 +142,16 @@ public function useOnlyUnsent()
145142
*/
146143
public function showCustomerInfo()
147144
{
148-
$adapter = $this->getConnection();
149-
150-
$lastNameData = $this->_customerHelperData->getAttributeMetadata(
151-
\Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
152-
'lastname'
153-
);
154-
$firstNameData = $this->_customerHelperData->getAttributeMetadata(
155-
\Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
156-
'firstname'
145+
$this->getSelect()->joinLeft(
146+
[
147+
'customer' => $this->getTable('customer_entity')
148+
],
149+
'main_table.customer_id',
150+
[
151+
'customer_lastname' => 'lastname',
152+
'customer_firstname' => 'firstname'
153+
]
157154
);
158-
159-
$this->getSelect()
160-
->joinLeft(
161-
['customer_lastname_table' => $lastNameData['attribute_table']],
162-
$adapter->quoteInto(
163-
'customer_lastname_table.entity_id=main_table.customer_id
164-
AND customer_lastname_table.attribute_id = ?',
165-
(int)$lastNameData['attribute_id']
166-
),
167-
['customer_lastname' => 'value']
168-
)
169-
->joinLeft(
170-
['customer_firstname_table' => $firstNameData['attribute_table']],
171-
$adapter->quoteInto(
172-
'customer_firstname_table.entity_id=main_table.customer_id
173-
AND customer_firstname_table.attribute_id = ?',
174-
(int)$firstNameData['attribute_id']
175-
),
176-
['customer_firstname' => 'value']
177-
);
178-
179155
return $this;
180156
}
181157

app/code/Magento/Quote/Model/Observer/Frontend/Quote/Address/CollectTotals.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,11 @@ public function dispatch(\Magento\Framework\Event\Observer $observer)
7373
$customer = $quote->getCustomer();
7474
$storeId = $customer->getStoreId();
7575

76-
if (($customer->getCustomAttribute('disable_auto_group_change')
77-
&& $customer->getCustomAttribute('disable_auto_group_change')->getValue())
76+
if ($customer->getDisableAutoGroupChange()
7877
|| false == $this->vatValidator->isEnabled($quoteAddress, $storeId)
7978
) {
8079
return;
8180
}
82-
8381
$customerCountryCode = $quoteAddress->getCountryId();
8482
$customerVatNumber = $quoteAddress->getVatId();
8583
$groupId = null;

dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementCustomAttributesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function testUpdateCustomerWithImageAttribute()
270270
$mediaDirectory = $this->fileSystem->getDirectoryWrite(DirectoryList::MEDIA);
271271
$customerMediaPath = $mediaDirectory->getAbsolutePath(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER);
272272
$previousImagePath =
273-
$previousCustomerData[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES][1][AttributeValue::VALUE];
273+
$previousCustomerData[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES][0][AttributeValue::VALUE];
274274
$this->assertFalse(file_exists($customerMediaPath . $previousImagePath));
275275
}
276276
}

dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerMetadataTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function getAttributeMetadataDataProvider()
8080
AttributeMetadata::NOTE => '',
8181
AttributeMetadata::SYSTEM => true,
8282
AttributeMetadata::USER_DEFINED => false,
83-
AttributeMetadata::BACKEND_TYPE => 'varchar',
83+
AttributeMetadata::BACKEND_TYPE => 'static',
8484
AttributeMetadata::SORT_ORDER => 40
8585
],
8686
],
@@ -106,7 +106,7 @@ public function getAttributeMetadataDataProvider()
106106
AttributeMetadata::NOTE => '',
107107
AttributeMetadata::SYSTEM => false,
108108
AttributeMetadata::USER_DEFINED => false,
109-
AttributeMetadata::BACKEND_TYPE => 'int',
109+
AttributeMetadata::BACKEND_TYPE => 'static',
110110
AttributeMetadata::SORT_ORDER => 110
111111
],
112112
],
@@ -187,9 +187,8 @@ public function testGetCustomAttributesMetadata()
187187

188188
$attributeMetadata = $this->_webApiCall($serviceInfo);
189189

190-
//Default custom attribute code 'disable_auto_group_change'
191-
$this->assertCount(1, $attributeMetadata);
192-
$this->assertEquals('disable_auto_group_change', $attributeMetadata[0]['attribute_code']);
190+
// There are no default custom attributes.
191+
$this->assertCount(0, $attributeMetadata);
193192
}
194193

195194
/**

0 commit comments

Comments
 (0)