From 6625945f314cdb39f239e3acb1c45be519f9e98c Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Sun, 17 Sep 2017 13:42:02 +0200 Subject: [PATCH 1/7] #10611 Ignore request key check for error page to avoid redirect loop --- .../Backend/Controller/Adminhtml/Noroute/Index.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Noroute/Index.php b/app/code/Magento/Backend/Controller/Adminhtml/Noroute/Index.php index f03d58b9a3eb7..e8251b5be6030 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Noroute/Index.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Noroute/Index.php @@ -39,4 +39,14 @@ public function execute() $resultPage->addHandle('adminhtml_noroute'); return $resultPage; } + + /** + * Error page should be public accessible. Do not check keys to avoid redirect loop + * + * @return bool + */ + protected function _validateSecretKey() + { + return true; + } } From 39e06b0d59fe7c5e233ff95e1e14d049485faed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mateos?= Date: Wed, 20 Sep 2017 16:37:33 +0200 Subject: [PATCH 2/7] Fix bug missed products with reindex catalog_category_product --- .../Catalog/Model/Indexer/Category/Product/AbstractAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php index 6b4aa3abc7fac..0cfb6ecf4c25d 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php @@ -317,7 +317,7 @@ protected function getNonAnchorCategoriesSelect(\Magento\Store\Model\Store $stor */ protected function isRangingNeeded() { - return true; + return false; } /** From 8731d97e16f6084cf65e9e8a6d17000e90fb0aa1 Mon Sep 17 00:00:00 2001 From: Mayank Date: Thu, 28 Sep 2017 18:03:30 +0530 Subject: [PATCH 3/7] Clean up code but getting read of 'Blank line found at start of control structure' coding standard violations --- .../Test/Unit/Gateway/Http/Client/TransactionSaleTest.php | 3 +-- app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js | 1 - app/code/Magento/Braintree/view/base/web/js/validator.js | 1 - .../frontend/web/js/view/payment/method-renderer/cc-form.js | 1 - .../web/js/view/payment/method-renderer/hosted-fields.js | 1 - .../frontend/web/js/view/payment/method-renderer/paypal.js | 1 - 6 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php index 5cbcfef8b6b9e..0837ecaea7a13 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php @@ -90,8 +90,7 @@ public function testPlaceRequestSuccess() $this->adapter->expects($this->once()) ->method('sale') ->with($this->getTransferData()) - ->willReturn($response) - ; + ->willReturn($response); $this->loggerMock->expects($this->once()) ->method('debug') diff --git a/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js b/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js index 8324cfe463bdb..c8aaa65cebb71 100644 --- a/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js +++ b/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js @@ -211,7 +211,6 @@ define([ } if (event.type !== 'fieldStateChange') { - return false; } diff --git a/app/code/Magento/Braintree/view/base/web/js/validator.js b/app/code/Magento/Braintree/view/base/web/js/validator.js index 3ed678cfb7eac..d4ba1ec86bbb5 100644 --- a/app/code/Magento/Braintree/view/base/web/js/validator.js +++ b/app/code/Magento/Braintree/view/base/web/js/validator.js @@ -83,7 +83,6 @@ define([ */ getCountrySpecificCardTypes: function (countryId) { if (typeof this.config.countrySpecificCardTypes[countryId] !== 'undefined') { - return this.config.countrySpecificCardTypes[countryId]; } diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js index 73a7b10d5d30f..2834c0a683979 100644 --- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js +++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js @@ -271,7 +271,6 @@ define( billingCountryId = billingAddress.countryId; if (billingCountryId && validator.getCountrySpecificCardTypes(billingCountryId)) { - return validator.collectTypes( availableTypes, validator.getCountrySpecificCardTypes(billingCountryId) ); diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js index 4e8f0cc4651e4..d2faac6ed792f 100644 --- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js +++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js @@ -104,7 +104,6 @@ define([ } if (event.type !== 'fieldStateChange') { - return false; } diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js index 9804ee8489625..ca9d3686958b4 100644 --- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js +++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js @@ -299,7 +299,6 @@ define([ var address = quote.shippingAddress(); if (_.isNull(address.postcode) || _.isUndefined(address.postcode)) { - return {}; } From 92d841822463ffe80d6a655d64487ea9865674ef Mon Sep 17 00:00:00 2001 From: Sergey Shvets Date: Thu, 28 Sep 2017 14:45:36 +0300 Subject: [PATCH 4/7] MAGETWO-80288: Fix unit tests on jenkins --- dev/tests/unit/framework/bootstrap.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/tests/unit/framework/bootstrap.php b/dev/tests/unit/framework/bootstrap.php index 9de9b3ac9ed26..68dba4e2ce00c 100644 --- a/dev/tests/unit/framework/bootstrap.php +++ b/dev/tests/unit/framework/bootstrap.php @@ -20,6 +20,10 @@ error_reporting(E_ALL); ini_set('display_errors', 1); +/* For data consistency between displaying (printing) and serialization a float number */ +ini_set('precision', 14); +ini_set('serialize_precision', 14); + /** * Set custom error handler */ From 7715950a0e5c620602713c71b19d8b3bdaf16c0a Mon Sep 17 00:00:00 2001 From: Eugene Tulika Date: Thu, 28 Sep 2017 16:38:15 -0500 Subject: [PATCH 5/7] MAGETWO-80367: Skip Jenkins builds and fix tests --- .../Test/TestCase/Product/CreateSimpleProductEntityTest.xml | 2 ++ .../Test/TestCase/Product/UpdateSimpleProductEntityTest.xml | 2 ++ .../Customer/Test/TestCase/MassAssignCustomerGroupTest.xml | 2 ++ .../RevokeAllAccessTokensForAdminWithoutTokensTest.xml | 2 ++ .../Variable/Test/TestCase/UpdateCustomVariableEntityTest.xml | 4 ++++ 5 files changed, 12 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml index 60af58cae5a10..37f79232c4c50 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml @@ -46,6 +46,8 @@ + stable:no + MAGETWO-80353: PHP 7.1 compatibility: Jenkins Failures related to PHP 7.1 upgrade test_type:extended_acceptance_test simple-product-%isolation% Simple Product %isolation% diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml index 2a46abdc2fd15..4d3817200dc26 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml @@ -178,6 +178,8 @@ + stable:no + MAGETWO-80353: PHP 7.1 compatibility: Jenkins Failures related to PHP 7.1 upgrade simple_with_hight_tier_price diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.xml index 4086a8585c8a8..303ae580dc9f4 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.xml @@ -8,6 +8,8 @@ + stable:no + MAGETWO-80353: PHP 7.1 compatibility: Jenkins Failures related to PHP 7.1 upgrade default diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml index e5fcba9b72c25..adbf71ae15581 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml @@ -8,6 +8,8 @@ + stable:no + MAGETWO-80353: PHP 7.1 compatibility: Jenkins Failures related to PHP 7.1 upgrade custom_admin diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.xml index 75894e96aadf5..a017d3d8b6bf1 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.xml @@ -19,6 +19,8 @@ + stable:no + MAGETWO-80353: PHP 7.1 compatibility: Jenkins Failures related to PHP 7.1 upgrade variableCode%isolation% variableName%isolation% No @@ -42,6 +44,8 @@ + stable:no + MAGETWO-80353: PHP 7.1 compatibility: Jenkins Failures related to PHP 7.1 upgrade variableCode%isolation% variableName%isolation% No From 9778bfba3c20d4c2bf2caab4c179c191dea1d08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mateos?= Date: Sat, 30 Sep 2017 02:08:39 +0200 Subject: [PATCH 6/7] Fix the correct removal of the images and the removal of all images in the catalog. --- .../Magento/Catalog/Model/Product/Gallery/UpdateHandler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php index 626d88f1acf82..d4f6bd2ca0d60 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php @@ -33,8 +33,10 @@ protected function processDeletedImages($product, array &$images) if (!empty($image['removed'])) { if (!empty($image['value_id']) && !isset($picturesInOtherStores[$image['file']])) { $recordsToDelete[] = $image['value_id']; - // only delete physical files if they are not used by any other products - if (!$this->resourceModel->countImageUses($image['file']) > 1) { + $catalogPath = $this->mediaConfig->getBaseMediaPath(); + $isFile = $this->mediaDirectory->isFile($catalogPath . $image['file']); + // only delete physical files if they are not used by any other products and if this file exist + if (!($this->resourceModel->countImageUses($image['file']) > 1) && $isFile) { $filesToDelete[] = ltrim($image['file'], '/'); } } From 5039c94343050aa764e3b048e76e9a3ebde665ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mateos?= Date: Sat, 30 Sep 2017 02:09:19 +0200 Subject: [PATCH 7/7] Revert "Fix bug missed products with reindex catalog_category_product" This reverts commit 39e06b0d59fe7c5e233ff95e1e14d049485faed0. --- .../Catalog/Model/Indexer/Category/Product/AbstractAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php index 0cfb6ecf4c25d..6b4aa3abc7fac 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php @@ -317,7 +317,7 @@ protected function getNonAnchorCategoriesSelect(\Magento\Store\Model\Store $stor */ protected function isRangingNeeded() { - return false; + return true; } /**