From fffad8d165fccde54b664627345515696dae3ea0 Mon Sep 17 00:00:00 2001 From: Ronald Edelschaap Date: Fri, 11 Nov 2016 18:18:16 +0100 Subject: [PATCH 01/21] Update Curl.php Added support for PUT requests --- lib/internal/Magento/Framework/HTTP/Adapter/Curl.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php index 181783c7b2115..2311da9e0e9ac 100644 --- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php @@ -175,6 +175,9 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = ' if ($method == \Zend_Http_Client::POST) { curl_setopt($this->_getResource(), CURLOPT_POST, true); curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body); + } elseif ($method == \Zend_Http_Client::PUT) { + curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body); } elseif ($method == \Zend_Http_Client::GET) { curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true); } From 2b9a6b35bfe640024bd0ae5152b35914a98f4cb4 Mon Sep 17 00:00:00 2001 From: Ronald Edelschaap Date: Mon, 14 Nov 2016 11:53:58 +0100 Subject: [PATCH 02/21] Update Curl.php We noticed that `CURLOPT_CUSTOMREQUEST` has priority over regular options like `CURLOPT_HTTPGET` and `CURLOPT_POST`. When the `CURLOPT_CUSTOMREQUEST` option has been set to `PUT` for a PUT request, `CURLOPT_HTTPGET` and `CURLOPT_POST` do not overwrite the value of `CURLOPT_CUSTOMREQUEST` and thus `CURLOPT_CUSTOMREQUEST` has to be used again. --- lib/internal/Magento/Framework/HTTP/Adapter/Curl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php index 2311da9e0e9ac..3d11e62d96f82 100644 --- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php @@ -174,12 +174,14 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = ' curl_setopt($this->_getResource(), CURLOPT_RETURNTRANSFER, true); if ($method == \Zend_Http_Client::POST) { curl_setopt($this->_getResource(), CURLOPT_POST, true); + curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body); } elseif ($method == \Zend_Http_Client::PUT) { curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body); } elseif ($method == \Zend_Http_Client::GET) { curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true); + curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'GET'); } if (is_array($headers)) { From c18602c3c2924175e8d2f0a8f147854781b40529 Mon Sep 17 00:00:00 2001 From: Pablo Ivulic Date: Tue, 13 Dec 2016 14:55:36 +0100 Subject: [PATCH 03/21] Throw exception if errors are found --- .../src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php b/setup/src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php index b6196c45f4e06..e914301f10ab7 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php @@ -70,6 +70,7 @@ public function write(array $data) if ($errorsCount) { $this->console->writeln('' . 'Total Errors Count: ' . $errorsCount . ''); + throw new \Magento\Framework\Validator\Exception(__('Error durring compilation')); } } From 27f540c962cd4d370684a544e8711ffc6142f278 Mon Sep 17 00:00:00 2001 From: Tibor Kotosz Date: Thu, 6 Apr 2017 15:30:30 +0200 Subject: [PATCH 04/21] Return array of blocks as items instead of array of arrays Based on `BlockSearchResultsInterface` the `getItems()` should return `\Magento\Cms\Api\Data\BlockInterface[]`. --- app/code/Magento/Cms/Model/BlockRepository.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/app/code/Magento/Cms/Model/BlockRepository.php b/app/code/Magento/Cms/Model/BlockRepository.php index a06c5fac1bc4e..5f8ec399e9bd6 100644 --- a/app/code/Magento/Cms/Model/BlockRepository.php +++ b/app/code/Magento/Cms/Model/BlockRepository.php @@ -154,25 +154,10 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria $this->collectionProcessor->process($criteria, $collection); - $blocks = []; - /** @var Block $blockModel */ - foreach ($collection as $blockModel) { - $blockData = $this->dataBlockFactory->create(); - $this->dataObjectHelper->populateWithArray( - $blockData, - $blockModel->getData(), - \Magento\Cms\Api\Data\BlockInterface::class - ); - $blocks[] = $this->dataObjectProcessor->buildOutputDataArray( - $blockData, - \Magento\Cms\Api\Data\BlockInterface::class - ); - } - /** @var Data\BlockSearchResultsInterface $searchResults */ $searchResults = $this->searchResultsFactory->create(); $searchResults->setSearchCriteria($criteria); - $searchResults->setItems($blocks); + $searchResults->setItems($collection->getItems()); $searchResults->setTotalCount($collection->getSize()); return $searchResults; } From 658a30a42046bc21abb7d61e700be566e06d61e1 Mon Sep 17 00:00:00 2001 From: Pablo Ivulic Date: Thu, 13 Apr 2017 13:03:47 +0200 Subject: [PATCH 05/21] Moved exception to be thrown one level up --- setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php | 4 ++++ .../Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php b/setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php index 9dff437500e57..de1c8c9fd99d8 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php @@ -81,11 +81,15 @@ public function add($type, $key, $message = '') * Write entries * * @return void + * @throws \Magento\Framework\Validator\Exception */ public function report() { $this->_successWriter->write($this->_successEntries); $this->_errorWriter->write($this->_errorEntries); + if (count($this->_errorEntries) > 0) { + throw new \Magento\Framework\Validator\Exception(__('Error during compilation')); + } } /** diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php b/setup/src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php index e914301f10ab7..b6196c45f4e06 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/Log/Writer/Console.php @@ -70,7 +70,6 @@ public function write(array $data) if ($errorsCount) { $this->console->writeln('' . 'Total Errors Count: ' . $errorsCount . ''); - throw new \Magento\Framework\Validator\Exception(__('Error durring compilation')); } } From 90ebccbb95d488db0b44ef568ace8e3ba5ec5e24 Mon Sep 17 00:00:00 2001 From: Arshad M Date: Wed, 3 May 2017 11:41:15 +0530 Subject: [PATCH 06/21] #7988 Typo in billingAddressFromData changed --- app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js index b5d3c93de6539..2cf37296840a3 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js @@ -39,7 +39,7 @@ define([ 'selectedShippingRate': null, 'selectedPaymentMethod': null, 'selectedBillingAddress': null, - 'billingAddressFormData': null, + 'billingAddressFromData': null, 'newCustomerBillingAddress': null }; saveData(checkoutData); From 5bc1a222fe16121d020ffbb578cf9f8688983f75 Mon Sep 17 00:00:00 2001 From: Arshad M Date: Wed, 3 May 2017 14:03:32 +0530 Subject: [PATCH 07/21] magento/magento2#7988 Added commnets in file checkout-data.js - added missing index in checkoutData --- .../view/frontend/web/js/checkout-data.js | 57 ++++++++++++++++--- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js index 2cf37296840a3..2c9950e522d22 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js @@ -33,20 +33,24 @@ define([ if ($.isEmptyObject(getData())) { checkoutData = { - 'selectedShippingAddress': null, - 'shippingAddressFromData': null, - 'newCustomerShippingAddress': null, - 'selectedShippingRate': null, - 'selectedPaymentMethod': null, - 'selectedBillingAddress': null, - 'billingAddressFromData': null, - 'newCustomerBillingAddress': null + 'selectedShippingAddress': null, // Selected shipping address pullled from local storage (Persistence) + 'shippingAddressFromData': null, // Shipping address pullled from local storage (Persistence) + 'newCustomerShippingAddress': null, // Shipping address pullled from local storage for new customer (Persistence) + 'selectedShippingRate': null, // Shipping rate pulled from local storage (Persistence) + 'selectedPaymentMethod': null, // Payment method pulled from local storage (Persistence) + 'selectedBillingAddress': null, // Selected billing address pullled from local storage (Persistence) + 'billingAddressFromData': null, // Billing address pullled from local storage (Persistence) + 'newCustomerBillingAddress': null, // Billing address pullled from local storage for new customer (Persistence) + 'validatedEmailValue': null, // Validated email address from local storage (Persistence) + 'inputFieldEmailValue' : null // Email input field value from local storage (Persistence) }; saveData(checkoutData); } return { /** + * Setting the selected shipping address pulled from local storage + * * @param {Object} data */ setSelectedShippingAddress: function (data) { @@ -57,6 +61,8 @@ define([ }, /** + * Pulling the selected shipping address from local storage + * * @return {*} */ getSelectedShippingAddress: function () { @@ -64,6 +70,8 @@ define([ }, /** + * Setting the shipping address pulled from local storage + * * @param {Object} data */ setShippingAddressFromData: function (data) { @@ -74,6 +82,8 @@ define([ }, /** + * Pulling the shipping address from local storage + * * @return {*} */ getShippingAddressFromData: function () { @@ -81,6 +91,8 @@ define([ }, /** + * Setting the shipping address pulled from local storage for new customer + * * @param {Object} data */ setNewCustomerShippingAddress: function (data) { @@ -91,6 +103,8 @@ define([ }, /** + * Pulling the shipping address from local storage for new customer + * * @return {*} */ getNewCustomerShippingAddress: function () { @@ -98,6 +112,8 @@ define([ }, /** + * Setting the selected shipping rate pulled from local storage + * * @param {Object} data */ setSelectedShippingRate: function (data) { @@ -108,6 +124,8 @@ define([ }, /** + * Pulling the selected shipping rate from local storge + * * @return {*} */ getSelectedShippingRate: function () { @@ -115,6 +133,8 @@ define([ }, /** + * Setting the selected payment method pulled from local storage + * * @param {Object} data */ setSelectedPaymentMethod: function (data) { @@ -125,6 +145,8 @@ define([ }, /** + * Pulling the payment method from local storage + * * @return {*} */ getSelectedPaymentMethod: function () { @@ -132,6 +154,8 @@ define([ }, /** + * Setting the selected billing address pulled from local storage + * * @param {Object} data */ setSelectedBillingAddress: function (data) { @@ -142,6 +166,8 @@ define([ }, /** + * Pulling the selected billing address from local storage + * * @return {*} */ getSelectedBillingAddress: function () { @@ -149,6 +175,8 @@ define([ }, /** + * Setting the billing address pulled from local storage + * * @param {Object} data */ setBillingAddressFromData: function (data) { @@ -159,6 +187,7 @@ define([ }, /** + * Pulling the billing address from local storage * @return {*} */ getBillingAddressFromData: function () { @@ -166,6 +195,8 @@ define([ }, /** + * Setting the billing address pulled from local storage for new customer + * * @param {Object} data */ setNewCustomerBillingAddress: function (data) { @@ -176,6 +207,8 @@ define([ }, /** + * Pulling the billing address from local storage for new customer + * * @return {*} */ getNewCustomerBillingAddress: function () { @@ -183,6 +216,8 @@ define([ }, /** + * Pulling the email address from local storage + * * @return {*} */ getValidatedEmailValue: function () { @@ -192,6 +227,8 @@ define([ }, /** + * Setting the email address pulled from local storage + * * @param {String} email */ setValidatedEmailValue: function (email) { @@ -202,6 +239,8 @@ define([ }, /** + * Pulling the email input field value from local storage + * * @return {*} */ getInputFieldEmailValue: function () { @@ -211,6 +250,8 @@ define([ }, /** + * Setting the email input field value pulled from local storage + * * @param {String} email */ setInputFieldEmailValue: function (email) { From e3b22e4a95ef8abfbf689151e182089af43a198f Mon Sep 17 00:00:00 2001 From: Arshad M Date: Wed, 3 May 2017 14:43:10 +0530 Subject: [PATCH 08/21] magento/magento2#7988 Requested changes updated also reverted last updates in checkoutData index --- .../view/frontend/web/js/checkout-data.js | 56 +++++++++---------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js index 2c9950e522d22..d5ad5fea29dcf 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js @@ -33,23 +33,21 @@ define([ if ($.isEmptyObject(getData())) { checkoutData = { - 'selectedShippingAddress': null, // Selected shipping address pullled from local storage (Persistence) - 'shippingAddressFromData': null, // Shipping address pullled from local storage (Persistence) - 'newCustomerShippingAddress': null, // Shipping address pullled from local storage for new customer (Persistence) - 'selectedShippingRate': null, // Shipping rate pulled from local storage (Persistence) - 'selectedPaymentMethod': null, // Payment method pulled from local storage (Persistence) - 'selectedBillingAddress': null, // Selected billing address pullled from local storage (Persistence) - 'billingAddressFromData': null, // Billing address pullled from local storage (Persistence) - 'newCustomerBillingAddress': null, // Billing address pullled from local storage for new customer (Persistence) - 'validatedEmailValue': null, // Validated email address from local storage (Persistence) - 'inputFieldEmailValue' : null // Email input field value from local storage (Persistence) + 'selectedShippingAddress': null, //Selected shipping address pullled from persistence storage. + 'shippingAddressFromData': null, //Shipping address pullled from persistence storage. + 'newCustomerShippingAddress': null, //Shipping address pullled from persistence storage for new customer. + 'selectedShippingRate': null, //Shipping rate pulled from persistence storage. + 'selectedPaymentMethod': null, //Payment method pulled from persistence storage. + 'selectedBillingAddress': null, //Selected billing address pullled from persistence storage. + 'billingAddressFromData': null, //Billing address pullled from persistence storage. + 'newCustomerBillingAddress': null //Billing address pullled from persistence storage for new customer. }; saveData(checkoutData); } return { /** - * Setting the selected shipping address pulled from local storage + * Setting the selected shipping address pulled from persistence storage. * * @param {Object} data */ @@ -61,7 +59,7 @@ define([ }, /** - * Pulling the selected shipping address from local storage + * Pulling the selected shipping address from persistence storage. * * @return {*} */ @@ -70,7 +68,7 @@ define([ }, /** - * Setting the shipping address pulled from local storage + * Setting the shipping address pulled from persistence storage. * * @param {Object} data */ @@ -82,7 +80,7 @@ define([ }, /** - * Pulling the shipping address from local storage + * Pulling the shipping address from persistence storage. * * @return {*} */ @@ -91,7 +89,7 @@ define([ }, /** - * Setting the shipping address pulled from local storage for new customer + * Setting the shipping address pulled from persistence storage for new customer. * * @param {Object} data */ @@ -103,7 +101,7 @@ define([ }, /** - * Pulling the shipping address from local storage for new customer + * Pulling the shipping address from persistence storage for new customer. * * @return {*} */ @@ -112,7 +110,7 @@ define([ }, /** - * Setting the selected shipping rate pulled from local storage + * Setting the selected shipping rate pulled from persistence storage. * * @param {Object} data */ @@ -133,7 +131,7 @@ define([ }, /** - * Setting the selected payment method pulled from local storage + * Setting the selected payment method pulled from persistence storage. * * @param {Object} data */ @@ -145,7 +143,7 @@ define([ }, /** - * Pulling the payment method from local storage + * Pulling the payment method from persistence storage. * * @return {*} */ @@ -154,7 +152,7 @@ define([ }, /** - * Setting the selected billing address pulled from local storage + * Setting the selected billing address pulled from persistence storage. * * @param {Object} data */ @@ -166,7 +164,7 @@ define([ }, /** - * Pulling the selected billing address from local storage + * Pulling the selected billing address from persistence storage. * * @return {*} */ @@ -175,7 +173,7 @@ define([ }, /** - * Setting the billing address pulled from local storage + * Setting the billing address pulled from persistence storage. * * @param {Object} data */ @@ -187,7 +185,7 @@ define([ }, /** - * Pulling the billing address from local storage + * Pulling the billing address from persistence storage. * @return {*} */ getBillingAddressFromData: function () { @@ -195,7 +193,7 @@ define([ }, /** - * Setting the billing address pulled from local storage for new customer + * Setting the billing address pulled from persistence storage for new customer. * * @param {Object} data */ @@ -207,7 +205,7 @@ define([ }, /** - * Pulling the billing address from local storage for new customer + * Pulling the billing address from persistence storage for new customer. * * @return {*} */ @@ -216,7 +214,7 @@ define([ }, /** - * Pulling the email address from local storage + * Pulling the email address from persistence storage. * * @return {*} */ @@ -227,7 +225,7 @@ define([ }, /** - * Setting the email address pulled from local storage + * Setting the email address pulled from persistence storage. * * @param {String} email */ @@ -239,7 +237,7 @@ define([ }, /** - * Pulling the email input field value from local storage + * Pulling the email input field value from persistence storage. * * @return {*} */ @@ -250,7 +248,7 @@ define([ }, /** - * Setting the email input field value pulled from local storage + * Setting the email input field value pulled from persistence storage. * * @param {String} email */ From 73ac8c4bd994764a2e401b2c6b1c2f22d7a27ed0 Mon Sep 17 00:00:00 2001 From: Arshad M Date: Wed, 3 May 2017 17:37:43 +0530 Subject: [PATCH 09/21] magento/magento2#7988 Changed typo pullled to pulled --- .../Checkout/view/frontend/web/js/checkout-data.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js index d5ad5fea29dcf..49911ddbee9d4 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js @@ -33,14 +33,14 @@ define([ if ($.isEmptyObject(getData())) { checkoutData = { - 'selectedShippingAddress': null, //Selected shipping address pullled from persistence storage. - 'shippingAddressFromData': null, //Shipping address pullled from persistence storage. - 'newCustomerShippingAddress': null, //Shipping address pullled from persistence storage for new customer. + 'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage. + 'shippingAddressFromData': null, //Shipping address pulled from persistence storage. + 'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for new customer. 'selectedShippingRate': null, //Shipping rate pulled from persistence storage. 'selectedPaymentMethod': null, //Payment method pulled from persistence storage. - 'selectedBillingAddress': null, //Selected billing address pullled from persistence storage. - 'billingAddressFromData': null, //Billing address pullled from persistence storage. - 'newCustomerBillingAddress': null //Billing address pullled from persistence storage for new customer. + 'selectedBillingAddress': null, //Selected billing address pulled from persistence storage. + 'billingAddressFromData': null, //Billing address pulled from persistence storage. + 'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer. }; saveData(checkoutData); } From d3b54864af54114f0914785e4e2153d17602cdba Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Mon, 15 May 2017 11:49:24 -0500 Subject: [PATCH 10/21] MAGETWO-68877: Issue #7988 Typo changed also added comments for each index, getters and setters. #9484 - fixed code style issue --- .../Checkout/view/frontend/web/js/checkout-data.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js index 49911ddbee9d4..01d65f8cd856b 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js @@ -48,7 +48,7 @@ define([ return { /** * Setting the selected shipping address pulled from persistence storage. - * + * * @param {Object} data */ setSelectedShippingAddress: function (data) { @@ -60,7 +60,7 @@ define([ /** * Pulling the selected shipping address from persistence storage. - * + * * @return {*} */ getSelectedShippingAddress: function () { @@ -80,7 +80,7 @@ define([ }, /** - * Pulling the shipping address from persistence storage. + * Pulling the shipping address from persistence storage. * * @return {*} */ @@ -122,7 +122,7 @@ define([ }, /** - * Pulling the selected shipping rate from local storge + * Pulling the selected shipping rate from local storage. * * @return {*} */ From 1e878622b63ebf624388938941011f27e721b209 Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Mon, 15 May 2017 13:17:07 -0500 Subject: [PATCH 11/21] MAGETWO-68877: Issue #7988 Typo changed also added comments for each index, getters and setters. #9484 - fixed code style issue --- .../view/frontend/web/js/checkout-data.js | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js index 01d65f8cd856b..4ebe145b11d06 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js @@ -33,21 +33,21 @@ define([ if ($.isEmptyObject(getData())) { checkoutData = { - 'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage. - 'shippingAddressFromData': null, //Shipping address pulled from persistence storage. - 'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for new customer. - 'selectedShippingRate': null, //Shipping rate pulled from persistence storage. - 'selectedPaymentMethod': null, //Payment method pulled from persistence storage. - 'selectedBillingAddress': null, //Selected billing address pulled from persistence storage. - 'billingAddressFromData': null, //Billing address pulled from persistence storage. - 'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer. + 'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage + 'shippingAddressFromData': null, //Shipping address pulled from persistence storage + 'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for new customer + 'selectedShippingRate': null, //Shipping rate pulled from persistence storage + 'selectedPaymentMethod': null, //Payment method pulled from persistence storage + 'selectedBillingAddress': null, //Selected billing address pulled from persistence storage + 'billingAddressFromData': null, //Billing address pulled from persistence storage + 'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer }; saveData(checkoutData); } return { /** - * Setting the selected shipping address pulled from persistence storage. + * Setting the selected shipping address pulled from persistence storage * * @param {Object} data */ @@ -59,7 +59,7 @@ define([ }, /** - * Pulling the selected shipping address from persistence storage. + * Pulling the selected shipping address from persistence storage * * @return {*} */ @@ -68,7 +68,7 @@ define([ }, /** - * Setting the shipping address pulled from persistence storage. + * Setting the shipping address pulled from persistence storage * * @param {Object} data */ @@ -80,7 +80,7 @@ define([ }, /** - * Pulling the shipping address from persistence storage. + * Pulling the shipping address from persistence storage * * @return {*} */ @@ -89,7 +89,7 @@ define([ }, /** - * Setting the shipping address pulled from persistence storage for new customer. + * Setting the shipping address pulled from persistence storage for new customer * * @param {Object} data */ @@ -101,7 +101,7 @@ define([ }, /** - * Pulling the shipping address from persistence storage for new customer. + * Pulling the shipping address from persistence storage for new customer * * @return {*} */ @@ -110,7 +110,7 @@ define([ }, /** - * Setting the selected shipping rate pulled from persistence storage. + * Setting the selected shipping rate pulled from persistence storage * * @param {Object} data */ @@ -122,7 +122,7 @@ define([ }, /** - * Pulling the selected shipping rate from local storage. + * Pulling the selected shipping rate from local storage * * @return {*} */ @@ -131,7 +131,7 @@ define([ }, /** - * Setting the selected payment method pulled from persistence storage. + * Setting the selected payment method pulled from persistence storage * * @param {Object} data */ @@ -143,7 +143,7 @@ define([ }, /** - * Pulling the payment method from persistence storage. + * Pulling the payment method from persistence storage * * @return {*} */ @@ -152,7 +152,7 @@ define([ }, /** - * Setting the selected billing address pulled from persistence storage. + * Setting the selected billing address pulled from persistence storage * * @param {Object} data */ @@ -164,7 +164,7 @@ define([ }, /** - * Pulling the selected billing address from persistence storage. + * Pulling the selected billing address from persistence storage * * @return {*} */ @@ -173,7 +173,7 @@ define([ }, /** - * Setting the billing address pulled from persistence storage. + * Setting the billing address pulled from persistence storage * * @param {Object} data */ @@ -185,7 +185,8 @@ define([ }, /** - * Pulling the billing address from persistence storage. + * Pulling the billing address from persistence storage + * * @return {*} */ getBillingAddressFromData: function () { @@ -193,7 +194,7 @@ define([ }, /** - * Setting the billing address pulled from persistence storage for new customer. + * Setting the billing address pulled from persistence storage for new customer * * @param {Object} data */ @@ -205,7 +206,7 @@ define([ }, /** - * Pulling the billing address from persistence storage for new customer. + * Pulling the billing address from persistence storage for new customer * * @return {*} */ @@ -214,7 +215,7 @@ define([ }, /** - * Pulling the email address from persistence storage. + * Pulling the email address from persistence storage * * @return {*} */ @@ -225,7 +226,7 @@ define([ }, /** - * Setting the email address pulled from persistence storage. + * Setting the email address pulled from persistence storage * * @param {String} email */ @@ -237,7 +238,7 @@ define([ }, /** - * Pulling the email input field value from persistence storage. + * Pulling the email input field value from persistence storage * * @return {*} */ @@ -248,7 +249,7 @@ define([ }, /** - * Setting the email input field value pulled from persistence storage. + * Setting the email input field value pulled from persistence storage * * @param {String} email */ From 065ab557bc3deb1600bcecb061a3f4ae09770ead Mon Sep 17 00:00:00 2001 From: alojua Date: Wed, 31 May 2017 16:17:03 +0200 Subject: [PATCH 12/21] Fix bug linked product position not updated if product link already exists --- .../CatalogImportExport/Model/Import/Product.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 8eb1214157265..289ce8798f896 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1230,15 +1230,15 @@ protected function _saveLinks() 'linked_product_id' => $linkedId, 'link_type_id' => $linkId, ]; - if (!empty($linkPositions[$linkedKey])) { - $positionRows[] = [ - 'link_id' => $productLinkKeys[$linkKey], - 'product_link_attribute_id' => $positionAttrId[$linkId], - 'value' => $linkPositions[$linkedKey], - ]; - } - $nextLinkId++; } + if (!empty($linkPositions[$linkedKey])) { + $positionRows[] = [ + 'link_id' => $productLinkKeys[$linkKey], + 'product_link_attribute_id' => $positionAttrId[$linkId], + 'value' => $linkPositions[$linkedKey], + ]; + } + $nextLinkId++; } } } From 4c576f43da6cf8db9b1edac31e5eda3750545249 Mon Sep 17 00:00:00 2001 From: Tibor Kotosz Date: Thu, 1 Jun 2017 14:20:02 +0200 Subject: [PATCH 13/21] Return array of pages as items instead of array of arrays Based on `PageSearchResultsInterface` the getItems() should return `\Magento\Cms\Api\Data\PageInterface[]`. --- app/code/Magento/Cms/Model/PageRepository.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/app/code/Magento/Cms/Model/PageRepository.php b/app/code/Magento/Cms/Model/PageRepository.php index 033289bf8fb8e..521a975c885dd 100644 --- a/app/code/Magento/Cms/Model/PageRepository.php +++ b/app/code/Magento/Cms/Model/PageRepository.php @@ -157,25 +157,10 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria $this->collectionProcessor->process($criteria, $collection); - $pages = []; - /** @var Page $pageModel */ - foreach ($collection as $pageModel) { - $pageData = $this->dataPageFactory->create(); - $this->dataObjectHelper->populateWithArray( - $pageData, - $pageModel->getData(), - \Magento\Cms\Api\Data\PageInterface::class - ); - $pages[] = $this->dataObjectProcessor->buildOutputDataArray( - $pageData, - \Magento\Cms\Api\Data\PageInterface::class - ); - } - /** @var Data\PageSearchResultsInterface $searchResults */ $searchResults = $this->searchResultsFactory->create(); $searchResults->setSearchCriteria($criteria); - $searchResults->setItems($pages); + $searchResults->setItems($collection->getItems()); $searchResults->setTotalCount($collection->getSize()); return $searchResults; } From 3b435e6a7ab29fb5f0a6c4bf5929d5a90a2bbdf6 Mon Sep 17 00:00:00 2001 From: Michele Fantetti Date: Thu, 1 Jun 2017 16:26:38 +0200 Subject: [PATCH 14/21] Update send.phtml --- app/code/Magento/SendFriend/view/frontend/templates/send.phtml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml index e498a5ce789ef..528ec6f096be3 100644 --- a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml +++ b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml @@ -104,6 +104,7 @@ + getChildHtml('form_additional_info'); ?>
From 29be479f6c3c9faab4b0d9e852bc11fb602d03f2 Mon Sep 17 00:00:00 2001 From: Michele Fantetti Date: Thu, 1 Jun 2017 16:38:09 +0200 Subject: [PATCH 15/21] Update sendfriend_product_send.xml --- .../view/frontend/layout/sendfriend_product_send.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml b/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml index 1790fe068ac4a..5c99ee377ddfa 100644 --- a/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml +++ b/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml @@ -13,7 +13,9 @@ - + + + From e85558ac02c0f4d00c7ddca3a62cdc555e0916f0 Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Fri, 9 Jun 2017 16:22:22 -0500 Subject: [PATCH 16/21] MAGETWO-69723: Email to a Friend feature #9824 - fixed template configuration format --- .../SendFriend/view/frontend/layout/sendfriend_product_send.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml b/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml index ec118a339b682..8065b7e236132 100644 --- a/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml +++ b/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml @@ -13,7 +13,7 @@ - + From 02172bdb87e2aca3edac55fdc3b07b08f007fd73 Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Fri, 9 Jun 2017 17:35:46 -0500 Subject: [PATCH 17/21] MAGETWO-69666: Return array of pages as items instead of array of arrays #9823 - fixed unit tests --- .../Cms/Test/Unit/Model/PageRepositoryTest.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php b/app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php index 7d064c73b3259..1bd742048c51e 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php @@ -261,22 +261,8 @@ public function testGetList() ->willReturnSelf(); $this->pageSearchResult->expects($this->once()) ->method('setItems') - ->with(['someData']) + ->with([$this->page]) ->willReturnSelf(); - - $this->page->expects($this->once()) - ->method('getData') - ->willReturn(['data']); - - $this->dataHelper->expects($this->once()) - ->method('populateWithArray') - ->with($this->pageData, ['data'], \Magento\Cms\Api\Data\PageInterface::class); - - $this->dataObjectProcessor->expects($this->once()) - ->method('buildOutputDataArray') - ->with($this->pageData, \Magento\Cms\Api\Data\PageInterface::class) - ->willReturn('someData'); - $this->assertEquals($this->pageSearchResult, $this->repository->getList($criteria)); } } From e091cfd28aa7a4abd4362df350de0fdbe8940979 Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Fri, 9 Jun 2017 17:39:26 -0500 Subject: [PATCH 18/21] MAGETWO-69805: Return array of blocks as items instead of array of arrays #9157 - fixed unit tests --- .../Cms/Test/Unit/Model/BlockRepositoryTest.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php b/app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php index dd43f4a0b2287..6e4440ef97b25 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php @@ -263,22 +263,8 @@ public function testGetList() ->willReturnSelf(); $this->blockSearchResult->expects($this->once()) ->method('setItems') - ->with(['someData']) + ->with([$this->block]) ->willReturnSelf(); - - $this->block->expects($this->once()) - ->method('getData') - ->willReturn(['data']); - - $this->dataHelper->expects($this->once()) - ->method('populateWithArray') - ->with($this->blockData, ['data'], \Magento\Cms\Api\Data\BlockInterface::class); - - $this->dataObjectProcessor->expects($this->once()) - ->method('buildOutputDataArray') - ->with($this->blockData, \Magento\Cms\Api\Data\BlockInterface::class) - ->willReturn('someData'); - $this->assertEquals($this->blockSearchResult, $this->repository->getList($criteria)); } } From e4276a7dd63a572d5d52203122129823c2351a9e Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Mon, 12 Jun 2017 11:29:29 -0500 Subject: [PATCH 19/21] MAGETWO-67500: setup:di:compile returns exit code 0 if errors are found #7780 - fixed false positive failures --- setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php b/setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php index 181573b5d67bb..a757cda7ba79a 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php @@ -86,7 +86,9 @@ public function report() { $this->_successWriter->write($this->_successEntries); $this->_errorWriter->write($this->_errorEntries); - if (count($this->_errorEntries) > 0) { + //do not take into account empty items since they are initialized in constructor. + $errors = array_filter($this->_errorEntries); + if (count($errors) > 0) { throw new \Magento\Framework\Validator\Exception(__('Error during compilation')); } } From 76b45a71c15975eab37a4c9ff7d2e701096564ef Mon Sep 17 00:00:00 2001 From: Pieter Hoste Date: Mon, 12 Jun 2017 22:10:43 +0200 Subject: [PATCH 20/21] Revert "MAGETWO-69728: Fixes layered navigation options being cached using the wrong store id. #9873" This reverts commit 58b4c7c312395dfe93ca12d8478a2379a104a476. --- .../Model/Entity/Attribute/Frontend/AbstractFrontend.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php index d1794aff97fb9..8f1324195b382 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php @@ -68,8 +68,8 @@ abstract class AbstractFrontend implements \Magento\Eav\Model\Entity\Attribute\F * @param CacheInterface $cache * @param $storeResolver @deprecated * @param array $cacheTags - * @param Serializer $serializer * @param StoreManagerInterface $storeManager + * @param Serializer $serializer * @codeCoverageIgnore * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -78,8 +78,8 @@ public function __construct( CacheInterface $cache = null, $storeResolver = null, array $cacheTags = null, - Serializer $serializer = null, - StoreManagerInterface $storeManager = null + StoreManagerInterface $storeManager = null, + Serializer $serializer = null ) { $this->_attrBooleanFactory = $attrBooleanFactory; $this->cache = $cache ?: ObjectManager::getInstance()->get(CacheInterface::class); From 1884fd87356b85de4bc7ba427b5e0d869ca8e33d Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Mon, 12 Jun 2017 16:28:17 -0500 Subject: [PATCH 21/21] MAGETWO-68877: Issue #7988 Typo changed also added comments for each index, getters and setters. #9484 - fixed merge conflict --- .../view/frontend/web/js/checkout-data.js | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js index 4ebe145b11d06..9c0ef8bb58c07 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js @@ -15,35 +15,36 @@ define([ 'use strict'; var cacheKey = 'checkout-data', - checkoutData, - - /** - * @return {*} - */ - getData = function () { - return storage.get(cacheKey)(); - }, /** * @param {Object} data */ saveData = function (data) { storage.set(cacheKey, data); - }; + }, - if ($.isEmptyObject(getData())) { - checkoutData = { - 'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage - 'shippingAddressFromData': null, //Shipping address pulled from persistence storage - 'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for new customer - 'selectedShippingRate': null, //Shipping rate pulled from persistence storage - 'selectedPaymentMethod': null, //Payment method pulled from persistence storage - 'selectedBillingAddress': null, //Selected billing address pulled from persistence storage - 'billingAddressFromData': null, //Billing address pulled from persistence storage - 'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer + /** + * @return {*} + */ + getData = function () { + var data = storage.get(cacheKey)(); + + if ($.isEmptyObject(data)) { + data = { + 'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage + 'shippingAddressFromData': null, //Shipping address pulled from persistence storage + 'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for customer + 'selectedShippingRate': null, //Shipping rate pulled from persistence storage + 'selectedPaymentMethod': null, //Payment method pulled from persistence storage + 'selectedBillingAddress': null, //Selected billing address pulled from persistence storage + 'billingAddressFromData': null, //Billing address pulled from persistence storage + 'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer + }; + saveData(data); + } + + return data; }; - saveData(checkoutData); - } return { /**