From 0fc55c24baff3a0644fe165c82d585bc0c26c7f9 Mon Sep 17 00:00:00 2001 From: Kostyantyn Alexeyev Date: Wed, 27 Dec 2017 15:25:34 +0200 Subject: [PATCH 001/528] MAGETWO-71381: Widget tied with cart price rule displays even when rule was not applied --- .../Test/Block/Cart/DiscountCodes.php | 24 ++++++++++- .../TestStep/ApplySalesRuleOnFrontendStep.php | 16 ++++++- .../CancelSalesRuleOnFrontendStep.php | 43 +++++++++++++++++++ .../Tab/WidgetInstanceType/GenericPages.xml | 8 +++- .../AbstractCreateWidgetEntityTest.php | 39 ++++++++++++++++- 5 files changed, 123 insertions(+), 7 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/DiscountCodes.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/DiscountCodes.php index bac12778f982c..a28fd6337565d 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/DiscountCodes.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/DiscountCodes.php @@ -37,14 +37,21 @@ class DiscountCodes extends Form protected $couponCode = '#coupon_code'; /** - * Click apply button selector + * Locator for "Apply Discount" button. * * @var string */ protected $applyButton = '.action.apply'; /** - * Enter discount code and click apply button + * Locator for "Cancel Coupon" button. + * + * @var string + */ + protected $cancelButton = '.action.cancel'; + + /** + * Enter Discount Code and click "Apply Discount" button. * * @param string $code * @return void @@ -57,4 +64,17 @@ public function applyCouponCode($code) $this->_rootElement->find($this->couponCode, Locator::SELECTOR_CSS)->setValue($code); $this->_rootElement->find($this->applyButton, Locator::SELECTOR_CSS)->click(); } + + /** + * Click "Cancel Coupon" button. + * + * @return void + */ + public function cancelCouponCode() + { + if (!$this->_rootElement->find($this->formWrapper)->isVisible()) { + $this->_rootElement->find($this->openForm)->click(); + } + $this->_rootElement->find($this->cancelButton)->click(); + } } diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php index ae39c162952bf..b5e222020bf43 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php @@ -29,15 +29,24 @@ class ApplySalesRuleOnFrontendStep implements TestStepInterface */ protected $salesRule; + /** + * Sales Rule Discount Code. + * + * @var SalesRule + */ + protected $couponCode; + /** * @constructor * @param CheckoutCart $checkoutCart * @param SalesRule $salesRule + * @param string $couponCode */ - public function __construct(CheckoutCart $checkoutCart, SalesRule $salesRule = null) + public function __construct(CheckoutCart $checkoutCart, SalesRule $salesRule = null, $couponCode = null) { $this->checkoutCart = $checkoutCart; $this->salesRule = $salesRule; + $this->couponCode = $couponCode; } /** @@ -51,5 +60,10 @@ public function run() $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($this->salesRule->getCouponCode()); $this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals(); } + + if ($this->couponCode !== null) { + $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($this->couponCode); + $this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals(); + } } } diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php new file mode 100644 index 0000000000000..9e884e59f0b0f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php @@ -0,0 +1,43 @@ +checkoutCart = $checkoutCart; + } + + /** + * Apply coupon before one page checkout. + * + * @return void + */ + public function run() + { + $this->checkoutCart->getDiscountCodesBlock()->cancelCouponCode(); + $this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml index e2a917673a40e..2bd2ae01f943b 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml @@ -11,12 +11,16 @@ .page_group_select optgroupselect + + #pages_0 #layout_handle + select + - .block_reference select + #pages_0 .block_reference select select diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php index 5cff464b6b937..f9e7ba18af5ea 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php @@ -6,17 +6,26 @@ namespace Magento\Widget\Test\TestCase; +use Magento\Mtf\TestStep\TestStepFactory; use Magento\Widget\Test\Fixture\Widget; use Magento\Widget\Test\Page\Adminhtml\WidgetInstanceEdit; use Magento\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; use Magento\Widget\Test\Page\Adminhtml\WidgetInstanceNew; use Magento\Mtf\TestCase\Injectable; +use Magento\PageCache\Test\Page\Adminhtml\AdminCache; /** * Test Creation for New Instance of WidgetEntity. */ abstract class AbstractCreateWidgetEntityTest extends Injectable { + /** + * Factory for Test Steps. + * + * @var TestStepFactory + */ + protected $testStep; + /** * WidgetInstanceIndex page. * @@ -38,31 +47,57 @@ abstract class AbstractCreateWidgetEntityTest extends Injectable */ protected $widgetInstanceEdit; + /** + * "Cache Management" Admin panel page. + * + * @var AdminCache + */ + protected $cachePage; + /** * Injection data. * * @param WidgetInstanceIndex $widgetInstanceIndex * @param WidgetInstanceNew $widgetInstanceNew * @param WidgetInstanceEdit $widgetInstanceEdit + * @param AdminCache $adminCache + * @param TestStepFactory $testStepFactory * @return void */ public function __inject( WidgetInstanceIndex $widgetInstanceIndex, WidgetInstanceNew $widgetInstanceNew, - WidgetInstanceEdit $widgetInstanceEdit + WidgetInstanceEdit $widgetInstanceEdit, + AdminCache $adminCache, + TestStepFactory $testStepFactory ) { $this->widgetInstanceIndex = $widgetInstanceIndex; $this->widgetInstanceNew = $widgetInstanceNew; $this->widgetInstanceEdit = $widgetInstanceEdit; + $this->cachePage = $adminCache; + $this->testStep = $testStepFactory; } /** - * Delete all widgets. + * Delete all Widgets & flush the Cache. * * @return void */ public function tearDown() { $this->objectManager->create('Magento\Widget\Test\TestStep\DeleteAllWidgetsStep')->run(); + $this->flushCache(); + } + + /** + * Flush Magento Cache in Admin panel. + * + * @return void + */ + protected function flushCache() + { + $this->cachePage->open(); + $this->cachePage->getActionsBlock()->flushMagentoCache(); + $this->cachePage->getMessagesBlock()->waitSuccessMessage(); } } From 73ca3548ed5ebcee3b5f0bb08bec48094e1be277 Mon Sep 17 00:00:00 2001 From: Jeroen Date: Wed, 14 Feb 2018 12:18:29 +0100 Subject: [PATCH 002/528] Update Store getConfig() to respect valid false return value Using a config setting Yes/No will return string '0' when No is saved. Method will therefore fetch default config value because '0' equals false. --- app/code/Magento/Store/Model/Store.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index 823cab5622702..2f93699e3993f 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -531,8 +531,8 @@ public function setName($name) public function getConfig($path) { $data = $this->_config->getValue($path, ScopeInterface::SCOPE_STORE, $this->getCode()); - if (!$data) { - $data = $this->_config->getValue($path, ScopeConfigInterface::SCOPE_TYPE_DEFAULT); + if ($data === null) { + $data = $this->_config->getValue($path); } return $data === false ? null : $data; } From 2239f3d21bb1ce9cee807a28cc4a2861b0361ab7 Mon Sep 17 00:00:00 2001 From: Alessandro Pagnin Date: Tue, 20 Feb 2018 20:43:24 +0100 Subject: [PATCH 003/528] [backport] Category collection now use getStoreId and not directly the store manager --- .../ResourceModel/Category/Collection.php | 2 +- .../Category/Collection/UrlRewriteTest.php | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php index 325d8ceee0d39..38831ed9138f1 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php @@ -311,7 +311,7 @@ public function joinUrlRewrite() ['request_path'], sprintf( '{{table}}.is_autogenerated = 1 AND {{table}}.store_id = %d AND {{table}}.entity_type = \'%s\'', - $this->_storeManager->getStore()->getId(), + $this->getStoreId(), CategoryUrlRewriteGenerator::ENTITY_TYPE ), 'left' diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php new file mode 100644 index 0000000000000..7dec04fceaef6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php @@ -0,0 +1,39 @@ +_model = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Category\Collection::class) + ->disableOriginalConstructor() + ->setMethodsExcept(['joinUrlRewrite', 'setStoreId', 'getStoreId']) + ->getMock(); + } + + public function testStoreIdUsedByUrlRewrite() + { + $cond = '{{table}}.is_autogenerated = 1 AND {{table}}.store_id = 100 AND {{table}}.entity_type = \'category\''; + $this->_model->expects($this->once()) + ->method('joinTable') + ->with( + $this->anything(), + $this->anything(), + $this->anything(), + $this->equalTo($cond), + $this->anything() + ); + $this->_model->setStoreId(100); + $this->_model->joinUrlRewrite(); + } +} From 6f556ff03d8161686e4a49217342756ebd77d6f1 Mon Sep 17 00:00:00 2001 From: Alessandro Pagnin Date: Tue, 20 Feb 2018 21:03:56 +0100 Subject: [PATCH 004/528] fix to wrong php unit class name --- .../Model/ResourceModel/Category/Collection/UrlRewriteTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php index 7dec04fceaef6..4b1e55255c666 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php @@ -6,7 +6,7 @@ namespace Magento\Catalog\Test\Unit\Model\ResourceModel\Category\Collection; -class UrlRewriteTest extends \PHPUnit\Framework\TestCase +class UrlRewriteTest extends \PHPUnit_Framework_TestCase { /** * @var \PHPUnit_Framework_MockObject_MockObject From 915be6ea120a8e46922250459f63d077ae8675b0 Mon Sep 17 00:00:00 2001 From: Alessandro Pagnin Date: Mon, 26 Feb 2018 22:49:45 +0100 Subject: [PATCH 005/528] fix test to comply with older versions of phpunit --- .../Model/ResourceModel/Category/Collection/UrlRewriteTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php index 4b1e55255c666..d3b3ce05ee4b8 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php @@ -17,7 +17,7 @@ protected function setUp() { $this->_model = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Category\Collection::class) ->disableOriginalConstructor() - ->setMethodsExcept(['joinUrlRewrite', 'setStoreId', 'getStoreId']) + ->setMethods(['joinTable']) ->getMock(); } From 5a379fcc42abbb92c6211e32e1c8f045f37f5ad5 Mon Sep 17 00:00:00 2001 From: Ankur Raiyani Date: Tue, 27 Feb 2018 12:44:54 +0530 Subject: [PATCH 006/528] Corrected Invoice Grid Column Subtotal value to copy from. Changed from sales_order to sales_invoice --- app/code/Magento/Sales/etc/di.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/etc/di.xml b/app/code/Magento/Sales/etc/di.xml index 8b0e5c5444503..236c3a90cd5b2 100644 --- a/app/code/Magento/Sales/etc/di.xml +++ b/app/code/Magento/Sales/etc/di.xml @@ -669,7 +669,7 @@ BillingAddressAggregator ShippingAddressAggregator sales_order.shipping_description - sales_order.base_subtotal + sales_invoice.base_subtotal sales_order.base_shipping_amount sales_invoice.base_grand_total sales_invoice.grand_total From 71bb94f97593f7efec2275a743f1aff07e0d5524 Mon Sep 17 00:00:00 2001 From: Dmytro Vilchynskyi Date: Thu, 1 Mar 2018 14:00:24 +0200 Subject: [PATCH 007/528] MAGETWO-71381: Banner tied with cart price rule displays even when rule was not applied - fixed Static tests --- .../SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php index 9e884e59f0b0f..bba48acd667f5 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CancelSalesRuleOnFrontendStep.php @@ -1,6 +1,6 @@ Date: Thu, 1 Mar 2018 16:00:04 +0200 Subject: [PATCH 008/528] MAGETWO-71381: Banner tied with cart price rule displays even when rule was not applied - fixed MTF FATs --- .../Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml index 65d374e82e7d4..aa6844834da4b 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/GenericPages.xml @@ -12,15 +12,15 @@ optgroupselect - #pages_0 #layout_handle + #layout_handle select - #pages_0 .block_reference select + .block_reference select select From 1bc84e6a167059083e5ae8fe1b7d7eff27cf5ace Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Fri, 2 Mar 2018 20:45:13 +0200 Subject: [PATCH 009/528] MAGETWO-84849: Update Changelog based on delivered scope --- CHANGELOG.md | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44844f62b6449..bc8186b776232 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,81 @@ +2.1.13 +============= +* GitHub issues: + * [#9869](https://github.com/magento/magento2/issues/9869) -- datetime type product attribute showing current date (fixed in [magento/magento2#12033](https://github.com/magento/magento2/pull/12033)) + * [#10765](https://github.com/magento/magento2/issues/10765) -- Export data from grid not adding custom rendered data magento2 (fixed in [magento/magento2#12373](https://github.com/magento/magento2/pull/12373)) + * [#9410](https://github.com/magento/magento2/issues/9410) -- Impossible to add swatch options via Service Contracts if there is no existing swatch option for attribute (fixed in [magento/magento2#12043](https://github.com/magento/magento2/pull/12043)) + * [#10707](https://github.com/magento/magento2/issues/10707) -- Create attribute option via API for swatch attribute fails (fixed in [magento/magento2#12043](https://github.com/magento/magento2/pull/12043)) + * [#10737](https://github.com/magento/magento2/issues/10737) -- Can't import attribute option over API if option is 'visual swatch' (fixed in [magento/magento2#12043](https://github.com/magento/magento2/pull/12043)) + * [#11032](https://github.com/magento/magento2/issues/11032) -- Unable to add new options to swatch attribute (fixed in [magento/magento2#12043](https://github.com/magento/magento2/pull/12043)) + * [#10210](https://github.com/magento/magento2/issues/10210) -- Transport variable can not be altered in email_invoice_set_template_vars_before Event (fixed in [magento/magento2#12135](https://github.com/magento/magento2/pull/12135)) + * [#11341](https://github.com/magento/magento2/issues/11341) -- Attribute category_ids issue (fixed in [magento/magento2#11807](https://github.com/magento/magento2/pull/11807)) + * [#11825](https://github.com/magento/magento2/issues/11825) -- 2.1.9 Item not added to the Wishlist if the user is not logged at the moment he click on the button to add it. (fixed in [magento/magento2#12041](https://github.com/magento/magento2/pull/12041)) + * [#11908](https://github.com/magento/magento2/issues/11908) -- Adding to wishlist doesn't work when not logged in (fixed in [magento/magento2#12041](https://github.com/magento/magento2/pull/12041)) + * [#9768](https://github.com/magento/magento2/issues/9768) -- Admin dashboard Most Viewed Products Tab only gives default attribute set's products (fixed in [magento/magento2#12137](https://github.com/magento/magento2/pull/12137)) + * [#11409](https://github.com/magento/magento2/issues/11409) -- Too many password reset requests even when disabled in settings (fixed in [magento/magento2#11436](https://github.com/magento/magento2/pull/11436)) + * [#8009](https://github.com/magento/magento2/issues/8009) -- Magento 2.1.3 out of stock associated products to configurable are not full page cache cleaned (fixed in [magento/magento2#12548](https://github.com/magento/magento2/pull/12548)) + * [#12268](https://github.com/magento/magento2/issues/12268) -- Gallery issues on configurable product page (fixed in [magento/magento2#12558](https://github.com/magento/magento2/pull/12558)) + * [#8069](https://github.com/magento/magento2/issues/8069) -- Saving Category with existing image causes an exception (fixed in [magento/magento2#12368](https://github.com/magento/magento2/pull/12368)) + * [#6770](https://github.com/magento/magento2/issues/6770) -- M2.1.1 : Re-saving a product attribute with a different name than it's code results in an error (fixed in [magento/magento2#11618](https://github.com/magento/magento2/pull/11618)) + * [#12627](https://github.com/magento/magento2/issues/12627) -- Referer is not added to login url in checkout config (fixed in [magento/magento2#12629](https://github.com/magento/magento2/pull/12629)) + * [#8415](https://github.com/magento/magento2/issues/8415) -- Content Block Administration fails when I delete more than one record (fixed in [magento/magento2#12840](https://github.com/magento/magento2/pull/12840)) + * [#9243](https://github.com/magento/magento2/issues/9243) -- Upgrade ZF components. Zend_Service (fixed in [magento/magento2#12958](https://github.com/magento/magento2/pull/12958)) + * [#10812](https://github.com/magento/magento2/issues/10812) -- htaccess Options override (fixed in [magento/magento2#12959](https://github.com/magento/magento2/pull/12959)) + * [#7441](https://github.com/magento/magento2/issues/7441) -- Configurable attribute options are not sorted (fixed in [magento/magento2#12962](https://github.com/magento/magento2/pull/12962)) + * [#10682](https://github.com/magento/magento2/issues/10682) -- Meta description and keywords transform to html entities for non latin/cyrilic characters in category and product pages (fixed in [magento/magento2#12956](https://github.com/magento/magento2/pull/12956)) + * [#9969](https://github.com/magento/magento2/issues/9969) -- Cancel order and restore quote methods increase stocks twice (fixed in [magento/magento2#12952](https://github.com/magento/magento2/pull/12952)) + * [#2156](https://github.com/magento/magento2/issues/2156) -- Why does \Magento\Translation\Model\Js\DataProvider use \Magento\Framework\Phrase\Renderer\Translate, not \Magento\Framework\Phrase\Renderer\Composite? (fixed in [magento/magento2#12954](https://github.com/magento/magento2/pull/12954)) + * [#12967](https://github.com/magento/magento2/issues/12967) -- Undeclared dependency magento/zendframework1 by magento/framework (fixed in [magento/magento2#12991](https://github.com/magento/magento2/pull/12991)) + * [#12393](https://github.com/magento/magento2/issues/12393) -- Attribute with "Catalog Input Type for Store Owner" equal "Fixed Product Tax" for Multi-store (fixed in [magento/magento2#13020](https://github.com/magento/magento2/pull/13020)) + * [#10168](https://github.com/magento/magento2/issues/10168) -- Coupon codes not showing in invoice (fixed in [magento/magento2#13261](https://github.com/magento/magento2/pull/13261)) + * [#8621](https://github.com/magento/magento2/issues/8621) -- M2.1 Multishipping Checkout step New Address - Old State is saved when country is changed (fixed in [magento/magento2#13367](https://github.com/magento/magento2/pull/13367)) + * [#10738](https://github.com/magento/magento2/issues/10738) -- Empty attribute label is displayed on product page when other language used. (fixed in [magento/magento2#13532](https://github.com/magento/magento2/pull/13532)) + * [#6207](https://github.com/magento/magento2/issues/6207) -- Checkbox IDs for Terms and Conditions should be unique in Checkout (fixed in [magento/magento2#13543](https://github.com/magento/magento2/pull/13543)) + * [#10565](https://github.com/magento/magento2/issues/10565) -- Magento ver. 2.1.8 New Product with Custom attribute set not working (fixed in [magento/magento2#13549](https://github.com/magento/magento2/pull/13549)) + * [#6457](https://github.com/magento/magento2/issues/6457) -- Expired special_price is still shown for configurable products when no variant is selected (fixed in [magento/magento2#13490](https://github.com/magento/magento2/pull/13490)) + * [#6729](https://github.com/magento/magento2/issues/6729) -- Configurable product old price with taxes displayed wrong (fixed in [magento/magento2#13490](https://github.com/magento/magento2/pull/13490)) + * [#7362](https://github.com/magento/magento2/issues/7362) -- Special price vigency for configurable childs (simple products associated) doesn´t work (fixed in [magento/magento2#13490](https://github.com/magento/magento2/pull/13490)) +* GitHub pull requests: + * [magento/magento2#12033](https://github.com/magento/magento2/pull/12033) -- Backport 2.1-develop] Fix datetime type product that show current date when is empty in grids (by @enriquei4) + * [magento/magento2#12373](https://github.com/magento/magento2/pull/12373) -- #10765 Export data from grid not adding custom rendered data magento2 (by @Zefiryn) + * [magento/magento2#12043](https://github.com/magento/magento2/pull/12043) -- [Backport 2.1] Add swatch option: Prevent loosing data and default value if data is not populated via adminhtml (by @gomencal) + * [magento/magento2#12135](https://github.com/magento/magento2/pull/12135) -- 10210: Transport variable can not be altered in email_invoice_set_template_vars_before Event (backport MAGETWO-69482 to 2.1). (by @RomaKis) + * [magento/magento2#11807](https://github.com/magento/magento2/pull/11807) -- [backport 2.1] Attribute category_ids issue #11389 (by @manuelson) + * [magento/magento2#12246](https://github.com/magento/magento2/pull/12246) -- Clear `mage-cache-sessid` cookie on Ajax Login (by @pmclain) + * [magento/magento2#12041](https://github.com/magento/magento2/pull/12041) -- [Backport 2.1] #11825: Generate new FormKey and replace for oldRequestParams Wishlist (by @osrecio) + * [magento/magento2#12137](https://github.com/magento/magento2/pull/12137) -- 9768: Admin dashboard Most Viewed Products Tab only gives default attribute set's products (backport for 2.1) (by @RomaKis) + * [magento/magento2#12519](https://github.com/magento/magento2/pull/12519) -- Duplicate array key (by @lfluvisotto) + * [magento/magento2#11860](https://github.com/magento/magento2/pull/11860) -- [Backport 2.1-develop] CMS Page - Force validate layout update xml in production mode when saving CMS Page - Handle layout update xml validation exceptions (by @adrian-martinez-interactiv4) + * [magento/magento2#12522](https://github.com/magento/magento2/pull/12522) -- PR#12466 [BACKPORT 2.1] (by @atishgoswami) + * [magento/magento2#12321](https://github.com/magento/magento2/pull/12321) -- Trying to get data from non existent products (by @angelo983) + * [magento/magento2#11436](https://github.com/magento/magento2/pull/11436) -- [Backport 2.1-develop] #11409: Too many password reset requests even when disabled in settings (by @adrian-martinez-interactiv4) + * [magento/magento2#12548](https://github.com/magento/magento2/pull/12548) -- Fixes #8009 (by @ajpevers) + * [magento/magento2#12050](https://github.com/magento/magento2/pull/12050) -- [2.1] - Add command to view mview state and queue (by @convenient) + * [magento/magento2#12558](https://github.com/magento/magento2/pull/12558) -- [Backport-2.1] Added namespace to product videos fotorama events (by @roma84) + * [magento/magento2#12579](https://github.com/magento/magento2/pull/12579) -- [Backport 2.1-develop] Fix swagger-ui on instances of Magento running on a non-standard port (by @JeroenVanLeusden) + * [magento/magento2#12368](https://github.com/magento/magento2/pull/12368) -- [Backport for 2.1 of #9904] #8069: Saving Category with existing imag… (by @nemesis-back) + * [magento/magento2#11618](https://github.com/magento/magento2/pull/11618) -- Re saving product attribute [backport 2.1] (by @raumatbel) + * [magento/magento2#12611](https://github.com/magento/magento2/pull/12611) -- Backport #4958 to 2.1 (by @slackerzz) + * [magento/magento2#12629](https://github.com/magento/magento2/pull/12629) -- [2.1-develop] Add customer login url from Customer Url model to checkout config so … (by @quisse) + * [magento/magento2#12840](https://github.com/magento/magento2/pull/12840) -- Backport PR8418 - Fatal error on cms block grid delete (by @duckchip) + * [magento/magento2#12930](https://github.com/magento/magento2/pull/12930) -- Fix wishlist item getBuyRequest with no options (by @jameshalsall) + * [magento/magento2#12959](https://github.com/magento/magento2/pull/12959) -- [Backport to 2.1-develop] Fix #10812: htaccess Options override (by @dverkade) + * [magento/magento2#12958](https://github.com/magento/magento2/pull/12958) -- [Backport to 2.1-develop] Fix #9243 - Upgrade ZF components. Zend_Service (by @dverkade) + * [magento/magento2#12956](https://github.com/magento/magento2/pull/12956) -- [Backport to 2.1-develop] Fix #10682: Meta description and keywords transform to html entities (by @dverkade) + * [magento/magento2#12962](https://github.com/magento/magento2/pull/12962) -- [Backport to 2.1-develop] Fix configurable attribute options not being sorted (by @wardcapp) + * [magento/magento2#12952](https://github.com/magento/magento2/pull/12952) -- [Backport #12668 into 2.1-develop] Fix for reverting stock twice for cancelled orders (by @dverkade) + * [magento/magento2#12954](https://github.com/magento/magento2/pull/12954) -- [Backport to 2.1-develop] Fix #2156 Js\Dataprovider uses the RendererInterface. (by @dverkade) + * [magento/magento2#12991](https://github.com/magento/magento2/pull/12991) -- [2.1.x] Fix undeclared dependency magento/zendframework1 by magento/framework (by @ihor-sviziev) + * [magento/magento2#13020](https://github.com/magento/magento2/pull/13020) -- [Backport to 2.1-develop] Attribute with "Catalog Input Type for Store Owner" equal "Fixed Product Tax" for Multi-store (by @dverkade) + * [magento/magento2#13261](https://github.com/magento/magento2/pull/13261) -- Backport 2.1 for MAGETWO-80428 (by @PieterCappelle) + * [magento/magento2#13367](https://github.com/magento/magento2/pull/13367) -- [Backport 2.1] In checkout->multishipping-> new addres clean region when select country without dropdown for states (by @enriquei4) + * [magento/magento2#13489](https://github.com/magento/magento2/pull/13489) -- [Backport 2.1] #9247 fixed layout handle for cms page (by @simpleadm) + * [magento/magento2#13532](https://github.com/magento/magento2/pull/13532) -- Backport of PR-11169 for Magento 2.1: Fixed issue #10738: Empty attribute label is displayed on product pag… (by @hostep) + * [magento/magento2#13543](https://github.com/magento/magento2/pull/13543) -- Backport of MAGETWO-69379 for Magento 2.1: use payment method name to… (by @hostep) + * [magento/magento2#13549](https://github.com/magento/magento2/pull/13549) -- Backport of MAGETWO-80198 for Magento 2.1: Fix issue #10565 #10575 (by @hostep) + * [magento/magento2#13490](https://github.com/magento/magento2/pull/13490) -- [Backport 2.1] #9796 configurable product price options provider (by @simpleadm) + * [magento/magento2#13916](https://github.com/magento/magento2/pull/13916) -- Pass Expected Data Type in backgroundColor Call (2.1) (by @northernco) + 2.1.11 ============= * GitHub issues: From 49f98cf193b4f5378c34992f1c1254a6a0927b5c Mon Sep 17 00:00:00 2001 From: Yevhen Miroshnychenko Date: Mon, 5 Mar 2018 13:04:25 +0200 Subject: [PATCH 010/528] MAGETWO-88336: [Backport] JS merging fails when JS bundling is enabled and bundle folder contains any other files --- app/code/Magento/RequireJs/Model/FileManager.php | 3 +++ app/code/Magento/RequireJs/Test/Unit/Model/FileManagerTest.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/RequireJs/Model/FileManager.php b/app/code/Magento/RequireJs/Model/FileManager.php index f13e3e050999e..8037fe44ee056 100644 --- a/app/code/Magento/RequireJs/Model/FileManager.php +++ b/app/code/Magento/RequireJs/Model/FileManager.php @@ -164,6 +164,9 @@ public function createBundleJsPool() } foreach ($libDir->read($bundleDir) as $bundleFile) { + if (pathinfo($bundleFile, PATHINFO_EXTENSION) !== 'js') { + continue; + } $relPath = $libDir->getRelativePath($bundleFile); $bundles[] = $this->assetRepo->createArbitrary($relPath, ''); } diff --git a/app/code/Magento/RequireJs/Test/Unit/Model/FileManagerTest.php b/app/code/Magento/RequireJs/Test/Unit/Model/FileManagerTest.php index 057f03edb9ba2..1963c860a5935 100644 --- a/app/code/Magento/RequireJs/Test/Unit/Model/FileManagerTest.php +++ b/app/code/Magento/RequireJs/Test/Unit/Model/FileManagerTest.php @@ -150,7 +150,7 @@ public function testCreateBundleJsPool() ->expects($this->once()) ->method('read') ->with('path/to/bundle/dir/js/bundle') - ->willReturn(['bundle1.js', 'bundle2.js']); + ->willReturn(['bundle1.js', 'bundle2.js', 'some_file.not_js']); $dirRead ->expects($this->exactly(2)) ->method('getRelativePath') From 0455635b9a6230d79f79bbfcdf4f0d9cf02195ca Mon Sep 17 00:00:00 2001 From: Viktor Sevch Date: Tue, 13 Mar 2018 14:25:47 +0200 Subject: [PATCH 011/528] MAGETWO-88992: Broken image in Schedule update. --- .../Category/Attribute/Backend/Image.php | 27 ++++--------------- .../Category/Attribute/Backend/ImageTest.php | 5 ++-- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index 3950fd1eee719..818a761814548 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -52,11 +52,6 @@ class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend */ private $imageUploader; - /** - * @var string - */ - private $additionalData = '_additional_data_'; - /** * Image constructor. * @@ -85,9 +80,9 @@ public function beforeSave($object) { $attributeName = $this->getAttribute()->getName(); $value = $object->getData($attributeName); + $imageName = $this->getUploadedImageName($value); - if ($imageName = $this->getUploadedImageName($value)) { - $object->setData($this->additionalData . $attributeName, $value); + if ($imageName) { $object->setData($attributeName, $imageName); } else if (!is_string($value)) { $object->setData($attributeName, ''); @@ -130,27 +125,15 @@ private function getImageUploader() } /** - * Check if temporary file is available for new image upload. - * - * @param array $value - * @return bool - */ - private function isTmpFileAvailable($value) - { - return is_array($value) && isset($value[0]['tmp_name']); - } - - /** - * Save uploaded file and set its name to category + * Save uploaded file and set its name to category. * * @param \Magento\Framework\DataObject $object * @return \Magento\Catalog\Model\Category\Attribute\Backend\Image */ public function afterSave($object) { - $value = $object->getData($this->additionalData . $this->getAttribute()->getName()); - - if ($this->isTmpFileAvailable($value) && $imageName = $this->getUploadedImageName($value)) { + $imageName = $object->getData($this->getAttribute()->getName(), null); + if ($imageName) { try { $this->getImageUploader()->moveFileFromTmp($imageName); } catch (\Exception $e) { diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php index 88ab0f5a1ce63..247a124a7af1d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php @@ -164,8 +164,7 @@ public function testAfterSave() $object = new \Magento\Framework\DataObject( [ - 'test_attribute' => 'test1234.jpg', - '_additional_data_test_attribute' => [['name' => 'test1234.jpg', 'tmp_name' => 'test-test-1234']] + 'test_attribute' => 'test1234.jpg' ] ); $model->afterSave($object); @@ -208,7 +207,7 @@ public function testAfterSaveWithExceptions() ->with($this->equalTo($exception)); $object = new \Magento\Framework\DataObject( [ - '_additional_data_test_attribute' => [['name' => 'test1234.jpg', 'tmp_name' => 'test-test-1234']] + 'test_attribute' => 'test1234.jpg' ] ); $model->afterSave($object); From 8c3f48227475b35ac58cc5b02278df7704782d71 Mon Sep 17 00:00:00 2001 From: Andrii Meysar Date: Tue, 13 Mar 2018 19:04:01 +0200 Subject: [PATCH 012/528] MAGETWO-89066: Category chooser shows blank block --- app/code/Magento/Backend/Model/Url.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Backend/Model/Url.php b/app/code/Magento/Backend/Model/Url.php index 764ab297605d5..b1f7e0a74d981 100644 --- a/app/code/Magento/Backend/Model/Url.php +++ b/app/code/Magento/Backend/Model/Url.php @@ -213,6 +213,10 @@ public function getUrl($routePath = null, $routeParams = null) $routeParams[self::SECRET_KEY_PARAM_NAME] = $secretKey; } + if (is_array($this->_getRouteParams())) { + $routeParams = array_merge($this->_getRouteParams(), $routeParams); + } + return parent::getUrl("{$routeName}/{$controllerName}/{$actionName}", $routeParams); } From 23cb416ed00a75bbbe82e05da00134cc32eeedc5 Mon Sep 17 00:00:00 2001 From: Andrii Meysar Date: Wed, 14 Mar 2018 10:45:47 +0200 Subject: [PATCH 013/528] MAGETWO-89066: Category chooser shows blank block --- app/code/Magento/Backend/Model/Url.php | 6 ++++-- .../integration/testsuite/Magento/Backend/Model/UrlTest.php | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/Model/Url.php b/app/code/Magento/Backend/Model/Url.php index b1f7e0a74d981..e91344f341269 100644 --- a/app/code/Magento/Backend/Model/Url.php +++ b/app/code/Magento/Backend/Model/Url.php @@ -198,7 +198,9 @@ public function getUrl($routePath = null, $routeParams = null) return $result; } + $this->getRouteParamsResolver()->unsetData('route_params'); $this->_setRoutePath($routePath); + $extraParams = $this->getRouteParamsResolver()->getRouteParams(); $routeName = $this->_getRouteName('*'); $controllerName = $this->_getControllerName(self::DEFAULT_CONTROLLER_NAME); $actionName = $this->_getActionName(self::DEFAULT_ACTION_NAME); @@ -213,8 +215,8 @@ public function getUrl($routePath = null, $routeParams = null) $routeParams[self::SECRET_KEY_PARAM_NAME] = $secretKey; } - if (is_array($this->_getRouteParams())) { - $routeParams = array_merge($this->_getRouteParams(), $routeParams); + if (!empty($extraParams)) { + $routeParams = array_merge($extraParams, $routeParams); } return parent::getUrl("{$routeName}/{$controllerName}/{$actionName}", $routeParams); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php index 32cc75afa7acc..ae29a37679536 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php @@ -75,6 +75,9 @@ public function testGetUrl() ]; $url = $this->_model->getUrl('path', $routeParams); $this->assertContains('/param4/' . $paramEncoder->encode('a4==') . '/', $url); + + $url = $this->_model->getUrl('route/controller/action/id/100'); + $this->assertContains('id/100', $url); } /** From 80f1e92162fa26166a813ec1326e7c78887c6025 Mon Sep 17 00:00:00 2001 From: madotto Date: Thu, 2 Mar 2017 18:22:07 +0100 Subject: [PATCH 014/528] Backport of PR-8772 for Magento 2.1: magento/magento2#3882 magento/magento2#3882: - An XML comment node as parameter in widget.xml fails with fatal error - Fixed also for comments in containers node (cherry picked from commit 51da3d497fc78832a917120ccdf2292af4f82f3a) MAGETWO-65436: [GitHub][PR] magento/magento2#3882 magento/magento2#8772 (cherry picked from commit 03c9c20f75c1bb4f4e56a2f54c1c5b442cad5e62) --- app/code/Magento/Widget/Model/Config/Converter.php | 4 ++-- app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Widget/Model/Config/Converter.php b/app/code/Magento/Widget/Model/Config/Converter.php index 894d63ad4cc57..010c46da56950 100644 --- a/app/code/Magento/Widget/Model/Config/Converter.php +++ b/app/code/Magento/Widget/Model/Config/Converter.php @@ -44,7 +44,7 @@ public function convert($source) case 'parameters': /** @var $parameter \DOMNode */ foreach ($widgetSubNode->childNodes as $parameter) { - if ($parameter->nodeName === '#text') { + if ($parameter->nodeName === '#text' || $parameter->nodeName === '#comment') { continue; } $subNodeAttributes = $parameter->attributes; @@ -57,7 +57,7 @@ public function convert($source) $widgetArray['supported_containers'] = []; } foreach ($widgetSubNode->childNodes as $container) { - if ($container->nodeName === '#text') { + if ($container->nodeName === '#text' || $container->nodeName === '#comment') { continue; } $widgetArray['supported_containers'] = array_merge( diff --git a/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml b/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml index 0a3ace9463557..02e65707d322f 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml +++ b/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml @@ -11,6 +11,7 @@ Orders and Returns Search Form + @@ -54,6 +55,7 @@ +