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

Commit 5498231

Browse files
authored
Merge pull request #3495 from magento-borg/BugFixPR
[2.3-develop] Bug Fixes
2 parents 6ea3d2f + e342395 commit 5498231

File tree

17 files changed

+223
-14
lines changed

17 files changed

+223
-14
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,7 @@ public function loadProductCount($items, $countRegular = true, $countAnchor = tr
322322
['e' => $this->getTable('catalog_category_entity')],
323323
'main_table.category_id=e.entity_id',
324324
[]
325-
)->where(
326-
'e.entity_id = :entity_id'
327-
)->orWhere(
328-
'e.path LIKE :c_path'
329-
);
325+
)->where('e.entity_id = :entity_id OR e.path LIKE :c_path');
330326
if ($websiteId) {
331327
$select->join(
332328
['w' => $this->getProductWebsiteTable()],

app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
userInput="$$createProduct1.name$$" stepKey="seeProductName4"/>
141141
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
142142
userInput="$$createProduct12.name$$" stepKey="seeProductName5"/>
143+
<waitForText userInput="$$createCategory.name$$ (2)" stepKey="seeCorrectProductCount"/>
143144
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
144145
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName"/>
145146
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
@@ -164,6 +165,7 @@
164165
userInput="$$createProduct2.name$$" stepKey="seeProductName6"/>
165166
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
166167
userInput="$$createProduct12.name$$" stepKey="seeProductName7"/>
168+
<waitForText userInput="$$createCategory.name$$ (2)" stepKey="seeCorrectProductCount2"/>
167169
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
168170
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName2"/>
169171
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"

app/code/Magento/Catalog/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<level>2</level>
1919
<label translate="true">Base</label>
2020
</settings>
21-
<field name="watermark_image_image" formElement="fileUploader">
21+
<field name="watermark_image_image" formElement="imageUploader">
2222
<settings>
2323
<notice translate="true">Allowed file types: jpeg, gif, png.</notice>
2424
<label translate="true">Image</label>
@@ -78,7 +78,7 @@
7878
<level>2</level>
7979
<label translate="true">Thumbnail</label>
8080
</settings>
81-
<field name="watermark_thumbnail_image" formElement="fileUploader">
81+
<field name="watermark_thumbnail_image" formElement="imageUploader">
8282
<settings>
8383
<label translate="true">Image</label>
8484
<componentType>imageUploader</componentType>
@@ -137,7 +137,7 @@
137137
<level>2</level>
138138
<label translate="true">Small</label>
139139
</settings>
140-
<field name="watermark_small_image_image" formElement="fileUploader">
140+
<field name="watermark_small_image_image" formElement="imageUploader">
141141
<settings>
142142
<label translate="true">Image</label>
143143
<componentType>imageUploader</componentType>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<element name="availablePaymentSolutions" type="text" selector="#checkout-payment-method-load>div>div>div:nth-child(2)>div.payment-method-title.field.choice"/>
1414
<element name="notAvailablePaymentSolutions" type="text" selector="#checkout-payment-method-load>div>div>div.payment-method._active>div.payment-method-title.field.choice"/>
1515
<element name="billingNewAddressForm" type="text" selector="[data-form='billing-new-address']"/>
16+
<element name="billingAddressNotSameCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-checkmo"/>
1617
<element name="placeOrderDisabled" type="button" selector="#checkout-payment-method-load button.disabled"/>
1718
<element name="update" type="button" selector=".payment-method-billing-address .action.action-update"/>
1819
<element name="guestFirstName" type="input" selector=".billing-address-form input[name*='firstname']"/>

app/code/Magento/Customer/Controller/Address/Delete.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
*/
77
namespace Magento\Customer\Controller\Address;
88

9+
use Magento\Framework\App\Action\HttpGetActionInterface;
910
use Magento\Framework\App\Action\HttpPostActionInterface;
1011

11-
class Delete extends \Magento\Customer\Controller\Address implements HttpPostActionInterface
12+
/**
13+
* Delete customer address controller action.
14+
*/
15+
class Delete extends \Magento\Customer\Controller\Address implements HttpPostActionInterface, HttpGetActionInterface
1216
{
1317
/**
18+
* @inheritdoc
1419
* @return \Magento\Framework\Controller\Result\Redirect
1520
*/
1621
public function execute()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public function isLocked($customerId)
166166
public function authenticate($customerId, $password)
167167
{
168168
$customerSecure = $this->customerRegistry->retrieveSecureData($customerId);
169-
$hash = $customerSecure->getPasswordHash();
170-
if (!$hash || !$this->encryptor->validateHash($password, $hash)) {
169+
$hash = $customerSecure->getPasswordHash() ?? '';
170+
if (!$this->encryptor->validateHash($password, $hash)) {
171171
$this->processAuthenticationFailure($customerId);
172172
if ($this->isLocked($customerId)) {
173173
throw new UserLockedException(__('The account is locked.'));

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCustomerAddressesSection">
1212
<element name="addressesList" type="text" selector=".block-addresses-list" />
13+
<element name="deleteAdditionalAddress" type="button" selector="//ol[@class='items addresses']/li[@class='item'][{{var}}]//a[@class='action delete']" parameterized="true"/>
1314
</section>
1415
</sections>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontDeleteCustomerAddressTest">
12+
<annotations>
13+
<stories value="Delete customer address from storefront"/>
14+
<title value="User should be able to delete Customer address successfully from storefront"/>
15+
<description value="User should be able to delete Customer address successfully from storefront"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-5713"/>
18+
<group value="Customer"/>
19+
</annotations>
20+
<before>
21+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
22+
</before>
23+
<after>
24+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
25+
</after>
26+
<amOnPage stepKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage.url}}"/>
27+
<fillField stepKey="fillEmail" userInput="$$createCustomer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}"/>
28+
<fillField stepKey="fillPassword" userInput="$$createCustomer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}"/>
29+
<click stepKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}"/>
30+
<actionGroup ref="EnterCustomerAddressInfo" stepKey="enterAddressInfo">
31+
<argument name="Address" value="US_Address_NY"/>
32+
</actionGroup>
33+
<see userInput="You saved the address." stepKey="verifyAddressCreated"/>
34+
<click selector="{{StorefrontCustomerAddressesSection.deleteAdditionalAddress('1')}}" stepKey="deleteAdditionalAddress"/>
35+
<waitForElementVisible selector="{{ModalConfirmationSection.modalContent}}" stepKey="waitFortheConfirmationModal"/>
36+
<see selector="{{ModalConfirmationSection.modalContent}}" userInput="Are you sure you want to delete this address?" stepKey="seeAddressDeleteConfirmationMessage"/>
37+
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="confirmDelete"/>
38+
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
39+
<see userInput="You deleted the address." stepKey="verifyDeleteAddress"/>
40+
</test>
41+
</tests>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminWatermarkUploadTest">
12+
<waitForElement selector="{{AdminDesignConfigSection.imageUploadInputByFieldsetName('Swatch Image')}}" stepKey="waitForInputVisible4" after="waitForPreviewImage3"/>
13+
<attachFile selector="{{AdminDesignConfigSection.imageUploadInputByFieldsetName('Swatch Image')}}" userInput="adobe-small.jpg" stepKey="attachFile4" after="waitForInputVisible4"/>
14+
<waitForElementVisible selector="{{AdminDesignConfigSection.imageUploadPreviewByFieldsetName('Swatch Image')}}" stepKey="waitForPreviewImage4" after="attachFile4"/>
15+
</test>
16+
</tests>

app/code/Magento/Swatches/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<level>2</level>
1414
<label translate="true">Swatch Image</label>
1515
</settings>
16-
<field name="watermark_swatch_image_image" formElement="fileUploader">
16+
<field name="watermark_swatch_image_image" formElement="imageUploader">
1717
<settings>
1818
<label translate="true">Image</label>
1919
<componentType>imageUploader</componentType>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="DesignConfigPage" url="theme/design_config/" area="admin" module="Magento_Theme">
12+
<section name="AdminDesignConfigSection"/>
13+
</page>
14+
</pages>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminDesignConfigSection">
12+
<element name="scopeRow" type="button" selector="//*[contains(@class,'data-row')][{{arg1}}]//*[contains(@class,'action-menu-item')]" parameterized="true"/>
13+
<element name="watermarkSectionHeader" type="text" selector="[data-index='watermark']"/>
14+
<element name="watermarkSection" type="text" selector="[data-index='watermark'] .admin__fieldset-wrapper-content"/>
15+
<element name="imageUploadInputByFieldsetName" type="input" selector="//*[contains(@class,'fieldset-wrapper')][child::*[contains(@class,'fieldset-wrapper-title')]//*[contains(text(),'{{arg1}}')]]//*[contains(@class,'file-uploader')]//input" parameterized="true"/>
16+
<element name="imageUploadPreviewByFieldsetName" type="input" selector="//*[contains(@class,'fieldset-wrapper')][child::*[contains(@class,'fieldset-wrapper-title')]//*[contains(text(),'{{arg1}}')]]//*[contains(@class,'file-uploader-preview')]//img" parameterized="true"/>
17+
</section>
18+
</sections>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminWatermarkUploadTest">
12+
<annotations>
13+
<features value="Watermark"/>
14+
<stories value="Watermark"/>
15+
<title value="MAGETWO-95934: Can't upload Watermark Image"/>
16+
<description value="Watermark images should be able to be uploaded in the admin"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-5796"/>
19+
<group value="Watermark"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
26+
</after>
27+
<amOnPage url="{{DesignConfigPage.url}}" stepKey="navigateToDesignConfigPage" />
28+
<waitForPageLoad stepKey="waitForPageload1"/>
29+
<click selector="{{AdminDesignConfigSection.scopeRow('3')}}" stepKey="editStoreView"/>
30+
<waitForPageLoad stepKey="waitForPageload2"/>
31+
<scrollTo selector="{{AdminDesignConfigSection.watermarkSectionHeader}}" stepKey="scrollToWatermarkSection"/>
32+
<click selector="{{AdminDesignConfigSection.watermarkSectionHeader}}" stepKey="openWatermarkSection"/>
33+
34+
<waitForElement selector="{{AdminDesignConfigSection.imageUploadInputByFieldsetName('Base')}}" stepKey="waitForInputVisible1"/>
35+
<attachFile selector="{{AdminDesignConfigSection.imageUploadInputByFieldsetName('Base')}}" userInput="adobe-base.jpg" stepKey="attachFile1"/>
36+
<waitForElementVisible selector="{{AdminDesignConfigSection.imageUploadPreviewByFieldsetName('Base')}}" stepKey="waitForPreviewImage"/>
37+
38+
<waitForElement selector="{{AdminDesignConfigSection.imageUploadInputByFieldsetName('Thumbnail')}}" stepKey="waitForInputVisible2"/>
39+
<attachFile selector="{{AdminDesignConfigSection.imageUploadInputByFieldsetName('Thumbnail')}}" userInput="adobe-thumb.jpg" stepKey="attachFile2"/>
40+
<waitForElementVisible selector="{{AdminDesignConfigSection.imageUploadPreviewByFieldsetName('Thumbnail')}}" stepKey="waitForPreviewImage2"/>
41+
42+
<waitForElement selector="{{AdminDesignConfigSection.imageUploadInputByFieldsetName('Small')}}" stepKey="waitForInputVisible3"/>
43+
<attachFile selector="{{AdminDesignConfigSection.imageUploadInputByFieldsetName('Small')}}" userInput="adobe-small.jpg" stepKey="attachFile3"/>
44+
<waitForElementVisible selector="{{AdminDesignConfigSection.imageUploadPreviewByFieldsetName('Small')}}" stepKey="waitForPreviewImage3"/>
45+
</test>
46+
</tests>

app/code/Magento/Ui/Test/Mftf/Section/ModalConfirmationSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="ModalConfirmationSection">
12+
<element name="modalContent" type="text" selector="aside.confirm div.modal-content"/>
1213
<element name="CancelButton" type="button" selector="//footer[@class='modal-footer']/button[contains(@class, 'action-dismiss')]"/>
1314
<element name="OkButton" type="button" selector="//footer[@class='modal-footer']/button[contains(@class, 'action-accept')]"/>
1415
</section>

dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,35 @@ public function testIndexAction()
5656
$this->assertContains('Green str, 67', $body);
5757
}
5858

59+
/**
60+
* @magentoDataFixture Magento/Customer/_files/customer_no_password.php
61+
*/
62+
public function testLoginWithIncorrectPassword()
63+
{
64+
$expectedMessage = 'The account sign-in was incorrect or your account is disabled temporarily. '
65+
. 'Please wait and try again later.';
66+
$this->getRequest()
67+
->setMethod('POST')
68+
->setPostValue(
69+
[
70+
'login' => [
71+
'username' => '[email protected]',
72+
'password' => '123123q'
73+
]
74+
]
75+
);
76+
77+
$this->dispatch('customer/account/loginPost');
78+
$this->assertRedirect($this->stringContains('customer/account/login'));
79+
$this->assertSessionMessages(
80+
$this->equalTo(
81+
[
82+
$expectedMessage
83+
]
84+
)
85+
);
86+
}
87+
5988
/**
6089
* Test sign up form displaying.
6190
*/
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
use Magento\Customer\Model\CustomerRegistry;
7+
8+
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
9+
/** @var $repository \Magento\Customer\Api\CustomerRepositoryInterface */
10+
$repository = $objectManager->create(\Magento\Customer\Api\CustomerRepositoryInterface::class);
11+
$customer = $objectManager->create(\Magento\Customer\Model\Customer::class);
12+
/** @var CustomerRegistry $customerRegistry */
13+
$customerRegistry = $objectManager->get(CustomerRegistry::class);
14+
/** @var Magento\Customer\Model\Customer $customer */
15+
$customer->setWebsiteId(1)
16+
->setId(1)
17+
->setEmail('[email protected]')
18+
->setGroupId(1)
19+
->setStoreId(1)
20+
->setIsActive(1)
21+
->setPrefix('Mr.')
22+
->setFirstname('John')
23+
->setMiddlename('A')
24+
->setLastname('Smith')
25+
->setSuffix('Esq.')
26+
->setDefaultBilling(1)
27+
->setDefaultShipping(1)
28+
->setTaxvat('12')
29+
->setGender(0);
30+
31+
$customer->isObjectNew(true);
32+
$customer->save();
33+
$customerRegistry->remove($customer->getId());

lib/internal/Magento/Framework/Encryption/Encryptor.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function validateHashVersion($hash, $validateCount = false)
228228
}
229229

230230
/**
231-
* Split password hash into parts: hash, salt, version
231+
* Explode password hash
232232
*
233233
* @param string $hash
234234
* @return array
@@ -271,7 +271,13 @@ private function getPasswordSalt()
271271
*/
272272
private function getPasswordVersion()
273273
{
274-
return array_map('intval', explode(self::DELIMITER, $this->passwordHashMap[self::PASSWORD_VERSION]));
274+
return array_map(
275+
'intval',
276+
explode(
277+
self::DELIMITER,
278+
(string)$this->passwordHashMap[self::PASSWORD_VERSION]
279+
)
280+
);
275281
}
276282

277283
/**

0 commit comments

Comments
 (0)