Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Browse files Browse the repository at this point in the history
Accepted Community Pull Requests:
 - #26129: Refactor / Cleanup: `use` section does not need leading backslash (by @lbajsarowicz)
 - #26131: Reduce sleep time for Unit Test of Consumer to 0 seconds (by @lbajsarowicz)
 - #26125: [WishlistGraphQL] Covering the CustomerWishlistResolver (by @lbajsarowicz)
 - #26126: [WeeeGraphQl] Covering the FixedProductTax (by @lbajsarowicz)
 - #26033: Normalize new line symbols in Product Text Option (type=area) (by @Leone)
 - #25915:  Tests for: #24907, #25051, #25149, #24973, #25666. (by @p-bystritsky)
 - #25853: Tests for: #25585, #25248, #25058.  (by @p-bystritsky)
 - #25315: Error in vendor/magento/module-shipping/Model/Config/Source/Allmethod� (by @mrodespin)
 - #25838: [FIXES] #25674: Elasticsearch version selections in admin are overly � (by @mautz-et-tong)


Fixed GitHub Issues:
 - #25974: Amount of characters on a 'Area' Customizable Option counted differently on backend/frontend (reported by @hans-vereyken) has been fixed in #26033 by @Leone in 2.4-develop branch
   Related commits:
     1. 284e3ed
     2. 2ae6838
     3. d2a4865
     4. 6e68a47

 - #13136: Error in vendor/magento/module-shipping/Model/Config/Source/Allmethods.php - public function toOptionArray (reported by @Tantuss) has been fixed in #25315 by @mrodespin in 2.4-develop branch
   Related commits:
     1. 529c46f
     2. c4a3c00
     3. fd7633b

 - #25674: Elasticsearch version selections in admin are overly broad (reported by @dobooth) has been fixed in #25838 by @mautz-et-tong in 2.4-develop branch
   Related commits:
     1. cf1b084
     2. 37cf56d
  • Loading branch information
VladimirZaets authored Dec 29, 2019
2 parents 6159dc8 + cbfd175 commit 6bfdbd3
Show file tree
Hide file tree
Showing 224 changed files with 1,186 additions and 230 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/AdminAnalytics/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdminAnalytics', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdminNotification', __DIR__);
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdvancedPricingImportExport', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/AdvancedSearch/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdvancedSearch', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/Amqp/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Amqp', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/AmqpStore/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AmqpStore', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/AsynchronousOperations/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AsynchronousOperations', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/Authorization/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Authorization', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/Authorizenet/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Authorizenet', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/AuthorizenetAcceptjs/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

declare(strict_types=1);

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AuthorizenetAcceptjs', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/AuthorizenetCardinal/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AuthorizenetCardinal', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Backend', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/Backup/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Backup', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/Braintree/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Braintree', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/Bundle/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Bundle', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/BundleImportExport/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_BundleImportExport', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/CacheInvalidate/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CacheInvalidate', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/Captcha/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Captcha', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/CardinalCommerce/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CardinalCommerce', __DIR__);
14 changes: 14 additions & 0 deletions app/code/Magento/Catalog/Model/Product/Option/Type/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/**
* Catalog product option text type
*
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class Text extends \Magento\Catalog\Model\Product\Option\Type\DefaultType
{
Expand Down Expand Up @@ -68,6 +70,7 @@ public function validateUserValue($values)

// Check maximal length limit
$maxCharacters = $option->getMaxCharacters();
$value = $this->normalizeNewLineSymbols($value);
if ($maxCharacters > 0 && $this->string->strlen($value) > $maxCharacters) {
$this->setIsValid(false);
throw new LocalizedException(__('The text is too long. Shorten the text and try again.'));
Expand Down Expand Up @@ -101,4 +104,15 @@ public function getFormattedOptionValue($value)
{
return $this->_escaper->escapeHtml($value);
}

/**
* Normalize newline symbols
*
* @param string $value
* @return string
*/
private function normalizeNewLineSymbols(string $value)
{
return str_replace(["\r\n", "\n\r", "\r"], "\n", $value);
}
}
5 changes: 5 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@
<requiredEntity type="product_option">ProductOptionDateTime</requiredEntity>
<requiredEntity type="product_option">ProductOptionTime</requiredEntity>
</entity>
<entity name="productWithDateTimeOption" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<data key="file">magento.jpg</data>
<requiredEntity type="product_option">ProductOptionDateTime</requiredEntity>
</entity>
<entity name="productWithOptionRadiobutton" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionRadiobuttonWithTwoFixedOptions</requiredEntity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductCustomizableOptionsSection">
<element name="requiredFieldIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('#product_composite_configure_form_fields .admin__field.required .admin__field-label'), ':after').getPropertyValue('content');"/>
<element name="checkIfCustomizableOptionsTabOpen" type="text" selector="//span[text()='Customizable Options']/parent::strong/parent::*[@data-state-collapsible='closed']" timeout="30"/>
<element name="customizableOptions" type="text" selector="//strong[contains(@class, 'admin__collapsible-title')]/span[text()='Customizable Options']"/>
<element name="useDefaultOptionTitle" type="text" selector="[data-index='options'] tr.data-row [data-index='title'] [name^='options_use_default']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<element name="specialPriceValue" type="text" selector="//span[@class='special-price']//span[@class='price']"/>
<element name="mapPrice" type="text" selector="//div[@class='price-box price-final_price']//span[contains(@class, 'price-msrp_price')]"/>
<element name="clickForPriceLink" type="text" selector="//div[@class='price-box price-final_price']//a[contains(text(), 'Click for price')]"/>
<element name="addReviewLink" type="text" selector="//div[@class='reviews-actions']//a[@class='action add']"/>

<!-- The parameter is the nth custom option that you want to get -->
<element name="nthCustomOption" type="block" selector="//*[@id='product-options-wrapper']/*[@class='fieldset']/*[contains(@class, 'field')][{{customOptionNum}}]" parameterized="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@
<element name="imageFile" type="text" selector="//*[@class='product media']//img[contains(@src, '{{filename}}')]" parameterized="true"/>
<element name="productImageActive" type="text" selector=".product.media div[data-active=true] > img[src*='{{filename}}']" parameterized="true"/>
<element name="productImageInFotorama" type="file" selector=".fotorama__nav__shaft img[src*='{{imageName}}']" parameterized="true"/>
<element name="fotoramaPrevButton" type="button" selector="//*[@data-gallery-role='gallery']//*[@data-gallery-role='nav-wrap']//*[@data-gallery-role='arrow' and contains(@class, 'fotorama__thumb__arr--left')]"/>
<element name="fotoramaNextButton" type="button" selector="//*[@data-gallery-role='gallery']//*[@data-gallery-role='nav-wrap']//*[@data-gallery-role='arrow' and contains(@class, 'fotorama__thumb__arr--right')]"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="ProductAttributeWithoutValueInCompareListTest">
<annotations>
<features value="Catalog"/>
<title value="Product attribute without value in compare list test"/>
<description
value="The product attribute that has no value should output 'N/A' on the product comparison page."/>
<severity value="MINOR"/>
<group value="Catalog"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<createData entity="textProductAttribute" stepKey="createProductAttribute"/>
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/"
stepKey="onAttributeSetEdit"/>
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
<argument name="group" value="Product Details"/>
<argument name="attribute" value="$$createProductAttribute.attribute_code$$"/>
</actionGroup>
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="_defaultProduct" stepKey="createProductDefault">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="SimpleProductWithCustomAttributeSet" stepKey="createProductCustom">
<requiredEntity createDataKey="createCategory"/>
<requiredEntity createDataKey="createAttributeSet"/>
</createData>
</before>
<after>
<deleteData createDataKey="createProductDefault" stepKey="deleteProductDefault"/>
<deleteData createDataKey="createProductCustom" stepKey="deleteProductCustom"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!--Open product page-->
<amOnPage url="{{StorefrontProductPage.url($$createProductDefault.name$$)}}" stepKey="goToProductDefaultPage"/>
<waitForPageLoad stepKey="waitForProductPage"/>
<!--Click on 'Add to Compare' link-->
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompare">
<argument name="productVar" value="$$createProductDefault$$"/>
</actionGroup>
<!--See product in the comparison list-->
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductDefaultInComparisonListActionGroup">
<argument name="productVar" value="$$createProductDefault$$"/>
</actionGroup>
<!--Open product with custom attribute page-->
<amOnPage url="{{StorefrontProductPage.url($$createProductCustom.name$$)}}" stepKey="goToProductCustomPage"/>
<waitForPageLoad stepKey="waitForProductCustomPage"/>
<!--Click on 'Add to Compare' link-->
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompareCustom">
<argument name="productVar" value="$$createProductCustom$$"/>
</actionGroup>
<!--See product with custom attribute in the comparison list-->
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductCustomInComparisonListActionGroup">
<argument name="productVar" value="$$createProductCustom$$"/>
</actionGroup>
<!--See attribute default value in the comparison list-->
<see userInput="$createProductAttribute.defaultValue$"
selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName(ProductAttributeFrontendLabel.label, $createProductCustom.name$)}}"
stepKey="assertAttributeValueForProductCustom"/>
<!--See N/A if attribute has no value in the comparison list-->
<see userInput="N/A"
selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName(ProductAttributeFrontendLabel.label, $createProductDefault.name$)}}"
stepKey="assertNAForProductDefault"/>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminAddDefaultImageSimpleProductTest">
<annotations>
<features value="Catalog"/>
<title value="Storefront Fotorama arrows test"/>
<description value="Check arrows next to the thumbs are not visible than there is room for all pictures."/>
<severity value="MINOR"/>
<group value="Catalog"/>
</annotations>
<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="_defaultProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
</after>

<!-- Open Product for edit -->
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="findCreatedProductInGrid">
<argument name="product" value="$$createProduct$$"/>
</actionGroup>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="goToEditProductPage">
<argument name="product" value="$$createProduct$$"/>
</actionGroup>

<!-- Add images to product -->
<actionGroup ref="AddProductImageActionGroup" stepKey="addFirstImageToProduct">
<argument name="image" value="MagentoLogo"/>
</actionGroup>
<actionGroup ref="AddProductImageActionGroup" stepKey="addSecondImageToProduct">
<argument name="image" value="ProductImage"/>
</actionGroup>
<actionGroup ref="AddProductImageActionGroup" stepKey="addThirdImageToProduct">
<argument name="image" value="TestImageNew"/>
</actionGroup>
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/>

<!-- Assert product in storefront product page -->
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openCreatedProductPage">
<argument name="productUrl" value="$$createProduct.name$$"/>
</actionGroup>

<!-- Assert Fotorama arrows aren't visible -->
<dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButton"/>
<dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="dontSeeNextButton"/>
</test>
</tests>
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Catalog', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogImportExport/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogImportExport', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogInventory/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogInventory', __DIR__);
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogRule/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CatalogRule', __DIR__);
Loading

0 comments on commit 6bfdbd3

Please sign in to comment.