From c276064c31714bb21c494e5dc45e8ffe8217c333 Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina Date: Tue, 12 Feb 2019 13:27:31 +0300 Subject: [PATCH 01/36] MAGETWO-65232: Product name does not display special characters properly - Fix product name with special characters in product grid --- .../Catalog/view/adminhtml/ui_component/product_listing.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml index 65090fa3ac461..ad4a9d8103704 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml @@ -132,6 +132,7 @@ true text + ui/grid/cells/html From a34d4f5e62b4bb0a459179ccd209af952b41489f Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina Date: Thu, 14 Feb 2019 12:12:53 +0300 Subject: [PATCH 02/36] MAGETWO-65232: Product name does not display special characters properly - Fix product name with special characters in invoice ans shipment pdf --- .../Model/Order/Pdf/Items/Invoice/DefaultInvoice.php | 9 +++++++-- .../Model/Order/Pdf/Items/Shipment/DefaultShipment.php | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php index 8562328025540..9c183ed44c72a 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php @@ -66,11 +66,16 @@ public function draw() $lines = []; // draw Product name - $lines[0] = [['text' => $this->string->split($item->getName(), 35, true, true), 'feed' => 35]]; + $lines[0] = [ + [ + 'text' => $this->string->split(html_entity_decode($item->getName()), 35, true, true), + 'feed' => 35 + ] + ]; // draw SKU $lines[0][] = [ - 'text' => $this->string->split($this->getSku($item), 17), + 'text' => $this->string->split(html_entity_decode($this->getSku($item)), 17), 'feed' => 290, 'align' => 'right', ]; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php index 6007e1dcf2b47..c175b9866fb8e 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php @@ -65,14 +65,19 @@ public function draw() $lines = []; // draw Product name - $lines[0] = [['text' => $this->string->split($item->getName(), 60, true, true), 'feed' => 100]]; + $lines[0] = [ + [ + 'text' => $this->string->split(html_entity_decode($item->getName()), 60, true, true), + 'feed' => 100 + ] + ]; // draw QTY $lines[0][] = ['text' => $item->getQty() * 1, 'feed' => 35]; // draw SKU $lines[0][] = [ - 'text' => $this->string->split($this->getSku($item), 25), + 'text' => $this->string->split(html_entity_decode($this->getSku($item)), 25), 'feed' => 565, 'align' => 'right', ]; From 4a214364eb0b3fb06cc9acd92747c67505fdf539 Mon Sep 17 00:00:00 2001 From: Nikita Chubukov Date: Fri, 15 Feb 2019 14:42:08 +0300 Subject: [PATCH 03/36] MAGETWO-58219: Product Attribute Option Values for storeview instead of admin on product creation - Changed logic of displaying attribute option values in admin panel --- .../DataProvider/Product/Form/Modifier/Eav.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) mode change 100755 => 100644 app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php old mode 100755 new mode 100644 index 99f7122efa0a8..c96fe54a87620 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -35,6 +35,7 @@ use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav\CompositeConfigProcessor; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory as AttributeCollectionFactory; +use Magento\Framework\App\State; /** * Class Eav @@ -213,6 +214,11 @@ class Eav extends AbstractModifier */ private $scopeConfig; + /** + * @var State + */ + private $state; + /** * Eav constructor. * @param LocatorInterface $locator @@ -237,6 +243,7 @@ class Eav extends AbstractModifier * @param CompositeConfigProcessor|null $wysiwygConfigProcessor * @param ScopeConfigInterface|null $scopeConfig * @param AttributeCollectionFactory $attributeCollectionFactory + * @param State $state * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -261,7 +268,8 @@ public function __construct( $attributesToEliminate = [], CompositeConfigProcessor $wysiwygConfigProcessor = null, ScopeConfigInterface $scopeConfig = null, - AttributeCollectionFactory $attributeCollectionFactory = null + AttributeCollectionFactory $attributeCollectionFactory = null, + State $state = null ) { $this->locator = $locator; $this->catalogEavValidationRules = $catalogEavValidationRules; @@ -288,6 +296,8 @@ public function __construct( ->get(ScopeConfigInterface::class); $this->attributeCollectionFactory = $attributeCollectionFactory ?: \Magento\Framework\App\ObjectManager::getInstance()->get(AttributeCollectionFactory::class); + $this->state = $state ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(State::class); } /** @@ -676,7 +686,9 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC // TODO: Refactor to $attribute->getOptions() when MAGETWO-48289 is done $attributeModel = $this->getAttributeModel($attribute); if ($attributeModel->usesSource()) { - $options = $attributeModel->getSource()->getAllOptions(); + $options = ($this->state->getAreaCode() == \Magento\Framework\App\Area::AREA_ADMINHTML) + ? $attributeModel->getSource()->getAllOptions(true, true) + : $attributeModel->getSource()->getAllOptions(); $meta = $this->arrayManager->merge($configPath, $meta, [ 'options' => $this->convertOptionsValueToString($options), ]); From ea4a5ec6a150474d7731418c995ded75a55f1bea Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina Date: Mon, 18 Feb 2019 13:06:36 +0300 Subject: [PATCH 04/36] MAGETWO-65232: Product name does not display special characters properly - Fix product name with special characters --- .../view/adminhtml/ui_component/product_listing.xml | 1 + .../Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml index ad4a9d8103704..d2d6f098125ce 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml @@ -155,6 +155,7 @@ text + ui/grid/cells/html diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php index 11908864236f6..882fec2ab7c46 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php @@ -66,11 +66,16 @@ public function draw() $lines = []; // draw Product name - $lines[0] = [['text' => $this->string->split($item->getName(), 35, true, true), 'feed' => 35]]; + $lines[0] = [ + [ + 'text' => $this->string->split(html_entity_decode($item->getName()), 35, true, true), + 'feed' => 35 + ] + ]; // draw SKU $lines[0][] = [ - 'text' => $this->string->split($this->getSku($item), 17), + 'text' => $this->string->split(html_entity_decode($this->getSku($item)), 17), 'feed' => 255, 'align' => 'right', ]; From e619c008b66854be09b093a149bb4b35d027218b Mon Sep 17 00:00:00 2001 From: Alexey Yakimovich Date: Mon, 18 Feb 2019 17:20:29 +0300 Subject: [PATCH 05/36] MAGETWO-70232: [GITHUB] Import customizable options adds it to another product if same SKU is filled#9457 - Fixed an issue with incorrect saving of imported custom options when product sku was changed; --- app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 0941aa2478935..43d496c37ca69 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -58,7 +58,11 @@ public function execute($entity, $arguments = []) } } if ($options) { + $hasChangedSku = $entity->dataHasChangedFor('sku'); foreach ($options as $option) { + if ($hasChangedSku) { + $option->setProductSku($entity->getSku()); + } $this->optionRepository->save($option); } } From f1b43abc82c370ef4c48d684ae59313345c37893 Mon Sep 17 00:00:00 2001 From: Nikita Chubukov Date: Wed, 20 Feb 2019 10:43:41 +0300 Subject: [PATCH 06/36] MAGETWO-58226: Calendar Custom Options are displayed broken on Storefront - Preventing error messages below each select field for Customizable Options --- .../frontend/Magento/blank/web/css/source/_forms.less | 10 ++++++++++ .../frontend/Magento/luma/web/css/source/_forms.less | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/app/design/frontend/Magento/blank/web/css/source/_forms.less b/app/design/frontend/Magento/blank/web/css/source/_forms.less index c9f3c3d72ef4c..6ad1f3bf38eb9 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_forms.less +++ b/app/design/frontend/Magento/blank/web/css/source/_forms.less @@ -101,6 +101,16 @@ .lib-form-validation-note(); } + .product-options-wrapper { + .date { + &.required { + div[for*='options'] { + display: none !important; + } + } + } + } + .field .tooltip { .lib-tooltip(right); .tooltip-content { diff --git a/app/design/frontend/Magento/luma/web/css/source/_forms.less b/app/design/frontend/Magento/luma/web/css/source/_forms.less index 98dd57dead74c..78a50ba10c9bf 100644 --- a/app/design/frontend/Magento/luma/web/css/source/_forms.less +++ b/app/design/frontend/Magento/luma/web/css/source/_forms.less @@ -113,6 +113,16 @@ .lib-form-validation-note(); } + .product-options-wrapper { + .required { + div[for*='options'] { + &.mage-error { + display: none !important; + } + } + } + } + // TEMP .field .tooltip { From 0ff3e0ea40d2558fd3afbf809d26403d066b25db Mon Sep 17 00:00:00 2001 From: Nikita Chubukov Date: Thu, 21 Feb 2019 16:02:26 +0300 Subject: [PATCH 07/36] MAGETWO-58226: Calendar Custom Options are displayed broken on Storefront - Preventing error messages below each field of date type for Customizable Options --- .../frontend/Magento/blank/web/css/source/_forms.less | 4 +++- .../frontend/Magento/luma/web/css/source/_forms.less | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/design/frontend/Magento/blank/web/css/source/_forms.less b/app/design/frontend/Magento/blank/web/css/source/_forms.less index 6ad1f3bf38eb9..26f5ff89e99e3 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_forms.less +++ b/app/design/frontend/Magento/blank/web/css/source/_forms.less @@ -105,7 +105,9 @@ .date { &.required { div[for*='options'] { - display: none !important; + &.mage-error { + display: none !important; + } } } } diff --git a/app/design/frontend/Magento/luma/web/css/source/_forms.less b/app/design/frontend/Magento/luma/web/css/source/_forms.less index 78a50ba10c9bf..047ffd18d352f 100644 --- a/app/design/frontend/Magento/luma/web/css/source/_forms.less +++ b/app/design/frontend/Magento/luma/web/css/source/_forms.less @@ -114,10 +114,12 @@ } .product-options-wrapper { - .required { - div[for*='options'] { - &.mage-error { - display: none !important; + .date { + &.required { + div[for*='options'] { + &.mage-error { + display: none !important; + } } } } From b099719a7fc18d84bd210f441e0e432ccb5d5af8 Mon Sep 17 00:00:00 2001 From: Lilit Sargsyan Date: Wed, 27 Feb 2019 12:33:18 +0400 Subject: [PATCH 08/36] MAGETWO-65232: Product name does not display special characters properly - Added automated test script. --- .../Magento/Catalog/Test/Mftf/Data/ConstData.xml | 4 ++++ .../Magento/Catalog/Test/Mftf/Data/ProductData.xml | 4 ++++ .../Test/Mftf/Section/AdminProductGridSection.xml | 1 + .../Mftf/Section/StorefrontNavigationSection.xml | 1 + .../Mftf/ActionGroup/AdminInvoiceActionGroup.xml | 12 ++++++++++++ 5 files changed, 22 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ConstData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ConstData.xml index 8a26b6babdbbc..d09880f14afbf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ConstData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ConstData.xml @@ -13,4 +13,8 @@ 1 2 + + "Pursuit Lumaflex™ Tone Band" + "x™" + diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index 6d0d953e44676..f6032fd307a84 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -35,6 +35,10 @@ EavStockItem CustomAttributeCategoryIds + + Pursuit Lumaflex&trade; Tone Band + x&trade; + 100 diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml index 02bdbac313076..07dd26381fe08 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml @@ -17,6 +17,7 @@ + diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml index c6bad0efb3ca7..0263e218c2417 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml @@ -12,5 +12,6 @@ + diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml index c814a886a2b33..990e488e9c662 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml @@ -63,4 +63,16 @@ + + + + + + + + + + + + From b133eccf61ec7bbcf007233dd755109eb3a63ec7 Mon Sep 17 00:00:00 2001 From: Nikita Chubukov Date: Wed, 27 Feb 2019 17:23:38 +0300 Subject: [PATCH 09/36] MAGETWO-58219: Product Attribute Option Values for storeview instead of admin on product creation - Fix functional test --- .../Test/Mftf/Test/CreateProductAttributeEntityTest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml index 52022f32fd8ec..aa5fc05ad9db4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml @@ -417,9 +417,9 @@ - - - - + + + + From e80b1620240c874cd29421299f1b9fb98617b606 Mon Sep 17 00:00:00 2001 From: Alexey Yakimovich Date: Thu, 28 Feb 2019 13:06:04 +0300 Subject: [PATCH 10/36] MAGETWO-70232: [GITHUB] Import customizable options adds it to another product if same SKU is filled#9457 - Fixed integration test related issue; --- app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 43d496c37ca69..5447c386c692c 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -58,9 +58,9 @@ public function execute($entity, $arguments = []) } } if ($options) { - $hasChangedSku = $entity->dataHasChangedFor('sku'); + $hasChangedSku = ($entity->getOrigData('sku') !== null && $entity->dataHasChangedFor('sku')); foreach ($options as $option) { - if ($hasChangedSku) { + if ($hasChangedSku && $option->hasData('product_sku')) { $option->setProductSku($entity->getSku()); } $this->optionRepository->save($option); From b8a1d21bf74dc3a3975acae37678e88313484b2b Mon Sep 17 00:00:00 2001 From: Mikalai Shostka Date: Thu, 28 Feb 2019 15:23:44 +0300 Subject: [PATCH 11/36] MAGETWO-58219: Product Attribute Option Values for storeview instead of admin on product creation - Fix functional test --- .../Mftf/Test/CreateProductAttributeEntityTest.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml index aa5fc05ad9db4..d895993217e32 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml @@ -262,10 +262,10 @@ - - - - + + + + @@ -333,8 +333,8 @@ - - + + From 1001a7cf7ec47286b56ac4d8e4b1971b4cf59700 Mon Sep 17 00:00:00 2001 From: Alexey Yakimovich Date: Thu, 28 Feb 2019 17:13:08 +0300 Subject: [PATCH 12/36] MAGETWO-70232: [GITHUB] Import customizable options adds it to another product if same SKU is filled#9457 - Fixed static test; --- .../Model/Product/Option/SaveHandler.php | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 5447c386c692c..715c7a7719079 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -59,14 +59,25 @@ public function execute($entity, $arguments = []) } if ($options) { $hasChangedSku = ($entity->getOrigData('sku') !== null && $entity->dataHasChangedFor('sku')); - foreach ($options as $option) { - if ($hasChangedSku && $option->hasData('product_sku')) { - $option->setProductSku($entity->getSku()); - } - $this->optionRepository->save($option); - } + $this->processOptionsSaving($options, $hasChangedSku, $entity->getSku()); } return $entity; } + + /** + * Save custom options + * + * @param array $options + * @param bool $hasChangedSku + * @param string $newSku + */ + private function processOptionsSaving($options, $hasChangedSku, $newSku) { + foreach ($options as $option) { + if ($hasChangedSku && $option->hasData('product_sku')) { + $option->setProductSku($newSku); + } + $this->optionRepository->save($option); + } + } } From 85829049bc98a795e7ede8ddac573567d09f533d Mon Sep 17 00:00:00 2001 From: Alexey Yakimovich Date: Thu, 28 Feb 2019 23:31:23 +0300 Subject: [PATCH 13/36] MAGETWO-70232: [GITHUB] Import customizable options adds it to another product if same SKU is filled#9457 - Fixed static test; --- app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 715c7a7719079..d210670920ef1 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -72,7 +72,8 @@ public function execute($entity, $arguments = []) * @param bool $hasChangedSku * @param string $newSku */ - private function processOptionsSaving($options, $hasChangedSku, $newSku) { + private function processOptionsSaving($options, $hasChangedSku, $newSku) + { foreach ($options as $option) { if ($hasChangedSku && $option->hasData('product_sku')) { $option->setProductSku($newSku); From 17561929f9089b76afaff886c86c71693cf5918c Mon Sep 17 00:00:00 2001 From: Yuliya Labudova Date: Tue, 5 Mar 2019 10:47:09 +0300 Subject: [PATCH 14/36] MAGETWO-58226: Calendar Custom Options are displayed broken on Storefront if JS validation is performed - Fix functional test --- .../Magento/Catalog/Test/Block/Product/View/CustomOptions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index dcc8cce970098..99ff9b73b92eb 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -128,7 +128,8 @@ class CustomOptions extends Form * * @var string */ - private $validationErrorMessage = '//div[@class="mage-error"][contains(text(), "required field")]'; + private $validationErrorMessage = '//div[@class="mage-error"][contains(text(), "required field")' . + 'and not(contains(@style,\'display\'))]'; /** * Get product options From 61f9a74d2a1f91cebeb09a1cde880b2c7287a4f4 Mon Sep 17 00:00:00 2001 From: Alexey Yakimovich Date: Wed, 6 Mar 2019 16:22:43 +0300 Subject: [PATCH 15/36] MAGETWO-70232: [GITHUB] Import customizable options adds it to another product if same SKU is filled#9457 - Fixed an issue with incorrect options saving on new created product; --- app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index d210670920ef1..4d5dd57b76f61 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -58,8 +58,7 @@ public function execute($entity, $arguments = []) } } if ($options) { - $hasChangedSku = ($entity->getOrigData('sku') !== null && $entity->dataHasChangedFor('sku')); - $this->processOptionsSaving($options, $hasChangedSku, $entity->getSku()); + $this->processOptionsSaving($options, $entity->dataHasChangedFor('sku'), $entity->getSku()); } return $entity; From d583606dd48748d7ac6571e987c8b04cd8ae19e7 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin Date: Wed, 6 Mar 2019 15:53:28 +0200 Subject: [PATCH 16/36] MAGETWO-96416: Clicking on a Root Category causes all other Root Categories to be expanded to the top-level categories --- app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index a67f55235b6df..479e212924f23 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -367,7 +367,7 @@ protected function _getNodeJson($node, $level = 0) } } - if ($isParent || $node->getLevel() < 2) { + if ($isParent || $node->getLevel() < 1) { $item['expanded'] = true; } From 3cf122cc0f0882b55a7fa92c465fdc04238c585a Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin Date: Thu, 7 Mar 2019 16:13:02 +0200 Subject: [PATCH 17/36] MAGETWO-96416: Clicking on a Root Category causes all other Root Categories to be expanded to the top-level categories --- .../Catalog/Block/Adminhtml/Category/Tree.php | 32 +++++++++++++++++-- .../Cms/Test/Mftf/Section/TinyMCESection.xml | 1 + ...WYSIWYGWithCatalogCategoryLinkTypeTest.xml | 1 + ...oWYSIWYGWithCatalogProductLinkTypeTest.xml | 1 + 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index 479e212924f23..83ec501592489 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -71,7 +71,7 @@ public function __construct( } /** - * @return void + * @inheritdoc */ protected function _construct() { @@ -80,7 +80,7 @@ protected function _construct() } /** - * @return $this + * @inheritdoc */ protected function _prepareLayout() { @@ -182,6 +182,8 @@ public function getSuggestedCategoriesJson($namePart) } /** + * Get add root button html + * * @return string */ public function getAddRootButtonHtml() @@ -190,6 +192,8 @@ public function getAddRootButtonHtml() } /** + * Get add sub button html + * * @return string */ public function getAddSubButtonHtml() @@ -198,6 +202,8 @@ public function getAddSubButtonHtml() } /** + * Get expand button html + * * @return string */ public function getExpandButtonHtml() @@ -206,6 +212,8 @@ public function getExpandButtonHtml() } /** + * Get collapse button html + * * @return string */ public function getCollapseButtonHtml() @@ -214,6 +222,8 @@ public function getCollapseButtonHtml() } /** + * Get store switcher + * * @return string */ public function getStoreSwitcherHtml() @@ -222,6 +232,8 @@ public function getStoreSwitcherHtml() } /** + * Get loader tree url + * * @param bool|null $expanded * @return string */ @@ -235,6 +247,8 @@ public function getLoadTreeUrl($expanded = null) } /** + * Get nodes url + * * @return string */ public function getNodesUrl() @@ -243,6 +257,8 @@ public function getNodesUrl() } /** + * Get switcher tree url + * * @return string */ public function getSwitchTreeUrl() @@ -254,6 +270,8 @@ public function getSwitchTreeUrl() } /** + * Get is was expanded + * * @return bool * @SuppressWarnings(PHPMD.BooleanGetMethodName) */ @@ -263,6 +281,8 @@ public function getIsWasExpanded() } /** + * Get move url + * * @return string */ public function getMoveUrl() @@ -271,6 +291,8 @@ public function getMoveUrl() } /** + * Get tree + * * @param mixed|null $parenNodeCategory * @return array */ @@ -282,6 +304,8 @@ public function getTree($parenNodeCategory = null) } /** + * Get tree json + * * @param mixed|null $parenNodeCategory * @return string */ @@ -390,6 +414,8 @@ public function buildNodeName($node) } /** + * Is category movable + * * @param Node|array $node * @return bool */ @@ -403,6 +429,8 @@ protected function _isCategoryMoveable($node) } /** + * Is parent selected category + * * @param Node|array $node * @return bool */ diff --git a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml index ff6167ffc10e0..4fb008eb422d3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml @@ -109,6 +109,7 @@ + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index 5b3679bed77e0..89f0439bd65b4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -46,6 +46,7 @@ + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index 123d25f92b6b7..3b79770badca4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -50,6 +50,7 @@ + From c5d1d62e10b3e024bd3d4295745a4440b062f9a7 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin Date: Mon, 11 Mar 2019 11:31:28 +0200 Subject: [PATCH 18/36] MAGETWO-96416: Clicking on a Root Category causes all other Root Categories to be expanded to the top-level categories --- .../Test/Mftf/Section/AdminCategorySidebarTreeSection.xml | 1 + app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml | 1 - ...dminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml | 5 +++-- ...AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml index 14e714cb2b6b7..fba28b3feaff1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml @@ -16,5 +16,6 @@ + diff --git a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml index 4fb008eb422d3..ff6167ffc10e0 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml @@ -109,7 +109,6 @@ - diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index 89f0439bd65b4..393e25e474f12 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -46,8 +46,9 @@ - - + + + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index 3b79770badca4..9ee9d27de477a 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -50,7 +50,8 @@ - + + From ace7f4c3f568e8dee4c6b1d6f9d06428368d53e2 Mon Sep 17 00:00:00 2001 From: Nikita Chubukov Date: Mon, 11 Mar 2019 13:59:54 +0300 Subject: [PATCH 19/36] MAGETWO-58219: Product Attribute Option Values for storeview instead of admin on product creation - Removed area check in data provider --- .../DataProvider/Product/Form/Modifier/Eav.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index c96fe54a87620..8326c3b531892 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -35,7 +35,6 @@ use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav\CompositeConfigProcessor; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory as AttributeCollectionFactory; -use Magento\Framework\App\State; /** * Class Eav @@ -214,11 +213,6 @@ class Eav extends AbstractModifier */ private $scopeConfig; - /** - * @var State - */ - private $state; - /** * Eav constructor. * @param LocatorInterface $locator @@ -243,7 +237,6 @@ class Eav extends AbstractModifier * @param CompositeConfigProcessor|null $wysiwygConfigProcessor * @param ScopeConfigInterface|null $scopeConfig * @param AttributeCollectionFactory $attributeCollectionFactory - * @param State $state * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -268,8 +261,7 @@ public function __construct( $attributesToEliminate = [], CompositeConfigProcessor $wysiwygConfigProcessor = null, ScopeConfigInterface $scopeConfig = null, - AttributeCollectionFactory $attributeCollectionFactory = null, - State $state = null + AttributeCollectionFactory $attributeCollectionFactory = null ) { $this->locator = $locator; $this->catalogEavValidationRules = $catalogEavValidationRules; @@ -296,8 +288,6 @@ public function __construct( ->get(ScopeConfigInterface::class); $this->attributeCollectionFactory = $attributeCollectionFactory ?: \Magento\Framework\App\ObjectManager::getInstance()->get(AttributeCollectionFactory::class); - $this->state = $state ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(State::class); } /** @@ -686,9 +676,7 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC // TODO: Refactor to $attribute->getOptions() when MAGETWO-48289 is done $attributeModel = $this->getAttributeModel($attribute); if ($attributeModel->usesSource()) { - $options = ($this->state->getAreaCode() == \Magento\Framework\App\Area::AREA_ADMINHTML) - ? $attributeModel->getSource()->getAllOptions(true, true) - : $attributeModel->getSource()->getAllOptions(); + $options = $attributeModel->getSource()->getAllOptions(true, true); $meta = $this->arrayManager->merge($configPath, $meta, [ 'options' => $this->convertOptionsValueToString($options), ]); From 8ff613ebef8d20bed5a0abab8047e9afb26ff92e Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Thu, 21 Mar 2019 19:17:03 +0200 Subject: [PATCH 20/36] MAGETWO-98335: Unable to find product on product grid page using store view level attribute --- ...lterByNameByStoreViewOnProductGridTest.xml | 45 +++++++++++++ .../Product/ProductCollection.php | 63 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml new file mode 100644 index 0000000000000..f3ec225540c75 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + <description value="Verify that products grid can be filtered on all store view level by attribute"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-98755"/> + <useCaseId value="MAGETWO-98335"/> + <group value="catalog"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToEditPage"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreView"> + <argument name="storeView" value="_defaultStore.name"/> + </actionGroup> + <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> + <click selector="{{AdminProductFormSection.productNameUseDefault}}" stepKey="uncheckUseDefault"/> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillNewName"/> + <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <actionGroup ref="filterProductGridByName" stepKey="filterGridByName"> + <argument name="product" value="SimpleProduct"/> + </actionGroup> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{SimpleProduct2.name}}" stepKey="seeProductNameInGrid"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php index f4334bc25efd8..37ac5c85c6f67 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php @@ -5,6 +5,10 @@ */ namespace Magento\Catalog\Ui\DataProvider\Product; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Framework\Exception\LocalizedException; +use Magento\Eav\Model\Entity\Attribute\AttributeInterface; + /** * Collection which is used for rendering product list in the backend. * @@ -25,4 +29,63 @@ protected function _productLimitationJoinPrice() $this->_productLimitationFilters->setUsePriceIndex(false); return $this->_productLimitationPrice(true); } + + /** + * Add attribute filter to collection + * + * @param AttributeInterface|integer|string|array $attribute + * @param null|string|array $condition + * @param string $joinType + * @return $this + * @throws LocalizedException + */ + public function addAttributeToFilter($attribute, $condition = null, $joinType = 'inner') + { + $storeId = (int)$this->getStoreId(); + if ($attribute === 'is_saleable' + || is_array($attribute) + || $storeId !== $this->getDefaultStoreId() + ) { + return parent::addAttributeToFilter($attribute, $condition, $joinType); + } + + if ($attribute instanceof AttributeInterface) { + $attributeModel = $attribute; + } else { + $attributeModel = $this->getEntity()->getAttribute($attribute); + if ($attributeModel === false) { + throw new LocalizedException( + __('Invalid attribute identifier for filter (%1)', get_class($attribute)) + ); + } + } + + if ($attributeModel->isScopeGlobal() || $attributeModel->getBackend()->isStatic()) { + return parent::addAttributeToFilter($attribute, $condition, $joinType); + } + + $this->addAttributeToFilterAllStores($attributeModel, $condition); + + return $this; + } + + /** + * Add attribute to filter by all stores + * + * @param Attribute $attributeModel + * @param array $condition + * @return void + */ + private function addAttributeToFilterAllStores(Attribute $attributeModel, array $condition): void + { + $tableName = $this->getTable($attributeModel->getBackendTable()); + $entity = $this->getEntity(); + $fKey = 'e.' . $this->getEntityPkName($entity); + $pKey = $tableName . '.' . $this->getEntityPkName($entity); + $condition = "({$pKey} = {$fKey}) AND (" + . $this->_getConditionSql("{$tableName}.value", $condition) + . ')'; + $selectExistsInAllStores = $this->getConnection()->select()->from($tableName); + $this->getSelect()->exists($selectExistsInAllStores, $condition); + } } From 875313e745a9c06cb777308fa53eb7952e6ce0eb Mon Sep 17 00:00:00 2001 From: Davit_Zakharyan <davit_zakharyan@epam.com> Date: Fri, 22 Mar 2019 16:32:36 +0400 Subject: [PATCH 21/36] MAGETWO-65232: Product name does not display special characters properly - Updated automated test script. --- .../Test/Mftf/Section/StorefrontNavigationSection.xml | 2 +- .../Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml index 0263e218c2417..292b2d7008bc1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml @@ -12,6 +12,6 @@ <element name="subCategory" type="button" selector="//ul[contains(@class,'submenu')]//span[contains(text(),'{{var1}}')]" parameterized="true"/> <element name="breadcrumbs" type="textarea" selector=".items"/> <element name="categoryBreadcrumbs" type="textarea" selector=".breadcrumbs li"/> - <element name="categoryBreadcrumbsByNumber" type="textarea" selector=".breadcrumbs li:nth-of-type({{var1}})" parameterized="true"/> + <element name="categoryBreadcrumbsByNumber" type="textarea" selector=".breadcrumbs li:nth-of-type({{number}})" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml index 990e488e9c662..47fad10977b7c 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml @@ -52,6 +52,13 @@ <waitForPageLoad stepKey="waitForInvoicePageLoad"/> </actionGroup> + <actionGroup name="clearInvoicesGridFilers"> + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters" /> + <waitForPageLoad stepKey="waitInvoicesGrid"/> + </actionGroup> + <actionGroup name="goToInvoiceIntoOrder"> <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> From 42ed84a97209f120655261fdb290bef9b456c6d3 Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina <veronika_kurochkina@epam.com> Date: Mon, 25 Mar 2019 14:27:39 +0300 Subject: [PATCH 22/36] MAGETWO-65232: Product name does not display special characters properly - Add strict type declaration --- .../Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php | 2 ++ .../Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php | 2 ++ .../Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php index 882fec2ab7c46..64e569977429c 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Sales\Model\Order\Pdf\Items\Creditmemo; /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php index 9c183ed44c72a..4a77053521e4a 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Sales\Model\Order\Pdf\Items\Invoice; /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php index c175b9866fb8e..fd18830e45b6e 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Sales\Model\Order\Pdf\Items\Shipment; /** From c289f5dd45e879c48b2dda152985de7611174e15 Mon Sep 17 00:00:00 2001 From: Aliaksei Yakimovich2 <aliaksei_yakimovich2@epam.com> Date: Mon, 25 Mar 2019 14:42:53 +0300 Subject: [PATCH 23/36] MAGETWO-70232: [GITHUB] Import customizable options adds it to another product if same SKU is filled#9457 - code refactoring; --- app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 4d5dd57b76f61..6b2f3aba12e7a 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Catalog\Model\Product\Option; use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface as OptionRepository; @@ -71,7 +73,7 @@ public function execute($entity, $arguments = []) * @param bool $hasChangedSku * @param string $newSku */ - private function processOptionsSaving($options, $hasChangedSku, $newSku) + private function processOptionsSaving(array $options, bool $hasChangedSku, string $newSku) { foreach ($options as $option) { if ($hasChangedSku && $option->hasData('product_sku')) { From b78c229577b10b0b0334ba7ede392a556382f509 Mon Sep 17 00:00:00 2001 From: Lusine Papyan <Lusine_Papyan@epam.com> Date: Mon, 25 Feb 2019 14:58:11 +0400 Subject: [PATCH 24/36] MAGETWO-70232: Import customizable options adds it to another product if same SKU is filled - Add automated test script --- .../ActionGroup/CustomOptionsActionGroup.xml | 52 ++++++++++++ ...AdminProductCustomizableOptionsSection.xml | 12 ++- ...CustomizableOptionToProductWithSKUTest.xml | 84 +++++++++++++++++++ 3 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml index 2d966dde64c4a..b372166f1d0de 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml @@ -52,4 +52,56 @@ <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType('0')}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> <fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensions('0')}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/> </actionGroup> + + <actionGroup name="AddProductCustomOptionField"> + <arguments> + <argument name="option" defaultValue="ProductOptionField"/> + <argiment name="optionIndex" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> + <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionType('Field')}}" stepKey="selectTypeFile"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="waitForElements"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" userInput="{{option.price}}" stepKey="fillPrice"/> + <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType(optionIndex)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" userInput="{{option.title}}" stepKey="fillSku"/> + </actionGroup> + + <actionGroup name="importProductCustomizableOptions"> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> + <waitForElementVisible selector="{{AdminProductImportOptionsSection.selectProductTitle}}" stepKey="waitForTitleVisible"/> + <conditionalClick selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" dependentSelector="{{AdminProductImportOptionsSection.resetFiltersButton}}" visible="true" stepKey="clickResetFilters"/> + <click selector="{{AdminProductImportOptionsSection.filterButton}}" stepKey="clickFilterButton"/> + <waitForElementVisible selector="{{AdminProductImportOptionsSection.nameField}}" stepKey="waitForNameField"/> + <fillField selector="{{AdminProductImportOptionsSection.nameField}}" userInput="{{productName}}" stepKey="fillProductName"/> + <click selector="{{AdminProductImportOptionsSection.applyFiltersButton}}" stepKey="clickApplyFilters"/> + <checkOption selector="{{AdminProductImportOptionsSection.firstRowItemCheckbox}}" stepKey="checkProductCheckbox"/> + <click selector="{{AdminProductImportOptionsSection.importButton}}" stepKey="clickImport"/> + </actionGroup> + + <actionGroup name="resetImportOptionFilter"> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> + <click selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" stepKey="clickResetFilterButton"/> + </actionGroup> + + <actionGroup name="checkCustomizableOptionImport"> + <arguments> + <argument name="option" defaultValue="ProductOptionField"/> + <argiment name="optionIndex" type="string"/> + </arguments> + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionTitleInput(optionIndex)}}" stepKey="grabOptionTitle"/> + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="grabOptionPrice"/> + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" stepKey="grabOptionSku"/> + + <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionTitle" stepKey="assertOptionTitle"/> + <assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/> + <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml index fc78c25ec49fa..5598edcfbcb28 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml @@ -45,5 +45,15 @@ <element name="optionPriceType" type="select" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr//*[@name='product[options][{{var}}][price_type]']" parameterized="true"/> <element name="optionSku" type="input" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr//*[@name='product[options][{{index}}][sku]']" parameterized="true"/> <element name="optionFileExtensions" type="input" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr//*[@name='product[options][{{index}}][file_extension]']" parameterized="true"/> + <element name="importOptions" type="button" selector="//button[@data-index='button_import']" timeout="30"/> </section> -</sections> \ No newline at end of file + <section name="AdminProductImportOptionsSection"> + <element name="selectProductTitle" type="text" selector="//h1[contains(text(), 'Select Product')]" timeout="30"/> + <element name="filterButton" type="button" selector="//button[@data-action='grid-filter-expand']" timeout="30"/> + <element name="nameField" type="input" selector="//input[@name='name']" timeout="30"/> + <element name="applyFiltersButton" type="button" selector="//button[@data-action='grid-filter-apply']" timeout="30"/> + <element name="resetFiltersButton" type="button" selector="//button[@data-action='grid-filter-reset']" timeout="30"/> + <element name="firstRowItemCheckbox" type="input" selector="//input[@data-action='select-row']" timeout="30"/> + <element name="importButton" type="button" selector="//button[@class='action-primary']/span[contains(text(), 'Import')]" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml new file mode 100644 index 0000000000000..836c07a7c1935 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -0,0 +1,84 @@ +<?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="AdminImportCustomizableOptionToProductWithSKUTest"> + <annotations> + <features value="Catalog"/> + <title value="Check that 'trie price' block not available for simple product from options without 'trie price'"/> + <description value="Check that 'trie price' block not available for simple product from options without 'trie price'"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-98211"/> + <useCaseId value="MAGETWO-70232"/> + <group value="catalog"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + + <!--Create category--> + <createData entity="ApiCategory" stepKey="createCategory"/> + + <!-- Create two product --> + <createData entity="SimpleProduct2" stepKey="createFirstProduct"/> + <createData entity="ApiSimpleProduct" stepKey="createSecondProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + </before> + <after> + + <!--Delete second product with changed sku--> + <actionGroup ref="deleteProductBySku" stepKey="deleteSecondProduct"> + <argument name="sku" value="$$createFirstProduct.sku$$-1"/> + </actionGroup> + + <!--Delete created data--> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> + + <actionGroup ref="logout" stepKey="logoutOfAdmin"/> + </after> + + <!--Go to product page --> + <amOnPage url="{{AdminProductEditPage.url($$createFirstProduct.id$$)}}" stepKey="goToProductEditPage"/> + <waitForPageLoad stepKey="waitForProductEditPageLoad"/> + <actionGroup ref="AddProductCustomOptionField" stepKey="addCutomOption1"> + <argument name="option" value="ProductOptionField"/> + <argument name="optionIndex" value="0"/> + </actionGroup> + <actionGroup ref="AddProductCustomOptionField" stepKey="addCutomOption2"> + <argument name="option" value="ProductOptionField2"/> + <argument name="optionIndex" value="1"/> + </actionGroup> + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + + <!--Change second product sku to first product sku--> + <amOnPage url="{{AdminProductEditPage.url($$createSecondProduct.id$$)}}" stepKey="goToProductEditPage1"/> + <waitForPageLoad stepKey="waitForProductEditPageLoad1"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="$$createFirstProduct.sku$$" stepKey="fillProductSku1"/> + + <!--Import customizable options and check--> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <actionGroup ref="importProductCustomizableOptions" stepKey="importOptions"> + <argument name="productName" value="$$createFirstProduct.name$$"/> + </actionGroup> + <actionGroup ref="checkCustomizableOptionImport" stepKey="checkFirstOptionImport"> + <argument name="option" value="ProductOptionField"/> + <argument name="optionIndex" value="0"/> + </actionGroup> + <actionGroup ref="checkCustomizableOptionImport" stepKey="checkSecondOptionImport"> + <argument name="option" value="ProductOptionField2"/> + <argument name="optionIndex" value="1"/> + </actionGroup> + + <!--SAve product and check sku changed message--> + <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <see userInput="SKU for product $$createSecondProduct.name$$ has been changed to $$createFirstProduct.sku$$-1." stepKey="seeSkuChangedMessage"/> + </test> +</tests> From fc94ab8d0c1df4654a92b9817bc47f5ff7dce802 Mon Sep 17 00:00:00 2001 From: Lusine Papyan <Lusine_Papyan@epam.com> Date: Mon, 25 Mar 2019 18:59:26 +0400 Subject: [PATCH 25/36] MAGETWO-70232: Import customizable options adds it to another product if same SKU is filled - Update automated test script --- .../ActionGroup/CustomOptionsActionGroup.xml | 5 ---- ...AdminProductCustomizableOptionsSection.xml | 2 +- ...CustomizableOptionToProductWithSKUTest.xml | 26 +++++++++---------- ...eForProductOptionsWithoutTierPriceTest.xml | 4 +-- 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml index b372166f1d0de..b914d5e20712d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml @@ -52,7 +52,6 @@ <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType('0')}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> <fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensions('0')}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/> </actionGroup> - <actionGroup name="AddProductCustomOptionField"> <arguments> <argument name="option" defaultValue="ProductOptionField"/> @@ -69,7 +68,6 @@ <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType(optionIndex)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> <fillField selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" userInput="{{option.title}}" stepKey="fillSku"/> </actionGroup> - <actionGroup name="importProductCustomizableOptions"> <arguments> <argument name="productName" type="string"/> @@ -84,13 +82,11 @@ <checkOption selector="{{AdminProductImportOptionsSection.firstRowItemCheckbox}}" stepKey="checkProductCheckbox"/> <click selector="{{AdminProductImportOptionsSection.importButton}}" stepKey="clickImport"/> </actionGroup> - <actionGroup name="resetImportOptionFilter"> <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> <click selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" stepKey="clickResetFilterButton"/> </actionGroup> - <actionGroup name="checkCustomizableOptionImport"> <arguments> <argument name="option" defaultValue="ProductOptionField"/> @@ -99,7 +95,6 @@ <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionTitleInput(optionIndex)}}" stepKey="grabOptionTitle"/> <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="grabOptionPrice"/> <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" stepKey="grabOptionSku"/> - <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionTitle" stepKey="assertOptionTitle"/> <assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/> <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml index 5598edcfbcb28..352d219351fb8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml @@ -54,6 +54,6 @@ <element name="applyFiltersButton" type="button" selector="//button[@data-action='grid-filter-apply']" timeout="30"/> <element name="resetFiltersButton" type="button" selector="//button[@data-action='grid-filter-reset']" timeout="30"/> <element name="firstRowItemCheckbox" type="input" selector="//input[@data-action='select-row']" timeout="30"/> - <element name="importButton" type="button" selector="//button[@class='action-primary']/span[contains(text(), 'Import')]" timeout="30"/> + <element name="importButton" type="button" selector="//button[contains(@class, 'action-primary')]/span[contains(text(), 'Import')]" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index 836c07a7c1935..79ff7bcade77b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -11,8 +11,8 @@ <test name="AdminImportCustomizableOptionToProductWithSKUTest"> <annotations> <features value="Catalog"/> - <title value="Check that 'trie price' block not available for simple product from options without 'trie price'"/> - <description value="Check that 'trie price' block not available for simple product from options without 'trie price'"/> + <title value="Import customizable options to a product with existing SKU"/> + <description value="Import customizable options to a product with existing SKU"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-98211"/> <useCaseId value="MAGETWO-70232"/> @@ -20,32 +20,30 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <!--Create category--> + <comment userInput="Create category" stepKey="commentCreateCategory"/> <createData entity="ApiCategory" stepKey="createCategory"/> - <!-- Create two product --> + <comment userInput="Create two product" stepKey="commentCreateTwoProduct"/> <createData entity="SimpleProduct2" stepKey="createFirstProduct"/> <createData entity="ApiSimpleProduct" stepKey="createSecondProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - </before> <after> - - <!--Delete second product with changed sku--> + <!--Delete second product with changed sku--> + <comment userInput="Delete second product with changed sku" stepKey="commentDeleteProduct"/> <actionGroup ref="deleteProductBySku" stepKey="deleteSecondProduct"> <argument name="sku" value="$$createFirstProduct.sku$$-1"/> </actionGroup> - <!--Delete created data--> + <comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> - <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <!--Go to product page --> + <comment userInput="Go to product page" stepKey="commentGoToProductPage"/> <amOnPage url="{{AdminProductEditPage.url($$createFirstProduct.id$$)}}" stepKey="goToProductEditPage"/> <waitForPageLoad stepKey="waitForProductEditPageLoad"/> <actionGroup ref="AddProductCustomOptionField" stepKey="addCutomOption1"> @@ -57,13 +55,13 @@ <argument name="optionIndex" value="1"/> </actionGroup> <actionGroup ref="saveProductForm" stepKey="saveProduct"/> - <!--Change second product sku to first product sku--> + <comment userInput="Change second product sku to first product sku" stepKey="commentChangeSecondProduct"/> <amOnPage url="{{AdminProductEditPage.url($$createSecondProduct.id$$)}}" stepKey="goToProductEditPage1"/> <waitForPageLoad stepKey="waitForProductEditPageLoad1"/> <fillField selector="{{AdminProductFormSection.productSku}}" userInput="$$createFirstProduct.sku$$" stepKey="fillProductSku1"/> - <!--Import customizable options and check--> + <comment userInput="Import customizable options and check" stepKey="commentImportOptions"/> <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> <actionGroup ref="importProductCustomizableOptions" stepKey="importOptions"> <argument name="productName" value="$$createFirstProduct.name$$"/> @@ -76,8 +74,8 @@ <argument name="option" value="ProductOptionField2"/> <argument name="optionIndex" value="1"/> </actionGroup> - - <!--SAve product and check sku changed message--> + <!--Save product and check sku changed message--> + <comment userInput="Save product and check sku changed message" stepKey="commentSAveProductAndCheck"/> <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> <see userInput="SKU for product $$createSecondProduct.name$$ has been changed to $$createFirstProduct.sku$$-1." stepKey="seeSkuChangedMessage"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml index 3086f4398e08d..51af9d78dfd46 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml @@ -11,8 +11,8 @@ <test name="AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest"> <annotations> <features value="Catalog"/> - <title value="Check that 'trie price' block not available for simple product from options without 'trie price'"/> - <description value="Check that 'trie price' block not available for simple product from options without 'trie price'"/> + <title value="Check that 'tier price' block not available for simple product from options without 'tier price'"/> + <description value="Check that 'tier price' block not available for simple product from options without 'tier price'"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-97050"/> <useCaseId value="MAGETWO-96842"/> From 4dcc18aba77d27dd7f284bf4f5421be2cf9a585d Mon Sep 17 00:00:00 2001 From: Roman Zhupanyn <roma.dj.elf@gmail.com> Date: Tue, 26 Mar 2019 16:01:09 +0200 Subject: [PATCH 26/36] MAGETWO-98680: Cart Price Rule code is absent on "view Order/Invoice" Admin page if had been used for Free Shipping --- .../Magento/Sales/Block/Adminhtml/Totals.php | 27 +++++++++- .../Sales/Block/Adminhtml/TotalsTest.php | 53 +++++++++++++++++++ .../order_with_free_shipping_by_coupon.php | 34 ++++++++++++ ..._with_free_shipping_by_coupon_rollback.php | 8 +++ 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon_rollback.php diff --git a/app/code/Magento/Sales/Block/Adminhtml/Totals.php b/app/code/Magento/Sales/Block/Adminhtml/Totals.php index 83b155293c2b9..3f08dc48d38d1 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Totals.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Totals.php @@ -5,6 +5,8 @@ */ namespace Magento\Sales\Block\Adminhtml; +use Magento\Sales\Model\Order; + class Totals extends \Magento\Sales\Block\Order\Totals { /** @@ -67,12 +69,16 @@ protected function _initTotals() if (!$this->getSource()->getIsVirtual() && ((double)$this->getSource()->getShippingAmount() || $this->getSource()->getShippingDescription()) ) { + $shippingLabel = __('Shipping & Handling'); + if ($this->isHasFreeShipping($this->getSource()) && $this->getSource()->getDiscountDescription()) { + $shippingLabel .= sprintf(' (%s)', $this->getSource()->getDiscountDescription()); + } $this->_totals['shipping'] = new \Magento\Framework\DataObject( [ 'code' => 'shipping', 'value' => $this->getSource()->getShippingAmount(), 'base_value' => $this->getSource()->getBaseShippingAmount(), - 'label' => __('Shipping & Handling'), + 'label' => $shippingLabel, ] ); } @@ -109,4 +115,23 @@ protected function _initTotals() return $this; } + + /** + * Availability of free shipping in at least one order item + * + * @param Order $order + * @return bool + */ + private function isHasFreeShipping(Order $order): bool + { + $isActive = false; + foreach ($order->getItems() as $orderItem) { + if ($orderItem->getFreeShipping() === '1') { + $isActive = true; + break; + } + } + + return $isActive; + } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php new file mode 100644 index 0000000000000..a77676e64a331 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Sales\Block\Adminhtml; + +use Magento\Framework\View\LayoutInterface; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\OrderFactory; + +/** + * Test class for \Magento\Sales\Block\Adminhtml\Totals + */ +class TotalsTest extends \Magento\TestFramework\TestCase\AbstractBackendController +{ + /** @var LayoutInterface */ + protected $_layout; + + /** @var Totals */ + protected $_block; + + /** @var OrderFactory */ + private $orderFactory; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + $this->_layout = $this->_objectManager->get(LayoutInterface::class); + $this->_block = $this->_layout->createBlock(Totals::class, 'totals_block'); + $this->orderFactory = $this->_objectManager->get(OrderFactory::class); + } + + /** + * @magentoDataFixture Magento/Sales/_files/order_with_free_shipping_by_coupon.php + */ + public function testShowShippingCoupon() + { + /** @var Order $order */ + $order = $this->orderFactory->create(); + $order->loadByIncrementId('100000001'); + + $this->_block->setOrder($order); + $this->_block->toHtml(); + + $shippingTotal = $this->_block->getTotal('shipping'); + $this->assertNotFalse($shippingTotal, 'Shipping method is absent on the total\'s block.'); + $this->assertContains('1234567890', $shippingTotal->getLabel(), 'Coupon code is absent in the shipping method label name.'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon.php new file mode 100644 index 0000000000000..04e39ae3e462c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Item as OrderItem; + +require __DIR__ . '/../../../Magento/Sales/_files/order.php'; +/** @var \Magento\Catalog\Model\Product $product */ + +/** @var OrderItem $orderItem */ +$orderItem = $objectManager->create(OrderItem::class); +$orderItem->setProductId($product->getId()) + ->setQtyOrdered(2) + ->setBasePrice($product->getPrice()) + ->setPrice($product->getPrice()) + ->setRowTotal($product->getPrice()) + ->setProductType('simple') + ->setName($product->getName()) + ->setFreeShipping('1'); + +/** @var Order $order */ +$order->setShippingDescription('Flat Rate - Fixed') + ->setShippingAmount(0) + ->setCouponCode('1234567890') + ->setDiscountDescription('1234567890') + ->addItem($orderItem); + +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->create(OrderRepositoryInterface::class); +$orderRepository->save($order); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon_rollback.php new file mode 100644 index 0000000000000..1fb4b4636ab29 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon_rollback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require 'default_rollback.php'; From 01e7e08bf92afb696105fdfd3957c97fa316198b Mon Sep 17 00:00:00 2001 From: Roman Zhupanyn <roma.dj.elf@gmail.com> Date: Wed, 27 Mar 2019 09:52:34 +0200 Subject: [PATCH 27/36] MAGETWO-98680: Cart Price Rule code is absent on "view Order/Invoice" Admin page if had been used for Free Shipping --- app/code/Magento/Sales/Block/Adminhtml/Totals.php | 5 +++++ .../testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Block/Adminhtml/Totals.php b/app/code/Magento/Sales/Block/Adminhtml/Totals.php index 3f08dc48d38d1..f26df0946168a 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Totals.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Totals.php @@ -7,6 +7,11 @@ use Magento\Sales\Model\Order; +/** + * Adminhtml sales totals block + * + * @package Magento\Sales\Block\Adminhtml + */ class Totals extends \Magento\Sales\Block\Order\Totals { /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php index a77676e64a331..091b8e3f2b72c 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php @@ -48,6 +48,10 @@ public function testShowShippingCoupon() $shippingTotal = $this->_block->getTotal('shipping'); $this->assertNotFalse($shippingTotal, 'Shipping method is absent on the total\'s block.'); - $this->assertContains('1234567890', $shippingTotal->getLabel(), 'Coupon code is absent in the shipping method label name.'); + $this->assertContains( + '1234567890', + $shippingTotal->getLabel(), + 'Coupon code is absent in the shipping method label name.' + ); } } From ed989a0c8843986ad29117915a5a74cb2523f166 Mon Sep 17 00:00:00 2001 From: Aliaksei Yakimovich2 <aliaksei_yakimovich2@epam.com> Date: Wed, 27 Mar 2019 12:58:37 +0300 Subject: [PATCH 28/36] MAGETWO-70232: Import customizable options adds it to another product if same SKU is filled - Fixed unit test; --- app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 6b2f3aba12e7a..9cb6cda4d0a09 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -60,7 +60,7 @@ public function execute($entity, $arguments = []) } } if ($options) { - $this->processOptionsSaving($options, $entity->dataHasChangedFor('sku'), $entity->getSku()); + $this->processOptionsSaving($options, (bool)$entity->dataHasChangedFor('sku'), (string)$entity->getSku()); } return $entity; From 0d58dec4219792b6c5919ca9a445ae4cf5c06755 Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina <veronika_kurochkina@epam.com> Date: Wed, 27 Mar 2019 14:49:06 +0300 Subject: [PATCH 29/36] MAGETWO-65232: Product name does not display special characters properly - Updated automated test script. --- .../Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml index 47fad10977b7c..76893f1c7deb3 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml @@ -52,7 +52,7 @@ <waitForPageLoad stepKey="waitForInvoicePageLoad"/> </actionGroup> - <actionGroup name="clearInvoicesGridFilers"> + <actionGroup name="clearInvoicesGridFilters"> <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters" /> From 2d8404d59dafd97c4881dfb1529deb6ce3d8e0f6 Mon Sep 17 00:00:00 2001 From: Roman Zhupanyn <roma.dj.elf@gmail.com> Date: Thu, 28 Mar 2019 12:04:25 +0200 Subject: [PATCH 30/36] MAGETWO-98680: Cart Price Rule code is absent on "view Order/Invoice" Admin page if had been used for Free Shipping --- app/code/Magento/Sales/Block/Adminhtml/Totals.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Block/Adminhtml/Totals.php b/app/code/Magento/Sales/Block/Adminhtml/Totals.php index f26df0946168a..ccc05a54676d9 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Totals.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Totals.php @@ -75,7 +75,7 @@ protected function _initTotals() $this->getSource()->getShippingDescription()) ) { $shippingLabel = __('Shipping & Handling'); - if ($this->isHasFreeShipping($this->getSource()) && $this->getSource()->getDiscountDescription()) { + if ($this->isHasFreeShipping($this->getOrder()) && $this->getSource()->getDiscountDescription()) { $shippingLabel .= sprintf(' (%s)', $this->getSource()->getDiscountDescription()); } $this->_totals['shipping'] = new \Magento\Framework\DataObject( From 975872e4a5cd8b3b8642e22ff8260e5ddb830f74 Mon Sep 17 00:00:00 2001 From: Roman Zhupanyn <roma.dj.elf@gmail.com> Date: Thu, 28 Mar 2019 15:09:29 +0200 Subject: [PATCH 31/36] MAGETWO-98680: Cart Price Rule code is absent on "view Order/Invoice" Admin page if had been used for Free Shipping --- .../Magento/Sales/Block/Adminhtml/Totals.php | 14 ++++++-------- .../Magento/Sales/Block/Adminhtml/TotalsTest.php | 16 +++++++++------- .../order_with_free_shipping_by_coupon.php | 1 + 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Sales/Block/Adminhtml/Totals.php b/app/code/Magento/Sales/Block/Adminhtml/Totals.php index ccc05a54676d9..8172a3c0db4ad 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Totals.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Totals.php @@ -9,8 +9,6 @@ /** * Adminhtml sales totals block - * - * @package Magento\Sales\Block\Adminhtml */ class Totals extends \Magento\Sales\Block\Order\Totals { @@ -75,7 +73,7 @@ protected function _initTotals() $this->getSource()->getShippingDescription()) ) { $shippingLabel = __('Shipping & Handling'); - if ($this->isHasFreeShipping($this->getOrder()) && $this->getSource()->getDiscountDescription()) { + if ($this->isFreeShipping($this->getOrder()) && $this->getSource()->getDiscountDescription()) { $shippingLabel .= sprintf(' (%s)', $this->getSource()->getDiscountDescription()); } $this->_totals['shipping'] = new \Magento\Framework\DataObject( @@ -127,16 +125,16 @@ protected function _initTotals() * @param Order $order * @return bool */ - private function isHasFreeShipping(Order $order): bool + private function isFreeShipping(Order $order): bool { - $isActive = false; + $isFreeShipping = false; foreach ($order->getItems() as $orderItem) { - if ($orderItem->getFreeShipping() === '1') { - $isActive = true; + if ($orderItem->getFreeShipping() == '1') { + $isFreeShipping = true; break; } } - return $isActive; + return $isFreeShipping; } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php index 091b8e3f2b72c..1125fc1730718 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/TotalsTest.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Sales\Block\Adminhtml; use Magento\Framework\View\LayoutInterface; @@ -15,10 +17,10 @@ class TotalsTest extends \Magento\TestFramework\TestCase\AbstractBackendController { /** @var LayoutInterface */ - protected $_layout; + private $layout; /** @var Totals */ - protected $_block; + private $block; /** @var OrderFactory */ private $orderFactory; @@ -29,8 +31,8 @@ class TotalsTest extends \Magento\TestFramework\TestCase\AbstractBackendControll protected function setUp() { parent::setUp(); - $this->_layout = $this->_objectManager->get(LayoutInterface::class); - $this->_block = $this->_layout->createBlock(Totals::class, 'totals_block'); + $this->layout = $this->_objectManager->get(LayoutInterface::class); + $this->block = $this->layout->createBlock(Totals::class, 'totals_block'); $this->orderFactory = $this->_objectManager->get(OrderFactory::class); } @@ -43,10 +45,10 @@ public function testShowShippingCoupon() $order = $this->orderFactory->create(); $order->loadByIncrementId('100000001'); - $this->_block->setOrder($order); - $this->_block->toHtml(); + $this->block->setOrder($order); + $this->block->toHtml(); - $shippingTotal = $this->_block->getTotal('shipping'); + $shippingTotal = $this->block->getTotal('shipping'); $this->assertNotFalse($shippingTotal, 'Shipping method is absent on the total\'s block.'); $this->assertContains( '1234567890', diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon.php index 04e39ae3e462c..57ccffadaa4d0 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_free_shipping_by_coupon.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); use Magento\Sales\Api\OrderRepositoryInterface; use Magento\Sales\Model\Order; From e71d8e80c7373ac5adcc6a0b97cfd5ca17761233 Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina <veronika_kurochkina@epam.com> Date: Fri, 29 Mar 2019 16:58:11 +0300 Subject: [PATCH 32/36] MAGETWO-65232: Product name does not display special characters properly - Updated automated test script. --- .../Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 060720ab007eb..85c54e0942c74 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -65,6 +65,10 @@ </actionGroup> <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> + + <magentoCLI stepKey="reindex" command="indexer:reindex"/> + <magentoCLI stepKey="flushCache" command="cache:flush"/> + <actionGroup ref="logout" stepKey="logout"/> </after> From fde1788926782f91da6074aa98f7128f3553c0a6 Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina <veronika_kurochkina@epam.com> Date: Mon, 1 Apr 2019 18:18:49 +0300 Subject: [PATCH 33/36] MAGETWO-65232: Product name does not display special characters properly - Fix static --- .../Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php | 2 ++ .../Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php | 2 ++ .../Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php index 64e569977429c..48934e24a3795 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php @@ -70,6 +70,7 @@ public function draw() // draw Product name $lines[0] = [ [ + // phpcs:ignore Magento2.Functions.DiscouragedFunction 'text' => $this->string->split(html_entity_decode($item->getName()), 35, true, true), 'feed' => 35 ] @@ -77,6 +78,7 @@ public function draw() // draw SKU $lines[0][] = [ + // phpcs:ignore Magento2.Functions.DiscouragedFunction 'text' => $this->string->split(html_entity_decode($this->getSku($item)), 17), 'feed' => 255, 'align' => 'right', diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php index 4a77053521e4a..23c2c00daadc3 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php @@ -70,6 +70,7 @@ public function draw() // draw Product name $lines[0] = [ [ + // phpcs:ignore Magento2.Functions.DiscouragedFunction 'text' => $this->string->split(html_entity_decode($item->getName()), 35, true, true), 'feed' => 35 ] @@ -77,6 +78,7 @@ public function draw() // draw SKU $lines[0][] = [ + // phpcs:ignore Magento2.Functions.DiscouragedFunction 'text' => $this->string->split(html_entity_decode($this->getSku($item)), 17), 'feed' => 290, 'align' => 'right', diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php index fd18830e45b6e..a88b508ba0789 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php @@ -69,6 +69,7 @@ public function draw() // draw Product name $lines[0] = [ [ + // phpcs:ignore Magento2.Functions.DiscouragedFunction 'text' => $this->string->split(html_entity_decode($item->getName()), 60, true, true), 'feed' => 100 ] @@ -79,6 +80,7 @@ public function draw() // draw SKU $lines[0][] = [ + // phpcs:ignore Magento2.Functions.DiscouragedFunction 'text' => $this->string->split(html_entity_decode($this->getSku($item)), 25), 'feed' => 565, 'align' => 'right', From 7b6a620b7c3b1b2faf12a190398d7d2f2e3a9644 Mon Sep 17 00:00:00 2001 From: serhii balko <serhii.balko@transoftgroup.com> Date: Tue, 2 Apr 2019 10:52:23 +0300 Subject: [PATCH 34/36] MAGETWO-98335: Unable to find product on product grid page using store view level attribute --- .../Catalog/Ui/DataProvider/Product/ProductCollection.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php index 37ac5c85c6f67..e5451c8e49847 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php @@ -13,6 +13,8 @@ * Collection which is used for rendering product list in the backend. * * Used for product grid and customizes behavior of the default Product collection for grid needs. + * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class ProductCollection extends \Magento\Catalog\Model\ResourceModel\Product\Collection { From cb0ed4012a022ad32045d80e7e3f7780b4072ba0 Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina <veronika_kurochkina@epam.com> Date: Tue, 2 Apr 2019 11:45:51 +0300 Subject: [PATCH 35/36] MAGETWO-58226: Calendar Custom Options are displayed broken on Storefront if JS validation is performed - Fix static --- .../Magento/Catalog/Test/Block/Product/View/CustomOptions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index 99ff9b73b92eb..4e8e0f97d70d5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -149,6 +149,7 @@ public function getOptions(FixtureInterface $product) foreach ($dataOptions as $option) { $title = $option['title']; if (!isset($listCustomOptions[$title])) { + // phpcs:ignore Magento2.Exceptions.DirectThrow throw new \Exception("Can't find option: \"{$title}\""); } From 3eb35194059903766b5eb7bb14e7d8d1c67e4f5f Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina <veronika_kurochkina@epam.com> Date: Tue, 2 Apr 2019 11:58:48 +0300 Subject: [PATCH 36/36] MAGETWO-65232: Product name does not display special characters properly - Updated automated test script. --- .../Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml | 2 -- .../Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml | 9 --------- 2 files changed, 11 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 85c54e0942c74..8316f54c15a52 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -65,10 +65,8 @@ </actionGroup> <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> - <magentoCLI stepKey="reindex" command="indexer:reindex"/> <magentoCLI stepKey="flushCache" command="cache:flush"/> - <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml index 7c971f3b04457..b90bac7e0881b 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml @@ -19,18 +19,15 @@ <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> </actionGroup> - <!--Check that product is in invoice items--> <actionGroup name="seeProductInInvoiceItems"> <arguments> @@ -38,7 +35,6 @@ </arguments> <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> </actionGroup> - <!--Admin Fast Create Invoice--> <actionGroup name="adminFastCreateInvoice"> <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> @@ -50,26 +46,22 @@ <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> <waitForPageLoad stepKey="waitForInvoicePageLoad"/> </actionGroup> - <actionGroup name="clearInvoicesGridFilters"> <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters" /> <waitForPageLoad stepKey="waitInvoicesGrid"/> </actionGroup> - <actionGroup name="goToInvoiceIntoOrder"> <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> </actionGroup> - <actionGroup name="StartCreateInvoiceFromOrderPage"> <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> </actionGroup> - <actionGroup name="SubmitInvoice"> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForMessageAppears"/> @@ -77,7 +69,6 @@ <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> </actionGroup> - <!--Filter invoices by order id --> <actionGroup name="filterInvoiceGridByOrderId"> <arguments>