Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 4832a75

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento/magento2#15134: [Forwardport] [TASK] Fix overriding of payment methods in getPaymentMethodList (by @mzeis) - magento/magento2#15142: [Forwardport] Changed the length of the remote_ip field to store ipv6 addresses (by @dmytro-ch) - magento/magento2#15095: [Forwardport] Fix reset password link with appropriate customer store (by @rogyar) - magento/magento2#15080: [Forwardport] Renamed "Add Block Names to Hints" config setting to represent what it actually does (by @adrian-martinez-interactiv4) - magento/magento2#15079: [Forwardport] Change 'Update'-button visibility on change qty event. (by @adrian-martinez-interactiv4) - magento/magento2#15074: [Forwardport] Fixed issue products grid operations in admin cart price rule edit page for user which has no access to CatalogRule module (by @adrian-martinez-interactiv4) - magento/magento2#15077: [Forwardport] FIX for issue#14855 - Adding an * to do a customer search (by @adrian-martinez-interactiv4) - magento/magento2#15072: [Forwardport] Fix infinite checkout loader when some script wasn't loaded correctly because of network error (by @adrian-martinez-interactiv4) Fixed GitHub Issues: - magento/magento2#13460: Allmethods config source model does not always report the full list of payment methods (reported by @moehrenzahn) has been fixed in magento/magento2#15134 by @mzeis in 2.3-develop branch Related commits: 1. 971e303 - magento/magento2#10395: REMOTE_IP gets saved partially when using IPV6 (reported by @keevitaja) has been fixed in magento/magento2#15142 by @dmytro-ch in 2.3-develop branch Related commits: 1. 41a99e1 - magento/magento2#5726: Reset Password Email Issue on Multi Store from Admin (reported by @ngashokkumar) has been fixed in magento/magento2#15095 by @rogyar in 2.3-develop branch Related commits: 1. 1e8ce46 2. a267e2f 3. 407c930 - magento/magento2#14855: Adding an * to do a customer search. (reported by @taylored2) has been fixed in magento/magento2#15077 by @adrian-martinez-interactiv4 in 2.3-develop branch Related commits: 1. 01b546f
2 parents 723ba59 + fbc5f2c commit 4832a75

File tree

10 files changed

+149
-13
lines changed

10 files changed

+149
-13
lines changed

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
137137
</field>
138138
<field id="template_hints_blocks" translate="label" type="select" sortOrder="21" showInDefault="1" showInWebsite="1" showInStore="1">
139-
<label>Add Block Names to Hints</label>
139+
<label>Add Block Class Type to Hints</label>
140140
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
141141
</field>
142142
</group>

app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ protected function _prepareColumns()
207207
public function getGridUrl()
208208
{
209209
return $this->getUrl(
210-
'catalog_rule/*/chooser',
210+
'*/*/chooser',
211211
['_current' => true, 'current_grid_id' => $this->getId(), 'collapse' => null]
212212
);
213213
}

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ define([
105105
self._showItemButton($(event.target));
106106
};
107107

108+
/**
109+
* @param {jQuery.Event} event
110+
*/
111+
events['change ' + this.options.item.qty] = function (event) {
112+
self._showItemButton($(event.target));
113+
};
114+
108115
/**
109116
* @param {jQuery.Event} event
110117
*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ private function getWebsiteStoreId($customer, $defaultStoreId = null)
314314
*/
315315
public function passwordReminder(CustomerInterface $customer)
316316
{
317-
$storeId = $this->getWebsiteStoreId($customer);
317+
$storeId = $customer->getStoreId();
318318
if (!$storeId) {
319-
$storeId = $this->storeManager->getStore()->getId();
319+
$storeId = $this->getWebsiteStoreId($customer);
320320
}
321321

322322
$customerEmailData = $this->getFullCustomerObject($customer);

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

Lines changed: 107 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,15 @@ public function sendNotificationEmailsDataProvider()
312312
public function testPasswordReminder()
313313
{
314314
$customerId = 1;
315+
$customerWebsiteId = 1;
315316
$customerStoreId = 2;
316317
$customerEmail = '[email protected]';
317318
$customerData = ['key' => 'value'];
318319
$customerName = 'Customer Name';
319320
$templateIdentifier = 'Template Identifier';
320321
$sender = 'Sender';
321322
$senderValues = ['name' => $sender, 'email' => $sender];
323+
$storeIds = [1, 2];
322324

323325
$this->senderResolverMock
324326
->expects($this->once())
@@ -328,6 +330,9 @@ public function testPasswordReminder()
328330

329331
/** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customer */
330332
$customer = $this->createMock(CustomerInterface::class);
333+
$customer->expects($this->any())
334+
->method('getWebsiteId')
335+
->willReturn($customerWebsiteId);
331336
$customer->expects($this->any())
332337
->method('getStoreId')
333338
->willReturn($customerStoreId);
@@ -346,10 +351,15 @@ public function testPasswordReminder()
346351
->method('getStore')
347352
->willReturn($this->storeMock);
348353

349-
$this->storeManagerMock->expects($this->at(1))
350-
->method('getStore')
351-
->with($customerStoreId)
352-
->willReturn($this->storeMock);
354+
$websiteMock = $this->createPartialMock(\Magento\Store\Model\Website::class, ['getStoreIds']);
355+
$websiteMock->expects($this->any())
356+
->method('getStoreIds')
357+
->willReturn($storeIds);
358+
359+
$this->storeManagerMock->expects($this->any())
360+
->method('getWebsite')
361+
->with($customerWebsiteId)
362+
->willReturn($websiteMock);
353363

354364
$this->customerRegistryMock->expects($this->once())
355365
->method('retrieveSecureData')
@@ -396,6 +406,99 @@ public function testPasswordReminder()
396406
$this->model->passwordReminder($customer);
397407
}
398408

409+
/**
410+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
411+
*/
412+
public function testPasswordReminderCustomerWithoutStoreId()
413+
{
414+
$customerId = 1;
415+
$customerWebsiteId = 1;
416+
$customerStoreId = null;
417+
$customerEmail = '[email protected]';
418+
$customerData = ['key' => 'value'];
419+
$customerName = 'Customer Name';
420+
$templateIdentifier = 'Template Identifier';
421+
$sender = 'Sender';
422+
$senderValues = ['name' => $sender, 'email' => $sender];
423+
$storeIds = [1, 2];
424+
$defaultStoreId = reset($storeIds);
425+
$this->senderResolverMock
426+
->expects($this->once())
427+
->method('resolve')
428+
->with($sender, $defaultStoreId)
429+
->willReturn($senderValues);
430+
/** @var CustomerInterface | \PHPUnit_Framework_MockObject_MockObject $customer */
431+
$customer = $this->createMock(CustomerInterface::class);
432+
$customer->expects($this->any())
433+
->method('getWebsiteId')
434+
->willReturn($customerWebsiteId);
435+
$customer->expects($this->any())
436+
->method('getStoreId')
437+
->willReturn($customerStoreId);
438+
$customer->expects($this->any())
439+
->method('getId')
440+
->willReturn($customerId);
441+
$customer->expects($this->any())
442+
->method('getEmail')
443+
->willReturn($customerEmail);
444+
$this->storeMock->expects($this->any())
445+
->method('getId')
446+
->willReturn($defaultStoreId);
447+
$this->storeManagerMock->expects($this->at(0))
448+
->method('getStore')
449+
->willReturn($this->storeMock);
450+
$this->storeManagerMock->expects($this->at(1))
451+
->method('getStore')
452+
->with($defaultStoreId)
453+
->willReturn($this->storeMock);
454+
$websiteMock = $this->createPartialMock(\Magento\Store\Model\Website::class, ['getStoreIds']);
455+
$websiteMock->expects($this->any())
456+
->method('getStoreIds')
457+
->willReturn($storeIds);
458+
$this->storeManagerMock->expects($this->any())
459+
->method('getWebsite')
460+
->with($customerWebsiteId)
461+
->willReturn($websiteMock);
462+
463+
$this->customerRegistryMock->expects($this->once())
464+
->method('retrieveSecureData')
465+
->with($customerId)
466+
->willReturn($this->customerSecureMock);
467+
$this->dataProcessorMock->expects($this->once())
468+
->method('buildOutputDataArray')
469+
->with($customer, CustomerInterface::class)
470+
->willReturn($customerData);
471+
$this->customerViewHelperMock->expects($this->any())
472+
->method('getCustomerName')
473+
->with($customer)
474+
->willReturn($customerName);
475+
$this->customerSecureMock->expects($this->once())
476+
->method('addData')
477+
->with($customerData)
478+
->willReturnSelf();
479+
$this->customerSecureMock->expects($this->once())
480+
->method('setData')
481+
->with('name', $customerName)
482+
->willReturnSelf();
483+
$this->scopeConfigMock->expects($this->at(0))
484+
->method('getValue')
485+
->with(EmailNotification::XML_PATH_REMIND_EMAIL_TEMPLATE, ScopeInterface::SCOPE_STORE, $defaultStoreId)
486+
->willReturn($templateIdentifier);
487+
$this->scopeConfigMock->expects($this->at(1))
488+
->method('getValue')
489+
->with(EmailNotification::XML_PATH_FORGOT_EMAIL_IDENTITY, ScopeInterface::SCOPE_STORE, $defaultStoreId)
490+
->willReturn($sender);
491+
$this->mockDefaultTransportBuilder(
492+
$templateIdentifier,
493+
$defaultStoreId,
494+
$senderValues,
495+
$customerEmail,
496+
$customerName,
497+
['customer' => $this->customerSecureMock, 'store' => $this->storeMock]
498+
);
499+
$this->model->passwordReminder($customer);
500+
}
501+
399502
/**
400503
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
401504
*/

app/code/Magento/Payment/Helper/Data.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ public function getPaymentMethodList($sorted = true, $asLabelValue = false, $wit
293293
foreach ($methods as $code => $title) {
294294
if (isset($groups[$code])) {
295295
$labelValues[$code]['label'] = $title;
296-
$labelValues[$code]['value'] = null;
296+
if (!isset($labelValues[$code]['value'])) {
297+
$labelValues[$code]['value'] = null;
298+
}
297299
} elseif (isset($groupRelations[$code])) {
298300
unset($labelValues[$code]);
299301
$labelValues[$groupRelations[$code]]['value'][$code] = ['value' => $code, 'label' => $title];

app/code/Magento/Quote/etc/db_schema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
identity="false" default="1" comment="Customer Note Notify"/>
6262
<column xsi:type="smallint" name="customer_is_guest" padding="5" unsigned="true" nullable="true"
6363
identity="false" default="0" comment="Customer Is Guest"/>
64-
<column xsi:type="varchar" name="remote_ip" nullable="true" length="32" comment="Remote Ip"/>
64+
<column xsi:type="varchar" name="remote_ip" nullable="true" length="45" comment="Remote Ip"/>
6565
<column xsi:type="varchar" name="applied_rule_ids" nullable="true" length="255" comment="Applied Rule Ids"/>
6666
<column xsi:type="varchar" name="reserved_order_id" nullable="true" length="64" comment="Reserved Order Id"/>
6767
<column xsi:type="varchar" name="password_hash" nullable="true" length="255" comment="Password Hash"/>

app/code/Magento/Sales/etc/db_schema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
<column xsi:type="varchar" name="relation_parent_id" nullable="true" length="32" comment="Relation Parent Id"/>
217217
<column xsi:type="varchar" name="relation_parent_real_id" nullable="true" length="32"
218218
comment="Relation Parent Real Id"/>
219-
<column xsi:type="varchar" name="remote_ip" nullable="true" length="32" comment="Remote Ip"/>
219+
<column xsi:type="varchar" name="remote_ip" nullable="true" length="45" comment="Remote Ip"/>
220220
<column xsi:type="varchar" name="shipping_method" nullable="true" length="120"/>
221221
<column xsi:type="varchar" name="store_currency_code" nullable="true" length="3" comment="Store Currency Code"/>
222222
<column xsi:type="varchar" name="store_name" nullable="true" length="32" comment="Store Name"/>

lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/FulltextFilter.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ function ($column) use ($alias) {
6262
return $columns;
6363
}
6464

65+
/**
66+
* Escape against value
67+
* @param string $value
68+
* @return string
69+
*/
70+
private function escapeAgainstValue(string $value): string
71+
{
72+
return preg_replace('/([+\-><\(\)~*\"@]+)/', ' ', $value);
73+
}
74+
6575
/**
6676
* Apply fulltext filters
6777
*
@@ -86,7 +96,7 @@ public function apply(Collection $collection, Filter $filter)
8696
$collection->getSelect()
8797
->where(
8898
'MATCH(' . implode(',', $columns) . ') AGAINST(?)',
89-
$filter->getValue()
99+
$this->escapeAgainstValue($filter->getValue())
90100
);
91101
}
92102
}

lib/web/mage/requirejs/resolver.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,28 @@ define([
2727
return !!_.findWhere(callbacks, callback);
2828
}
2929

30+
/**
31+
* Checks if provided module is rejected during load.
32+
*
33+
* @param {Object} module - Module to be checked.
34+
* @return {Boolean}
35+
*/
36+
function isRejected(module) {
37+
return registry[module.id] && registry[module.id].error;
38+
}
39+
3040
/**
3141
* Checks if provided module has unresolved dependencies.
3242
*
3343
* @param {Object} module - Module to be checked.
3444
* @returns {Boolean}
3545
*/
3646
function isPending(module) {
37-
return !!module.depCount;
47+
if (!module.depCount) {
48+
return false;
49+
}
50+
51+
return module.depCount > _.filter(module.depMaps, isRejected).length;
3852
}
3953

4054
/**

0 commit comments

Comments
 (0)