Skip to content

Commit 8c7c700

Browse files
author
Volodymyr Kublytskyi
authored
Merge pull request #1736 from magento-partners/prs-develop-2017-11-17
[EngCom] Partners Pull Requests
2 parents 2bdf70c + f783ad9 commit 8c7c700

File tree

13 files changed

+83
-31
lines changed

13 files changed

+83
-31
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ protected function _createTemporaryFlatTable($storeId)
179179

180180
$columnComment = isset($fieldProp['comment']) ? $fieldProp['comment'] : $fieldName;
181181

182+
if ($fieldName == 'created_at') {
183+
$columnDefinition['nullable'] = true;
184+
$columnDefinition['default'] = null;
185+
}
186+
182187
$table->addColumn($fieldName, $fieldProp['type'], $columnLength, $columnDefinition, $columnComment);
183188
}
184189

app/code/Magento/Customer/Api/CustomerRepositoryInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function save(\Magento\Customer\Api\Data\CustomerInterface $customer, $pa
3838
public function get($email, $websiteId = null);
3939

4040
/**
41-
* Get customer by customer ID.
41+
* Get customer by Customer ID.
4242
*
4343
* @param int $customerId
4444
* @return \Magento\Customer\Api\Data\CustomerInterface
@@ -70,7 +70,7 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr
7070
public function delete(\Magento\Customer\Api\Data\CustomerInterface $customer);
7171

7272
/**
73-
* Delete customer by ID.
73+
* Delete customer by Customer ID.
7474
*
7575
* @param int $customerId
7676
* @return bool true on success

app/code/Magento/Customer/Model/AccountManagement.php

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,12 @@ private function activateCustomer($customer, $confirmationKey)
460460

461461
$customer->setConfirmation(null);
462462
$this->customerRepository->save($customer);
463-
$this->getEmailNotification()->newAccount($customer, 'confirmed', '', $this->storeManager->getStore()->getId());
463+
$this->getEmailNotification()->newAccount(
464+
$customer,
465+
'confirmed',
466+
'',
467+
$this->storeManager->getStore()->getId()
468+
);
464469
return $customer;
465470
}
466471

@@ -531,12 +536,8 @@ public function initiatePasswordReset($email, $template, $websiteId = null)
531536
$this->getEmailNotification()->passwordResetConfirmation($customer);
532537
break;
533538
default:
534-
throw new InputException(
535-
__(
536-
'Invalid value of "%value" provided for the %fieldName field.',
537-
['value' => $template, 'fieldName' => 'email type']
538-
)
539-
);
539+
$this->handleUnknownTemplate($template);
540+
break;
540541
}
541542
return true;
542543
} catch (MailException $e) {
@@ -546,6 +547,25 @@ public function initiatePasswordReset($email, $template, $websiteId = null)
546547
return false;
547548
}
548549

550+
/**
551+
* Handle not supported template
552+
*
553+
* @param string $template
554+
* @throws InputException
555+
*/
556+
private function handleUnknownTemplate($template)
557+
{
558+
throw new InputException(__(
559+
'Invalid value of "%value" provided for the %fieldName field. Possible values: %template1 or %template2.',
560+
[
561+
'value' => $template,
562+
'fieldName' => 'template',
563+
'template1' => AccountManagement::EMAIL_REMINDER,
564+
'template2' => AccountManagement::EMAIL_RESET
565+
]
566+
));
567+
}
568+
549569
/**
550570
* {@inheritdoc}
551571
*/
@@ -1111,15 +1131,23 @@ protected function sendEmailTemplate(
11111131
$storeId = null,
11121132
$email = null
11131133
) {
1114-
$templateId = $this->scopeConfig->getValue($template, ScopeInterface::SCOPE_STORE, $storeId);
1134+
$templateId = $this->scopeConfig->getValue(
1135+
$template,
1136+
ScopeInterface::SCOPE_STORE,
1137+
$storeId
1138+
);
11151139
if ($email === null) {
11161140
$email = $customer->getEmail();
11171141
}
11181142

11191143
$transport = $this->transportBuilder->setTemplateIdentifier($templateId)
11201144
->setTemplateOptions(['area' => Area::AREA_FRONTEND, 'store' => $storeId])
11211145
->setTemplateVars($templateParams)
1122-
->setFrom($this->scopeConfig->getValue($sender, ScopeInterface::SCOPE_STORE, $storeId))
1146+
->setFrom($this->scopeConfig->getValue(
1147+
$sender,
1148+
ScopeInterface::SCOPE_STORE,
1149+
$storeId
1150+
))
11231151
->addTo($email, $this->customerViewHelper->getCustomerName($customer))
11241152
->getTransport();
11251153

@@ -1313,8 +1341,10 @@ protected function getFullCustomerObject($customer)
13131341
// No need to flatten the custom attributes or nested objects since the only usage is for email templates and
13141342
// object passed for events
13151343
$mergedCustomerData = $this->customerRegistry->retrieveSecureData($customer->getId());
1316-
$customerData =
1317-
$this->dataProcessor->buildOutputDataArray($customer, \Magento\Customer\Api\Data\CustomerInterface::class);
1344+
$customerData = $this->dataProcessor->buildOutputDataArray(
1345+
$customer,
1346+
\Magento\Customer\Api\Data\CustomerInterface::class
1347+
);
13181348
$mergedCustomerData->addData($customerData);
13191349
$mergedCustomerData->setData('name', $this->customerViewHelper->getCustomerName($customer));
13201350
return $mergedCustomerData;

app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,10 +1173,6 @@ public function testInitiatePasswordResetEmailReset()
11731173
$this->assertTrue($this->accountManagement->initiatePasswordReset($email, $template));
11741174
}
11751175

1176-
/**
1177-
* @expectedException \Magento\Framework\Exception\InputException
1178-
* @expectedExceptionMessage Invalid value of "" provided for the email type field
1179-
*/
11801176
public function testInitiatePasswordResetNoTemplate()
11811177
{
11821178
$storeId = 1;
@@ -1192,6 +1188,10 @@ public function testInitiatePasswordResetNoTemplate()
11921188

11931189
$this->prepareInitiatePasswordReset($email, $templateIdentifier, $sender, $storeId, $customerId, $hash);
11941190

1191+
$this->expectException(\Magento\Framework\Exception\InputException::class);
1192+
$this->expectExceptionMessage(
1193+
'Invalid value of "" provided for the template field. Possible values: email_reminder or email_reset.'
1194+
);
11951195
$this->accountManagement->initiatePasswordReset($email, $template);
11961196
}
11971197

app/code/Magento/Customer/etc/webapi.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
<resource ref="anonymous"/>
129129
</resources>
130130
</route>
131-
<route url="/V1/customers/:id" method="PUT">
131+
<route url="/V1/customers/:customerId" method="PUT">
132132
<service class="Magento\Customer\Api\CustomerRepositoryInterface" method="save"/>
133133
<resources>
134134
<resource ref="Magento_Customer::manage"/>
@@ -194,6 +194,12 @@
194194
<resource ref="anonymous"/>
195195
</resources>
196196
</route>
197+
<route url="/V1/customers/resetPassword" method="POST">
198+
<service class="Magento\Customer\Api\AccountManagementInterface" method="resetPassword"/>
199+
<resources>
200+
<resource ref="anonymous"/>
201+
</resources>
202+
</route>
197203
<route url="/V1/customers/:customerId/confirm" method="GET">
198204
<service class="Magento\Customer\Api\AccountManagementInterface" method="getConfirmationStatus"/>
199205
<resources>

app/code/Magento/Tax/Model/Plugin/OrderSave.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order)
163163
if (isset($quoteItemId['id'])) {
164164
//This is a product item
165165
$item = $order->getItemByQuoteItemId($quoteItemId['id']);
166-
$itemId = $item->getId();
166+
if ($item !== null && $item->getId()) {
167+
$itemId = $item->getId();
168+
}
167169
} elseif (isset($quoteItemId['associated_item_id'])) {
168170
//This item is associated with a product item
169171
$item = $order->getItemByQuoteItemId($quoteItemId['associated_item_id']);

app/code/Magento/Ui/view/base/web/templates/form/element/input.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
placeholder: placeholder,
1616
'aria-describedby': noticeId,
1717
id: uid,
18-
disabled: disabled
18+
disabled: disabled,
19+
maxlength: 255
1920
}"/>

app/code/Magento/Wishlist/view/frontend/templates/cart/item/renderer/actions/move_to_wishlist.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<?php if ($block->isAllowInCart() && $block->isProductVisibleInSiteVisibility()): ?>
1212
<a href="#"
1313
data-post='<?= /* @noEscape */ $block->getMoveFromCartParams() ?>'
14-
class="use-ajax action action-towishlist">
14+
class="use-ajax action towishlist action-towishlist">
1515
<span><?= $block->escapeHtml(__('Move to Wishlist')) ?></span>
1616
</a>
1717
<?php endif ?>

app/design/frontend/Magento/luma/Magento_GiftMessage/web/css/source/_module.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
}
329329

330330
.gift-options-cart-item {
331-
& + .action-towishlist {
331+
& + .towishlist {
332332
left: 43px;
333333
position: absolute;
334334
}

app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/_module.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
}
268268

269269
.cart.table-wrapper {
270-
.action-towishlist {
270+
.towishlist {
271271
.lib-icon-font(
272272
@icon-wishlist-full,
273273
@_icon-font-size: 18px,

0 commit comments

Comments
 (0)