diff --git a/.htaccess b/.htaccess index c67d0b95272b4..28c123418534b 100644 --- a/.htaccess +++ b/.htaccess @@ -106,6 +106,10 @@ DirectoryIndex index.php order allow,deny deny from all + + order allow,deny + deny from all + order allow,deny deny from all diff --git a/.htaccess.sample b/.htaccess.sample index 13e1e7d48d3e3..0b67b16cfd571 100644 --- a/.htaccess.sample +++ b/.htaccess.sample @@ -270,6 +270,10 @@ DirectoryIndex index.php order allow,deny deny from all + + order allow,deny + deny from all + order allow,deny deny from all diff --git a/.php_cs b/.php_cs index 4bd705bb09a2f..28d1ff0d3a5e9 100644 --- a/.php_cs +++ b/.php_cs @@ -1,6 +1,6 @@ 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: + * [#10441](https://github.com/magento/magento2/issues/10441) -- State/Province Not displayed after edit Billing Address on Sales Orders - Backend Admin. (fixed in [#11378](https://github.com/magento/magento2/pull/11378)) + * [#11328](https://github.com/magento/magento2/issues/11328) -- app:config:dump adds extra space every time in multiline array value (fixed in [#11451](https://github.com/magento/magento2/pull/11451)) + * [#7591](https://github.com/magento/magento2/issues/7591) -- PayPal module, "didgit" misspelling (fixed in [#11674](https://github.com/magento/magento2/pull/11674)) + * [#10301](https://github.com/magento/magento2/issues/10301) -- Customer review report search Bug in 2.1.x, 2.2 (fixed in [#11523](https://github.com/magento/magento2/pull/11523)) + * [#7927](https://github.com/magento/magento2/issues/7927) -- Dashboard graph has broken y-axis range (fixed in [#11753](https://github.com/magento/magento2/pull/11753)) + * [#11586](https://github.com/magento/magento2/issues/11586) -- Cron install / remove via command messes up stderr 2>&1 entries (fixed in [#11590](https://github.com/magento/magento2/pull/11590)) + * [#11322](https://github.com/magento/magento2/issues/11322) -- User.ini files specify 768M - Docs recommend at least 1G (fixed in [#11761](https://github.com/magento/magento2/pull/11761)) + * [#9007](https://github.com/magento/magento2/issues/9007) -- Get MAGETWO-52856 into Magento 2.1.x (fixed in [#11640](https://github.com/magento/magento2/pull/11640)) + * [#6891](https://github.com/magento/magento2/issues/6891) -- Add-to-cart checkbox still visible when $canItemsAddToCart = false (fixed in [#11611](https://github.com/magento/magento2/pull/11611)) + * [#11729](https://github.com/magento/magento2/issues/11729) -- Exported Excel with negative number can't be opened by MS Office (fixed in [#11758](https://github.com/magento/magento2/pull/11758)) + * [#4808](https://github.com/magento/magento2/issues/4808) -- The price of product custom option can't be set to 0. (fixed in [#11844](https://github.com/magento/magento2/pull/11844)) + * [#7640](https://github.com/magento/magento2/issues/7640) -- X-Magento-Tags header containing whitespaces causes exception (fixed in [#11848](https://github.com/magento/magento2/pull/11848)) + * [#10185](https://github.com/magento/magento2/issues/10185) -- New Orders are not in Order grid after data migration from M 1.7.0.2 to M 2.1.7 (fixed in [#11932](https://github.com/magento/magento2/pull/11932)) + * [#8799](https://github.com/magento/magento2/issues/8799) -- Image brackground (fixed in [#11890](https://github.com/magento/magento2/pull/11890)) + * [#11898](https://github.com/magento/magento2/issues/11898) -- Zip code Netherlands should allow zipcode without space (fixed in [#11960](https://github.com/magento/magento2/pull/11960)) + * [#7995](https://github.com/magento/magento2/issues/7995) -- If you leave as default, shipping lines disappear (fixed in [#12022](https://github.com/magento/magento2/pull/12022)) + * [#5439](https://github.com/magento/magento2/issues/5439) -- Newsletter subscription (fixed in [#11316](https://github.com/magento/magento2/pull/11316)) + * [#8846](https://github.com/magento/magento2/issues/8846) -- Attribute option value uniqueness is not checked if created via REST Api (fixed in [#11786](https://github.com/magento/magento2/pull/11786)) + * [#11996](https://github.com/magento/magento2/issues/11996) -- Magento 2 Store Code validation regex: doesn't support uppercase letters in store code (fixed in [#12040](https://github.com/magento/magento2/pull/12040)) + * [#7903](https://github.com/magento/magento2/issues/7903) -- Datepicker does not scroll (fixed in [#12045](https://github.com/magento/magento2/pull/12045)) + * [#11697](https://github.com/magento/magento2/issues/11697) -- Theme: Added html node to page xml root, cause validation error (fixed in [#11861](https://github.com/magento/magento2/pull/11861)) + * [#11022](https://github.com/magento/magento2/issues/11022) -- GET v1/products/attribute-sets/sets/list inconsistent return result (fixed in [#11432](https://github.com/magento/magento2/pull/11432)) + * [#10032](https://github.com/magento/magento2/issues/10032) -- Download back-up .tgz always takes the latest that's created (fixed in [#11596](https://github.com/magento/magento2/pull/11596)) + * [#9830](https://github.com/magento/magento2/issues/9830) -- Null order in Magento\Sales\Block\Order\PrintShipment.php (fixed in [#11631](https://github.com/magento/magento2/pull/11631)) + * [#10530](https://github.com/magento/magento2/issues/10530) -- Print order error on magento 2.1.8 (fixed in [#11631](https://github.com/magento/magento2/pull/11631)) + * [#6597](https://github.com/magento/magento2/issues/6597) -- Sales email subject "&" turns to (fixed in [#12115](https://github.com/magento/magento2/pull/12115)) + * [#8094](https://github.com/magento/magento2/issues/8094) -- Special characters in store name converted to numerical character references in email subject (fixed in [#12115](https://github.com/magento/magento2/pull/12115)) + * [#10767](https://github.com/magento/magento2/issues/10767) -- Race condition causing duplicate orders with double-clicks on Braintree "Pay" button (fixed in [#11901](https://github.com/magento/magento2/pull/11901)) + * [#8172](https://github.com/magento/magento2/issues/8172) -- Free shipping coupon not working with Table Rates shipping - Sorry, no quotes are available for this order. (fixed in [#11919](https://github.com/magento/magento2/pull/11919)) + * [#8089](https://github.com/magento/magento2/issues/8089) -- Cart Price Rules based on Shipping Method can't be applied in basket (fixed in [#11919](https://github.com/magento/magento2/pull/11919)) + * [#10507](https://github.com/magento/magento2/issues/10507) -- Free shipping not being properly applied in CE 2.1.8 (fixed in [#11919](https://github.com/magento/magento2/pull/11919)) + * [#3596](https://github.com/magento/magento2/issues/3596) -- Notice: Undefined index: value in /app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Select.php on line 72 (fixed in [#12284](https://github.com/magento/magento2/pull/12284)) + * [#10347](https://github.com/magento/magento2/issues/10347) -- Wrong order tax amounts displayed when using specific tax configuration (fixed in [#11593](https://github.com/magento/magento2/pull/11593)) +* GitHub pull requests: + * [#11378](https://github.com/magento/magento2/pull/11378) -- Save region correctly to save sales address from admin [backport] (by @raumatbel) + * [#11451](https://github.com/magento/magento2/pull/11451) -- [Backport 2.1-develop] #11328 : app:config:dump adds extra space every time in multiline array value (by @adrian-martinez-interactiv4) + * [#11674](https://github.com/magento/magento2/pull/11674) -- [TASK] Removed Typo in Paypal Module didgit => digit (by @lewisvoncken) + * [#11678](https://github.com/magento/magento2/pull/11678) -- [BACKPORT 2.1] [TASK] Moved Customer Groups Menu Item from Other sett… (by @lewisvoncken) + * [#11523](https://github.com/magento/magento2/pull/11523) -- [Backport 2.1-develop] Fix Filter Customer Report Review (by @osrecio) + * [#11753](https://github.com/magento/magento2/pull/11753) -- [Backport 2.1-develop] Dashboard Fix Y Axis for range (by @osrecio) + * [#11590](https://github.com/magento/magento2/pull/11590) -- [Backport 2.1-develop] #11586 Fix duplicated crontab 2>&1 expression (by @adrian-martinez-interactiv4) + * [#11761](https://github.com/magento/magento2/pull/11761) -- [BACKPORT 2.1] [TASK] Incorrect minimum memory_limit references have … (by @lewisvoncken) + * [#11640](https://github.com/magento/magento2/pull/11640) -- 9007: Get MAGETWO-52856 into Magento 2.1.x (by @nmalevanec) + * [#11611](https://github.com/magento/magento2/pull/11611) -- FR#6891_21 Add-to-cart checkbox still visible when = false [Backport 2.1 develop] (by @mrodespin) + * [#11606](https://github.com/magento/magento2/pull/11606) -- [Backport 2.1-develop] Fix AcountManagementTest unit test fail randomly (by @adrian-martinez-interactiv4) + * [#11758](https://github.com/magento/magento2/pull/11758) -- Fix #11729 - negative value in excel export[M2.1] (by @hauso) + * [#11728](https://github.com/magento/magento2/pull/11728) -- Check variable existence in prepareOptionIds(array) in EavAttribute.php (by @angelo983) + * [#11844](https://github.com/magento/magento2/pull/11844) -- Save the price 0 as price in custom options [backport 2.1] (by @raumatbel) + * [#11848](https://github.com/magento/magento2/pull/11848) -- [2.1-develop] X-Magento-Tags header containing whitespaces causes exception (by @ihor-sviziev) + * [#11932](https://github.com/magento/magento2/pull/11932) -- [2.1-develop] Order grid - Sort by Purchase Date Desc by default (by @ihor-sviziev) + * [#11804](https://github.com/magento/magento2/pull/11804) -- [Backport 2.1-develop] #8236 FIX CMS blocks (by @thiagolima-bm) + * [#11890](https://github.com/magento/magento2/pull/11890) -- Save background color correctly in images. [backport 2.1] (by @raumatbel) + * [#11920](https://github.com/magento/magento2/pull/11920) -- [BACKPORT 2.1] [TASK] Add resetPassword call to the webapi (by @lewisvoncken) + * [#11960](https://github.com/magento/magento2/pull/11960) -- [Backport 2.1] #11898 - Change NL PostCode Pattern (by @osrecio) + * [#11621](https://github.com/magento/magento2/pull/11621) -- Check attribute unique between same fields in magento commerce [backport 2.1] (by @raumatbel) + * [#12022](https://github.com/magento/magento2/pull/12022) -- Add validation for number of street lines [Backport 2.1] (by @crissanclick) + * [#11316](https://github.com/magento/magento2/pull/11316) -- [Backport 2.1-develop] Send email to subscribers only when are new (by @osrecio) + * [#11786](https://github.com/magento/magento2/pull/11786) -- fix #8846 [Backport 2.1-develop]: avoid duplicated attribute option values (by @gomencal) + * [#12040](https://github.com/magento/magento2/pull/12040) -- [backport 2.1] Magento 2 Store Code validation regex: doesn't support uppercase letters in store code (by @manuelson) + * [#12045](https://github.com/magento/magento2/pull/12045) -- #7903 correct the position of the datepicker when you scroll (by @lionelalvarez) + * [#11861](https://github.com/magento/magento2/pull/11861) -- [Backport 2.1-develop] #11697 Theme: Added html node to page xml root, cause validation error (by @adrian-martinez-interactiv4) + * [#12092](https://github.com/magento/magento2/pull/12092) -- Fix "Undefined variable: responseAjax" notice when trying to save a shipment package (backport fix to 2.1) (by @lazyguru) + * [#11432](https://github.com/magento/magento2/pull/11432) -- FIX #11022 in 2.1-develop: Filter Groups of search criteria parameter have not been included for further processing (by @davidverholen) + * [#11596](https://github.com/magento/magento2/pull/11596) -- Fix issue #10032 - Download back-up .tgz always takes the latest that's created (2.1-develop) (by @PieterCappelle) + * [#11631](https://github.com/magento/magento2/pull/11631) -- Fixed order items list for order printing (by @rogyar) + * [#11739](https://github.com/magento/magento2/pull/11739) -- [Backport 2.1-develop] Remove hardcoding for Magento_Backend::admin in ACL tree (by @navarr) + * [#12115](https://github.com/magento/magento2/pull/12115) -- Fix issue with special characters in email subject (by @ihor-sviziev) + * [#11901](https://github.com/magento/magento2/pull/11901) -- [Backport 2.1-develop] #10767 Race condition causing duplicate orders with double-clicks on Braintree "Pay" button (by @tr33m4n) + * [#11919](https://github.com/magento/magento2/pull/11919) -- [BACKPORT 2.1] [BUGFIX] Add FreeShipping to the Items when SalesRule uses (by @lewisvoncken) + * [#12106](https://github.com/magento/magento2/pull/12106) -- update button.phtml overcomplicated translation phrase. (by @ChuckyK) + * [#12284](https://github.com/magento/magento2/pull/12284) -- Issue: 3596. Resolve Notice with undefined index 'value' (by @madonzy) + * [#11593](https://github.com/magento/magento2/pull/11593) -- Fix issue #10347 - Wrong order tax amounts displayed when using specific tax configuration (2.1-develop) (by @PieterCappelle) + 2.1.10 ============= * GitHub issues: diff --git a/COPYING.txt b/COPYING.txt index d7d04f5b7edba..d123a34602dc5 100644 --- a/COPYING.txt +++ b/COPYING.txt @@ -1,3 +1,5 @@ +Copyright © 2013-present Magento, Inc. + Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) diff --git a/Gruntfile.js.sample b/Gruntfile.js.sample index 5be5c29610e39..369f3114c77de 100644 --- a/Gruntfile.js.sample +++ b/Gruntfile.js.sample @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/README.md b/README.md index 74f3a517570d0..aa83b880ca38d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ -[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=develop)](https://travis-ci.org/magento/magento2) +[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=2.1-develop)](https://travis-ci.org/magento/magento2) +[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

Welcome

-Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results. +Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results. The installation instructions that used to be here are now published on our GitHub site. Use the information on this page to get started or go directly to the guide. @@ -73,6 +74,19 @@ To suggest documentation improvements, click [here][4]. [3]: [4]: +

Community Maintainers

+The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions. + + + + + +

Top Contributors

+Magento is thankful for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform. + + + +

Reporting security issues

To report security vulnerabilities in Magento software or web sites, please e-mail security@magento.com. Please do not report security issues using GitHub. Be sure to encrypt your e-mail with our encryption key if it includes sensitive information. Learn more about reporting security issues here. diff --git a/app/autoload.php b/app/autoload.php index 6fdfcd07fdff1..54087d0255495 100644 --- a/app/autoload.php +++ b/app/autoload.php @@ -2,7 +2,7 @@ /** * Register basic autoloader that uses include path * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ use Magento\Framework\Autoload\AutoloaderRegistry; @@ -35,6 +35,3 @@ } AutoloaderRegistry::registerAutoloader(new ClassLoaderWrapper($composerAutoloader)); - -// Sets default autoload mappings, may be overridden in Bootstrap::create -\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []); diff --git a/app/bootstrap.php b/app/bootstrap.php index eb91654f1fcf4..7cff670ac0d45 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -1,6 +1,6 @@ (string)\Magento\Framework\Notification\MessageInterface::SEVERITY_NOTICE, - 'text' => 'You have viewed and resolved all recent system notices. ' - . 'Please refresh the web page to clear the notice alert.', + 'text' => __( + 'You have viewed and resolved all recent system notices. ' + . 'Please refresh the web page to clear the notice alert.' + ) ]; } $this->getResponse()->representJson($this->jsonHelper->jsonEncode($result)); diff --git a/app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php b/app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php index 9863019b2de5e..7b97a4f266bec 100644 --- a/app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php +++ b/app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/di.xml b/app/code/Magento/AdminNotification/etc/adminhtml/di.xml index 1be5f99616cc3..7eb1588baeb51 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/di.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/events.xml b/app/code/Magento/AdminNotification/etc/adminhtml/events.xml index 9c897af0a2f94..e019bc47be509 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/events.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/menu.xml b/app/code/Magento/AdminNotification/etc/adminhtml/menu.xml index 47c6644b9f369..fbed5c0960b73 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/menu.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml b/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml index a710049993270..a8bff21b42a9f 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/system.xml b/app/code/Magento/AdminNotification/etc/adminhtml/system.xml index ab0cff5f897c1..71f25741ca851 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/system.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/etc/config.xml b/app/code/Magento/AdminNotification/etc/config.xml index f23962e0565f0..fd423cc554499 100644 --- a/app/code/Magento/AdminNotification/etc/config.xml +++ b/app/code/Magento/AdminNotification/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/etc/di.xml b/app/code/Magento/AdminNotification/etc/di.xml index 03e415dd3714e..e0b0cbd6bfffa 100644 --- a/app/code/Magento/AdminNotification/etc/di.xml +++ b/app/code/Magento/AdminNotification/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/etc/module.xml b/app/code/Magento/AdminNotification/etc/module.xml index 8fdfc713293d3..8a792ee8453ce 100644 --- a/app/code/Magento/AdminNotification/etc/module.xml +++ b/app/code/Magento/AdminNotification/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/i18n/en_US.csv b/app/code/Magento/AdminNotification/i18n/en_US.csv index 7b55e96976cad..8f780efa6c184 100644 --- a/app/code/Magento/AdminNotification/i18n/en_US.csv +++ b/app/code/Magento/AdminNotification/i18n/en_US.csv @@ -49,3 +49,4 @@ Severity,Severity "Date Added","Date Added" Message,Message Actions,Actions +"You have viewed and resolved all recent system notices. Please refresh the web page to clear the notice alert.","You have viewed and resolved all recent system notices. Please refresh the web page to clear the notice alert." diff --git a/app/code/Magento/AdminNotification/registration.php b/app/code/Magento/AdminNotification/registration.php index 9bd6a540462f7..b0e1c4ef1aa44 100644 --- a/app/code/Magento/AdminNotification/registration.php +++ b/app/code/Magento/AdminNotification/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_index.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_index.xml index 1083e32f3c942..112052830e38f 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_index.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml index 836399135228a..4e07391cae96c 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdminNotification/view/adminhtml/requirejs-config.js b/app/code/Magento/AdminNotification/view/adminhtml/requirejs-config.js index c866e796e0ade..9b29b3402c402 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/AdminNotification/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml b/app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml index 5e0e23246764a..c6b8bda208410 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml +++ b/app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/di.xml b/app/code/Magento/AdvancedPricingImportExport/etc/di.xml index 15e505282dd94..631e351e76b41 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/di.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/export.xml b/app/code/Magento/AdvancedPricingImportExport/etc/export.xml index da176e7bd73e1..ca2408420daa2 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/export.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/export.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/import.xml b/app/code/Magento/AdvancedPricingImportExport/etc/import.xml index 80c8873aad387..eb6e5c5f666c2 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/import.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/import.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/module.xml b/app/code/Magento/AdvancedPricingImportExport/etc/module.xml index f9ad9f34b2ad6..ac4b8dafd0183 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/module.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/AdvancedPricingImportExport/registration.php b/app/code/Magento/AdvancedPricingImportExport/registration.php index a9477f3a9a1fb..bd00e7cf7d5ae 100644 --- a/app/code/Magento/AdvancedPricingImportExport/registration.php +++ b/app/code/Magento/AdvancedPricingImportExport/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Authorization/etc/module.xml b/app/code/Magento/Authorization/etc/module.xml index f27253870499d..357e36d937e50 100644 --- a/app/code/Magento/Authorization/etc/module.xml +++ b/app/code/Magento/Authorization/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorization/registration.php b/app/code/Magento/Authorization/registration.php index f35b17a4d6710..1b7855f81ce35 100644 --- a/app/code/Magento/Authorization/registration.php +++ b/app/code/Magento/Authorization/registration.php @@ -1,6 +1,6 @@ orderFactory = $orderFactory; $this->storeManager = $storeManager; @@ -180,6 +194,8 @@ public function __construct( $this->orderSender = $orderSender; $this->transactionRepository = $transactionRepository; $this->_code = static::METHOD_CODE; + $this->paymentFailures = $paymentFailures ? : ObjectManager::getInstance() + ->get(PaymentFailuresInterface::class); parent::__construct( $context, @@ -564,13 +580,10 @@ public function process(array $responseData) $this->validateResponse(); $response = $this->getResponse(); - //operate with order - $orderIncrementId = $response->getXInvoiceNum(); $responseText = $this->dataHelper->wrapGatewayError($response->getXResponseReasonText()); $isError = false; - if ($orderIncrementId) { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->orderFactory->create()->loadByIncrementId($orderIncrementId); + if ($this->getOrderIncrementId()) { + $order = $this->getOrderFromResponse(); //check payment method $payment = $order->getPayment(); if (!$payment || $payment->getMethod() != $this->getCode()) { @@ -635,9 +648,10 @@ public function checkResponseCode() return true; case self::RESPONSE_CODE_DECLINED: case self::RESPONSE_CODE_ERROR: - throw new \Magento\Framework\Exception\LocalizedException( - $this->dataHelper->wrapGatewayError($this->getResponse()->getXResponseReasonText()) - ); + $errorMessage = $this->dataHelper->wrapGatewayError($this->getResponse()->getXResponseReasonText()); + $order = $this->getOrderFromResponse(); + $this->paymentFailures->handle($order->getQuoteId(), $errorMessage); + throw new \Magento\Framework\Exception\LocalizedException($errorMessage); default: throw new \Magento\Framework\Exception\LocalizedException( __('There was a payment authorization error.') @@ -992,12 +1006,40 @@ protected function getTransactionResponse($transactionId) private function getPsrLogger() { if (null === $this->psrLogger) { - $this->psrLogger = \Magento\Framework\App\ObjectManager::getInstance() + $this->psrLogger = ObjectManager::getInstance() ->get(\Psr\Log\LoggerInterface::class); } return $this->psrLogger; } + /** + * Fetch order by increment id from response. + * + * @return \Magento\Sales\Model\Order + */ + private function getOrderFromResponse() + { + if (!$this->order) { + $this->order = $this->orderFactory->create(); + + if ($incrementId = $this->getOrderIncrementId()) { + $this->order = $this->order->loadByIncrementId($incrementId); + } + } + + return $this->order; + } + + /** + * Fetch order increment id from response. + * + * @return string + */ + private function getOrderIncrementId() + { + return $this->getResponse()->getXInvoiceNum(); + } + /** * Checks if filter action is Report Only. Transactions that trigger this filter are processed as normal, * but are also reported in the Merchant Interface as triggering this filter. diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Request.php b/app/code/Magento/Authorizenet/Model/Directpost/Request.php index e43856a5e3508..d9a403e5c991e 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost/Request.php +++ b/app/code/Magento/Authorizenet/Model/Directpost/Request.php @@ -1,6 +1,6 @@ scopeConfigMock = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface') @@ -104,6 +110,12 @@ protected function setUp() ->setMethods(['getTransactionDetails']) ->getMock(); + $this->paymentFailures = $this->getMockBuilder( + PaymentFailuresInterface::class + ) + ->disableOriginalConstructor() + ->getMock(); + $this->requestFactory = $this->getRequestFactoryMock(); $httpClientFactoryMock = $this->getHttpClientFactoryMock(); @@ -117,7 +129,8 @@ protected function setUp() 'responseFactory' => $this->responseFactoryMock, 'transactionRepository' => $this->transactionRepositoryMock, 'transactionService' => $this->transactionServiceMock, - 'httpClientFactory' => $httpClientFactoryMock + 'httpClientFactory' => $httpClientFactoryMock, + 'paymentFailures' => $this->paymentFailures ] ); } @@ -313,12 +326,15 @@ public function checkResponseCodeSuccessDataProvider() } /** + * Checks response failures behaviour. + * * @param bool $responseCode + * @param int $failuresHandlerCalls * * @expectedException \Magento\Framework\Exception\LocalizedException * @dataProvider checkResponseCodeFailureDataProvider */ - public function testCheckResponseCodeFailure($responseCode) + public function testCheckResponseCodeFailure($responseCode, $failuresHandlerCalls) { $reasonText = 'reason text'; @@ -333,6 +349,23 @@ public function testCheckResponseCodeFailure($responseCode) ->with($reasonText) ->willReturn(__('Gateway error: %1', $reasonText)); + $orderMock = $this->getMockBuilder(Order::class) + ->disableOriginalConstructor() + ->getMock(); + + $orderMock->expects($this->exactly($failuresHandlerCalls)) + ->method('getQuoteId') + ->willReturn(1); + + $this->paymentFailures->expects($this->exactly($failuresHandlerCalls)) + ->method('handle') + ->with(1); + + $reflection = new \ReflectionClass($this->directpost); + $order = $reflection->getProperty('order'); + $order->setAccessible(true); + $order->setValue($this->directpost, $orderMock); + $this->directpost->checkResponseCode(); } @@ -342,9 +375,9 @@ public function testCheckResponseCodeFailure($responseCode) public function checkResponseCodeFailureDataProvider() { return [ - ['responseCode' => Directpost::RESPONSE_CODE_DECLINED], - ['responseCode' => Directpost::RESPONSE_CODE_ERROR], - ['responseCode' => 999999] + ['responseCode' => Directpost::RESPONSE_CODE_DECLINED, 1], + ['responseCode' => Directpost::RESPONSE_CODE_ERROR, 1], + ['responseCode' => 999999, 0] ]; } diff --git a/app/code/Magento/Authorizenet/Test/Unit/Model/Request/FactoryTest.php b/app/code/Magento/Authorizenet/Test/Unit/Model/Request/FactoryTest.php index e1ee29e819b7d..b7c2783d20fe6 100644 --- a/app/code/Magento/Authorizenet/Test/Unit/Model/Request/FactoryTest.php +++ b/app/code/Magento/Authorizenet/Test/Unit/Model/Request/FactoryTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/events.xml b/app/code/Magento/Authorizenet/etc/adminhtml/events.xml index 8114b8c8312cc..085598d3fa95c 100644 --- a/app/code/Magento/Authorizenet/etc/adminhtml/events.xml +++ b/app/code/Magento/Authorizenet/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml b/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml index 028e1a8500d07..00bb0475766f9 100644 --- a/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml +++ b/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/system.xml b/app/code/Magento/Authorizenet/etc/adminhtml/system.xml index 3d4cde185dcd1..1319fa102d0d8 100644 --- a/app/code/Magento/Authorizenet/etc/adminhtml/system.xml +++ b/app/code/Magento/Authorizenet/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/config.xml b/app/code/Magento/Authorizenet/etc/config.xml index f5b053003f1f2..eacf77cda1e77 100644 --- a/app/code/Magento/Authorizenet/etc/config.xml +++ b/app/code/Magento/Authorizenet/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/di.xml b/app/code/Magento/Authorizenet/etc/di.xml index 3bd70f25a3bf9..b25db520022a2 100644 --- a/app/code/Magento/Authorizenet/etc/di.xml +++ b/app/code/Magento/Authorizenet/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/frontend/di.xml b/app/code/Magento/Authorizenet/etc/frontend/di.xml index 8dcf8ed700dcb..a0e5d907b15aa 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/di.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/frontend/events.xml b/app/code/Magento/Authorizenet/etc/frontend/events.xml index 2c6e3f12a9196..9910dc4776fbe 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/events.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/frontend/page_types.xml b/app/code/Magento/Authorizenet/etc/frontend/page_types.xml index be4692b135955..56bfca71231cd 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/page_types.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/frontend/routes.xml b/app/code/Magento/Authorizenet/etc/frontend/routes.xml index 1bdcff9f1efe1..e570f24f66c9c 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/routes.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/frontend/sections.xml b/app/code/Magento/Authorizenet/etc/frontend/sections.xml index 977a4b14e3e14..1239398b06a10 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/sections.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/sections.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/etc/module.xml b/app/code/Magento/Authorizenet/etc/module.xml index 91d93e56e0cad..6d05f14d21318 100644 --- a/app/code/Magento/Authorizenet/etc/module.xml +++ b/app/code/Magento/Authorizenet/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/registration.php b/app/code/Magento/Authorizenet/registration.php index ad98beafa744d..1ad96fcf28049 100644 --- a/app/code/Magento/Authorizenet/registration.php +++ b/app/code/Magento/Authorizenet/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml index 851cbf398750d..b675e49d72618 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml index ec5ce845b8521..ae14700836667 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_view.xml index 7470afcfdb7d0..57aeffce62c27 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/iframe.phtml b/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/iframe.phtml index 2b95af46a6b47..8bfeede4059c2 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/iframe.phtml +++ b/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/iframe.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml index 1eedd5e26a3ed..2486b7af30964 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml index 1eedd5e26a3ed..2486b7af30964 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_index_index.xml index 1025207fec1d5..a61e503fedc64 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Authorizenet/view/frontend/requirejs-config.js b/app/code/Magento/Authorizenet/view/frontend/requirejs-config.js index 26c0e732303d0..8edc38dce6f60 100644 --- a/app/code/Magento/Authorizenet/view/frontend/requirejs-config.js +++ b/app/code/Magento/Authorizenet/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/authorizenet.js b/app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/authorizenet.js index 6f7f94eab63fc..c8293cf35582d 100644 --- a/app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/authorizenet.js +++ b/app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/authorizenet.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*browser:true*/ diff --git a/app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js b/app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js index a40f3e9276712..3e43121f72720 100644 --- a/app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js +++ b/app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define( diff --git a/app/code/Magento/Authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html b/app/code/Magento/Authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html index 2de6cad54d267..e12096b8173f7 100644 --- a/app/code/Magento/Authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html +++ b/app/code/Magento/Authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/App/AbstractAction.php b/app/code/Magento/Backend/App/AbstractAction.php index 95045e0946831..ffcbf3028b060 100644 --- a/app/code/Magento/Backend/App/AbstractAction.php +++ b/app/code/Magento/Backend/App/AbstractAction.php @@ -1,6 +1,6 @@ _view->loadLayout(['default', 'adminhtml_denied'], true, true, false); $this->_view->renderLayout(); $this->_request->setDispatched(true); + return $this->_response; } @@ -223,6 +224,11 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request) $this->_processLocaleSettings(); + // Need to preload isFirstPageAfterLogin (see https://github.com/magento/magento2/issues/15510) + if ($this->_auth->isLoggedIn()) { + $this->_auth->getAuthStorage()->isFirstPageAfterLogin(); + } + return parent::dispatch($request); } diff --git a/app/code/Magento/Backend/App/Action.php b/app/code/Magento/Backend/App/Action.php index e4847301e3ce4..cc085e1b0dafc 100644 --- a/app/code/Magento/Backend/App/Action.php +++ b/app/code/Magento/Backend/App/Action.php @@ -1,6 +1,6 @@ getUrl() == '#') { - $output = '' - . '' . $this->_getAnchorLabel($menuItem) . '' - . ''; + $output = ''; + if ($menuItem->hasChildren()) { + $output = '' + . '' . $this->_getAnchorLabel($menuItem) . '' + . ''; + } } else { $output = '_renderItemAnchorTitle( $menuItem diff --git a/app/code/Magento/Backend/Block/Page.php b/app/code/Magento/Backend/Block/Page.php index 750eaebf58de6..6042479f2c784 100644 --- a/app/code/Magento/Backend/Block/Page.php +++ b/app/code/Magento/Backend/Block/Page.php @@ -1,6 +1,6 @@ _localeDate->getDateFormat(\IntlDateFormatter::SHORT) ); } + + if (is_string($value)) { + return $this->escapeHtml($value); + } + return $value; } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Datetime.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Datetime.php index 8cfb90ea1757a..13d5de1f3fc85 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Datetime.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Datetime.php @@ -1,6 +1,6 @@ _localeDate->formatDateTime($value); } + + if (is_string($value)) { + return $this->escapeHtml($value); + } + return $value; } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/FilterInterface.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/FilterInterface.php index dc68abae35416..cc658c6ced15d 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/FilterInterface.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/FilterInterface.php @@ -1,6 +1,6 @@ getValue()) { return $this->getColumn()->getValue(); - } else { - return [['neq' => $this->getColumn()->getValue()], ['is' => new \Zend_Db_Expr('NULL')]]; } + return [['neq' => $this->getColumn()->getValue()], ['is' => new \Zend_Db_Expr('NULL')]]; } } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Range.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Range.php index c20aa66d1395f..8d6a1a750e16d 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Range.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Range.php @@ -1,6 +1,6 @@ getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return join(',', $selected); - } else { - return ''; } + return ''; } /** @@ -220,9 +219,8 @@ public function getSelected() if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return $selected; - } else { - return []; } + return []; } /** diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php index 15250b3904d2d..4b36f0655a2f5 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php @@ -1,6 +1,6 @@ getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return join(',', $selected); - } else { - return ''; } + return ''; } /** @@ -230,9 +229,8 @@ public function getSelected() if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return $selected; - } else { - return []; } + return []; } /** diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php index cf08e78b9fc23..9efc1de8f15f0 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php @@ -1,6 +1,6 @@ getRedirect($backendUrl); - } else { - return $this->resultPageFactory->create(); } + return $this->resultPageFactory->create(); } /** diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php index b970a9743438b..41e32c929287a 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php @@ -1,7 +1,7 @@ securityCookie instanceof SecurityCookie)) { return \Magento\Framework\App\ObjectManager::getInstance()->get(SecurityCookie::class); - } else { - return $this->securityCookie; } + return $this->securityCookie; } /** diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php index 4f79572cd19b3..d61a76055b3e5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php @@ -1,6 +1,6 @@ useSecretKey()) { 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); - if ($cacheSecretKey) { - $secret = [self::SECRET_KEY_PARAM_NAME => "\${$routeName}/{$controllerName}/{$actionName}\$"]; - } else { - $secret = [ - self::SECRET_KEY_PARAM_NAME => $this->getSecretKey($routeName, $controllerName, $actionName), - ]; - } - if (is_array($routeParams)) { - $routeParams = array_merge($secret, $routeParams); - } else { - $routeParams = $secret; + if (!isset($routeParams[self::SECRET_KEY_PARAM_NAME])) { + if (!is_array($routeParams)) { + $routeParams = []; + } + + $secretKey = $cacheSecretKey + ? "\${$routeName}/{$controllerName}/{$actionName}\$" + : $this->getSecretKey($routeName, $controllerName, $actionName); + $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/app/code/Magento/Backend/Model/Url/ScopeResolver.php b/app/code/Magento/Backend/Model/Url/ScopeResolver.php index 923341d4a30c8..04713dc4eb372 100644 --- a/app/code/Magento/Backend/Model/Url/ScopeResolver.php +++ b/app/code/Magento/Backend/Model/Url/ScopeResolver.php @@ -1,6 +1,6 @@ mathRandomMock = $this->getMockBuilder('Magento\Framework\Math\Random') + $this->mathRandomMock = $this->getMockBuilder(\Magento\Framework\Math\Random::class) ->disableOriginalConstructor() ->setMethods(['getUniqueHash']) ->getMock(); - $this->localeResolverMock = $this->getMockBuilder('Magento\Framework\Locale\ResolverInterface') + $this->localeResolverMock = $this->getMockBuilder(\Magento\Framework\Locale\ResolverInterface::class) ->disableOriginalConstructor() ->setMethods([]) ->getMock(); $this->dateTimeFormatterMock = $this - ->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface') + ->getMockBuilder(\Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface::class) ->disableOriginalConstructor() ->setMethods([]) ->getMock(); - $this->columnMock = $this->getMockBuilder('Magento\Backend\Block\Widget\Grid\Column') + $this->columnMock = $this->getMockBuilder(\Magento\Backend\Block\Widget\Grid\Column::class) ->disableOriginalConstructor() ->setMethods(['getTimezone', 'getHtmlId', 'getId']) ->getMock(); - $this->localeDateMock = $this->getMockBuilder('\Magento\Framework\Stdlib\DateTime\TimezoneInterface') + $this->localeDateMock = $this->getMockBuilder(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::class) ->disableOriginalConstructor() ->setMethods([]) ->getMock(); $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManagerHelper->getObject( - 'Magento\Backend\Block\Widget\Grid\Column\Filter\Date', + \Magento\Backend\Block\Widget\Grid\Column\Filter\Date::class, [ 'mathRandom' => $this->mathRandomMock, 'localeResolver' => $this->localeResolverMock, diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DatetimeTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DatetimeTest.php index 5d9bd2a0ab3dc..e648a1fa0673f 100644 --- a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DatetimeTest.php +++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DatetimeTest.php @@ -1,6 +1,6 @@ mathRandomMock = $this->getMockBuilder('Magento\Framework\Math\Random') + $this->mathRandomMock = $this->getMockBuilder(\Magento\Framework\Math\Random::class) ->disableOriginalConstructor() ->setMethods(['getUniqueHash']) ->getMock(); - $this->localeResolverMock = $this->getMockBuilder('Magento\Framework\Locale\ResolverInterface') + $this->localeResolverMock = $this->getMockBuilder(\Magento\Framework\Locale\ResolverInterface::class) ->disableOriginalConstructor() ->setMethods([]) ->getMock(); $this->dateTimeFormatterMock = $this - ->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface') + ->getMockBuilder(\Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface::class) ->disableOriginalConstructor() ->setMethods([]) ->getMock(); - $this->columnMock = $this->getMockBuilder('Magento\Backend\Block\Widget\Grid\Column') + $this->columnMock = $this->getMockBuilder(\Magento\Backend\Block\Widget\Grid\Column::class) ->disableOriginalConstructor() ->setMethods(['getTimezone', 'getHtmlId', 'getId']) ->getMock(); - $this->localeDateMock = $this->getMockBuilder('\Magento\Framework\Stdlib\DateTime\TimezoneInterface') + $this->localeDateMock = $this->getMockBuilder(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::class) ->disableOriginalConstructor() ->setMethods([]) ->getMock(); $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManagerHelper->getObject( - 'Magento\Backend\Block\Widget\Grid\Column\Filter\Datetime', + \Magento\Backend\Block\Widget\Grid\Column\Filter\Datetime::class, [ 'mathRandom' => $this->mathRandomMock, 'localeResolver' => $this->localeResolverMock, diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/StoreTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/StoreTest.php index 53b836cfe2b44..b340b8629826d 100644 --- a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/StoreTest.php +++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/StoreTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/valid_menu.xml b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/valid_menu.xml index d60f5a0cd37da..6a169ea126a68 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/valid_menu.xml +++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/valid_menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php b/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php index 7b25a07e51aba..8a7d3ba9f74d6 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/Test/Unit/Model/_files/menu_merged.xml b/app/code/Magento/Backend/Test/Unit/Model/_files/menu_merged.xml index e7ac5aec547d2..5f290e635df31 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/_files/menu_merged.xml +++ b/app/code/Magento/Backend/Test/Unit/Model/_files/menu_merged.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/Test/Unit/Setup/ConfigOptionsListTest.php b/app/code/Magento/Backend/Test/Unit/Setup/ConfigOptionsListTest.php index 89a87de6f12f5..210b4de137172 100644 --- a/app/code/Magento/Backend/Test/Unit/Setup/ConfigOptionsListTest.php +++ b/app/code/Magento/Backend/Test/Unit/Setup/ConfigOptionsListTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/etc/adminhtml/di.xml b/app/code/Magento/Backend/etc/adminhtml/di.xml index c38c284f3c560..eff6262a63da6 100644 --- a/app/code/Magento/Backend/etc/adminhtml/di.xml +++ b/app/code/Magento/Backend/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/etc/adminhtml/menu.xml b/app/code/Magento/Backend/etc/adminhtml/menu.xml index d7d57b7953c77..b6f62310c179e 100644 --- a/app/code/Magento/Backend/etc/adminhtml/menu.xml +++ b/app/code/Magento/Backend/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/etc/adminhtml/routes.xml b/app/code/Magento/Backend/etc/adminhtml/routes.xml index 2f3857c91c5c0..0a870f4fdf4fb 100644 --- a/app/code/Magento/Backend/etc/adminhtml/routes.xml +++ b/app/code/Magento/Backend/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/etc/adminhtml/system.xml b/app/code/Magento/Backend/etc/adminhtml/system.xml index 813a097ea6bf3..8bc52141872ca 100644 --- a/app/code/Magento/Backend/etc/adminhtml/system.xml +++ b/app/code/Magento/Backend/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ @@ -116,7 +116,7 @@ Magento\Config\Model\Config\Source\Yesno - + Magento\Config\Model\Config\Source\Yesno @@ -405,7 +405,7 @@ general Magento_Backend::web - + @@ -415,7 +415,7 @@ Warning! When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).]]> - + Magento\Config\Model\Config\Source\Web\Redirect I.e. redirect from http://example.com/store/ to http://www.example.com/store/ diff --git a/app/code/Magento/Backend/etc/config.xml b/app/code/Magento/Backend/etc/config.xml index ee10f5f4c1683..0f4a3e5153cda 100644 --- a/app/code/Magento/Backend/etc/config.xml +++ b/app/code/Magento/Backend/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/etc/crontab.xml b/app/code/Magento/Backend/etc/crontab.xml index 4f6450a7226ae..e555fbdcb394e 100644 --- a/app/code/Magento/Backend/etc/crontab.xml +++ b/app/code/Magento/Backend/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 2ed8a77bbac43..a6da91f2c9b85 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/etc/menu.xsd b/app/code/Magento/Backend/etc/menu.xsd index 5c5ad89bd89c1..08edb5bb30c75 100644 --- a/app/code/Magento/Backend/etc/menu.xsd +++ b/app/code/Magento/Backend/etc/menu.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/etc/module.xml b/app/code/Magento/Backend/etc/module.xml index b7f188e78d34e..57e00489391f2 100644 --- a/app/code/Magento/Backend/etc/module.xml +++ b/app/code/Magento/Backend/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/etc/webapi.xml b/app/code/Magento/Backend/etc/webapi.xml index 14d4dccc78cbe..7f9da7fe66dc5 100644 --- a/app/code/Magento/Backend/etc/webapi.xml +++ b/app/code/Magento/Backend/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/i18n/en_US.csv b/app/code/Magento/Backend/i18n/en_US.csv index 08a28eb95579b..d34827b14e520 100644 --- a/app/code/Magento/Backend/i18n/en_US.csv +++ b/app/code/Magento/Backend/i18n/en_US.csv @@ -324,7 +324,7 @@ Developer,Developer Debug,Debug "Enabled Template Path Hints for Storefront","Enabled Template Path Hints for Storefront" "Enabled Template Path Hints for Admin","Enabled Template Path Hints for Admin" -"Add Block Names to Hints","Add Block Names to Hints" +"Add Block Class Type to Hints","Add Block Class Type to Hints" "Template Settings","Template Settings" "Allow Symlinks","Allow Symlinks" "Warning! Enabling this feature is not recommended on production environments because it represents a potential security risk.","Warning! Enabling this feature is not recommended on production environments because it represents a potential security risk." diff --git a/app/code/Magento/Backend/registration.php b/app/code/Magento/Backend/registration.php index fac71f545151f..6d5b33f9b463d 100644 --- a/app/code/Magento/Backend/registration.php +++ b/app/code/Magento/Backend/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml index bb7370b3317a4..f4c04e937a00b 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml index 6374f0d31b6bb..de94f28687c3b 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_index.xml index 77ba8f6f39824..ab5ddc414b51f 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersmost.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersmost.xml index 31b3ff2c44bc1..5d82942b2c38c 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersmost.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersmost.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersnewest.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersnewest.xml index ce4e20140eb54..53afc1e89e387 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersnewest.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersnewest.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml index b353b81aa1b7c..803eb1dbe903b 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_productsviewed.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_productsviewed.xml index 4621d83dc6753..a3ee3ec9bf06a 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_productsviewed.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_productsviewed.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml index fac9407cc3298..27f2d021212c7 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml index 598bdf490e8a5..b22f429fceca4 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_account_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_account_index.xml index dfc27d5e6b5e0..6eb3642ad99b0 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_account_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_account_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml index 91469c51e06c9..52fe538a2edcb 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid.xml index bda7f3883adce..314b39ad63108 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid_block.xml index a39aee9813286..52d88ce717043 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_index.xml index 7412c983cff8b..70e4bd94e6a15 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_grid_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_grid_block.xml index 0521a87831663..8dcb6e07b3c4e 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_grid_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_index.xml index 2abd830f5fa37..7fdfe4044a3da 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml index 1ab7ef1e6cf60..7cfe8bc748482 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/editor.xml b/app/code/Magento/Backend/view/adminhtml/layout/editor.xml index 2c34667c0502e..a1b32a3b2243b 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/editor.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/editor.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/empty.xml b/app/code/Magento/Backend/view/adminhtml/layout/empty.xml index e01b48cc71b11..6b97ebabce5b7 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/empty.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/empty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml b/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml index 6ba9743703ed4..4ced64395b424 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml b/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml index 8a48fcca66c0e..93cb1dc01aa19 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/layout/popup.xml b/app/code/Magento/Backend/view/adminhtml/layout/popup.xml index dd65940af81e5..b09a87e035ee4 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/popup.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/popup.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/requirejs-config.js b/app/code/Magento/Backend/view/adminhtml/requirejs-config.js index 2703ea79738b7..3419b18af05cd 100644 --- a/app/code/Magento/Backend/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/Backend/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*eslint no-unused-vars: 0*/ diff --git a/app/code/Magento/Backend/view/adminhtml/templates/admin/access_denied.phtml b/app/code/Magento/Backend/view/adminhtml/templates/admin/access_denied.phtml index 32910c9978d2d..c91cf9b079854 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/admin/access_denied.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/admin/access_denied.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml b/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml index 372e426dc9d00..c829a2f01fa9c 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/templates/admin/overlay_popup.phtml b/app/code/Magento/Backend/view/adminhtml/templates/admin/overlay_popup.phtml index e95b063599daa..833570254095a 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/admin/overlay_popup.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/admin/overlay_popup.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml b/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml index aeac3fd33248c..2152fd5fc44d2 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/templates/page/notices.phtml b/app/code/Magento/Backend/view/adminhtml/templates/page/notices.phtml index b4e7c2d7f50a8..b45a2ae6cb1c1 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/page/notices.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/page/notices.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/design/index.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/design/index.phtml index 2cdb9f451a86f..bb3f69ead1c2d 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/system/design/index.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/system/design/index.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/templates/widget/accordion.phtml b/app/code/Magento/Backend/view/adminhtml/templates/widget/accordion.phtml index 060ee67e9a7b2..d59617a8693eb 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/widget/accordion.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/widget/accordion.phtml @@ -1,6 +1,6 @@ - + diff --git a/app/code/Magento/Backend/view/adminhtml/templates/widget/form.phtml b/app/code/Magento/Backend/view/adminhtml/templates/widget/form.phtml index 72fc76a255c86..560da9bc80102 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/widget/form.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/widget/form.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/ui_component/design_config_listing.xml b/app/code/Magento/Backend/view/adminhtml/ui_component/design_config_listing.xml index c299f217c8df7..26acbad9dee88 100644 --- a/app/code/Magento/Backend/view/adminhtml/ui_component/design_config_listing.xml +++ b/app/code/Magento/Backend/view/adminhtml/ui_component/design_config_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/web/js/bootstrap/editor.js b/app/code/Magento/Backend/view/adminhtml/web/js/bootstrap/editor.js index de003bb3b8d08..2a119a1d9883e 100644 --- a/app/code/Magento/Backend/view/adminhtml/web/js/bootstrap/editor.js +++ b/app/code/Magento/Backend/view/adminhtml/web/js/bootstrap/editor.js @@ -1,6 +1,6 @@ /** * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ require([ diff --git a/app/code/Magento/Backend/view/adminhtml/web/js/media-uploader.js b/app/code/Magento/Backend/view/adminhtml/web/js/media-uploader.js index fe7c8dd7cb800..b1d99487fa843 100644 --- a/app/code/Magento/Backend/view/adminhtml/web/js/media-uploader.js +++ b/app/code/Magento/Backend/view/adminhtml/web/js/media-uploader.js @@ -1,6 +1,6 @@ /** * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global byteConvert*/ diff --git a/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/cells/action-delete.html b/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/cells/action-delete.html index d58d3e8990e64..3003096970759 100644 --- a/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/cells/action-delete.html +++ b/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/cells/action-delete.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html b/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html index 3de4b65aa2a5f..0b785aa9984aa 100644 --- a/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html +++ b/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html @@ -1,6 +1,6 @@ @@ -85,7 +85,7 @@
+ translate="'Search strings are either normal strings or regular expressions (PCRE). They are matched in the same order as entered.'">
: diff --git a/app/code/Magento/Backend/view/adminhtml/web/template/form/element/helper/fallback-reset-link.html b/app/code/Magento/Backend/view/adminhtml/web/template/form/element/helper/fallback-reset-link.html index f788dbb6fbe20..97fe7e2bd9269 100644 --- a/app/code/Magento/Backend/view/adminhtml/web/template/form/element/helper/fallback-reset-link.html +++ b/app/code/Magento/Backend/view/adminhtml/web/template/form/element/helper/fallback-reset-link.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backup/Block/Adminhtml/Backup.php b/app/code/Magento/Backup/Block/Adminhtml/Backup.php index 4d4624caa3b24..7e8cad886b4a3 100644 --- a/app/code/Magento/Backup/Block/Adminhtml/Backup.php +++ b/app/code/Magento/Backup/Block/Adminhtml/Backup.php @@ -1,6 +1,6 @@ getRequest()->isAjax()) { + if (!$this->requestAllowed()) { return $this->_redirect('*/*/index'); } @@ -28,7 +28,7 @@ public function execute() /** * @var \Magento\Backup\Helper\Data $helper */ - $helper = $this->_objectManager->get('Magento\Backup\Helper\Data'); + $helper = $this->_objectManager->get(\Magento\Backup\Helper\Data::class); try { $type = $this->getRequest()->getParam('type'); @@ -73,7 +73,7 @@ public function execute() if ($type != \Magento\Framework\Backup\Factory::TYPE_DB) { /** @var Filesystem $filesystem */ - $filesystem = $this->_objectManager->get('Magento\Framework\Filesystem'); + $filesystem = $this->_objectManager->get(\Magento\Framework\Filesystem::class); $backupManager->setRootDir($filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath()) ->addIgnorePaths($helper->getBackupIgnorePaths()); } @@ -88,10 +88,10 @@ public function execute() } catch (\Magento\Framework\Backup\Exception\NotEnoughFreeSpace $e) { $errorMessage = __('You need more free space to create a backup.'); } catch (\Magento\Framework\Backup\Exception\NotEnoughPermissions $e) { - $this->_objectManager->get('Psr\Log\LoggerInterface')->info($e->getMessage()); + $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->info($e->getMessage()); $errorMessage = __('You need more permissions to create a backup.'); } catch (\Exception $e) { - $this->_objectManager->get('Psr\Log\LoggerInterface')->info($e->getMessage()); + $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->info($e->getMessage()); $errorMessage = __('We can\'t create the backup right now.'); } @@ -106,4 +106,14 @@ public function execute() $this->getResponse()->representJson($response->toJson()); } + + /** + * Check if request is allowed. + * + * @return bool + */ + private function requestAllowed() + { + return $this->getRequest()->isAjax() && $this->getRequest()->isPost(); + } } diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index/Download.php b/app/code/Magento/Backup/Controller/Adminhtml/Index/Download.php index 450a3e2355f91..bc24f376fc307 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index/Download.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index/Download.php @@ -1,7 +1,7 @@ objectManagerMock = $this->getMockBuilder(\Magento\Framework\ObjectManagerInterface::class) + ->getMock(); + $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + ->disableOriginalConstructor() + ->setMethods(['isAjax', 'isPost', 'getParam']) + ->getMock(); + $this->responseMock = $this->getMockBuilder(\Magento\Framework\App\Response\Http::class) + ->disableOriginalConstructor() + ->setMethods(['representJson']) + ->getMock(); + $this->sessionMock = $this->getMockBuilder(\Magento\Backend\Model\Session::class) + ->disableOriginalConstructor() + ->getMock(); + $this->backupFactoryMock = $this->getMockBuilder(\Magento\Framework\Backup\Factory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->backupModelMock = $this->getMockBuilder(\Magento\Backup\Model\Backup::class) + ->disableOriginalConstructor() + ->setMethods(['setBackupExtension', 'setTime', 'setBackupsDir', 'setName', 'create']) + ->getMock(); + $this->dataBackendHelperMock = $this->getMockBuilder(\Magento\Backend\Helper\Data::class) + ->disableOriginalConstructor() + ->setMethods(['getUrl']) + ->getMock(); + $this->dataBackupHelperMock = $this->getMockBuilder(\Magento\Backup\Helper\Data::class) + ->disableOriginalConstructor() + ->setMethods(['getExtensionByType', 'getBackupsDir']) + ->getMock(); + $this->maintenanceMode = $this->getMockBuilder(\Magento\Framework\App\MaintenanceMode::class) + ->disableOriginalConstructor() + ->setMethods(['set']) + ->getMock(); + $this->fileFactoryMock = $this->getMockBuilder(\Magento\Framework\App\Response\Http\FileFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->objectManager = new ObjectManager($this); + $this->context = $this->objectManager->getObject( + \Magento\Backend\App\Action\Context::class, + [ + 'objectManager' => $this->objectManagerMock, + 'request' => $this->requestMock, + 'response' => $this->responseMock, + 'session' => $this->sessionMock, + 'helper' => $this->dataBackendHelperMock, + 'maintenanceMode' => $this->maintenanceMode, + ] + ); + $this->createController = $this->objectManager->getObject( + \Magento\Backup\Controller\Adminhtml\Index\Create::class, + [ + 'context' => $this->context, + 'backupFactory' => $this->backupFactoryMock, + 'fileFactory' => $this->fileFactoryMock, + ] + ); + } + + /** + * @covers \Magento\Backup\Controller\Adminhtml\Index\Create::execute + * @return void + */ + public function testExecuteNotPost() + { + $redirectUrl = '*/*/index'; + $redirectUrlBackup = 'backup/index/index'; + + $this->requestMock->expects($this->any()) + ->method('isAjax') + ->willReturn(true); + $this->requestMock->expects($this->any()) + ->method('isPost') + ->willReturn(false); + $this->requestMock->expects($this->any()) + ->method('getParam') + ->with('maintenance_mode') + ->willReturn(true); + $this->dataBackendHelperMock->expects($this->any()) + ->method('getUrl') + ->with($redirectUrl, []) + ->willReturn($redirectUrlBackup); + $this->responseMock->expects($this->any()) + ->method('setRedirect') + ->with($redirectUrlBackup) + ->willReturnSelf(); + + $this->assertSame($this->responseMock, $this->createController->execute()); + } + + /** + * @covers \Magento\Backup\Controller\Adminhtml\Index\Create::execute + * @return void + */ + public function testExecutePermission() + { + $redirectUrl = '*/*/index'; + $redirectUrlBackup = 'backup/index/index'; + $backupType = 'db'; + $backupName = 'backup1'; + $response = '{"redirect_url":"backup\/index\/index"}'; + + $this->requestMock->expects($this->any()) + ->method('isAjax') + ->willReturn(true); + $this->requestMock->expects($this->any()) + ->method('isPost') + ->willReturn(true); + $this->requestMock->expects($this->any()) + ->method('getParam') + ->willReturnMap([ + ['type', null, $backupType], + ['backup_name', null, $backupName], + ]); + $this->dataBackendHelperMock->expects($this->any()) + ->method('getUrl') + ->with($redirectUrl, []) + ->willReturn($redirectUrlBackup); + $this->responseMock->expects($this->any()) + ->method('representJson') + ->with($response) + ->willReturnSelf(); + $this->maintenanceMode->expects($this->any()) + ->method('set') + ->with(true) + ->willReturn(false); + $this->backupFactoryMock->expects($this->any()) + ->method('create') + ->with($backupType) + ->willReturn($this->backupModelMock); + $this->backupModelMock->expects($this->any()) + ->method('setBackupExtension') + ->with($backupType) + ->willReturnSelf(); + $this->backupModelMock->expects($this->any()) + ->method('setBackupsDir') + ->willReturnSelf(); + $this->backupModelMock->expects($this->any()) + ->method('setTime') + ->willReturnSelf(); + $this->backupModelMock->expects($this->any()) + ->method('setName') + ->with($backupName) + ->willReturnSelf(); + $this->backupModelMock->expects($this->once()) + ->method('create') + ->willReturnSelf(); + $this->objectManagerMock->expects($this->any()) + ->method('get') + ->with(\Magento\Backup\Helper\Data::class) + ->willReturn($this->dataBackupHelperMock); + $this->dataBackupHelperMock->expects($this->any()) + ->method('getExtensionByType') + ->with($backupType) + ->willReturn($backupType); + $this->dataBackupHelperMock->expects($this->any()) + ->method('getBackupsDir') + ->willReturn('dir'); + + $this->assertNull($this->createController->execute()); + } +} diff --git a/app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php b/app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php index 85ec2db855299..75aa499f42989 100644 --- a/app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php +++ b/app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backup/etc/adminhtml/menu.xml b/app/code/Magento/Backup/etc/adminhtml/menu.xml index 32c2936697fac..27991e57b8485 100644 --- a/app/code/Magento/Backup/etc/adminhtml/menu.xml +++ b/app/code/Magento/Backup/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backup/etc/adminhtml/routes.xml b/app/code/Magento/Backup/etc/adminhtml/routes.xml index 232c0ca0f9d6a..f24ff67ecff65 100644 --- a/app/code/Magento/Backup/etc/adminhtml/routes.xml +++ b/app/code/Magento/Backup/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backup/etc/adminhtml/system.xml b/app/code/Magento/Backup/etc/adminhtml/system.xml index 325395826df15..4028452d04439 100644 --- a/app/code/Magento/Backup/etc/adminhtml/system.xml +++ b/app/code/Magento/Backup/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backup/etc/crontab.xml b/app/code/Magento/Backup/etc/crontab.xml index 150751eb94a1f..59694ccdd9802 100644 --- a/app/code/Magento/Backup/etc/crontab.xml +++ b/app/code/Magento/Backup/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backup/etc/di.xml b/app/code/Magento/Backup/etc/di.xml index fc9c5bb2ff025..6b1359a3ea40b 100644 --- a/app/code/Magento/Backup/etc/di.xml +++ b/app/code/Magento/Backup/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backup/etc/module.xml b/app/code/Magento/Backup/etc/module.xml index 9f4fe8da7ac1d..667ec9d8a7461 100644 --- a/app/code/Magento/Backup/etc/module.xml +++ b/app/code/Magento/Backup/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backup/registration.php b/app/code/Magento/Backup/registration.php index d429ad8208552..042ec939dcf5b 100644 --- a/app/code/Magento/Backup/registration.php +++ b/app/code/Magento/Backup/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_grid.xml b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_grid.xml index 03b4aa4a7f4ad..5631a53737ef6 100644 --- a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_grid.xml +++ b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_index.xml b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_index.xml index 242534d006e37..bdfa8b6bee899 100644 --- a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_index.xml +++ b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml b/app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml index dc4ce1d52438d..d5836ae0d36fe 100644 --- a/app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml +++ b/app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Backup/view/adminhtml/templates/backup/list.phtml b/app/code/Magento/Backup/view/adminhtml/templates/backup/list.phtml index ace0931b60428..0625c917b8daf 100644 --- a/app/code/Magento/Backup/view/adminhtml/templates/backup/list.phtml +++ b/app/code/Magento/Backup/view/adminhtml/templates/backup/list.phtml @@ -1,6 +1,6 @@ getValue(); + if (!is_array($value)) { + try { + $value = unserialize($value); + } catch (\InvalidArgumentException $e) { + $value = []; + } + } $result = []; foreach ($value as $data) { if (empty($data['country_id']) || empty($data['cc_types'])) { diff --git a/app/code/Magento/Braintree/Model/Paypal/Helper/AbstractHelper.php b/app/code/Magento/Braintree/Model/Paypal/Helper/AbstractHelper.php index 0a5583d465f68..58c2f1d454899 100644 --- a/app/code/Magento/Braintree/Model/Paypal/Helper/AbstractHelper.php +++ b/app/code/Magento/Braintree/Model/Paypal/Helper/AbstractHelper.php @@ -1,6 +1,6 @@ _attributes)) { return $this->_attributes[$name]; - } else { - trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE); - return null; } + trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE); + return null; } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/FilterMapperTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/FilterMapperTest.php index 99af9c1e9cdc3..21cbc82442947 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Report/FilterMapperTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/FilterMapperTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Braintree/etc/adminhtml/di.xml b/app/code/Magento/Braintree/etc/adminhtml/di.xml index d590066b1fbf2..90fc927ed4f80 100644 --- a/app/code/Magento/Braintree/etc/adminhtml/di.xml +++ b/app/code/Magento/Braintree/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/adminhtml/menu.xml b/app/code/Magento/Braintree/etc/adminhtml/menu.xml index 43d12aa0bb995..590d5b3dce008 100644 --- a/app/code/Magento/Braintree/etc/adminhtml/menu.xml +++ b/app/code/Magento/Braintree/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/adminhtml/routes.xml b/app/code/Magento/Braintree/etc/adminhtml/routes.xml index 0991aef948541..5349d540598ce 100644 --- a/app/code/Magento/Braintree/etc/adminhtml/routes.xml +++ b/app/code/Magento/Braintree/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/adminhtml/system.xml b/app/code/Magento/Braintree/etc/adminhtml/system.xml index 4c7f46268548d..473848f0fae18 100644 --- a/app/code/Magento/Braintree/etc/adminhtml/system.xml +++ b/app/code/Magento/Braintree/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/config.xml b/app/code/Magento/Braintree/etc/config.xml index eaa233da109ce..e9aaa75cd92a3 100644 --- a/app/code/Magento/Braintree/etc/config.xml +++ b/app/code/Magento/Braintree/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/di.xml b/app/code/Magento/Braintree/etc/di.xml index b5a986d3162a5..a4f9167b06df8 100644 --- a/app/code/Magento/Braintree/etc/di.xml +++ b/app/code/Magento/Braintree/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/events.xml b/app/code/Magento/Braintree/etc/events.xml index 2bf95bdbad178..a87d518a85a36 100644 --- a/app/code/Magento/Braintree/etc/events.xml +++ b/app/code/Magento/Braintree/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/frontend/di.xml b/app/code/Magento/Braintree/etc/frontend/di.xml index 781f985b4b3a8..1983bb1f20e62 100644 --- a/app/code/Magento/Braintree/etc/frontend/di.xml +++ b/app/code/Magento/Braintree/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/frontend/events.xml b/app/code/Magento/Braintree/etc/frontend/events.xml index e1bff1a20b238..77bc1a45e65ee 100644 --- a/app/code/Magento/Braintree/etc/frontend/events.xml +++ b/app/code/Magento/Braintree/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/frontend/routes.xml b/app/code/Magento/Braintree/etc/frontend/routes.xml index ad8b484ca30d6..5dbe389ac84f8 100644 --- a/app/code/Magento/Braintree/etc/frontend/routes.xml +++ b/app/code/Magento/Braintree/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/frontend/sections.xml b/app/code/Magento/Braintree/etc/frontend/sections.xml index add86f4cdb5cc..e44fb38aaef4b 100644 --- a/app/code/Magento/Braintree/etc/frontend/sections.xml +++ b/app/code/Magento/Braintree/etc/frontend/sections.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/etc/module.xml b/app/code/Magento/Braintree/etc/module.xml index 56f0fa6108783..8364d0e94028b 100644 --- a/app/code/Magento/Braintree/etc/module.xml +++ b/app/code/Magento/Braintree/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/i18n/en_US.csv b/app/code/Magento/Braintree/i18n/en_US.csv index f5e2d36e1e9bb..bce38100b9e33 100644 --- a/app/code/Magento/Braintree/i18n/en_US.csv +++ b/app/code/Magento/Braintree/i18n/en_US.csv @@ -165,4 +165,5 @@ Debug,Debug "credit_card","Credit card" "apple_pay_card","Apple pay card" "android_pay_card","Android pay card" -"Accept credit/debit cards and PayPal in your Magento store.
No setup or monthly fees and your customers never leave your store to complete the purchase.","Accept credit/debit cards and PayPal in your Magento store.
No setup or monthly fees and your customers never leave your store to complete the purchase." \ No newline at end of file +"Accept credit/debit cards and PayPal in your Magento store.
No setup or monthly fees and your customers never leave your store to complete the purchase.","Accept credit/debit cards and PayPal in your Magento store.
No setup or monthly fees and your customers never leave your store to complete the purchase." +"Save for later use.","Save for later use." diff --git a/app/code/Magento/Braintree/registration.php b/app/code/Magento/Braintree/registration.php index d56ac32c07c96..11fddbcea6036 100644 --- a/app/code/Magento/Braintree/registration.php +++ b/app/code/Magento/Braintree/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Braintree/view/adminhtml/layout/braintree_report_index.xml b/app/code/Magento/Braintree/view/adminhtml/layout/braintree_report_index.xml index 396f86b903fd5..fef51cff62fc5 100644 --- a/app/code/Magento/Braintree/view/adminhtml/layout/braintree_report_index.xml +++ b/app/code/Magento/Braintree/view/adminhtml/layout/braintree_report_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml index b5ce1fc9c6792..5394f0b7370a6 100644 --- a/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml index 0cfa34cf020c1..ca1b1980d0365 100644 --- a/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml +++ b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml index 50076da1a851f..76a4a28307e26 100644 --- a/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml +++ b/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml @@ -1,6 +1,6 @@ getInfoData('cc_type'); name="payment[is_active_payment_token_enabler]" class="admin__control-checkbox"/>
diff --git a/app/code/Magento/Braintree/view/adminhtml/templates/form/paypal/vault.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/form/paypal/vault.phtml index ef3edc75fa589..93f0d07717ca5 100644 --- a/app/code/Magento/Braintree/view/adminhtml/templates/form/paypal/vault.phtml +++ b/app/code/Magento/Braintree/view/adminhtml/templates/form/paypal/vault.phtml @@ -1,7 +1,7 @@ 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 af0fac558d89f..5e1e85e6a3c48 100644 --- a/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js +++ b/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*browser:true*/ diff --git a/app/code/Magento/Braintree/view/adminhtml/web/js/grid/filters/status.html b/app/code/Magento/Braintree/view/adminhtml/web/js/grid/filters/status.html index f69cbcc619846..63fa308beee48 100644 --- a/app/code/Magento/Braintree/view/adminhtml/web/js/grid/filters/status.html +++ b/app/code/Magento/Braintree/view/adminhtml/web/js/grid/filters/status.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Braintree/view/adminhtml/web/js/grid/provider.js b/app/code/Magento/Braintree/view/adminhtml/web/js/grid/provider.js index 8b1380f6029be..373b01d5eaa7e 100644 --- a/app/code/Magento/Braintree/view/adminhtml/web/js/grid/provider.js +++ b/app/code/Magento/Braintree/view/adminhtml/web/js/grid/provider.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Braintree/view/adminhtml/web/js/vault.js b/app/code/Magento/Braintree/view/adminhtml/web/js/vault.js index 47decbb18bdbe..a1a1c81d27c3d 100644 --- a/app/code/Magento/Braintree/view/adminhtml/web/js/vault.js +++ b/app/code/Magento/Braintree/view/adminhtml/web/js/vault.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*browser:true*/ diff --git a/app/code/Magento/Braintree/view/adminhtml/web/styles.css b/app/code/Magento/Braintree/view/adminhtml/web/styles.css index 19a4f794fb428..3c9daaaee72f7 100644 --- a/app/code/Magento/Braintree/view/adminhtml/web/styles.css +++ b/app/code/Magento/Braintree/view/adminhtml/web/styles.css @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ 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 931774aaffa2d..3ed678cfb7eac 100644 --- a/app/code/Magento/Braintree/view/base/web/js/validator.js +++ b/app/code/Magento/Braintree/view/base/web/js/validator.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*browser:true*/ diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml index a5125861a048f..ce1c866f1cb6e 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml index 872cb7d51ce1f..ab294f8e797b7 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/view/frontend/layout/vault_cards_listaction.xml b/app/code/Magento/Braintree/view/frontend/layout/vault_cards_listaction.xml index 1ab68abf1976d..f94eafa0f6f76 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/vault_cards_listaction.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/vault_cards_listaction.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Braintree/view/frontend/requirejs-config.js b/app/code/Magento/Braintree/view/frontend/requirejs-config.js index e12a4dd87043e..8b347d799007a 100644 --- a/app/code/Magento/Braintree/view/frontend/requirejs-config.js +++ b/app/code/Magento/Braintree/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml b/app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml index 5fc4bf83cab28..a244833051082 100644 --- a/app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml +++ b/app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html b/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html index 8df52975917b9..ae1df2a195d35 100644 --- a/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html +++ b/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal/vault.html b/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal/vault.html index 28cd3ebb2f2d1..b9402da02cc8a 100644 --- a/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal/vault.html +++ b/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal/vault.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Bundle/Api/Data/BundleOptionInterface.php b/app/code/Magento/Bundle/Api/Data/BundleOptionInterface.php index 5ef6c2971b18b..f8051bb7895e4 100644 --- a/app/code/Magento/Bundle/Api/Data/BundleOptionInterface.php +++ b/app/code/Magento/Bundle/Api/Data/BundleOptionInterface.php @@ -1,6 +1,6 @@ "product[{$switchAttributeCode}]", 'values' => $this->getOptions(), - 'value' => $switchAttributeCode, 'class' => 'required-entry next-toinput', 'no_span' => true, 'disabled' => $this->isDisabledField(), diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php index 800f79f56f15f..b3e52e5560cc2 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php @@ -1,6 +1,6 @@ getOrderItem()->getId()])) { return $itemsArray[$item->getOrderItem()->getId()]; - } else { - return null; } + return null; } /** @@ -186,9 +185,8 @@ public function getOrderItem() { if ($this->getItem() instanceof \Magento\Sales\Model\Order\Item) { return $this->getItem(); - } else { - return $this->getItem()->getOrderItem(); } + return $this->getItem()->getOrderItem(); } /** diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php b/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php index a41896f139d9d..d0d68c8415b38 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php @@ -1,6 +1,6 @@ getSelectionId(), $selectedOptions); } elseif ($selectedOptions == 'None') { return false; - } else { - return $selection->getIsDefault() && $selection->isSaleable(); } + return $selection->getIsDefault() && $selection->isSaleable(); } /** diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php index c79b4605e847e..6a03124901235 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php @@ -1,6 +1,6 @@ getSelectionAttributes($item)) { return sprintf('%d', $attributes['qty']) . ' x ' . $this->escapeHtml($item->getName()) . " " . $this->getOrder()->formatPrice($attributes['price']); - } else { - return $this->escapeHtml($item->getName()); } + return $this->escapeHtml($item->getName()); } /** @@ -151,9 +150,8 @@ public function getChildren($item) if (isset($itemsArray[$item->getOrderItem()->getId()])) { return $itemsArray[$item->getOrderItem()->getId()]; - } else { - return null; } + return null; } /** diff --git a/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Product/Edit/AddAttributeToTemplate.php b/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Product/Edit/AddAttributeToTemplate.php index d37f4ff77fd91..a3125aa868eff 100644 --- a/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Product/Edit/AddAttributeToTemplate.php +++ b/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Product/Edit/AddAttributeToTemplate.php @@ -1,7 +1,7 @@ setBundleOptionsData($result['bundle_options']); } + $this->processBundleOptionsData($product); $this->processDynamicOptionsData($product); + } elseif (!$compositeReadonly) { + $extension = $product->getExtensionAttributes(); + $extension->setBundleProductOptions([]); + $product->setExtensionAttributes($extension); } $affectProductSelections = (bool)$this->request->getPost('affect_bundle_product_selections'); @@ -127,13 +132,11 @@ protected function processBundleOptionsData(\Magento\Catalog\Model\Product $prod } $options = []; foreach ($bundleOptionsData as $key => $optionData) { - if ((bool)$optionData['delete']) { - continue; - } - $option = $this->optionFactory->create(['data' => $optionData]); $option->setSku($product->getSku()); - $option->setOptionId(null); + if (!$option->getOptionId()) { + $option->setOptionId(null); + } $links = []; $bundleLinks = $product->getBundleSelectionsData(); diff --git a/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php b/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php index 2b33451d299d4..59f4fa25ede98 100644 --- a/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php +++ b/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php @@ -1,6 +1,6 @@ productRepository->get($sku, true); + $product = $this->productRepository->get($sku, true, null, true); if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { throw new InputException(__('Only implemented for bundle product')); } diff --git a/app/code/Magento/Bundle/Model/OptionTypeList.php b/app/code/Magento/Bundle/Model/OptionTypeList.php index f35f46caa2442..6415a3d6daa8f 100644 --- a/app/code/Magento/Bundle/Model/OptionTypeList.php +++ b/app/code/Magento/Bundle/Model/OptionTypeList.php @@ -1,7 +1,7 @@ getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC ) { return true; - } else { - return $proceed($object); } + return $proceed($object); } } diff --git a/app/code/Magento/Bundle/Model/Plugin/Product.php b/app/code/Magento/Bundle/Model/Plugin/Product.php index 28792dbe6685b..b0f8d1af32fc2 100644 --- a/app/code/Magento/Bundle/Model/Plugin/Product.php +++ b/app/code/Magento/Bundle/Model/Plugin/Product.php @@ -1,6 +1,6 @@ getExtensionAttributes()->getBundleProductOptions(); - if ($entity->getTypeId() !== 'bundle' || empty($bundleProductOptions)) { + if ($entity->getTypeId() !== Type::TYPE_CODE || empty($bundleProductOptions)) { return $entity; } + $existingBundleProductOptions = $this->optionRepository->getList($entity->getSku()); + + $existingOptionsIds = !empty($existingBundleProductOptions) + ? $this->getOptionIds($existingBundleProductOptions) + : []; + $optionIds = !empty($bundleProductOptions) + ? $this->getOptionIds($bundleProductOptions) + : []; + + $options = $bundleProductOptions ?: []; + if (!$entity->getCopyFromView()) { - /** @var \Magento\Catalog\Api\Data\ProductInterface $entity */ - foreach ($this->optionRepository->getList($entity->getSku()) as $option) { - $this->removeOptionLinks($entity->getSku(), $option); - $this->optionRepository->delete($option); - } + $this->processRemovedOptions($entity->getSku(), $existingOptionsIds, $optionIds); + $this->processExistingOptions($entity->getSku(), $existingOptionsIds, $optionIds); - $options = $bundleProductOptions ?: []; - foreach ($options as $option) { - $option->setOptionId(null); - $this->optionRepository->save($entity, $option); - } + $newOptionsIds = array_diff($optionIds, $existingOptionsIds); + $this->saveOptions($entity, $options, $newOptionsIds); } else { //save only labels and not selections + product links - $options = $bundleProductOptions ?: []; - foreach ($options as $option) { - $this->optionRepository->save($entity, $option); - $entity->setCopyFromView(false); - } + $this->saveOptions($entity, $options); + $entity->setCopyFromView(false); } return $entity; } @@ -75,6 +81,8 @@ public function execute($entity, $arguments = []) /** * @param string $entitySku * @param \Magento\Bundle\Api\Data\OptionInterface $option + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\InputException * @return void */ protected function removeOptionLinks($entitySku, $option) @@ -86,4 +94,85 @@ protected function removeOptionLinks($entitySku, $option) } } } + + /** + * Perform save for all options entities + * + * @param ProductInterface $entity + * @param array $options + * @param array $newOptionsIds + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws \Magento\Framework\Exception\InputException + * @return void + */ + private function saveOptions(ProductInterface $entity, array $options, array $newOptionsIds = []) + { + foreach ($options as $option) { + if (in_array($option->getOptionId(), $newOptionsIds, true)) { + $option->setOptionId(null); + } + $this->optionRepository->save($entity, $option); + } + } + + /** + * Get options ids from array of the options entities + * + * @param array $options + * @return array + */ + private function getOptionIds(array $options) + { + $optionIds = []; + + if (empty($options)) { + return $optionIds; + } + + /** @var \Magento\Bundle\Api\Data\OptionInterface $option */ + foreach ($options as $option) { + if ($option->getOptionId()) { + $optionIds[] = $option->getOptionId(); + } + } + return $optionIds; + } + + /** + * Removes old options that no longer exists + * + * @param string $entitySku + * @param array $existingOptionsIds + * @param array $optionIds + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @return void + */ + private function processRemovedOptions($entitySku, array $existingOptionsIds, array $optionIds) + { + foreach (array_diff($existingOptionsIds, $optionIds) as $optionId) { + $option = $this->optionRepository->get($entitySku, $optionId); + $this->removeOptionLinks($entitySku, $option); + $this->optionRepository->delete($option); + } + } + + /** + * Removes option links for existing options + * + * @param string $entitySku + * @param array $existingOptionsIds + * @param array $optionIds + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\InputException + * @return void + */ + private function processExistingOptions($entitySku, array $existingOptionsIds, array $optionIds) + { + foreach (array_intersect($optionIds, $existingOptionsIds) as $optionId) { + $option = $this->optionRepository->get($entitySku, $optionId); + $this->removeOptionLinks($entitySku, $option); + } + } } diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index 033762113d081..affabcb7be4f3 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -1,6 +1,6 @@ join( ['e' => $this->getTable('catalog_product_entity')], - "i.entity_id=e.$linkField", + "i.entity_id=e.entity_id", [] )->where( 'e.type_id=?', @@ -502,7 +502,7 @@ protected function _prepareTierPriceIndex($entityIds = null) $select = $connection->select()->from( ['tp' => $this->getTable('catalog_product_entity_tier_price')], - [$linkField] + ['e.entity_id'] )->join( ['e' => $this->getTable('catalog_product_entity')], "tp.{$linkField} = e.{$linkField}", @@ -523,11 +523,11 @@ protected function _prepareTierPriceIndex($entityIds = null) )->columns( new \Zend_Db_Expr('MIN(tp.value)') )->group( - ["tp.{$linkField}", 'cg.customer_group_id', 'cw.website_id'] + ['e.entity_id', 'cg.customer_group_id', 'cw.website_id'] ); if (!empty($entityIds)) { - $select->where("tp.{$linkField} IN(?)", $entityIds); + $select->where('e.entity_id IN(?)', $entityIds); } $query = $select->insertFromSelect($this->_getTierPriceIndexTable()); diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php index c05c1dc8b7fa2..4448ebe8c5bd8 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php @@ -1,6 +1,6 @@ getOrderItem()->getId()])) { return $itemsArray[$item->getOrderItem()->getId()]; - } else { - return null; } + return null; } /** @@ -196,9 +195,8 @@ public function getOrderItem() { if ($this->getItem() instanceof \Magento\Sales\Model\Order\Item) { return $this->getItem(); - } else { - return $this->getItem()->getOrderItem(); } + return $this->getItem()->getOrderItem(); } /** diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php index 408582343e503..6576763b4dd36 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -1,6 +1,6 @@ getPriceType() == Price::PRICE_TYPE_FIXED) { return $this->calculateFixedBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude); - } else { - return $this->calculateDynamicBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude); } + return $this->calculateDynamicBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude); } /** diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php index 0ab3cbdfbe0cf..3ca37fb55cbcf 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php @@ -1,6 +1,6 @@ bundleProduct->getPriceType() == Price::PRICE_TYPE_DYNAMIC) { return parent::getProduct(); - } else { - return $this->bundleProduct; } + return $this->bundleProduct; } } diff --git a/app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php b/app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php index ed1c69fa5f547..4f2f35b076d82 100644 --- a/app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php @@ -1,6 +1,6 @@ priceInfo ->getPrice(BundleDiscountPrice::PRICE_CODE) ->calculateDiscount($configuredOptionsAmount); - } else { - return parent::getValue(); } + return parent::getValue(); } /** diff --git a/app/code/Magento/Bundle/Pricing/Price/DiscountCalculator.php b/app/code/Magento/Bundle/Pricing/Price/DiscountCalculator.php index 032e436239c14..6990149efc373 100644 --- a/app/code/Magento/Bundle/Pricing/Price/DiscountCalculator.php +++ b/app/code/Magento/Bundle/Pricing/Price/DiscountCalculator.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Bundle/etc/adminhtml/events.xml b/app/code/Magento/Bundle/etc/adminhtml/events.xml index cd8af005694ea..ff0fa5d58dc23 100644 --- a/app/code/Magento/Bundle/etc/adminhtml/events.xml +++ b/app/code/Magento/Bundle/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/adminhtml/routes.xml b/app/code/Magento/Bundle/etc/adminhtml/routes.xml index d2e7c9c3b20f9..926190c8a1f85 100644 --- a/app/code/Magento/Bundle/etc/adminhtml/routes.xml +++ b/app/code/Magento/Bundle/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/catalog_attributes.xml b/app/code/Magento/Bundle/etc/catalog_attributes.xml index 8c45aaab6c46f..5a96484ca1014 100644 --- a/app/code/Magento/Bundle/etc/catalog_attributes.xml +++ b/app/code/Magento/Bundle/etc/catalog_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/config.xml b/app/code/Magento/Bundle/etc/config.xml index 0016210cd149d..152f04e251c35 100644 --- a/app/code/Magento/Bundle/etc/config.xml +++ b/app/code/Magento/Bundle/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/di.xml b/app/code/Magento/Bundle/etc/di.xml index 2899ce28d0400..d3cb063ce0d03 100644 --- a/app/code/Magento/Bundle/etc/di.xml +++ b/app/code/Magento/Bundle/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/extension_attributes.xml b/app/code/Magento/Bundle/etc/extension_attributes.xml index d23dfc71b39fc..a8bd6e1872cd0 100644 --- a/app/code/Magento/Bundle/etc/extension_attributes.xml +++ b/app/code/Magento/Bundle/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/frontend/di.xml b/app/code/Magento/Bundle/etc/frontend/di.xml index 084f681df7e03..54f6d3b4b0f42 100644 --- a/app/code/Magento/Bundle/etc/frontend/di.xml +++ b/app/code/Magento/Bundle/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/frontend/events.xml b/app/code/Magento/Bundle/etc/frontend/events.xml index d08cdb4bcc997..d4505c8a5337e 100644 --- a/app/code/Magento/Bundle/etc/frontend/events.xml +++ b/app/code/Magento/Bundle/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/module.xml b/app/code/Magento/Bundle/etc/module.xml index 77b78dcc43284..86085d8301142 100644 --- a/app/code/Magento/Bundle/etc/module.xml +++ b/app/code/Magento/Bundle/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/pdf.xml b/app/code/Magento/Bundle/etc/pdf.xml index 912aa1426efa1..24f46afb5b9ba 100644 --- a/app/code/Magento/Bundle/etc/pdf.xml +++ b/app/code/Magento/Bundle/etc/pdf.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/product_types.xml b/app/code/Magento/Bundle/etc/product_types.xml index 6168189a3b4e3..75c2e5970e440 100644 --- a/app/code/Magento/Bundle/etc/product_types.xml +++ b/app/code/Magento/Bundle/etc/product_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/sales.xml b/app/code/Magento/Bundle/etc/sales.xml index 3094eb6bfecfa..4d632b3a5b3ab 100644 --- a/app/code/Magento/Bundle/etc/sales.xml +++ b/app/code/Magento/Bundle/etc/sales.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/webapi.xml b/app/code/Magento/Bundle/etc/webapi.xml index 69124309687a3..79aa530ef38a3 100644 --- a/app/code/Magento/Bundle/etc/webapi.xml +++ b/app/code/Magento/Bundle/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/webapi_rest/di.xml b/app/code/Magento/Bundle/etc/webapi_rest/di.xml index 084f681df7e03..54f6d3b4b0f42 100644 --- a/app/code/Magento/Bundle/etc/webapi_rest/di.xml +++ b/app/code/Magento/Bundle/etc/webapi_rest/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/etc/webapi_soap/di.xml b/app/code/Magento/Bundle/etc/webapi_soap/di.xml index 084f681df7e03..54f6d3b4b0f42 100644 --- a/app/code/Magento/Bundle/etc/webapi_soap/di.xml +++ b/app/code/Magento/Bundle/etc/webapi_soap/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/registration.php b/app/code/Magento/Bundle/registration.php index 53f3657ae0519..3a3dacddd5079 100644 --- a/app/code/Magento/Bundle/registration.php +++ b/app/code/Magento/Bundle/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml index 6b97971a0ee51..163fc2b7b20f4 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml index d0fdb184355d7..46bc496e67a9e 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_new.xml index a496ea7538923..34f47b745b8e9 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_view_type_bundle.xml b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_view_type_bundle.xml index 15374cb987d36..ad7b4d4a45843 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_view_type_bundle.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_view_type_bundle.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Bundle/view/adminhtml/layout/customer_index_wishlist.xml index 7e37070109921..2b53db52b797a 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/customer_index_wishlist.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml index 99fdab5a7e9f4..b75d2c5345897 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index 99fdab5a7e9f4..b75d2c5345897 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_view.xml index 323aba1d186e6..d8fff02a12cba 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_new.xml index b03ce7a9cb451..47fb17196268a 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_updateqty.xml index b03ce7a9cb451..47fb17196268a 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_view.xml index 34c3470cf06a7..3a38ec4003e1a 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_view.xml index 62f0305194fa9..f3ce4b214b599 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/catalog/product/edit/tab/attributes/extend.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/catalog/product/edit/tab/attributes/extend.phtml index 84e87afd48180..46f1e155c89a6 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/catalog/product/edit/tab/attributes/extend.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/catalog/product/edit/tab/attributes/extend.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/sales/creditmemo/create/items/renderer.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/sales/creditmemo/create/items/renderer.phtml index 41923c4826432..f5340c1cbdde6 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/sales/creditmemo/create/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/sales/creditmemo/create/items/renderer.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Bundle/view/adminhtml/web/css/bundle-product.css b/app/code/Magento/Bundle/view/adminhtml/web/css/bundle-product.css index d5aed8a7d652e..15a15d3d6249c 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/css/bundle-product.css +++ b/app/code/Magento/Bundle/view/adminhtml/web/css/bundle-product.css @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js b/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js index 53b08e43614a0..6ce0c1be59adc 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint browser:true jquery:true*/ diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-type-handler.js b/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-type-handler.js index 7f4a57cb530da..c65ff76c8db94 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-type-handler.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-type-handler.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint browser:true jquery:true expr:true*/ diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-checkbox.js b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-checkbox.js index 9c2432bade43f..aedb6c44ac751 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-checkbox.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-checkbox.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-input-type.js b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-input-type.js index cee0489cc901a..6705d568705f9 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-input-type.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-input-type.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js index 7b5734c7451ea..40e72dc4361af 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Bundle/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Bundle/view/base/layout/catalog_product_prices.xml index 5f7d22ba2650b..40419ebfa91e1 100644 --- a/app/code/Magento/Bundle/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Bundle/view/base/layout/catalog_product_prices.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/base/templates/product/price/final_price.phtml b/app/code/Magento/Bundle/view/base/templates/product/price/final_price.phtml index efd75677d3061..095e14e1513a7 100644 --- a/app/code/Magento/Bundle/view/base/templates/product/price/final_price.phtml +++ b/app/code/Magento/Bundle/view/base/templates/product/price/final_price.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_simple.xml b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_simple.xml index fedd29f952b02..6bd2fcb77443f 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_simple.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_simple.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml index adb1b2911983b..fb0efe0cd9edf 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_item_renderers.xml index 9abf0a4018980..5137782656269 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/checkout_onepage_review_item_renderers.xml index ddede2340995b..dce5945e3221d 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/default.xml b/app/code/Magento/Bundle/view/frontend/layout/default.xml index cb14616af5980..092aab97fb71c 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/default.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_creditmemo_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_creditmemo_renderers.xml index 991011db9fa08..ddd85d3b9f846 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_creditmemo_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_creditmemo_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_invoice_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_invoice_renderers.xml index 0e32c9fd9e816..f5fee7a6ccd1d 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_invoice_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_invoice_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_renderers.xml index 927214fbcc174..46471b57ce142 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_shipment_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_shipment_renderers.xml index 7463caa738083..846d5286eed0e 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_shipment_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_shipment_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_creditmemo_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_creditmemo_renderers.xml index c94b4957d267b..ab8bc480c08af 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_creditmemo_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_creditmemo_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_invoice_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_invoice_renderers.xml index d07959385bd9f..a89da856cd52a 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_invoice_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_invoice_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_item_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_item_renderers.xml index fb26de5bc2fdd..125007b2c4ba7 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_item_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_creditmemo_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_creditmemo_renderers.xml index 8c328c87a5c65..20c2dfa05b73b 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_creditmemo_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_creditmemo_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_invoice_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_invoice_renderers.xml index 57e39795df7da..513912eff5d3e 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_invoice_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_invoice_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_renderers.xml index 510168ac55e8a..34216f4e8eb7b 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_shipment_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_shipment_renderers.xml index f46b6260f3bd8..11b78d15c44a6 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_shipment_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_shipment_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_shipment_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_shipment_renderers.xml index 536953423a3f2..f861b34032147 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_shipment_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_shipment_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Bundle/view/frontend/requirejs-config.js b/app/code/Magento/Bundle/view/frontend/requirejs-config.js index 51ab4cab6bb2c..753c9cf89251d 100644 --- a/app/code/Magento/Bundle/view/frontend/requirejs-config.js +++ b/app/code/Magento/Bundle/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/backbutton.phtml b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/backbutton.phtml index 86cd52b6dc6fd..8ab61e349b69c 100644 --- a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/backbutton.phtml +++ b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/backbutton.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/customize.phtml b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/customize.phtml index e3538ebd6caea..559ca5dc820a9 100644 --- a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/customize.phtml +++ b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/customize.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml index 0fc7e6f9c8f06..4278095b4cdb4 100644 --- a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml +++ b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/BundleImportExport/etc/export.xml b/app/code/Magento/BundleImportExport/etc/export.xml index c7fd951bfab53..dcbd9521027c0 100644 --- a/app/code/Magento/BundleImportExport/etc/export.xml +++ b/app/code/Magento/BundleImportExport/etc/export.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/BundleImportExport/etc/import.xml b/app/code/Magento/BundleImportExport/etc/import.xml index 8daa5296a8c39..4b0761db4d3ba 100644 --- a/app/code/Magento/BundleImportExport/etc/import.xml +++ b/app/code/Magento/BundleImportExport/etc/import.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/BundleImportExport/etc/module.xml b/app/code/Magento/BundleImportExport/etc/module.xml index 64f2c06b3c770..e324145cabcca 100644 --- a/app/code/Magento/BundleImportExport/etc/module.xml +++ b/app/code/Magento/BundleImportExport/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/BundleImportExport/registration.php b/app/code/Magento/BundleImportExport/registration.php index b4f80e749f130..368032565e588 100644 --- a/app/code/Magento/BundleImportExport/registration.php +++ b/app/code/Magento/BundleImportExport/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CacheInvalidate/etc/module.xml b/app/code/Magento/CacheInvalidate/etc/module.xml index b3277477fb62d..dda90ba8b38ab 100644 --- a/app/code/Magento/CacheInvalidate/etc/module.xml +++ b/app/code/Magento/CacheInvalidate/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CacheInvalidate/registration.php b/app/code/Magento/CacheInvalidate/registration.php index 00ddee3f6776b..2484edf8e215d 100644 --- a/app/code/Magento/CacheInvalidate/registration.php +++ b/app/code/Magento/CacheInvalidate/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Captcha/etc/adminhtml/events.xml b/app/code/Magento/Captcha/etc/adminhtml/events.xml index 7fcadbfd8f2ff..e9de9bc1888f8 100644 --- a/app/code/Magento/Captcha/etc/adminhtml/events.xml +++ b/app/code/Magento/Captcha/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/adminhtml/routes.xml b/app/code/Magento/Captcha/etc/adminhtml/routes.xml index 6b6b6717c489a..4d48e6334f298 100644 --- a/app/code/Magento/Captcha/etc/adminhtml/routes.xml +++ b/app/code/Magento/Captcha/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/adminhtml/system.xml b/app/code/Magento/Captcha/etc/adminhtml/system.xml index 88f0ae27f91c7..a05430989418d 100644 --- a/app/code/Magento/Captcha/etc/adminhtml/system.xml +++ b/app/code/Magento/Captcha/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/config.xml b/app/code/Magento/Captcha/etc/config.xml index d969626d73144..f754bdbe60ea3 100644 --- a/app/code/Magento/Captcha/etc/config.xml +++ b/app/code/Magento/Captcha/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/crontab.xml b/app/code/Magento/Captcha/etc/crontab.xml index d3d6e30e1a03a..09909ffbc9743 100644 --- a/app/code/Magento/Captcha/etc/crontab.xml +++ b/app/code/Magento/Captcha/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/crontab/di.xml b/app/code/Magento/Captcha/etc/crontab/di.xml index f3086b469842b..4a8616059787d 100644 --- a/app/code/Magento/Captcha/etc/crontab/di.xml +++ b/app/code/Magento/Captcha/etc/crontab/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/di.xml b/app/code/Magento/Captcha/etc/di.xml index db624420ba647..28964152809f7 100644 --- a/app/code/Magento/Captcha/etc/di.xml +++ b/app/code/Magento/Captcha/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/events.xml b/app/code/Magento/Captcha/etc/events.xml index 4223c4a2a3256..e3ddd19de2d12 100644 --- a/app/code/Magento/Captcha/etc/events.xml +++ b/app/code/Magento/Captcha/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/frontend/di.xml b/app/code/Magento/Captcha/etc/frontend/di.xml index 209f9beb71a04..225e62c8e8203 100644 --- a/app/code/Magento/Captcha/etc/frontend/di.xml +++ b/app/code/Magento/Captcha/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/frontend/events.xml b/app/code/Magento/Captcha/etc/frontend/events.xml index dfa0d1b428557..2f318d305f68f 100644 --- a/app/code/Magento/Captcha/etc/frontend/events.xml +++ b/app/code/Magento/Captcha/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/frontend/routes.xml b/app/code/Magento/Captcha/etc/frontend/routes.xml index d4bbe64821a91..895f18feecb4c 100644 --- a/app/code/Magento/Captcha/etc/frontend/routes.xml +++ b/app/code/Magento/Captcha/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/etc/module.xml b/app/code/Magento/Captcha/etc/module.xml index 698604928afb6..03ab6dbee3991 100644 --- a/app/code/Magento/Captcha/etc/module.xml +++ b/app/code/Magento/Captcha/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/i18n/en_US.csv b/app/code/Magento/Captcha/i18n/en_US.csv index 2de4ab5345c88..e9ab30df6a0ca 100644 --- a/app/code/Magento/Captcha/i18n/en_US.csv +++ b/app/code/Magento/Captcha/i18n/en_US.csv @@ -20,11 +20,7 @@ Forms,Forms "Number of Symbols","Number of Symbols" "Please specify 8 symbols at the most. Range allowed (e.g. 3-5)","Please specify 8 symbols at the most. Range allowed (e.g. 3-5)" "Symbols Used in CAPTCHA","Symbols Used in CAPTCHA" -" - Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer. - "," - Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer. - " +"Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer." "Case Sensitive","Case Sensitive" "Enable CAPTCHA on Storefront","Enable CAPTCHA on Storefront" "CAPTCHA for ""Create user"" and ""Forgot password"" forms is always enabled if chosen.","CAPTCHA for ""Create user"" and ""Forgot password"" forms is always enabled if chosen." diff --git a/app/code/Magento/Captcha/registration.php b/app/code/Magento/Captcha/registration.php index 488ac412a8926..1413bc36ff180 100644 --- a/app/code/Magento/Captcha/registration.php +++ b/app/code/Magento/Captcha/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml b/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml index 8c093257f1790..f9ac960dcfa97 100644 --- a/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml +++ b/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml b/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml index ffffcc4196bb1..8f3c6bf55a857 100644 --- a/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml +++ b/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml b/app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml index 1460d8fac6974..df6de5b162c26 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml index cd72cc5857b83..1ba5debf29692 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_edit.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_edit.xml index 9700e88006f10..826e288920d25 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_edit.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml index 1f25fa040b591..cbaabf6332d86 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml index 3a24e44fd1afe..50d99cf638f53 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/view/frontend/layout/default.xml b/app/code/Magento/Captcha/view/frontend/layout/default.xml index 43a770c54c0ca..5015d6b021cd9 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/default.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Captcha/view/frontend/requirejs-config.js b/app/code/Magento/Captcha/view/frontend/requirejs-config.js index ff1d9f1acc7b1..3b322711f8b1f 100644 --- a/app/code/Magento/Captcha/view/frontend/requirejs-config.js +++ b/app/code/Magento/Captcha/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Captcha/view/frontend/templates/default.phtml b/app/code/Magento/Captcha/view/frontend/templates/default.phtml index d8e11113d7707..f2058e959242d 100644 --- a/app/code/Magento/Captcha/view/frontend/templates/default.phtml +++ b/app/code/Magento/Captcha/view/frontend/templates/default.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/Api/AttributeSetFinderInterface.php b/app/code/Magento/Catalog/Api/AttributeSetFinderInterface.php index c7df36623ff83..41b569b7d0684 100644 --- a/app/code/Magento/Catalog/Api/AttributeSetFinderInterface.php +++ b/app/code/Magento/Catalog/Api/AttributeSetFinderInterface.php @@ -1,7 +1,7 @@ 'options', 'options' => ['1' => __('Yes'), '0' => __('No')], 'align' => 'center' - ], - 'is_user_defined' + ] ); $this->_eventManager->dispatch('product_attribute_grid_build', ['grid' => $this]); diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php index 764dc9c8bb0cc..d93d4c98cf45c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php @@ -1,6 +1,6 @@ */ -use Magento\Catalog\Model\Entity\Product\Attribute\Group\AttributeMapperInterface; - class Main extends \Magento\Backend\Block\Template { /** @@ -89,25 +90,25 @@ protected function _prepareLayout() { $setId = $this->_getSetId(); - $this->addChild('group_tree', 'Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main\Tree\Group'); + $this->addChild('group_tree', \Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main\Tree\Group::class); - $this->addChild('edit_set_form', 'Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main\Formset'); + $this->addChild('edit_set_form', \Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main\Formset::class); $this->addChild( 'delete_group_button', - 'Magento\Backend\Block\Widget\Button', + \Magento\Backend\Block\Widget\Button::class, ['label' => __('Delete Selected Group'), 'onclick' => 'editSet.submit();', 'class' => 'delete'] ); $this->addChild( 'add_group_button', - 'Magento\Backend\Block\Widget\Button', + \Magento\Backend\Block\Widget\Button::class, ['label' => __('Add New'), 'onclick' => 'editSet.addGroup();', 'class' => 'add'] ); $this->getToolbar()->addChild( 'back_button', - 'Magento\Backend\Block\Widget\Button', + \Magento\Backend\Block\Widget\Button::class, [ 'label' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/') . '\')', @@ -117,14 +118,14 @@ protected function _prepareLayout() $this->getToolbar()->addChild( 'reset_button', - 'Magento\Backend\Block\Widget\Button', + \Magento\Backend\Block\Widget\Button::class, ['label' => __('Reset'), 'onclick' => 'window.location.reload()', 'class' => 'reset'] ); if (!$this->getIsCurrentSetDefault()) { $this->getToolbar()->addChild( 'delete_button', - 'Magento\Backend\Block\Widget\Button', + \Magento\Backend\Block\Widget\Button::class, [ 'label' => __('Delete'), 'onclick' => 'deleteConfirm(\'' . $this->escapeJsQuote( @@ -143,7 +144,7 @@ protected function _prepareLayout() $this->getToolbar()->addChild( 'save_button', - 'Magento\Backend\Block\Widget\Button', + \Magento\Backend\Block\Widget\Button::class, [ 'label' => __('Save'), 'onclick' => 'editSet.save();', @@ -153,7 +154,7 @@ protected function _prepareLayout() $this->addChild( 'rename_button', - 'Magento\Backend\Block\Widget\Button', + \Magento\Backend\Block\Widget\Button::class, ['label' => __('New Set Name'), 'onclick' => 'editSet.rename()'] ); @@ -228,7 +229,7 @@ public function getGroupTreeJson() /* @var $node \Magento\Eav\Model\Entity\Attribute\Group */ foreach ($groups as $node) { $item = []; - $item['text'] = $node->getAttributeGroupName(); + $item['text'] = $this->escapeHtml($node->getAttributeGroupName()); $item['id'] = $node->getAttributeGroupId(); $item['cls'] = 'folder'; $item['allowDrop'] = true; @@ -275,7 +276,7 @@ public function getAttributeTreeJson() foreach ($attributes as $child) { $attr = [ - 'text' => $child->getAttributeCode(), + 'text' => $this->escapeHtml($child->getAttributeCode()), 'id' => $child->getAttributeId(), 'cls' => 'leaf', 'allowDrop' => false, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formattribute.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formattribute.php index a8c0d8f5e76b8..1626b6760c9a7 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formattribute.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formattribute.php @@ -1,6 +1,6 @@ getResizedImageInfo(); + try { + $imagesize = $helper->getResizedImageInfo(); + } catch (NotLoadInfoImageException $exception) { + $imagesize = [$helper->getWidth(), $helper->getHeight()]; + } $data = [ 'data' => [ @@ -140,8 +145,8 @@ public function create() 'label' => $helper->getLabel(), 'ratio' => $this->getRatio($helper), 'custom_attributes' => $this->getCustomAttributes(), - 'resized_image_width' => !empty($imagesize[0]) ? $imagesize[0] : $helper->getWidth(), - 'resized_image_height' => !empty($imagesize[1]) ? $imagesize[1] : $helper->getHeight(), + 'resized_image_width' => $imagesize[0], + 'resized_image_height' => $imagesize[1], ], ]; diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index e0a5f46573688..386fcf8eff9b2 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -1,6 +1,6 @@ _getProductCollection() as $item) { - $identities = array_merge($identities, $item->getIdentities()); - } + $category = $this->getLayer()->getCurrentCategory(); if ($category) { $identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $category->getId(); } + + //Check if category page shows only static block (No products) + if ($category->getData('display_mode') == Category::DM_PAGE) { + return $identities; + } + + foreach ($this->_getProductCollection() as $item) { + $identities = array_merge($identities, $item->getIdentities()); + } + return $identities; } @@ -332,7 +340,7 @@ public function getIdentities() * Get post parameters * * @param \Magento\Catalog\Model\Product $product - * @return string + * @return array */ public function getAddToCartPostParams(\Magento\Catalog\Model\Product $product) { diff --git a/app/code/Magento/Catalog/Block/Product/NewProduct.php b/app/code/Magento/Catalog/Block/Product/NewProduct.php index 11bb639ac2a5b..cb0904fe5fa64 100644 --- a/app/code/Magento/Catalog/Block/Product/NewProduct.php +++ b/app/code/Magento/Catalog/Block/Product/NewProduct.php @@ -1,6 +1,6 @@ pageConfig->setDescription($description); } else { - $this->pageConfig->setDescription($this->string->substr($product->getDescription(), 0, 255)); + $this->pageConfig->setDescription($this->string->substr(strip_tags($product->getDescription()), 0, 255)); } if ($this->_productHelper->canUseCanonicalTag()) { $this->pageConfig->addRemotePageAsset( diff --git a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php index 5daaff14ed733..3de6874576c7d 100644 --- a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php +++ b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php @@ -1,6 +1,6 @@ setPath('catalog/*/', ['_current' => true, 'id' => null]); } - $data['general'] = $this->getRequest()->getPostValue(); - $categoryPostData = $data['general']; + $categoryPostData = $this->getRequest()->getPostValue(); $isNewCategory = !isset($categoryPostData['entity_id']); $categoryPostData = $this->stringToBoolConverting($categoryPostData); $categoryPostData = $this->imagePreprocessing($categoryPostData); - $categoryPostData = $this->dateTimePreprocessing($category, $categoryPostData); $storeId = isset($categoryPostData['store_id']) ? $categoryPostData['store_id'] : null; $store = $this->storeManager->getStore($storeId); $this->storeManager->setCurrentStore($store->getCode()); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/SuggestCategories.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/SuggestCategories.php index 749f13f3cf0c6..d44f340479553 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/SuggestCategories.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/SuggestCategories.php @@ -1,7 +1,7 @@ resultJsonFactory = $resultJsonFactory; + if (null === $attributeGroupFactory) { + $attributeGroupFactory = \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Eav\Api\Data\AttributeGroupInterfaceFactory::class); + } + $this->attributeGroupFactory = $attributeGroupFactory; } /** @@ -132,7 +140,7 @@ public function execute() $attributeGroup = reset($attributeGroupItems); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { /** @var AttributeGroupInterface $attributeGroup */ - $attributeGroup = $this->getAttributeGroupFactory()->create(); + $attributeGroup = $this->attributeGroupFactory->create(); } $extensionAttributes = $attributeGroup->getExtensionAttributes() @@ -228,18 +236,6 @@ private function getAttributeGroupRepository() return $this->attributeGroupRepository; } - /** - * @return AttributeGroupInterfaceFactory - */ - private function getAttributeGroupFactory() - { - if (null === $this->attributeGroupFactory) { - $this->attributeGroupFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get('Magento\Eav\Api\Data\AttributeGroupInterfaceFactory'); - } - return $this->attributeGroupFactory; - } - /** * @return SearchCriteriaBuilder */ diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AlertsPriceGrid.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AlertsPriceGrid.php index 3b370edc27008..88456f15a364f 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AlertsPriceGrid.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AlertsPriceGrid.php @@ -1,7 +1,7 @@ buildFactory = $buildFactory; @@ -90,7 +106,7 @@ public function __construct( } /** - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) @@ -107,31 +123,43 @@ public function execute() $name = trim($name); try { - /** @var $attributeSet \Magento\Eav\Model\Entity\Attribute\Set */ + /** @var $attributeSet Set */ $attributeSet = $this->buildFactory->create() ->setEntityTypeId($this->_entityTypeId) ->setSkeletonId($setId) ->setName($name) ->getAttributeSet(); - } catch (AlreadyExistsException $alreadyExists) { - $this->messageManager->addError(__('An attribute set named \'%1\' already exists.', $name)); + $this->messageManager->addErrorMessage(__('An attribute set named \'%1\' already exists.', $name)); $this->_session->setAttributeData($data); return $this->returnResult('catalog/*/edit', ['_current' => true], ['error' => true]); - } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + } catch (LocalizedException $e) { + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('Something went wrong while saving the attribute.')); + $this->messageManager->addExceptionMessage( + $e, + __('Something went wrong while saving the attribute.') + ); } } $attributeId = $this->getRequest()->getParam('attribute_id'); - $attributeCode = $this->getRequest()->getParam('attribute_code') - ?: $this->generateCode($this->getRequest()->getParam('frontend_label')[0]); + + /** @var $model ProductAttributeInterface */ + $model = $this->attributeFactory->create(); + if ($attributeId) { + $model->load($attributeId); + } + $attributeCode = $model && $model->getId() + ? $model->getAttributeCode() + : $this->getRequest()->getParam('attribute_code'); + $attributeCode = $attributeCode ?: $this->generateCode($this->getRequest()->getParam('frontend_label')[0]); if (strlen($attributeCode) > 0) { - $validatorAttrCode = new \Zend_Validate_Regex(['pattern' => '/^[a-z][a-z_0-9]{0,30}$/']); + $validatorAttrCode = new \Zend_Validate_Regex( + ['pattern' => '/^[a-z][a-z_0-9]{0,30}$/'] + ); if (!$validatorAttrCode->isValid($attributeCode)) { - $this->messageManager->addError( + $this->messageManager->addErrorMessage( __( 'Attribute code "%1" is invalid. Please use only letters (a-z), ' . 'numbers (0-9) or underscore(_) in this field, first character should be a letter.', @@ -149,11 +177,11 @@ public function execute() //validate frontend_input if (isset($data['frontend_input'])) { - /** @var $inputType \Magento\Eav\Model\Adminhtml\System\Config\Source\Inputtype\Validator */ + /** @var $inputType Validator */ $inputType = $this->validatorFactory->create(); if (!$inputType->isValid($data['frontend_input'])) { foreach ($inputType->getMessages() as $message) { - $this->messageManager->addError($message); + $this->messageManager->addErrorMessage($message); } return $this->returnResult( 'catalog/*/edit', @@ -163,18 +191,14 @@ public function execute() } } - /* @var $model \Magento\Catalog\Model\ResourceModel\Eav\Attribute */ - $model = $this->attributeFactory->create(); - if ($attributeId) { - $model->load($attributeId); if (!$model->getId()) { - $this->messageManager->addError(__('This attribute no longer exists.')); + $this->messageManager->addErrorMessage(__('This attribute no longer exists.')); return $this->returnResult('catalog/*/', [], ['error' => true]); } // entity type check if ($model->getEntityTypeId() != $this->_entityTypeId) { - $this->messageManager->addError(__('We can\'t update the attribute.')); + $this->messageManager->addErrorMessage(__('We can\'t update the attribute.')); $this->_session->setAttributeData($data); return $this->returnResult('catalog/*/', [], ['error' => true]); } @@ -196,7 +220,7 @@ public function execute() $data += ['is_filterable' => 0, 'is_filterable_in_search' => 0, 'apply_to' => []]; - if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) { + if ($model->getIsUserDefined() === null || $model->getIsUserDefined() != 0) { $data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']); } @@ -242,7 +266,7 @@ public function execute() try { $model->save(); - $this->messageManager->addSuccess(__('You saved the product attribute.')); + $this->messageManager->addSuccessMessage(__('You saved the product attribute.')); $this->_attributeLabelCache->clean(); $this->_session->setAttributeData(false); @@ -253,7 +277,7 @@ public function execute() '_current' => true, 'product_tab' => $this->getRequest()->getParam('product_tab'), ]; - if (!is_null($attributeSet)) { + if ($attributeSet !== null) { $requestParams['new_attribute_set_id'] = $attributeSet->getId(); } return $this->returnResult('catalog/product/addAttribute', $requestParams, ['error' => false]); @@ -266,7 +290,7 @@ public function execute() } return $this->returnResult('catalog/*/', [], ['error' => false]); } catch (\Exception $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); $this->_session->setAttributeData($data); return $this->returnResult( 'catalog/*/edit', @@ -282,7 +306,7 @@ public function execute() * @param string $path * @param array $params * @param array $response - * @return \Magento\Framework\Controller\Result\Json|\Magento\Backend\Model\View\Result\Redirect + * @return Json|Redirect */ private function returnResult($path = '', array $params = [], array $response = []) { @@ -295,7 +319,6 @@ private function returnResult($path = '', array $params = [], array $response = return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setData($response); } return $this->resultFactory->create(ResultFactory::TYPE_REDIRECT)->setPath($path, $params); - } /** diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php index 94fad64f5ed96..99c65217e7bad 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php @@ -1,7 +1,7 @@ productFactory = $productFactory; $this->logger = $logger; $this->registry = $registry; $this->wysiwygConfig = $wysiwygConfig; + if (null === $storeFactory) { + $storeFactory = \Magento\Framework\App\ObjectManager::getInstance() + ->get(StoreFactory::class); + } + $this->storeFactory = $storeFactory; } /** @@ -70,7 +78,7 @@ public function build(RequestInterface $request) /** @var $product \Magento\Catalog\Model\Product */ $product = $this->productFactory->create(); $product->setStoreId($request->getParam('store', 0)); - $store = $this->getStoreFactory()->create(); + $store = $this->storeFactory->create(); $store->load($request->getParam('store', 0)); $typeId = $request->getParam('type'); @@ -99,16 +107,4 @@ public function build(RequestInterface $request) $this->wysiwygConfig->setStoreId($request->getParam('store')); return $product; } - - /** - * @return StoreFactory - */ - private function getStoreFactory() - { - if (null === $this->storeFactory) { - $this->storeFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get('Magento\Store\Model\StoreFactory'); - } - return $this->storeFactory; - } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Categories.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Categories.php index d9a6a92799719..7879e0369ff13 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Categories.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Categories.php @@ -1,7 +1,7 @@ get(LinkTypeProvider::class); + } + if (null === $customOptionFactory) { + $customOptionFactory = ObjectManager::getInstance()->get(CustomOptionFactory::class); + } + if (null === $productLinkFactory) { + $productLinkFactory = ObjectManager::getInstance()->get(ProductLinkFactory::class); + } + if (null === $productRepository) { + $productRepository = ObjectManager::getInstance()->get(ProductRepository::class); + } + if (null === $dateTimeFilter) { + $dateTimeFilter = ObjectManager::getInstance()->get(DateTime::class); + } + if (null === $linkResolver) { + $linkResolver = ObjectManager::getInstance()->get(LinkResolver::class); + } $this->request = $request; $this->storeManager = $storeManager; $this->stockFilter = $stockFilter; $this->productLinks = $productLinks; $this->jsHelper = $jsHelper; $this->dateFilter = $dateFilter; - $this->linkTypeProvider = $linkTypeProvider ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\Model\Product\LinkTypeProvider::class); + $this->linkTypeProvider = $linkTypeProvider; + $this->customOptionFactory = $customOptionFactory; + $this->productLinkFactory = $productLinkFactory; + $this->productRepository = $productRepository; + $this->dateTimeFilter = $dateTimeFilter; + $this->linkResolver = $linkResolver; } /** @@ -159,7 +199,7 @@ public function initializeFromData(Product $product, array $productData) foreach ($attributes as $attrKey => $attribute) { if ($attribute->getBackend()->getType() == 'datetime') { if (array_key_exists($attrKey, $productData) && $productData[$attrKey] != '') { - $dateFieldFilters[$attrKey] = $this->getDateTimeFilter(); + $dateFieldFilters[$attrKey] = $this->dateTimeFilter; } } } @@ -222,11 +262,12 @@ public function initialize(Product $product) * * @param Product $product * @return Product + * @throws \Magento\Framework\Exception\NoSuchEntityException * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ protected function setProductLinks(Product $product) { - $links = $this->getLinkResolver()->getLinks(); + $links = $this->linkResolver->getLinks(); $product->setProductLinks([]); @@ -251,8 +292,8 @@ protected function setProductLinks(Product $product) continue; } - $linkProduct = $this->getProductRepository()->getById($linkData['id']); - $link = $this->getProductLinkFactory()->create(); + $linkProduct = $this->productRepository->getById($linkData['id']); + $link = $this->productLinkFactory->create(); $link->setSku($product->getSku()) ->setLinkedProductSku($linkProduct->getSku()) ->setLinkType($linkType) @@ -360,73 +401,6 @@ private function overwriteValue($optionId, $option, $overwriteOptions) return $option; } - /** - * @return CustomOptionFactory - */ - private function getCustomOptionFactory() - { - if (null === $this->customOptionFactory) { - $this->customOptionFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory::class); - } - - return $this->customOptionFactory; - } - - /** - * @return ProductLinkFactory - */ - private function getProductLinkFactory() - { - if (null === $this->productLinkFactory) { - $this->productLinkFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\Api\Data\ProductLinkInterfaceFactory::class); - } - - return $this->productLinkFactory; - } - - /** - * @return ProductRepository - */ - private function getProductRepository() - { - if (null === $this->productRepository) { - $this->productRepository = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\Api\ProductRepositoryInterface\Proxy::class); - } - - return $this->productRepository; - } - - /** - * @deprecated - * @return LinkResolver - */ - private function getLinkResolver() - { - if (!is_object($this->linkResolver)) { - $this->linkResolver = ObjectManager::getInstance()->get(LinkResolver::class); - } - - return $this->linkResolver; - } - - /** - * @return \Magento\Framework\Stdlib\DateTime\Filter\DateTime - * - * @deprecated - */ - private function getDateTimeFilter() - { - if ($this->dateTimeFilter === null) { - $this->dateTimeFilter = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\Stdlib\DateTime\Filter\DateTime::class); - } - - return $this->dateTimeFilter; - } - /** * Fills $product with options from $productOptions array * @@ -464,7 +438,7 @@ function ($valueData) { } ); } - $customOption = $this->getCustomOptionFactory()->create( + $customOption = $this->customOptionFactory->create( ['data' => $customOptionData] ); $customOption->setProductSku($product->getSku()); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/HandlerFactory.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/HandlerFactory.php index 1aa81f50d822d..575ff09e9d5b1 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/HandlerFactory.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/HandlerFactory.php @@ -1,6 +1,6 @@ customAttributesCodes; } + /** + * @throws \Magento\Framework\Exception\LocalizedException + * @return \Magento\Catalog\Model\ResourceModel\Category + * @deprecated because resource models should be used directly + */ + protected function _getResource() + { + return parent::_getResource(); + } + /** * Get flat resource model flag * @@ -704,7 +719,7 @@ public function getParentId() return $parentId; } $parentIds = $this->getParentIds(); - return intval(array_pop($parentIds)); + return (int)array_pop($parentIds); } /** @@ -938,8 +953,11 @@ public function getAnchorsAbove() */ public function getProductCount() { - $count = $this->_getResource()->getProductCount($this); - $this->setData(self::KEY_PRODUCT_COUNT, $count); + if (!$this->hasData(self::KEY_PRODUCT_COUNT)) { + $count = $this->_getResource()->getProductCount($this); + $this->setData(self::KEY_PRODUCT_COUNT, $count); + } + return $this->getData(self::KEY_PRODUCT_COUNT); } @@ -1129,19 +1147,21 @@ public function getIdentities() { $identities = []; if ($this->getId()) { - $identities[] = self::CACHE_TAG . '_' . $this->getId(); - } - if ($this->getId() - && ( - $this->hasDataChanges() - || $this->isDeleted() - || $this->dataHasChangedFor(self::KEY_INCLUDE_IN_MENU) - ) - ) { - $identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $this->getId(); - } - if ($this->getId() && $this->isObjectNew()) { - $identities[] = self::CACHE_TAG; + if ($this->getAffectedCategoryIds()) { + foreach (array_unique($this->getAffectedCategoryIds()) as $affectedCategoryId) { + $identities[] = self::CACHE_TAG . '_' . $affectedCategoryId; + } + } else { + $identities[] = self::CACHE_TAG . '_' . $this->getId(); + } + + if ($this->hasDataChanges() || $this->isDeleted() || $this->dataHasChangedFor(self::KEY_INCLUDE_IN_MENU)) { + $identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $this->getId(); + } + + if ($this->isObjectNew()) { + $identities[] = self::CACHE_TAG; + } } return $identities; diff --git a/app/code/Magento/Catalog/Model/Category/Attribute.php b/app/code/Magento/Catalog/Model/Category/Attribute.php index 94a108c063f51..b56e20822a470 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute.php @@ -1,6 +1,6 @@ resource = $resource; $this->connection = $resource->getConnection(); $this->storeManager = $storeManager; $this->config = $config; - $this->queryGenerator = $queryGenerator ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(QueryGenerator::class); + $this->queryGenerator = $queryGenerator ?: ObjectManager::getInstance()->get(QueryGenerator::class); + $this->metadataPool = $metadataPool ?: ObjectManager::getInstance()->get(MetadataPool::class); } /** @@ -179,9 +186,9 @@ protected function getMainTable() */ protected function getMainTmpTable() { - return $this->useTempTable ? $this->getTable( - self::MAIN_INDEX_TABLE . self::TEMPORARY_TABLE_SUFFIX - ) : $this->getMainTable(); + return $this->useTempTable + ? $this->getTable(self::MAIN_INDEX_TABLE . self::TEMPORARY_TABLE_SUFFIX) + : $this->getMainTable(); } /** @@ -209,24 +216,25 @@ protected function getPathFromCategoryId($categoryId) /** * Retrieve select for reindex products of non anchor categories * - * @param \Magento\Store\Model\Store $store - * @return \Magento\Framework\DB\Select + * @param Store $store + * @return Select + * @throws \Exception when metadata not found for ProductInterface */ - protected function getNonAnchorCategoriesSelect(\Magento\Store\Model\Store $store) + protected function getNonAnchorCategoriesSelect(Store $store) { if (!isset($this->nonAnchorSelects[$store->getId()])) { $statusAttributeId = $this->config->getAttribute( - \Magento\Catalog\Model\Product::ENTITY, + Product::ENTITY, 'status' )->getId(); $visibilityAttributeId = $this->config->getAttribute( - \Magento\Catalog\Model\Product::ENTITY, + Product::ENTITY, 'visibility' )->getId(); $rootPath = $this->getPathFromCategoryId($store->getRootCategoryId()); - $metadata = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); $linkField = $metadata->getLinkField(); $select = $this->connection->select()->from( ['cc' => $this->getTable('catalog_category_entity')], @@ -295,12 +303,65 @@ protected function getNonAnchorCategoriesSelect(\Magento\Store\Model\Store $stor ] ); + $this->addFilteringByChildProductsToSelect($select, $store); + $this->nonAnchorSelects[$store->getId()] = $select; } return $this->nonAnchorSelects[$store->getId()]; } + /** + * Add filtering by child products to select + * + * It's used for correct handling of composite products. + * This method makes assumption that select already joins `catalog_product_entity` as `cpe`. + * + * @param Select $select + * @param Store $store + * @return void + * @throws \Exception when metadata not found for ProductInterface + */ + private function addFilteringByChildProductsToSelect(Select $select, Store $store) + { + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); + $linkField = $metadata->getLinkField(); + + $statusAttributeId = $this->config->getAttribute(Product::ENTITY, 'status')->getId(); + + $select->joinLeft( + ['relation' => $this->getTable('catalog_product_relation')], + 'cpe.' . $linkField . ' = relation.parent_id', + [] + )->joinLeft( + ['relation_product_entity' => $this->getTable('catalog_product_entity')], + 'relation.child_id = relation_product_entity.entity_id', + [] + )->joinLeft( + ['child_cpsd' => $this->getTable('catalog_product_entity_int')], + 'child_cpsd.' . $linkField . ' = '. 'relation_product_entity.' . $linkField + . ' AND child_cpsd.store_id = 0' + . ' AND child_cpsd.attribute_id = ' . $statusAttributeId, + [] + )->joinLeft( + ['child_cpss' => $this->getTable('catalog_product_entity_int')], + 'child_cpss.' . $linkField . ' = '. 'relation_product_entity.' . $linkField . '' + . ' AND child_cpss.attribute_id = child_cpsd.attribute_id' + . ' AND child_cpss.store_id = ' . $store->getId(), + [] + )->where( + 'relation.child_id IS NULL OR ' + . $this->connection->getIfNullSql('child_cpss.value', 'child_cpsd.value') . ' = ?', + \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED + )->group( + [ + 'cc.entity_id', + 'ccp.product_id', + 'visibility' + ] + ); + } + /** * Check whether select ranging is needed * @@ -314,16 +375,13 @@ protected function isRangingNeeded() /** * Return selects cut by min and max. * - * @param \Magento\Framework\DB\Select $select + * @param Select $select * @param string $field * @param int $range - * @return \Magento\Framework\DB\Select[] + * @return Select[] */ - protected function prepareSelectsByRange( - \Magento\Framework\DB\Select $select, - $field, - $range = self::RANGE_CATEGORY_STEP - ) { + protected function prepareSelectsByRange(Select $select, $field, $range = self::RANGE_CATEGORY_STEP) + { if ($this->isRangingNeeded()) { $iterator = $this->queryGenerator->generate( $field, @@ -346,10 +404,10 @@ protected function prepareSelectsByRange( /** * Reindex products of non anchor categories * - * @param \Magento\Store\Model\Store $store + * @param Store $store * @return void */ - protected function reindexNonAnchorCategories(\Magento\Store\Model\Store $store) + protected function reindexNonAnchorCategories(Store $store) { $selects = $this->prepareSelectsByRange($this->getNonAnchorCategoriesSelect($store), 'entity_id'); foreach ($selects as $select) { @@ -367,10 +425,10 @@ protected function reindexNonAnchorCategories(\Magento\Store\Model\Store $store) /** * Check if anchor select isset * - * @param \Magento\Store\Model\Store $store + * @param Store $store * @return bool */ - protected function hasAnchorSelect(\Magento\Store\Model\Store $store) + protected function hasAnchorSelect(Store $store) { return isset($this->anchorSelects[$store->getId()]); } @@ -378,19 +436,20 @@ protected function hasAnchorSelect(\Magento\Store\Model\Store $store) /** * Create anchor select * - * @param \Magento\Store\Model\Store $store - * @return \Magento\Framework\DB\Select + * @param Store $store + * @return Select + * @throws \Exception when metadata not found for ProductInterface or CategoryInterface * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - protected function createAnchorSelect(\Magento\Store\Model\Store $store) + protected function createAnchorSelect(Store $store) { $isAnchorAttributeId = $this->config->getAttribute( \Magento\Catalog\Model\Category::ENTITY, 'is_anchor' )->getId(); - $statusAttributeId = $this->config->getAttribute(\Magento\Catalog\Model\Product::ENTITY, 'status')->getId(); + $statusAttributeId = $this->config->getAttribute(Product::ENTITY, 'status')->getId(); $visibilityAttributeId = $this->config->getAttribute( - \Magento\Catalog\Model\Product::ENTITY, + Product::ENTITY, 'visibility' )->getId(); $rootCatIds = explode('/', $this->getPathFromCategoryId($store->getRootCategoryId())); @@ -398,12 +457,12 @@ protected function createAnchorSelect(\Magento\Store\Model\Store $store) $temporaryTreeTable = $this->makeTempCategoryTreeIndex(); - $productMetadata = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); - $categoryMetadata = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\CategoryInterface::class); + $productMetadata = $this->metadataPool->getMetadata(ProductInterface::class); + $categoryMetadata = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\CategoryInterface::class); $productLinkField = $productMetadata->getLinkField(); $categoryLinkField = $categoryMetadata->getLinkField(); - return $this->connection->select()->from( + $select = $this->connection->select()->from( ['cc' => $this->getTable('catalog_category_entity')], [] )->joinInner( @@ -485,6 +544,10 @@ protected function createAnchorSelect(\Magento\Store\Model\Store $store) 'visibility' => new \Zend_Db_Expr($this->connection->getIfNullSql('cpvs.value', 'cpvd.value')), ] ); + + $this->addFilteringByChildProductsToSelect($select, $store); + + return $select; } /** @@ -576,10 +639,10 @@ protected function fillTempCategoryTreeIndex($temporaryName) /** * Retrieve select for reindex products of non anchor categories * - * @param \Magento\Store\Model\Store $store - * @return \Magento\Framework\DB\Select + * @param Store $store + * @return Select */ - protected function getAnchorCategoriesSelect(\Magento\Store\Model\Store $store) + protected function getAnchorCategoriesSelect(Store $store) { if (!$this->hasAnchorSelect($store)) { $this->anchorSelects[$store->getId()] = $this->createAnchorSelect($store); @@ -590,10 +653,10 @@ protected function getAnchorCategoriesSelect(\Magento\Store\Model\Store $store) /** * Reindex products of anchor categories * - * @param \Magento\Store\Model\Store $store + * @param Store $store * @return void */ - protected function reindexAnchorCategories(\Magento\Store\Model\Store $store) + protected function reindexAnchorCategories(Store $store) { $selects = $this->prepareSelectsByRange($this->getAnchorCategoriesSelect($store), 'entity_id'); @@ -612,22 +675,23 @@ protected function reindexAnchorCategories(\Magento\Store\Model\Store $store) /** * Get select for all products * - * @param \Magento\Store\Model\Store $store - * @return \Magento\Framework\DB\Select + * @param Store $store + * @return Select + * @throws \Exception when metadata not found for ProductInterface */ - protected function getAllProducts(\Magento\Store\Model\Store $store) + protected function getAllProducts(Store $store) { if (!isset($this->productsSelects[$store->getId()])) { $statusAttributeId = $this->config->getAttribute( - \Magento\Catalog\Model\Product::ENTITY, + Product::ENTITY, 'status' )->getId(); $visibilityAttributeId = $this->config->getAttribute( - \Magento\Catalog\Model\Product::ENTITY, + Product::ENTITY, 'visibility' )->getId(); - $metadata = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); $linkField = $metadata->getLinkField(); $select = $this->connection->select()->from( @@ -716,10 +780,10 @@ protected function isIndexRootCategoryNeeded() /** * Reindex all products to root category * - * @param \Magento\Store\Model\Store $store + * @param Store $store * @return void */ - protected function reindexRootCategory(\Magento\Store\Model\Store $store) + protected function reindexRootCategory(Store $store) { if ($this->isIndexRootCategoryNeeded()) { $selects = $this->prepareSelectsByRange( @@ -740,16 +804,4 @@ protected function reindexRootCategory(\Magento\Store\Model\Store $store) } } } - - /** - * @return \Magento\Framework\EntityManager\MetadataPool - */ - private function getMetadataPool() - { - if (null === $this->metadataPool) { - $this->metadataPool = \Magento\Framework\App\ObjectManager::getInstance() - ->get('Magento\Framework\EntityManager\MetadataPool'); - } - return $this->metadataPool; - } } diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php index 5a5dced86f959..9385d1e13c2ad 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php @@ -1,6 +1,6 @@ cacheContext = $cacheContext ?: ObjectManager::getInstance()->get(CacheContext::class); + $this->eventManager = $eventManager ?: ObjectManager::getInstance()->get(EventManagerInterface::class); + } + /** * Refresh entities index * * @param int[] $entityIds * @param bool $useTempTable * @return $this + * @throws \Exception if metadataPool doesn't contain metadata for ProductInterface + * @throws \DomainException */ public function execute(array $entityIds = [], $useTempTable = false) { - $this->limitationByProducts = $entityIds; + $idsToBeReIndexed = $this->getProductIdsWithParents($entityIds); + + $this->limitationByProducts = $idsToBeReIndexed; $this->useTempTable = $useTempTable; + $affectedCategories = $this->getCategoryIdsFromIndex($idsToBeReIndexed); + $this->removeEntries(); $this->reindex(); - $this->registerProducts($entityIds); - $this->registerCategories($entityIds); + $affectedCategories = array_merge($affectedCategories, $this->getCategoryIdsFromIndex($idsToBeReIndexed)); + + $this->registerProducts($idsToBeReIndexed); + $this->registerCategories($affectedCategories); + $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); return $this; } + /** + * Get IDs of parent products by their child IDs. + * + * Returns identifiers of parent product from the catalog_product_relation. + * Please note that returned ids don't contain ids of passed child products. + * + * @param int[] $childProductIds + * @return int[] + * @throws \Exception if metadataPool doesn't contain metadata for ProductInterface + * @throws \DomainException + */ + private function getProductIdsWithParents(array $childProductIds) + { + /** @var \Magento\Framework\EntityManager\EntityMetadataInterface $metadata */ + $metadata = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); + $fieldForParent = $metadata->getLinkField(); + + $select = $this->connection + ->select() + ->from(['relation' => $this->getTable('catalog_product_relation')], []) + ->distinct(true) + ->where('child_id IN (?)', $childProductIds) + ->join( + ['cpe' => $this->getTable('catalog_product_entity')], + 'relation.parent_id = cpe.' . $fieldForParent, + ['cpe.entity_id'] + ); + + $parentProductIds = $this->connection->fetchCol($select); + + return array_unique(array_merge($childProductIds, $parentProductIds)); + } + /** * Register affected products * @@ -53,26 +133,19 @@ public function execute(array $entityIds = [], $useTempTable = false) */ private function registerProducts($entityIds) { - $this->getCacheContext()->registerEntities(Product::CACHE_TAG, $entityIds); + $this->cacheContext->registerEntities(Product::CACHE_TAG, $entityIds); } /** * Register categories assigned to products * - * @param array $entityIds + * @param array $categoryIds * @return void */ - private function registerCategories($entityIds) + private function registerCategories(array $categoryIds) { - $categories = $this->connection->fetchCol( - $this->connection->select() - ->from($this->getMainTable(), ['category_id']) - ->where('product_id IN (?)', $entityIds) - ->distinct() - ); - - if ($categories) { - $this->getCacheContext()->registerEntities(Category::CACHE_TAG, $categories); + if ($categoryIds) { + $this->cacheContext->registerEntities(Category::CACHE_TAG, $categoryIds); } } @@ -98,7 +171,7 @@ protected function removeEntries() protected function getNonAnchorCategoriesSelect(\Magento\Store\Model\Store $store) { $select = parent::getNonAnchorCategoriesSelect($store); - return $select->where('ccp.product_id IN (?)', $this->limitationByProducts); + return $select->where('ccp.product_id IN (?) OR relation.child_id IN (?)', $this->limitationByProducts); } /** @@ -136,16 +209,29 @@ protected function isRangingNeeded() } /** - * Get cache context + * Returns a list of category ids which are assigned to product ids in the index * - * @return \Magento\Framework\Indexer\CacheContext - * @deprecated + * This may be required to get list of categories that are affected by the indexation process. + * Also, returns all parents of assigned categories as they're may be affected as well. + * + * @param array $productIds + * @return array */ - private function getCacheContext() + private function getCategoryIdsFromIndex(array $productIds) { - if ($this->cacheContext === null) { - $this->cacheContext = \Magento\Framework\App\ObjectManager::getInstance()->get(CacheContext::class); + $categoryIds = $this->connection->fetchCol( + $this->connection->select() + ->from($this->getMainTable(), ['category_id']) + ->where('product_id IN (?)', $productIds) + ->distinct() + ); + $parentCategories = $categoryIds; + foreach ($categoryIds as $categoryId) { + $parentIds = explode('/', $this->getPathFromCategoryId($categoryId)); + $parentCategories = array_merge($parentCategories, $parentIds); } - return $this->cacheContext; + $categoryIds = array_unique($parentCategories); + + return $categoryIds; } } diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/RowsFactory.php b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/RowsFactory.php index 6d570baf7bcb7..078efe4f0424a 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/RowsFactory.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/RowsFactory.php @@ -1,6 +1,6 @@ _init('Magento\Catalog\Model\ResourceModel\Product'); } + /** + * Get resource instance + * + * @throws \Magento\Framework\Exception\LocalizedException + * @return \Magento\Catalog\Model\ResourceModel\Product + * @deprecated because resource models should be used directly + */ + protected function _getResource() + { + return parent::_getResource(); + } + /** * {@inheritdoc} */ @@ -1058,12 +1075,7 @@ protected function _afterLoad() */ public function cleanCache() { - if ($this->getId()) { - $this->_cacheManager->clean( - self::CACHE_TAG . '_' . $this->getId() - ); - } - return $this; + return $this->cleanModelCache(); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Action.php b/app/code/Magento/Catalog/Model/Product/Action.php index 6484f477c0ab6..bb6d56ee0ebf8 100644 --- a/app/code/Magento/Catalog/Model/Product/Action.php +++ b/app/code/Magento/Catalog/Model/Product/Action.php @@ -1,6 +1,6 @@ - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model\Product\Attribute; diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Management.php b/app/code/Magento/Catalog/Model/Product/Attribute/Management.php index 4529b61147402..d49f9dc31457a 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Management.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Management.php @@ -1,7 +1,7 @@ - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model\Product\Attribute; diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php b/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php index b7d592263163a..2e8b32910f361 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php @@ -1,7 +1,7 @@ _newFile === true) { - $asset = $this->_assetRepo->createAsset( - "Magento_Catalog::images/product/placeholder/{$this->getDestinationSubdir()}.jpg" - ); - $img = $asset->getSourceFile(); - $fileInfo = getimagesize($img); - } else { - if ($this->_mediaDirectory->isFile($this->_mediaDirectory->getAbsolutePath($this->_newFile))) { - $fileInfo = getimagesize($this->_mediaDirectory->getAbsolutePath($this->_newFile)); + try { + $fileInfo = null; + if ($this->_newFile === true) { + $asset = $this->_assetRepo->createAsset( + "Magento_Catalog::images/product/placeholder/{$this->getDestinationSubdir()}.jpg" + ); + $image = $asset->getSourceFile(); + $fileInfo = getimagesize($image); + } else { + $image = $this->_mediaDirectory->getAbsolutePath($this->_newFile); + if ($this->_mediaDirectory->isFile($image)) { + $fileInfo = getimagesize($image); + } + } + return $fileInfo; + } finally { + if (empty($fileInfo)) { + throw new NotLoadInfoImageException(__('Can\'t get information about the picture: %1', $image)); } } - return $fileInfo; } } diff --git a/app/code/Magento/Catalog/Model/Product/Image/Cache.php b/app/code/Magento/Catalog/Model/Product/Image/Cache.php index 2a5316583ff6e..c5e5e0ecac4c0 100644 --- a/app/code/Magento/Catalog/Model/Product/Image/Cache.php +++ b/app/code/Magento/Catalog/Model/Product/Image/Cache.php @@ -1,6 +1,6 @@ getGroupByType($this->getData('type')) === self::OPTION_GROUP_FILE) { + $this->cleanFileExtensions(); + } + return $this; } @@ -912,5 +917,22 @@ private function getMetadataPool() } return $this->metadataPool; } + + /** + * Clears all non-accepted characters from file_extension field. + * + * @return void + */ + private function cleanFileExtensions() + { + $rawExtensions = $this->getFileExtension(); + $matches = []; + preg_match_all('/(?[a-z0-9]+)/i', strtolower($rawExtensions), $matches); + if (!empty($matches)) { + $extensions = implode(', ', array_unique($matches['extensions'])); + } + $this->setFileExtension($extensions); + } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Catalog/Model/Product/Option/Converter.php b/app/code/Magento/Catalog/Model/Product/Option/Converter.php index 5ba9ced88588c..f5c447d30cc85 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Converter.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Converter.php @@ -1,7 +1,7 @@ productRepository = $productRepository; $this->optionResource = $optionResource; $this->converter = $converter; + if (null === $optionFactory) { + $optionFactory = \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Catalog\Model\Product\OptionFactory::class); + } + $this->optionFactory = $optionFactory; + if (null === $collectionFactory) { + $collectionFactory = \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Catalog\Model\ResourceModel\Product\Option\CollectionFactory::class); + } + $this->collectionFactory = $collectionFactory; } /** @@ -83,7 +98,7 @@ public function getList($sku) */ public function getProductOptions(ProductInterface $product, $requiredOnly = false) { - return $this->getCollectionFactory()->create()->getProductOptions( + return $this->collectionFactory->create()->getProductOptions( $product->getEntityId(), $product->getStoreId(), $requiredOnly @@ -122,7 +137,7 @@ public function duplicate( $hydrator = $this->getHydratorPool()->getHydrator(ProductInterface::class); $metadata = $this->getMetadataPool()->getMetadata(ProductInterface::class); return $this->optionResource->duplicate( - $this->getOptionFactory()->create([]), + $this->optionFactory->create([]), $hydrator->extract($product)[$metadata->getLinkField()], $hydrator->extract($duplicate)[$metadata->getLinkField()] ); @@ -228,32 +243,6 @@ protected function markRemovedValues($newValues, $originalValues) return $newValues; } - /** - * @return \Magento\Catalog\Model\Product\OptionFactory - * @deprecated - */ - private function getOptionFactory() - { - if (null === $this->optionFactory) { - $this->optionFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\Model\Product\OptionFactory::class); - } - return $this->optionFactory; - } - - /** - * @return \Magento\Catalog\Model\ResourceModel\Product\Option\CollectionFactory - * @deprecated - */ - private function getCollectionFactory() - { - if (null === $this->collectionFactory) { - $this->collectionFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\Model\ResourceModel\Product\Option\CollectionFactory::class); - } - return $this->collectionFactory; - } - /** * @return \Magento\Framework\EntityManager\MetadataPool * @deprecated @@ -269,6 +258,7 @@ private function getMetadataPool() /** * @return \Magento\Framework\EntityManager\HydratorPool + * @throws \RuntimeException * @deprecated */ private function getHydratorPool() diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 0f77d9e26ceb0..ff15f88bbd3b8 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -1,6 +1,6 @@ _dateExists()) { if ($this->useCalendar()) { - $timestamp += $this->_localeDate->date($value['date'], null, true, false)->getTimestamp(); + $timestamp += $this->_localeDate->date($value['date'], null, true)->getTimestamp(); } else { $timestamp += mktime(0, 0, 0, $value['month'], $value['day'], $value['year']); } diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php index b54266e17b402..8db51e97280d7 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php @@ -1,6 +1,6 @@ productRepository = $productRepository; $this->entityCollectionProvider = $entityCollectionProvider; $this->linkInitializer = $linkInitializer; $this->linkManagement = $linkManagement; $this->dataObjectProcessor = $dataObjectProcessor; + if (null === $productLinkFactory) { + $productLinkFactory = \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Catalog\Api\Data\ProductLinkInterfaceFactory::class); + } + if (null === $productLinkExtensionFactory) { + $productLinkExtensionFactory = \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Catalog\Api\Data\ProductLinkExtensionFactory::class); + } + $this->productLinkFactory = $productLinkFactory; + $this->productLinkExtensionFactory = $productLinkExtensionFactory; } /** @@ -149,7 +164,7 @@ public function getList(\Magento\Catalog\Api\Data\ProductInterface $product) $collection = $this->entityCollectionProvider->getCollection($product, $linkTypeName); foreach ($collection as $item) { /** @var \Magento\Catalog\Api\Data\ProductLinkInterface $productLink */ - $productLink = $this->getProductLinkFactory()->create(); + $productLink = $this->productLinkFactory->create(); $productLink->setSku($product->getSku()) ->setLinkType($linkTypeName) ->setLinkedProductSku($item['sku']) @@ -158,7 +173,7 @@ public function getList(\Magento\Catalog\Api\Data\ProductInterface $product) if (isset($item['custom_attributes'])) { $productLinkExtension = $productLink->getExtensionAttributes(); if ($productLinkExtension === null) { - $productLinkExtension = $this->getProductLinkExtensionFactory()->create(); + $productLinkExtension = $this->productLinkExtensionFactory->create(); } foreach ($item['custom_attributes'] as $option) { $name = $option['attribute_code']; @@ -258,30 +273,6 @@ private function getLinkTypeProvider() return $this->linkTypeProvider; } - /** - * @return ProductLinkInterfaceFactory - */ - private function getProductLinkFactory() - { - if (null === $this->productLinkFactory) { - $this->productLinkFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get('Magento\Catalog\Api\Data\ProductLinkInterfaceFactory'); - } - return $this->productLinkFactory; - } - - /** - * @return ProductLinkExtensionFactory - */ - private function getProductLinkExtensionFactory() - { - if (null === $this->productLinkExtensionFactory) { - $this->productLinkExtensionFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get('Magento\Catalog\Api\Data\ProductLinkExtensionFactory'); - } - return $this->productLinkExtensionFactory; - } - /** * @return \Magento\Framework\EntityManager\MetadataPool */ diff --git a/app/code/Magento/Catalog/Model/ProductLink/Type.php b/app/code/Magento/Catalog/Model/ProductLink/Type.php index a45589204fdc7..e22741e4a2565 100644 --- a/app/code/Magento/Catalog/Model/ProductLink/Type.php +++ b/app/code/Magento/Catalog/Model/ProductLink/Type.php @@ -1,6 +1,6 @@ $value) { $product->setData($key, $value); } - $this->assignProductToWebsites($product); + $this->assignProductToWebsites($product, $createNew); return $product; } /** * @param \Magento\Catalog\Model\Product $product + * @param bool $createNew * @return void */ - private function assignProductToWebsites(\Magento\Catalog\Model\Product $product) + private function assignProductToWebsites(\Magento\Catalog\Model\Product $product, $createNew) { - if (!$this->storeManager->hasSingleStore()) { - - if ($this->storeManager->getStore()->getCode() == \Magento\Store\Model\Store::ADMIN_CODE) { - $websiteIds = array_keys($this->storeManager->getWebsites()); - } else { - $websiteIds = [$this->storeManager->getStore()->getWebsiteId()]; - } + $websiteIds = $product->getWebsiteIds(); + + if ($createNew && !$this->storeManager->hasSingleStore()) { + $websiteIds = array_unique( + array_merge( + $websiteIds, + [$this->storeManager->getStore()->getWebsiteId()] + ) + ); + } - $product->setWebsiteIds(array_unique(array_merge($product->getWebsiteIds(), $websiteIds))); + if ($createNew && $this->storeManager->getStore(true)->getCode() == \Magento\Store\Model\Store::ADMIN_CODE) { + $websiteIds = array_keys($this->storeManager->getWebsites()); } + + $product->setWebsiteIds($websiteIds); } /** @@ -401,7 +408,7 @@ private function processLinks(\Magento\Catalog\Api\Data\ProductInterface $produc $linksToInitialize = []; foreach ($linksByType as $link) { $linkDataArray = $this->extensibleDataObjectConverter - ->toNestedArray($link, [], 'Magento\Catalog\Api\Data\ProductLinkInterface'); + ->toNestedArray($link, [], \Magento\Catalog\Api\Data\ProductLinkInterface::class); $linkedSku = $link->getLinkedProductSku(); if (!isset($linkedProductIds[$linkedSku])) { throw new NoSuchEntityException( @@ -518,7 +525,7 @@ public function save(\Magento\Catalog\Api\Data\ProductInterface $product, $saveO } $productDataArray = $this->extensibleDataObjectConverter - ->toNestedArray($product, [], 'Magento\Catalog\Api\Data\ProductInterface'); + ->toNestedArray($product, [], \Magento\Catalog\Api\Data\ProductInterface::class); $productDataArray = array_replace($productDataArray, $product->getData()); $ignoreLinksFlag = $product->getData('ignore_links_flag'); $productLinks = null; @@ -631,6 +638,7 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr $collection->setCurPage($searchCriteria->getCurrentPage()); $collection->setPageSize($searchCriteria->getPageSize()); $collection->load(); + $collection->addCategoryIds(); $searchResult = $this->searchResultsFactory->create(); $searchResult->setSearchCriteria($searchCriteria); @@ -717,7 +725,7 @@ private function getMediaGalleryProcessor() { if (null === $this->mediaGalleryProcessor) { $this->mediaGalleryProcessor = \Magento\Framework\App\ObjectManager::getInstance() - ->get('Magento\Catalog\Model\Product\Gallery\Processor'); + ->get(\Magento\Catalog\Model\Product\Gallery\Processor::class); } return $this->mediaGalleryProcessor; } diff --git a/app/code/Magento/Catalog/Model/ProductType.php b/app/code/Magento/Catalog/Model/ProductType.php index c1c0ecc82c4a0..48267ed8ed760 100644 --- a/app/code/Magento/Catalog/Model/ProductType.php +++ b/app/code/Magento/Catalog/Model/ProductType.php @@ -2,7 +2,7 @@ /** * Product type * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model; diff --git a/app/code/Magento/Catalog/Model/ProductTypeList.php b/app/code/Magento/Catalog/Model/ProductTypeList.php index 3e9946f43ea95..5c9774d22cece 100644 --- a/app/code/Magento/Catalog/Model/ProductTypeList.php +++ b/app/code/Magento/Catalog/Model/ProductTypeList.php @@ -2,7 +2,7 @@ /** * Product type provider * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model; diff --git a/app/code/Magento/Catalog/Model/ProductTypes/Config.php b/app/code/Magento/Catalog/Model/ProductTypes/Config.php index 701deb688e6f3..81315f0259e84 100644 --- a/app/code/Magento/Catalog/Model/ProductTypes/Config.php +++ b/app/code/Magento/Catalog/Model/ProductTypes/Config.php @@ -1,6 +1,6 @@ _storeManager->getStore()->getId(), + $this->getStoreId(), CategoryUrlRewriteGenerator::ENTITY_TYPE ), 'left' diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category/Collection/Factory.php b/app/code/Magento/Catalog/Model/ResourceModel/Category/Collection/Factory.php index 8b13ebd4a5b63..c1533ee7353a0 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category/Collection/Factory.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category/Collection/Factory.php @@ -1,6 +1,6 @@ _categoryFactory = $categoryFactory; $this->_categoryCollectionFactory = $categoryCollectionFactory; @@ -114,6 +117,11 @@ public function __construct( $this->_catalogConfig = $catalogConfig; $this->_eventManager = $eventManager; parent::__construct($context, $tableStrategy, $connectionName); + if (null === $categoryFlatCollectionFactory) { + $categoryFlatCollectionFactory = ObjectManager::getInstance() + ->get(CategoryFlatCollectionFactory::class); + } + $this->categoryFlatCollectionFactory = $categoryFlatCollectionFactory; } /** @@ -169,9 +177,7 @@ public function getMainTable() */ public function getMainStoreTable($storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID) { - if (is_string($storeId)) { - $storeId = intval($storeId); - } + $storeId = (int)$storeId; if ($storeId) { $suffix = sprintf('store_%d', $storeId); @@ -407,7 +413,7 @@ public function getCategories($parent, $recursionLevel = 0, $sorted = false, $as ); $parentPath = $this->getConnection()->fetchOne($select); - $collection = $this->getCategoryFlatCollectionFactory() + $collection = $this->categoryFlatCollectionFactory ->create() ->addNameToResult() ->addUrlRewriteToResult() @@ -698,19 +704,4 @@ public function getProductsPosition($category) return $this->getConnection()->fetchPairs($select, $bind); } - - /** - * Get instance of CategoryFlatCollectionFactory - * - * @return CategoryFlatCollectionFactory - */ - private function getCategoryFlatCollectionFactory() - { - if (!$this->categoryFlatCollectionFactory instanceof CategoryFlatCollectionFactory) { - $this->categoryFlatCollectionFactory = ObjectManager::getInstance() - ->get(CategoryFlatCollectionFactory::class); - } - - return $this->categoryFlatCollectionFactory; - } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat/Collection.php index 2449d6be86040..562b9501dd4eb 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat/Collection.php @@ -1,6 +1,6 @@ where('t.website_id = ?', $this->storeManager->getStore()->getWebsiteId()) ->where('t.customer_group_id = ?', $this->customerSession->getCustomerGroupId()) ->order('t.min_price ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $priceSelect = $this->baseSelectProcessor->process($priceSelect); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php index 8a97d43a18d7e..6fd1d080d32e8 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php @@ -1,6 +1,6 @@ where('t.attribute_id = ?', $priceAttribute->getAttributeId()) ->where('t.value IS NOT NULL') ->order('t.value ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $priceSelect = $this->baseSelectProcessor->process($priceSelect); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php index 17ce55b1252d6..5c47185a85bf4 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php @@ -1,6 +1,6 @@ getDatePartSql('special_to.value') .' >= ?', $currentDate )->order('t.value ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $specialPrice = $this->baseSelectProcessor->process($specialPrice); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php index b884d2504a47a..37281193d6a1b 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php @@ -1,6 +1,6 @@ where('t.all_groups = 1 OR customer_group_id = ?', $this->customerSession->getCustomerGroupId()) ->where('t.qty = ?', 1) ->order('t.value ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $priceSelect = $this->baseSelectProcessor->process($priceSelect); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderComposite.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderComposite.php index 1ba05e55fe2b1..5782834c06d85 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderComposite.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderComposite.php @@ -1,6 +1,6 @@ true, 'nullable' => false, 'default' => '0'], - 'Attriute Set ID' + 'Attribute Set ID' ) ->addColumn( 'parent_id', diff --git a/app/code/Magento/Catalog/Setup/Recurring.php b/app/code/Magento/Catalog/Setup/Recurring.php index e6cb302747918..c5dd4f0457f11 100644 --- a/app/code/Magento/Catalog/Setup/Recurring.php +++ b/app/code/Magento/Catalog/Setup/Recurring.php @@ -1,6 +1,6 @@ will($this->returnValue($currentCategory)); $this->assertEquals( - [$productTag, $categoryTag ], + [$categoryTag, $productTag], $this->block->getIdentities() ); } diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ListTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ListTest.php index b97064eed8828..8282a16c546e2 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ListTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ListTest.php @@ -1,6 +1,6 @@ expects($this->any()) ->method('getId') ->will($this->returnValue($categoryId)); - $categoryMock->expects($this->once()) - ->method('getAttributes') - ->willReturn([]); if (!$parentId) { if ($storeId) { $storeManagerMock->expects($this->once()) diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/CategoriesJsonTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/CategoriesJsonTest.php index 90f4f017b5cc6..e4871802dd5ad 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/CategoriesJsonTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/CategoriesJsonTest.php @@ -1,7 +1,7 @@ disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->productRepositoryMock = $this->getMockBuilder(ProductRepository::class) - ->disableOriginalConstructor() + $this->productRepositoryMock = $this->getMockBuilder(Proxy::class) + ->setMethods(['getById']) ->getMock(); $this->requestMock = $this->getMockBuilder(RequestInterface::class) ->setMethods(['getPost']) @@ -704,7 +704,7 @@ private function assembleProductRepositoryMock($links) ->willReturn($link['sku']); // Even optional arguments need to be provided for returnMapValue - $repositoryReturnMap[] = [$link['id'], false, null, false, $mockLinkedProduct]; + $repositoryReturnMap[] = [$link['id'], $mockLinkedProduct]; } } diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/StockDataFilterTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/StockDataFilterTest.php index e73269ac8f576..d569f35d453fb 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/StockDataFilterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/StockDataFilterTest.php @@ -1,6 +1,6 @@ ['test_attribute'], 'group_two' => ['attribute_one', 'attribute_two']]; diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_merged.xml b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_merged.xml index 813e9d64af710..c3c52fe89df83 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_merged.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_merged.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_one.xml b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_one.xml index 3fe4cc449c51d..26ad172c65dbd 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_one.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_one.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_two.xml b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_two.xml index 718895e7117fb..6990a2e110f9e 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_two.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_two.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/ConfigTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/ConfigTest.php index 7f469b6dc1eb5..483d21c5078db 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/ConfigTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/ConfigTest.php @@ -1,6 +1,6 @@ assertEquals("description", $this->category->getCustomAttribute($descriptionAttributeCode)->getValue()); //Change the attribute value, should reflect in getCustomAttribute - $this->category->setData($descriptionAttributeCode, "new description"); + $this->category->setCustomAttribute($descriptionAttributeCode, "new description"); $this->assertEquals(1, count($this->category->getCustomAttributes())); $this->assertNotNull($this->category->getCustomAttribute($descriptionAttributeCode)); $this->assertEquals( @@ -655,4 +655,22 @@ public function testGetIdentities() $category->setId(42); $this->assertNotEmpty($category->getIdentities()); } + + /** + * @return void + */ + public function testGetIdentitiesWithAffectedCategories() + { + $category = $this->getCategoryModel(); + $expectedIdentities = [ + 'catalog_category_1', + 'catalog_category_2', + 'catalog_category_3', + 'catalog_category_product_1', + ]; + $category->setId(1); + $category->setAffectedCategoryIds([1,2,3]); + + $this->assertEquals($expectedIdentities, $category->getIdentities()); + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Config/CatalogClone/Media/ImageTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Config/CatalogClone/Media/ImageTest.php index 1204fb49ab8d2..8f05a0dae34f4 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Config/CatalogClone/Media/ImageTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Config/CatalogClone/Media/ImageTest.php @@ -1,6 +1,6 @@ optionRepository = new Repository( $this->productRepositoryMock, $this->optionResourceMock, - $this->converterMock + $this->converterMock, + $optionFactory, + $this->optionCollectionFactory ); $this->setProperties( $this->optionRepository, [ - 'optionFactory' => $optionFactory, - 'collectionFactory' => $this->optionCollectionFactory, 'metadataPool' => $metadataPool ] ); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php index fee9f54ac981f..025313353b15c 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php @@ -1,6 +1,6 @@ productMock = $this->getMock('\Magento\Catalog\Model\Product', [], [], '', false); + $this->productMock = $this->getMock(\Magento\Catalog\Model\Product::class, [], [], '', false); $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject('Magento\Catalog\Model\Product\Option'); + $this->model = $objectManager->getObject(\Magento\Catalog\Model\Product\Option::class); $this->model->setProduct($this->productMock); } @@ -38,7 +41,7 @@ public function testGetProductSku() public function testGetRegularPrice() { $priceInfoMock = $this->getMockForAbstractClass( - 'Magento\Framework\Pricing\PriceInfoInterface', + \Magento\Framework\Pricing\PriceInfoInterface::class, [], '', false, @@ -47,7 +50,7 @@ public function testGetRegularPrice() ['getAmount', 'getPrice'] ); $priceInfoMock->expects($this->once())->method('getPrice')->willReturnSelf(); - $amountMock = $this->getMockForAbstractClass('Magento\Framework\Pricing\Amount\AmountInterface'); + $amountMock = $this->getMockForAbstractClass(\Magento\Framework\Pricing\Amount\AmountInterface::class); $priceInfoMock->expects($this->once())->method('getAmount')->willReturn($amountMock); $this->productMock->expects($this->once())->method('getPriceInfo')->willReturn($priceInfoMock); @@ -59,4 +62,41 @@ public function testGetRegularPrice() $this->model->setPriceType(null); $this->assertEquals(50, $this->model->getRegularPrice()); } + + /** + * Tests removing ineligible characters from file_extension. + * + * @param string $rawExtensions + * @param string $expectedExtensions + * @dataProvider beforeSaveFileOptionDataProvider + */ + public function testBeforeSaveFileOption($rawExtensions, $expectedExtensions) + { + $this->model->setType(Option::OPTION_GROUP_FILE); + $this->model->setFileExtension($rawExtensions); + $this->model->beforeSave(); + $actualExtensions = $this->model->getFileExtension(); + $this->assertEquals( + $expectedExtensions, + $actualExtensions + ); + } + + /** + * Data provider for testBeforeSaveFileOption. + * + * @return array + */ + public function beforeSaveFileOptionDataProvider() + { + return [ + ['JPG, PNG, GIF', 'jpg, png, gif'], + ['jpg, jpg, jpg', 'jpg'], + ['jpg, png, gif', 'jpg, png, gif'], + ['jpg png gif', 'jpg, png, gif'], + ['!jpg@png#gif%', 'jpg, png, gif'], + ['jpg, png, 123', 'jpg, png, 123'], + ['', ''], + ]; + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/PriceModifier/CompositeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/PriceModifier/CompositeTest.php index 26a46d11c00d2..03afc2cd37c52 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/PriceModifier/CompositeTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/PriceModifier/CompositeTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_valid.xml b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_valid.xml index 5f418c4b177ad..9bb8ffd5decad 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_valid.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_valid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php index ce031f5819a7d..c5199f70adc0a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php @@ -1,7 +1,7 @@ optionConverterMock = $this->getMockBuilder(\Magento\Catalog\Model\Product\Option\Converter::class) ->disableOriginalConstructor() ->getMock(); + $this->extensionAttributesJoinProcessor = $this->getMockBuilder(JoinProcessorInterface::class) + ->disableOriginalConstructor() + ->getMock(); $this->model = $this->objectManager->getObject( \Magento\Catalog\Model\ProductRepository::class, @@ -347,6 +360,7 @@ protected function setUp() 'imageProcessor' => $this->imageProcessorMock, 'extensionAttributesJoinProcessor' => $this->extensionAttributesJoinProcessorMock, 'mediaGalleryProcessor' => $this->mediaGalleryProcessor, + 'extensionAttributesJoinProcessor' => $this->extensionAttributesJoinProcessor, ] ); } @@ -671,85 +685,95 @@ public function testDeleteById() */ public function testGetList($fieldName) { - $searchCriteriaMock = $this->getMock(\Magento\Framework\Api\SearchCriteriaInterface::class, [], [], '', false); $attributeCode = 'attribute_code'; - $collectionMock = $this->getMock( - \Magento\Catalog\Model\ResourceModel\Product\Collection::class, - [], - [], - '', - false - ); - $extendedSearchCriteriaMock = $this->getMock(\Magento\Framework\Api\SearchCriteria::class, [], [], '', false); - $productAttributeSearchResultsMock = $this->getMock( - \Magento\Framework\Api\SearchResults::class, - [], - [], - '', - false - ); - $productAttributeMock = $this->getMock( - \Magento\Catalog\Api\Data\ProductAttributeInterface::class, - [], - [], - '', - false - ); - $filterGroupMock = $this->getMock(\Magento\Framework\Api\Search\FilterGroup::class, [], [], '', false); - $filterGroupFilterMock = $this->getMock(\Magento\Framework\Api\Filter::class, [], [], '', false); - $sortOrderMock = $this->getMock(\Magento\Framework\Api\SortOrder::class, [], [], '', false); - $itemsMock = $this->getMock(\Magento\Framework\DataObject::class, [], [], '', false); - $this->collectionFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); - $this->searchCriteriaBuilderMock - ->expects($this->once()) - ->method('create') - ->willReturn($extendedSearchCriteriaMock); - $this->metadataServiceMock - ->expects($this->once()) - ->method('getList') - ->with($extendedSearchCriteriaMock) - ->willReturn($productAttributeSearchResultsMock); - $productAttributeSearchResultsMock->expects($this->once()) - ->method('getItems') - ->willReturn([$productAttributeMock]); - $productAttributeMock->expects($this->once())->method('getAttributeCode')->willReturn($attributeCode); - $collectionMock->expects($this->once())->method('addAttributeToSelect')->with($attributeCode); - $collectionMock->expects($this->exactly(2)) - ->method('joinAttribute') + $filterGroupFilterMock = $this->getMockBuilder(\Magento\Framework\Api\Filter::class) + ->disableOriginalConstructor() + ->getMock(); + $filterGroupFilterMock->expects(self::exactly(2))->method('getConditionType')->willReturn('eq'); + $filterGroupFilterMock->expects(self::atLeastOnce())->method('getField')->willReturn($fieldName); + $filterGroupFilterMock->expects(self::once())->method('getValue')->willReturn('value'); + + $filterGroupMock = $this->getMockBuilder(\Magento\Framework\Api\Search\FilterGroup::class) + ->disableOriginalConstructor() + ->getMock(); + $filterGroupMock->expects(self::once())->method('getFilters')->willReturn([$filterGroupFilterMock]); + + $sortOrderMock = $this->getMockBuilder(\Magento\Framework\Api\SortOrder::class) + ->disableOriginalConstructor() + ->getMock(); + $sortOrderMock->expects(self::atLeastOnce())->method('getField')->willReturn($fieldName); + $sortOrderMock->expects(self::once())->method('getDirection')->willReturn(SortOrder::SORT_ASC); + + /** @var \Magento\Framework\Api\SearchCriteriaInterface|\PHPUnit_Framework_MockObject_MockObject $searchCriteriaMock */ + $searchCriteriaMock = $this->getMockBuilder(\Magento\Framework\Api\SearchCriteriaInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $searchCriteriaMock->expects(self::once())->method('getFilterGroups')->willReturn([$filterGroupMock]); + $searchCriteriaMock->expects(self::once())->method('getCurrentPage')->willReturn(4); + $searchCriteriaMock->expects(self::once())->method('getPageSize')->willReturn(42); + $searchCriteriaMock->expects(self::once())->method('getSortOrders')->willReturn([$sortOrderMock]); + + $itemsMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + ->disableOriginalConstructor() + ->getMock(); + + $collectionMock = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->getMock(); + $collectionMock->expects(self::once())->method('addAttributeToSelect')->with($attributeCode); + $collectionMock->expects(self::once())->method('setPageSize')->with(42); + $collectionMock->expects(self::once())->method('load'); + $collectionMock->expects(self::once())->method('addCategoryIds'); + $collectionMock->expects(self::once())->method('getItems')->willReturn([$itemsMock]); + $collectionMock->expects(self::once())->method('getSize')->willReturn(128); + $collectionMock->expects(self::once())->method('addOrder')->with($fieldName, 'ASC'); + $collectionMock->expects(self::once())->method('setCurPage')->with(4); + $collectionMock->expects(self::exactly(2))->method('joinAttribute') ->withConsecutive( ['status', 'catalog_product/status', 'entity_id', null, 'inner'], ['visibility', 'catalog_product/visibility', 'entity_id', null, 'inner'] - ); - $searchCriteriaMock->expects($this->once())->method('getFilterGroups')->willReturn([$filterGroupMock]); - $filterGroupMock->expects($this->once())->method('getFilters')->willReturn([$filterGroupFilterMock]); - $filterGroupFilterMock->expects($this->exactly(2))->method('getConditionType')->willReturn('eq'); - $filterGroupFilterMock->expects($this->atLeastOnce())->method('getField')->willReturn($fieldName); - $filterGroupFilterMock->expects($this->once())->method('getValue')->willReturn('value'); + ); + + $productAttributeMock = $this->getMockBuilder(ProductAttributeInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $productAttributeMock->expects(self::once())->method('getAttributeCode')->willReturn($attributeCode); + + $extendedSearchCriteriaMock = $this->getMockBuilder(\Magento\Framework\Api\SearchCriteria::class) + ->disableOriginalConstructor() + ->getMock(); + + $productAttributeSearchResultsMock = $this->getMockBuilder(ProductAttributeSearchResultsInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getItems']) + ->getMockForAbstractClass(); + $productAttributeSearchResultsMock->expects(self::once())->method('getItems') + ->willReturn([$productAttributeMock]); + + $this->collectionFactoryMock->expects(self::once()) + ->method('create') + ->willReturn($collectionMock); + + $this->extensionAttributesJoinProcessor->expects(self::once()) + ->method('process') + ->with($collectionMock); + + $this->metadataServiceMock->expects(self::once())->method('getList')->with($extendedSearchCriteriaMock) + ->willReturn($productAttributeSearchResultsMock); + + $this->searchCriteriaBuilderMock->expects(self::once())->method('create') + ->willReturn($extendedSearchCriteriaMock); + $this->expectAddToFilter($fieldName, $collectionMock); - $searchCriteriaMock->expects($this->once())->method('getSortOrders')->willReturn([$sortOrderMock]); - $sortOrderMock->expects($this->atLeastOnce())->method('getField')->willReturn($fieldName); - $sortOrderMock->expects($this->once())->method('getDirection')->willReturn(SortOrder::SORT_ASC); - $collectionMock->expects($this->once())->method('addOrder')->with($fieldName, 'ASC'); - $searchCriteriaMock->expects($this->once())->method('getCurrentPage')->willReturn(4); - $collectionMock->expects($this->once())->method('setCurPage')->with(4); - $searchCriteriaMock->expects($this->once())->method('getPageSize')->willReturn(42); - $collectionMock->expects($this->once())->method('setPageSize')->with(42); - $collectionMock->expects($this->once())->method('load'); - $collectionMock->expects($this->once())->method('getItems')->willReturn([$itemsMock]); - $collectionMock->expects($this->once())->method('getSize')->willReturn(128); - $searchResultsMock = $this->getMock( - \Magento\Catalog\Api\Data\ProductSearchResultsInterface::class, - [], - [], - '', - false - ); - $searchResultsMock->expects($this->once())->method('setSearchCriteria')->with($searchCriteriaMock); - $searchResultsMock->expects($this->once())->method('setItems')->with([$itemsMock]); - $searchResultsMock->expects($this->once())->method('setTotalCount')->with(128); - $this->searchResultsFactoryMock->expects($this->once())->method('create')->willReturn($searchResultsMock); + $searchResultsMock = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductSearchResultsInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $searchResultsMock->expects(self::once())->method('setSearchCriteria')->with($searchCriteriaMock); + $searchResultsMock->expects(self::once())->method('setItems')->with([$itemsMock]); + + $this->searchResultsFactoryMock->expects($this->once())->method('create')->willReturn($searchResultsMock); $this->assertEquals($searchResultsMock, $this->model->getList($searchCriteriaMock)); } @@ -1267,6 +1291,45 @@ public function testSaveExistingWithNewMediaGalleryEntries() $this->model->save($this->productMock); } + public function testSaveWithDifferentWebsites() + { + $getWebsitesResultData = [ + 1 => ['first'], + 2 => ['second'], + 3 => ['third'] + ]; + $getWebsiteIdsResultData = [1,2,3]; + $setWebsiteIdsResultData = [2,3]; + $getIdBySkuResultData = 100; + $storeMock = $this->getMock(StoreInterface::class); + $this->resourceModelMock->expects($this->at(0))->method('getIdBySku')->will($this->returnValue(null)); + $this->resourceModelMock + ->expects($this->at(3)) + ->method('getIdBySku') + ->will($this->returnValue($getIdBySkuResultData)); + $this->productFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->productMock)); + $this->initializationHelperMock->expects($this->never())->method('initialize'); + $this->resourceModelMock->expects($this->once())->method('validate')->with($this->productMock) + ->willReturn(true); + $this->resourceModelMock->expects($this->once())->method('save')->with($this->productMock)->willReturn(true); + $this->extensibleDataObjectConverterMock + ->expects($this->once()) + ->method('toNestedArray') + ->will($this->returnValue($this->productData)); + $this->storeManagerMock->expects($this->any()) + ->method('getStore') + ->willReturn($storeMock); + $this->storeManagerMock->expects($this->once()) + ->method('getWebsites') + ->willReturn($getWebsitesResultData); + $this->productMock->expects($this->once())->method('getWebsiteIds')->willReturn($getWebsiteIdsResultData); + $this->productMock->expects($this->once())->method('setWebsiteIds')->willReturn($setWebsiteIdsResultData); + + $this->assertEquals($this->productMock, $this->model->save($this->productMock)); + } + public function testSaveExistingWithMediaGalleryEntries() { //update one entry, delete one entry diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php index ee224b9aae230..5fda5f029e60f 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php @@ -1,6 +1,6 @@ assertEquals("red", $this->model->getCustomAttribute($colorAttributeCode)->getValue()); //Change the attribute value, should reflect in getCustomAttribute - $this->model->setData($colorAttributeCode, "blue"); + $this->model->setCustomAttribute($colorAttributeCode, "blue"); $this->assertEquals(1, count($this->model->getCustomAttributes())); $this->assertNotNull($this->model->getCustomAttribute($colorAttributeCode)); $this->assertEquals("blue", $this->model->getCustomAttribute($colorAttributeCode)->getValue()); @@ -1391,21 +1391,6 @@ public function testGetOptionByIdForProductWithoutOptions() $this->assertNull($this->model->getOptionById(100)); } - public function testCleanCache() - { - //Without an ID cleanCache won't clean anything because the entity is - //not identified and it will be called later exactly once. - $this->model->setId(null); - $this->cacheManagerMock - ->expects($this->once()) - ->method('clean'); - $this->model->cleanCache(); - - //Now that ID is set clean will be called. - $this->model->setId(1); - $this->model->cleanCache(); - } - public function testGetCacheTags() { //If entity is identified getCacheTags has to return the same values diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypeListTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypeListTest.php index 3c4e1fb3fc052..ebefb8eb25a36 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypeListTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypeListTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types.xml b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types.xml index dc5284d1e5405..0538e81178154 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types_merged.xml b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types_merged.xml index 724203272620b..7edbc399a9476 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types_merged.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types_merged.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php index 0c5d7e98095bb..584d034d03719 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php @@ -1,6 +1,6 @@ _model = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Category\Collection::class) + ->disableOriginalConstructor() + ->setMethods(['joinTable']) + ->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(); + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/FlatTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/FlatTest.php index d1e8570c9c399..af8cca7f71a9d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/FlatTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/FlatTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php b/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php index 23ea2bc891748..5580cd0c90517 100644 --- a/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php @@ -1,6 +1,6 @@ [ 'config' => [ 'label' => __('Compatible File Extensions'), + 'notice' => __('Enter separated extensions, like: png, jpg, gif.'), 'componentType' => Field::NAME, 'formElement' => Input::NAME, 'dataScope' => static::FIELD_FILE_EXTENSION_NAME, diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index de1d780fbf4fb..3d32fd5b9e957 100755 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index 5bc29d75f4186..eab6efa31f786 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/adminhtml/events.xml b/app/code/Magento/Catalog/etc/adminhtml/events.xml index 034204feff5c9..f4fd7fc30398c 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/events.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/adminhtml/menu.xml b/app/code/Magento/Catalog/etc/adminhtml/menu.xml index ee0d1ec5c4117..363829adf4795 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/menu.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/adminhtml/routes.xml b/app/code/Magento/Catalog/etc/adminhtml/routes.xml index 5deeddb3bb4bd..9015ef28b1a11 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/routes.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/adminhtml/system.xml b/app/code/Magento/Catalog/etc/adminhtml/system.xml index c5a1b3686fbe5..f91d12b0b2a3c 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/system.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/catalog_attributes.xml b/app/code/Magento/Catalog/etc/catalog_attributes.xml index 650652aa94555..4d9a2db084e39 100644 --- a/app/code/Magento/Catalog/etc/catalog_attributes.xml +++ b/app/code/Magento/Catalog/etc/catalog_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/catalog_attributes.xsd b/app/code/Magento/Catalog/etc/catalog_attributes.xsd index d95d5a17c258e..91d6e19896ff8 100644 --- a/app/code/Magento/Catalog/etc/catalog_attributes.xsd +++ b/app/code/Magento/Catalog/etc/catalog_attributes.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/config.xml b/app/code/Magento/Catalog/etc/config.xml index 4a8a523e0d55c..188824a0a5245 100644 --- a/app/code/Magento/Catalog/etc/config.xml +++ b/app/code/Magento/Catalog/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/crontab.xml b/app/code/Magento/Catalog/etc/crontab.xml index d69ac8f319b5e..c3a8106544357 100644 --- a/app/code/Magento/Catalog/etc/crontab.xml +++ b/app/code/Magento/Catalog/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index f2f92c6af7484..8ed8da543f365 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/eav_attributes.xml b/app/code/Magento/Catalog/etc/eav_attributes.xml index 005402937232f..4d373b540c9fd 100644 --- a/app/code/Magento/Catalog/etc/eav_attributes.xml +++ b/app/code/Magento/Catalog/etc/eav_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/events.xml b/app/code/Magento/Catalog/etc/events.xml index 3aa218aac1bdb..8a986a17a6b72 100644 --- a/app/code/Magento/Catalog/etc/events.xml +++ b/app/code/Magento/Catalog/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/extension_attributes.xml b/app/code/Magento/Catalog/etc/extension_attributes.xml index ca35211f82553..a8bd78fb68b9d 100644 --- a/app/code/Magento/Catalog/etc/extension_attributes.xml +++ b/app/code/Magento/Catalog/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/frontend/di.xml b/app/code/Magento/Catalog/etc/frontend/di.xml index ca1e1e244f49c..6b79af7dbce2d 100644 --- a/app/code/Magento/Catalog/etc/frontend/di.xml +++ b/app/code/Magento/Catalog/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/frontend/events.xml b/app/code/Magento/Catalog/etc/frontend/events.xml index dd225750f73be..63d5f5d3de7ae 100644 --- a/app/code/Magento/Catalog/etc/frontend/events.xml +++ b/app/code/Magento/Catalog/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/frontend/page_types.xml b/app/code/Magento/Catalog/etc/frontend/page_types.xml index 8f929046afeef..daff27951921c 100644 --- a/app/code/Magento/Catalog/etc/frontend/page_types.xml +++ b/app/code/Magento/Catalog/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/frontend/routes.xml b/app/code/Magento/Catalog/etc/frontend/routes.xml index d4d52559673d6..5b7aa8293d937 100644 --- a/app/code/Magento/Catalog/etc/frontend/routes.xml +++ b/app/code/Magento/Catalog/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/frontend/sections.xml b/app/code/Magento/Catalog/etc/frontend/sections.xml index 0bc9c63494b33..7e2c1d1166d1d 100644 --- a/app/code/Magento/Catalog/etc/frontend/sections.xml +++ b/app/code/Magento/Catalog/etc/frontend/sections.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/indexer.xml b/app/code/Magento/Catalog/etc/indexer.xml index 5c2ca91e525d9..08ad108119b4a 100644 --- a/app/code/Magento/Catalog/etc/indexer.xml +++ b/app/code/Magento/Catalog/etc/indexer.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/module.xml b/app/code/Magento/Catalog/etc/module.xml index 571176694547a..013afe8f2c2bf 100644 --- a/app/code/Magento/Catalog/etc/module.xml +++ b/app/code/Magento/Catalog/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/mview.xml b/app/code/Magento/Catalog/etc/mview.xml index 4600bb7fad370..4213faf9307b5 100644 --- a/app/code/Magento/Catalog/etc/mview.xml +++ b/app/code/Magento/Catalog/etc/mview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/product_options.xml b/app/code/Magento/Catalog/etc/product_options.xml index 43bf4865cb49e..09c5ffde5957d 100644 --- a/app/code/Magento/Catalog/etc/product_options.xml +++ b/app/code/Magento/Catalog/etc/product_options.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/product_options.xsd b/app/code/Magento/Catalog/etc/product_options.xsd index 18b5934c1410f..9ca354f6eed93 100644 --- a/app/code/Magento/Catalog/etc/product_options.xsd +++ b/app/code/Magento/Catalog/etc/product_options.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/product_options_merged.xsd b/app/code/Magento/Catalog/etc/product_options_merged.xsd index 7b9e6fa2650ec..9dd95e3c4bd1d 100644 --- a/app/code/Magento/Catalog/etc/product_options_merged.xsd +++ b/app/code/Magento/Catalog/etc/product_options_merged.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/product_types.xml b/app/code/Magento/Catalog/etc/product_types.xml index 513f0905b13ce..fe4922ab8fa1f 100644 --- a/app/code/Magento/Catalog/etc/product_types.xml +++ b/app/code/Magento/Catalog/etc/product_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/product_types.xsd b/app/code/Magento/Catalog/etc/product_types.xsd index 06999fbeddc7a..b25168f20e93e 100644 --- a/app/code/Magento/Catalog/etc/product_types.xsd +++ b/app/code/Magento/Catalog/etc/product_types.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/product_types_base.xsd b/app/code/Magento/Catalog/etc/product_types_base.xsd index eddd7a6845488..da0e0847f0744 100644 --- a/app/code/Magento/Catalog/etc/product_types_base.xsd +++ b/app/code/Magento/Catalog/etc/product_types_base.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/product_types_merged.xsd b/app/code/Magento/Catalog/etc/product_types_merged.xsd index 1b1d92c163989..62a149f84570d 100644 --- a/app/code/Magento/Catalog/etc/product_types_merged.xsd +++ b/app/code/Magento/Catalog/etc/product_types_merged.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/view.xml b/app/code/Magento/Catalog/etc/view.xml index 8c7500d9c1374..910a3be8055da 100644 --- a/app/code/Magento/Catalog/etc/view.xml +++ b/app/code/Magento/Catalog/etc/view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/webapi.xml b/app/code/Magento/Catalog/etc/webapi.xml index de66084cb50ef..fd5d4d0db1b34 100644 --- a/app/code/Magento/Catalog/etc/webapi.xml +++ b/app/code/Magento/Catalog/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/webapi_rest/di.xml b/app/code/Magento/Catalog/etc/webapi_rest/di.xml index 67e74dfbfd44e..1d2b013f2035d 100644 --- a/app/code/Magento/Catalog/etc/webapi_rest/di.xml +++ b/app/code/Magento/Catalog/etc/webapi_rest/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/webapi_soap/di.xml b/app/code/Magento/Catalog/etc/webapi_soap/di.xml index cb5273e4aeac5..98a8ef4de8408 100644 --- a/app/code/Magento/Catalog/etc/webapi_soap/di.xml +++ b/app/code/Magento/Catalog/etc/webapi_soap/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/etc/widget.xml b/app/code/Magento/Catalog/etc/widget.xml index f54d4af816c09..153eeedda1d03 100644 --- a/app/code/Magento/Catalog/etc/widget.xml +++ b/app/code/Magento/Catalog/etc/widget.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/registration.php b/app/code/Magento/Catalog/registration.php index fada27f08c173..94fe0b1115ce2 100644 --- a/app/code/Magento/Catalog/registration.php +++ b/app/code/Magento/Catalog/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR.xml b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR.xml index 30add348f7d2b..6cf41439bf600 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT.xml b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT.xml index ec97c79610237..21bc2d3c9cd54 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_add.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_add.xml index d9c70ae487903..8653cbb39343e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_add.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_add.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_create.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_create.xml index 02734a674189e..bb103272e5132 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_create.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_create.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml index 799c50dfc4756..65ef48cd751d1 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_action_attribute_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_action_attribute_edit.xml index 3a073f75eef12..37c2453a2d380 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_action_attribute_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_action_attribute_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertspricegrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertspricegrid.xml index 0cd56d138149e..a65603e513bdb 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertspricegrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertspricegrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertsstockgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertsstockgrid.xml index d098da96d3e52..fb63d4e96e657 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertsstockgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertsstockgrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit.xml index ddf02a7cdb9c2..c3328455be8ab 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_form.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_form.xml index 8f4780d34b17d..1a20c77199913 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml index a19d29a98720e..a46f6e5b0e8b4 100755 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_change_attribute_set.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_change_attribute_set.xml index 422cf537c3081..794ea397d0829 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_change_attribute_set.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_change_attribute_set.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssell.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssell.xml index 9c1280a2500df..4a27158be5f7c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssell.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssell.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssellgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssellgrid.xml index 96c66485f2132..b5efecf0d03c2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssellgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssellgrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_customoptions.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_customoptions.xml index 39781cc8adcf0..02f9f32cc91f1 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_customoptions.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_customoptions.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_edit.xml index 3375f5b8233f5..1c574a1e918e9 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_form.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_form.xml index 194c745e6a65a..af1238cb791d7 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grid.xml index e214ccad3dc21..b42a78dfbe302 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_index.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_index.xml index bad6a5d165535..c503196cc8647 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_index.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml index cb993bc892eac..f43f0c321e280 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_options.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_options.xml index 7d88ff2a04384..9c4fd4d0d7506 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_options.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_options.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_optionsimportgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_optionsimportgrid.xml index 7f6f62943bbea..b167b3292cb6c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_optionsimportgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_optionsimportgrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_related.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_related.xml index 6b688eeec2084..1340d40ef4f9f 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_related.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_related.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_relatedgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_relatedgrid.xml index 4a306dd725b91..1ae83419ae646 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_relatedgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_relatedgrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_reload.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_reload.xml index 422cf537c3081..794ea397d0829 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_reload.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_reload.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_block.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_block.xml index bbbc1e21669e1..22e16cac8cef2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_block.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml index bd8c2cd3550f3..a55c7590df9af 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_index.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_index.xml index b25eecbbc2502..b97ca4a3cbc98 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_index.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsell.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsell.xml index ce0b1521d82e6..a9770ed3c182e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsell.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsell.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsellgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsellgrid.xml index 83c19659b5135..a4acf572caeb5 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsellgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsellgrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/requirejs-config.js b/app/code/Magento/Catalog/view/adminhtml/requirejs-config.js index 848d1f1da908c..5ffc587f65bec 100644 --- a/app/code/Magento/Catalog/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/Catalog/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml index eaeed5b12ebaf..4cb96a1f840f7 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/toolbar/add.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/toolbar/add.phtml index cf40ee6d78af6..099bd2cae6c5e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/toolbar/add.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/toolbar/add.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/toolbar/main.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/toolbar/main.phtml index 2cdb9f451a86f..bb3f69ead1c2d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/toolbar/main.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/toolbar/main.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml index 6eed355cc3b83..8f75f37104346 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml index cb60254d4d8c7..538541136e910 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml @@ -1,6 +1,6 @@ +
x %2 px.', '', diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml index 0788d1449d715..2020e24432d4e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/wysiwyg/js.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/wysiwyg/js.phtml index 464e10d6da15c..eb934a5a25fba 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/wysiwyg/js.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/wysiwyg/js.phtml @@ -1,6 +1,6 @@ @@ -183,6 +183,7 @@ false false false + true ui/form/field category diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/crosssell_product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/crosssell_product_listing.xml index 25eb8092ab40d..1cdfbe6439b30 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/crosssell_product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/crosssell_product_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/design_config_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/design_config_form.xml index bf0fd9e33d2e1..942f0e62bc18b 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/design_config_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/design_config_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/new_category_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/new_category_form.xml index a0307886770c6..2773e9ffa3abe 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/new_category_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/new_category_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml index ab5ab6e288e13..afdcdce3356ed 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attributes_grid.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attributes_grid.xml index 24243f35bc958..852cd9207d27b 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attributes_grid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attributes_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_custom_options_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_custom_options_listing.xml index beef5bfe6c314..7ee82e8804298 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_custom_options_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_custom_options_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_form.xml index b99e01147c00d..b3db96293da88 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml index 5220c962ad0f5..25e6ac9714949 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/related_product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/related_product_listing.xml index 7801b4169a7e2..1f3f42f5c9d26 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/related_product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/related_product_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/upsell_product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/upsell_product_listing.xml index 2cca1d18b46f5..eedf965e1a14e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/upsell_product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/upsell_product_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/apply-to-type-switcher.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/apply-to-type-switcher.js index 13543ade8f726..a5ca9eb1eab0b 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/apply-to-type-switcher.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/apply-to-type-switcher.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/base-image-uploader.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/base-image-uploader.js index 4ba2d110ffb34..ae2ef17d2b0a4 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/base-image-uploader.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/base-image-uploader.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global alert:true*/ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js index 1da9c2c379c37..829c04c13106d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js index 66eb039790f28..05e94bed9ab1f 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js index 9f413832537e2..50934ef273c89 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js index 78f48b0bafabb..57ba9c01854b2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js index b751e75947ecc..20be1cc594d1e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ require([ @@ -22,7 +22,13 @@ require([ } function disableFieldEditMode(fieldId) { - byId(fieldId).prop('disabled', true); + var field = byId(fieldId); + + field.prop('disabled', true); + + if (field.next().hasClass('addafter')) { + field.parent().addClass('_update-attributes-disabled'); + } if (byId(fieldId + '_hidden').length) { byId(fieldId + '_hidden').prop('disabled', true); @@ -30,7 +36,13 @@ require([ } function enableFieldEditMode(fieldId) { - byId(fieldId).prop('disabled', false); + var field = byId(fieldId); + + field.prop('disabled', false); + + if (field.parent().hasClass('_update-attributes-disabled')) { + field.parent().removeClass('_update-attributes-disabled'); + } if (byId(fieldId + '_hidden').length) { byId(fieldId + '_hidden').prop('disabled', false); diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/attribute/unique-validate.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/attribute/unique-validate.js index 2af880f4d04c5..034085df6cbb3 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/attribute/unique-validate.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/attribute/unique-validate.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js index 0f45dda8043d0..d315f94f4b6fd 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/type-events.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/type-events.js index 9de0ff75fa843..d836974d8574d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/type-events.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/type-events.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/component/file-type-field.js b/app/code/Magento/Catalog/view/adminhtml/web/component/file-type-field.js index bed32eb574695..72bf80a02fdac 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/component/file-type-field.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/component/file-type-field.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/component/image-size-field.js b/app/code/Magento/Catalog/view/adminhtml/web/component/image-size-field.js index cbb16b397f9e6..c89acc1d7f2cc 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/component/image-size-field.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/component/image-size-field.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/component/select-type-grid.js b/app/code/Magento/Catalog/view/adminhtml/web/component/select-type-grid.js index 57d35424268b8..6262e4d5e5f5f 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/component/select-type-grid.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/component/select-type-grid.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-container.js b/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-container.js index b3ef035402c3e..977b7e2e48185 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-container.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-container.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-input.js b/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-input.js index d520758d456a5..46eb6ddb3bf79 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-input.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-input.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-select.js b/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-select.js index 6b61b5e49c97a..0c3190434a09d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-select.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/component/static-type-select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/component/text-type-field.js b/app/code/Magento/Catalog/view/adminhtml/web/component/text-type-field.js index 72d97b7aebcd9..2b829e5293f46 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/component/text-type-field.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/component/text-type-field.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/bundle-proxy-button.js b/app/code/Magento/Catalog/view/adminhtml/web/js/bundle-proxy-button.js index 42543656f210b..f260c5066223f 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/bundle-proxy-button.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/bundle-proxy-button.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/category-tree.js b/app/code/Magento/Catalog/view/adminhtml/web/js/category-tree.js index 5453b760e2f31..e2d7b230fd480 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/category-tree.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/category-tree.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint browser:true jquery:true*/ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/attribute-set-select.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/attribute-set-select.js index baefa1ae2e4b5..82bb539a5cc5c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/attribute-set-select.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/attribute-set-select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-fieldset.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-fieldset.js index 1e363ef2a1a0f..3b16c6ab1e2a0 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-fieldset.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-fieldset.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-grid-paging.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-grid-paging.js index 641dfaf295150..cac54a913da59 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-grid-paging.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-grid-paging.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-insert-listing.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-insert-listing.js index 10be9f2ffc907..ef47716434d7c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-insert-listing.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/attributes-insert-listing.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/checkbox.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/checkbox.js index b371efca26f64..866cadd6afbad 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/checkbox.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/checkbox.js @@ -1,4 +1,4 @@ -/* Copyright © 2013-2017 Magento, Inc. All rights reserved. +/* Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-hide-select.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-hide-select.js index 4bf54406e3598..313270caa9954 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-hide-select.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-hide-select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/input.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/input.js index 1961bc5fde625..f845b827feb34 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/input.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/input.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/select.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/select.js index 2dc21fc11cf55..d5b8dc8aaedfa 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/select.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/strategy.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/strategy.js index e8b276c171ca4..617332ed1c82f 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/strategy.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/strategy.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define(function () { diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/yesno.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/yesno.js index 7362acbe63eb2..da113dbf825a2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/yesno.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/disable-on-option/yesno.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/dynamic-rows-import-custom-options.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/dynamic-rows-import-custom-options.js index 87c7a49db19d1..999dd0880b110 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/dynamic-rows-import-custom-options.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/dynamic-rows-import-custom-options.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/import-handler.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/import-handler.js index a6c71e7d4b660..06b670df8a38b 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/import-handler.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/import-handler.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -141,6 +141,7 @@ define([ // strip tags tmpElement = document.createElement('div'); + str = str.replace(/(<([^>]+)>)/ig, ''); tmpElement.innerHTML = str; str = tmpElement.textContent || tmpElement.innerText || ''; diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/input-handle-required.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/input-handle-required.js index c342e961fa9e2..73fc159d682a8 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/input-handle-required.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/input-handle-required.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/messages.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/messages.js index 7e3696ba24bf8..a942ac3a7c573 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/messages.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/messages.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/multiselect-handle-required.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/multiselect-handle-required.js index b7146137c6bb3..c48c0472b8961 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/multiselect-handle-required.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/multiselect-handle-required.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-form.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-form.js index 360349f8c61e5..6702b94b119de 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-form.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-form.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-insert-form.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-insert-form.js index f3624de9cbd0f..fea7195adcf85 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-insert-form.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-insert-form.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-category.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-category.js index 7a16067b37291..adf6b976d704d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-category.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/new-category.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/product-status.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/product-status.js index 3e3c811584973..5851e8af46644 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/product-status.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/product-status.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/select-handle-required.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/select-handle-required.js index 08ed325c82a78..7f978f9a4f36e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/select-handle-required.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/select-handle-required.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/select-to-checkbox.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/select-to-checkbox.js index 281ef42a9e533..6180ac3051adb 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/select-to-checkbox.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/select-to-checkbox.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/url-key-handle-changes.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/url-key-handle-changes.js index b12f73c17125a..0d3b0b83760ea 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/url-key-handle-changes.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/url-key-handle-changes.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/date.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/date.js index ecdb3a66006b7..6f46d2911dd29 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/date.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/date.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/fieldset.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/fieldset.js index 581153832d3a5..2d61b67ae7c74 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/fieldset.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/fieldset.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/input.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/input.js index bd832632f7513..3fb5ec34717d7 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/input.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/input.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/select.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/select.js index 05453dc19bff8..0030874c1c81e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/select.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/strategy.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/strategy.js index 2e59efeab1b58..61f2a1f000b44 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/strategy.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/strategy.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define(function () { diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/textarea.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/textarea.js index 7446174982a21..0bda5142ea472 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/textarea.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/textarea.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/yesno.js b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/yesno.js index 9f8a9e43dacc5..dfa087eddec7c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/yesno.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/components/visible-on-option/yesno.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options-type.js b/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options-type.js index 878e8e1429680..b46d09a7323b1 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options-type.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options-type.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js b/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js index 0611c4fae9233..66ed079745150 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint browser:true*/ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/edit-tree.js b/app/code/Magento/Catalog/view/adminhtml/web/js/edit-tree.js index 7420595078071..41aba13623578 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/edit-tree.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/edit-tree.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js index 1ecfddac7abb8..97f978de47b60 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/checkbox.js b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/checkbox.js index 57d45551d180b..0c2eea53bfbad 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/checkbox.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/checkbox.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js index 84be3a4f8783b..51ffeaea0fc0c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js b/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js index e20d3f3e0c5b1..169d89d3b766d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint browser:true jquery:true*/ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/options.js b/app/code/Magento/Catalog/view/adminhtml/web/js/options.js index 75d768dae7bb6..5239eb207efca 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/options.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/options.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js b/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js index 2cfde92d6a762..e0a93ef666938 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint jquery:true*/ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/product/weight-handler.js b/app/code/Magento/Catalog/view/adminhtml/web/js/product/weight-handler.js index a2ae5b794f601..7628b376abe3f 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/product/weight-handler.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/product/weight-handler.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html b/app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html index bf03ffb1049e7..0797843cbf226 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/checkbox.html b/app/code/Magento/Catalog/view/adminhtml/web/template/checkbox.html index 7a2c8e42364df..8510168f4ab30 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/checkbox.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/checkbox.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/action-delete.html b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/action-delete.html index 3a516ad41358f..5d6bb0ae1498f 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/action-delete.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/action-delete.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-service.html b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-service.html index ad83bc144615e..c8c2bf5e2b22a 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-service.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-service.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-type-service.html b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-type-service.html index 3c3cbbde2ab39..0a5f7d946670d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-type-service.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-type-service.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html index 560bc90ea6d19..a3aad4284d8d8 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html b/app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html index cb741f5288d28..eac68139eecaa 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Catalog/view/base/layout/catalog_product_prices.xml index b47a6a3e69d86..28bf58bfff5c2 100644 --- a/app/code/Magento/Catalog/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Catalog/view/base/layout/catalog_product_prices.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/base/layout/default.xml b/app/code/Magento/Catalog/view/base/layout/default.xml index 776dbc4b646ef..9b6d27744bcc9 100644 --- a/app/code/Magento/Catalog/view/base/layout/default.xml +++ b/app/code/Magento/Catalog/view/base/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/base/layout/empty.xml b/app/code/Magento/Catalog/view/base/layout/empty.xml index 776dbc4b646ef..9b6d27744bcc9 100644 --- a/app/code/Magento/Catalog/view/base/layout/empty.xml +++ b/app/code/Magento/Catalog/view/base/layout/empty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/base/templates/js/components.phtml b/app/code/Magento/Catalog/view/base/templates/js/components.phtml index bdcb2e9bf7747..e71938935b8f3 100644 --- a/app/code/Magento/Catalog/view/base/templates/js/components.phtml +++ b/app/code/Magento/Catalog/view/base/templates/js/components.phtml @@ -1,6 +1,6 @@ getAdjustmentsHtml() ?> getSchema()): ?> + diff --git a/app/code/Magento/Catalog/view/base/templates/product/price/configured_price.phtml b/app/code/Magento/Catalog/view/base/templates/product/price/configured_price.phtml index eb424571e9f49..58f1ec1295fea 100644 --- a/app/code/Magento/Catalog/view/base/templates/product/price/configured_price.phtml +++ b/app/code/Magento/Catalog/view/base/templates/product/price/configured_price.phtml @@ -1,6 +1,6 @@ ' + - '<% if (data.finalPrice.value) { %>' + + '<% if (data.finalPrice.value > 0) { %>' + ' +<%- data.finalPrice.formatted %>' + + '<% } else if (data.finalPrice.value < 0) { %>' + + ' <%- data.finalPrice.formatted %>' + '<% } %>', controlContainer: 'dd' }; diff --git a/app/code/Magento/Catalog/view/base/web/js/price-utils.js b/app/code/Magento/Catalog/view/base/web/js/price-utils.js index 2b867658f05d2..4d3747a108068 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-utils.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-utils.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ @@ -70,7 +70,7 @@ define([ am = Number(Math.round(Math.abs(amount - i) + 'e+' + precision) + ('e-' + precision)); r = (j ? i.substr(0, j) + groupSymbol : '') + i.substr(j).replace(re, '$1' + groupSymbol) + - (precision ? decimalSymbol + am.toFixed(2).replace(/-/, 0).slice(2) : ''); + (precision ? decimalSymbol + am.toFixed(precision).replace(/-/, 0).slice(2) : ''); return pattern.replace('%s', r).replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml index 95e1cd3d358c1..1e3505ba1b08c 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml index d6788f3d4eed6..b5116f6784522 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml index e01b48cc71b11..6b97ebabce5b7 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml index c6f02a8acb155..181aa0fd92202 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml index 7e39fd35d6cde..f1a96d0220ef0 100755 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_opengraph.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_opengraph.xml index 661ec52df3dcd..2d8b0a502bb10 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_opengraph.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_opengraph.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml index dbb13639831c1..0d98217052782 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml @@ -1,7 +1,7 @@ @@ -94,7 +94,7 @@ getShortDescription short_description overview - none + none Overview itemprop="description" @@ -109,7 +109,7 @@ getDescription description description - none + none Details diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml index 6703d18deac37..94783b254f8d7 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml index dd93e8064e60c..b2fe3e1b5cdd9 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_item_renderers.xml index ee16e638b64cb..81d720d60ee3e 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/layout/default.xml b/app/code/Magento/Catalog/view/frontend/layout/default.xml index f267c2a5ae634..1e52f04820e2d 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/default.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Catalog/view/frontend/requirejs-config.js b/app/code/Magento/Catalog/view/frontend/requirejs-config.js index 790c25ee6dce2..9c0d36b417546 100644 --- a/app/code/Magento/Catalog/view/frontend/requirejs-config.js +++ b/app/code/Magento/Catalog/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Catalog/view/frontend/templates/category/cms.phtml b/app/code/Magento/Catalog/view/frontend/templates/category/cms.phtml index 818456d2272f6..992af539aaf05 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/category/cms.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/category/cms.phtml @@ -1,6 +1,6 @@
    + getIsActive()): ?>
  1. diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/compare/link.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/compare/link.phtml index 0fb2622254d71..c7ecc4e940bd1 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/compare/link.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/compare/link.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml index c3280c563fe58..6c64b3949f8ce 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml index 177b45ee679e6..f79a2430fcab1 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml @@ -1,6 +1,6 @@ helper('Magento\Catalog\Helper\Output'); ' : '
  2. ' ?> -
    +
    getImage($_product, $image); if ($pos != null) { diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/addto/compare.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/addto/compare.phtml index 518944dfb236c..b428c61b959f3 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/addto/compare.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/addto/compare.phtml @@ -1,6 +1,6 @@
    -isRedirectToCartEnabled()) : ?> - - - - diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/attribute.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/attribute.phtml index 9a0afa97578c0..aeecbb21f1cca 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/attribute.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/attribute.phtml @@ -1,6 +1,6 @@ getAtLabel(); $_attributeType = $block->getAtType(); $_attributeAddAttribute = $block->getAddAttribute(); +$renderLabel = true; +// if defined as 'none' in layout, do not render +if ($_attributeLabel == 'none') { + $renderLabel = false; +} + if ($_attributeLabel && $_attributeLabel == 'default') { $_attributeLabel = $_product->getResource()->getAttribute($_code)->getFrontendLabel(); } @@ -34,7 +40,7 @@ if ($_attributeType && $_attributeType == 'text') {
    - +
    >
    diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/attributes.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/attributes.phtml index 431b0229ef682..2e7bedad92cf2 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/attributes.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/attributes.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/wrapper/bottom.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/wrapper/bottom.phtml index 08642bc792586..871c29a09ff65 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/wrapper/bottom.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/wrapper/bottom.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/price_clone.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/price_clone.phtml index 8c7376ea1cead..45e5aa9b18e97 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/price_clone.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/price_clone.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html b/app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html index 88886989b19aa..d59237c190f71 100644 --- a/app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html +++ b/app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php index b3f266728e952..4fdfaf9581420 100644 --- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogImportExport/etc/di.xml b/app/code/Magento/CatalogImportExport/etc/di.xml index dca2159fbdc66..1155de1455243 100644 --- a/app/code/Magento/CatalogImportExport/etc/di.xml +++ b/app/code/Magento/CatalogImportExport/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogImportExport/etc/export.xml b/app/code/Magento/CatalogImportExport/etc/export.xml index 824b7defdaee6..3325ff1d38a06 100644 --- a/app/code/Magento/CatalogImportExport/etc/export.xml +++ b/app/code/Magento/CatalogImportExport/etc/export.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogImportExport/etc/import.xml b/app/code/Magento/CatalogImportExport/etc/import.xml index e4ff1c2825654..522b478752f01 100644 --- a/app/code/Magento/CatalogImportExport/etc/import.xml +++ b/app/code/Magento/CatalogImportExport/etc/import.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogImportExport/etc/module.xml b/app/code/Magento/CatalogImportExport/etc/module.xml index c63a6dd52918f..517ffc0fa393d 100644 --- a/app/code/Magento/CatalogImportExport/etc/module.xml +++ b/app/code/Magento/CatalogImportExport/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogImportExport/registration.php b/app/code/Magento/CatalogImportExport/registration.php index 5b1c90ca644a6..4726011242428 100644 --- a/app/code/Magento/CatalogImportExport/registration.php +++ b/app/code/Magento/CatalogImportExport/registration.php @@ -1,6 +1,6 @@ getStockStatusResource(); $resource->addStockDataToCollection( $collection, - !$isShowOutOfStock && $collection->getFlag('require_stock_items') + !$isShowOutOfStock ); $collection->setFlag($stockFlag, true); } diff --git a/app/code/Magento/CatalogInventory/Model/AddStockStatusToCollection.php b/app/code/Magento/CatalogInventory/Model/AddStockStatusToCollection.php index 90e6ed16b7777..2c52b49c1a039 100644 --- a/app/code/Magento/CatalogInventory/Model/AddStockStatusToCollection.php +++ b/app/code/Magento/CatalogInventory/Model/AddStockStatusToCollection.php @@ -1,6 +1,6 @@ cacheContext->registerEntities(Product::CACHE_TAG, $productIds); + $this->cacheContext->registerEntities(Product::CACHE_TAG, $processIds); $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); return $this; diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php index 2f545417a074a..dc78d4d9b5a91 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php @@ -2,7 +2,7 @@ /** * @category Magento * @package Magento_CatalogInventory - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Row.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Row.php index fda012eec3fda..c7dfcffee3d31 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Row.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Row.php @@ -2,7 +2,7 @@ /** * @category Magento * @package Magento_CatalogInventory - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Rows.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Rows.php index b2fd2aadf288b..f107955f0201e 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Rows.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Rows.php @@ -2,7 +2,7 @@ /** * @category Magento * @package Magento_CatalogInventory - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Plugin/StoreGroup.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Plugin/StoreGroup.php index 8ef156ad4e27c..c171e9bda2612 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Plugin/StoreGroup.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Plugin/StoreGroup.php @@ -1,6 +1,6 @@ getTable('cataloginventory_stock_item'); $select = $this->getConnection()->select()->from(['si' => $itemTable]) - ->where('website_id=?', $websiteId) + ->where('website_id = ?', $websiteId) ->where('product_id IN(?)', $productIds) ->forUpdate(true); @@ -139,9 +139,15 @@ public function lockProductsStock($productIds, $websiteId) 'type_id' => 'type_id' ] ); - $this->getConnection()->query($select); + $items = []; - return $this->getConnection()->fetchAll($selectProducts); + foreach ($this->getConnection()->query($select)->fetchAll() as $si) { + $items[$si['product_id']] = $si; + } + foreach ($this->getConnection()->fetchAll($selectProducts) as $p) { + $items[$p['product_id']]['type_id'] = $p['type_id']; + } + return $items; } /** diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Collection.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Collection.php index 2a400c0f8dd97..87df4508b4898 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Collection.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Collection.php @@ -1,6 +1,6 @@ stockConfiguration = $stockConfiguration; $this->stockStateProvider = $stockStateProvider; @@ -131,31 +137,25 @@ public function __construct( $this->localeDate = $localeDate; $this->indexProcessor = $indexProcessor; $this->dateTime = $dateTime; - } - - /** - * @deprecated - * @return \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory - */ - private function getProductCollectionFactory() - { - if ($this->productCollectionFactory === null) { - $this->productCollectionFactory = ObjectManager::getInstance()->get( - \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::class - ); + if (null === $productCollectionFactory) { + $productCollectionFactory = ObjectManager::getInstance()->get(ProductCollectionFactory::class); } - - return $this->productCollectionFactory; + $this->productCollectionFactory = $productCollectionFactory; + if (null === $stockRegistryStorage) { + $stockRegistryStorage = ObjectManager::getInstance()->get(StockRegistryStorage::class); + } + $this->stockRegistryStorage = $stockRegistryStorage; } /** * @inheritdoc + * @throws \Magento\Framework\Exception\CouldNotSaveException */ public function save(\Magento\CatalogInventory\Api\Data\StockItemInterface $stockItem) { try { /** @var \Magento\Catalog\Model\Product $product */ - $product = $this->getProductCollectionFactory()->create() + $product = $this->productCollectionFactory->create() ->setFlag('has_stock_status_filter') ->addIdFilter($stockItem->getProductId()) ->addFieldToSelect('type_id') @@ -190,8 +190,8 @@ public function save(\Magento\CatalogInventory\Api\Data\StockItemInterface $stoc $this->resource->save($stockItem); $this->indexProcessor->reindexRow($stockItem->getProductId()); - $this->getStockRegistryStorage()->removeStockItem($stockItem->getProductId()); - $this->getStockRegistryStorage()->removeStockStatus($stockItem->getProductId()); + $this->stockRegistryStorage->removeStockItem($stockItem->getProductId()); + $this->stockRegistryStorage->removeStockStatus($stockItem->getProductId()); } catch (\Exception $exception) { throw new CouldNotSaveException(__('Unable to save Stock Item'), $exception); } @@ -200,6 +200,7 @@ public function save(\Magento\CatalogInventory\Api\Data\StockItemInterface $stoc /** * @inheritdoc + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function get($stockItemId) { @@ -226,13 +227,14 @@ public function getList(\Magento\CatalogInventory\Api\StockItemCriteriaInterface /** * @inheritdoc + * @throws \Magento\Framework\Exception\CouldNotDeleteException */ public function delete(StockItemInterface $stockItem) { try { $this->resource->delete($stockItem); - $this->getStockRegistryStorage()->removeStockItem($stockItem->getProductId()); - $this->getStockRegistryStorage()->removeStockStatus($stockItem->getProductId()); + $this->stockRegistryStorage->removeStockItem($stockItem->getProductId()); + $this->stockRegistryStorage->removeStockStatus($stockItem->getProductId()); } catch (\Exception $exception) { throw new CouldNotDeleteException( __('Unable to remove Stock Item with id "%1"', $stockItem->getItemId()), @@ -244,6 +246,7 @@ public function delete(StockItemInterface $stockItem) /** * @inheritdoc + * @throws \Magento\Framework\Exception\CouldNotDeleteException */ public function deleteById($id) { @@ -258,16 +261,4 @@ public function deleteById($id) } return true; } - - /** - * @return StockRegistryStorage - */ - private function getStockRegistryStorage() - { - if (null === $this->stockRegistryStorage) { - $this->stockRegistryStorage = \Magento\Framework\App\ObjectManager::getInstance() - ->get('Magento\CatalogInventory\Model\StockRegistryStorage'); - } - return $this->stockRegistryStorage; - } } diff --git a/app/code/Magento/CatalogInventory/Model/Stock/StockRepository.php b/app/code/Magento/CatalogInventory/Model/Stock/StockRepository.php index c9f956088b974..9a30b6453a6c9 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/StockRepository.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/StockRepository.php @@ -1,6 +1,6 @@ stockRegistryProvider = $stockRegistryProvider; $this->stockState = $stockState; @@ -70,6 +77,8 @@ public function __construct( $this->productRepository = $productRepository; $this->qtyCounter = $qtyCounter; $this->resource = $stockResource; + $this->stockRegistryStorage = $stockRegistryStorage ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(StockRegistryStorage::class); } /** @@ -92,9 +101,12 @@ public function registerProductsSale($items, $websiteId = null) $fullSaveItems = $registeredItems = []; foreach ($lockedItems as $lockedItemRecord) { $productId = $lockedItemRecord['product_id']; + $this->stockRegistryStorage->removeStockItem($productId, $websiteId); + /** @var StockItemInterface $stockItem */ $orderedQty = $items[$productId]; $stockItem = $this->stockRegistryProvider->getStockItem($productId, $websiteId); + $stockItem->setQty($lockedItemRecord['qty']); // update data from locked item $canSubtractQty = $stockItem->getItemId() && $this->canSubtractQty($stockItem); if (!$canSubtractQty || !$this->stockConfiguration->isQty($lockedItemRecord['type_id'])) { continue; @@ -180,7 +192,7 @@ protected function getProductType($productId) } /** - * @return Stock + * @return ResourceStock */ protected function getResource() { diff --git a/app/code/Magento/CatalogInventory/Model/StockRegistry.php b/app/code/Magento/CatalogInventory/Model/StockRegistry.php index 9797f3039da33..468570b7fecc5 100644 --- a/app/code/Magento/CatalogInventory/Model/StockRegistry.php +++ b/app/code/Magento/CatalogInventory/Model/StockRegistry.php @@ -1,6 +1,6 @@ with($productId) ->willReturn($stockItemMock); - $this->productExtensionMock = $this->getMockBuilder('\Magento\Catalog\Api\Data\ProductExtension') + $this->productExtensionMock = $this->getMockBuilder('\Magento\Catalog\Api\Data\ProductExtensionInterface') ->setMethods(['setStockItem']) ->getMock(); $this->productExtensionMock->expects($this->once()) diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AroundProductRepositorySaveTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AroundProductRepositorySaveTest.php index c406ceed3aee0..ec7b24adc417f 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AroundProductRepositorySaveTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AroundProductRepositorySaveTest.php @@ -1,6 +1,6 @@ connectionMock = $this->getMockBuilder(Mysql::class) ->disableOriginalConstructor() ->getMock(); + $this->statementMock = $this->getMockForAbstractClass(\Zend_Db_Statement_Interface::class); $this->stock = $this->getMockBuilder(Stock::class) ->setMethods(['getTable', 'getConnection']) ->setConstructorArgs( @@ -119,7 +125,21 @@ public function testLockProductsStock() { $websiteId = 0; $productIds = [1, 2, 3]; - $result = ['testResult']; + $result = [ + 1 => [ + 'product_id' => 1, + 'type_id' => 'simple' + ], + 2 => [ + 'product_id' => 2, + 'type_id' => 'simple' + ], + 3 => [ + 'product_id' => 3, + 'type_id' => 'simple' + ] + ]; + $this->selectMock->expects(self::exactly(2)) ->method('from') ->withConsecutive( @@ -130,7 +150,7 @@ public function testLockProductsStock() $this->selectMock->expects(self::exactly(3)) ->method('where') ->withConsecutive( - [self::identicalTo('website_id=?'), self::identicalTo($websiteId)], + [self::identicalTo('website_id = ?'), self::identicalTo($websiteId)], [self::identicalTo('product_id IN(?)'), self::identicalTo($productIds)], [self::identicalTo('entity_id IN (?)'), self::identicalTo($productIds)] ) @@ -149,10 +169,19 @@ public function testLockProductsStock() ->willReturn($this->selectMock); $this->connectionMock->expects(self::once()) ->method('query') - ->with(self::identicalTo($this->selectMock)); + ->with(self::identicalTo($this->selectMock)) + ->willReturn($this->statementMock); + $this->statementMock->expects(self::once()) + ->method('fetchAll') + ->willReturn([ + 1 => ['product_id' => 1], + 2 => ['product_id' => 2], + 3 => ['product_id' => 3] + ]); + $this->connectionMock->expects(self::once()) ->method('fetchAll') - ->with($this->selectMock) + ->with(self::identicalTo($this->selectMock)) ->willReturn($result); $this->stock->expects(self::exactly(2)) diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockRegistryProviderTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockRegistryProviderTest.php index c37ea68a092c9..c08a5d71ceea2 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockRegistryProviderTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockRegistryProviderTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml index 9356f15cd7f86..803a6dae492a0 100644 --- a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml b/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml index c403bb3c627e1..b9332575c96f7 100644 --- a/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml +++ b/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/config.xml b/app/code/Magento/CatalogInventory/etc/config.xml index b4da95f48293c..976b3f4cad510 100644 --- a/app/code/Magento/CatalogInventory/etc/config.xml +++ b/app/code/Magento/CatalogInventory/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/di.xml b/app/code/Magento/CatalogInventory/etc/di.xml index 9e970cef7d052..3290919a51bc7 100644 --- a/app/code/Magento/CatalogInventory/etc/di.xml +++ b/app/code/Magento/CatalogInventory/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/events.xml b/app/code/Magento/CatalogInventory/etc/events.xml index 6543b023a72ce..7f97cd6236cc6 100644 --- a/app/code/Magento/CatalogInventory/etc/events.xml +++ b/app/code/Magento/CatalogInventory/etc/events.xml @@ -1,7 +1,7 @@ @@ -27,9 +27,6 @@ - - - diff --git a/app/code/Magento/CatalogInventory/etc/extension_attributes.xml b/app/code/Magento/CatalogInventory/etc/extension_attributes.xml index 43495ebf2e644..2e30788604908 100644 --- a/app/code/Magento/CatalogInventory/etc/extension_attributes.xml +++ b/app/code/Magento/CatalogInventory/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/frontend/di.xml b/app/code/Magento/CatalogInventory/etc/frontend/di.xml index 66591baa41660..83f0810fb17d7 100644 --- a/app/code/Magento/CatalogInventory/etc/frontend/di.xml +++ b/app/code/Magento/CatalogInventory/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/indexer.xml b/app/code/Magento/CatalogInventory/etc/indexer.xml index e3fc5e845c4c3..725477f64908f 100644 --- a/app/code/Magento/CatalogInventory/etc/indexer.xml +++ b/app/code/Magento/CatalogInventory/etc/indexer.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/module.xml b/app/code/Magento/CatalogInventory/etc/module.xml index 6d86fa559848e..9981b4f63e4e4 100644 --- a/app/code/Magento/CatalogInventory/etc/module.xml +++ b/app/code/Magento/CatalogInventory/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/mview.xml b/app/code/Magento/CatalogInventory/etc/mview.xml index 58a051a3d0e1b..b172d3e852823 100644 --- a/app/code/Magento/CatalogInventory/etc/mview.xml +++ b/app/code/Magento/CatalogInventory/etc/mview.xml @@ -1,14 +1,17 @@ - + +
    +
    diff --git a/app/code/Magento/CatalogInventory/etc/product_types.xml b/app/code/Magento/CatalogInventory/etc/product_types.xml index 206a4969b3fd2..9c4653b1bde9e 100644 --- a/app/code/Magento/CatalogInventory/etc/product_types.xml +++ b/app/code/Magento/CatalogInventory/etc/product_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/etc/webapi.xml b/app/code/Magento/CatalogInventory/etc/webapi.xml index 09753ed6d7ca0..c172b9c971500 100644 --- a/app/code/Magento/CatalogInventory/etc/webapi.xml +++ b/app/code/Magento/CatalogInventory/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/i18n/en_US.csv b/app/code/Magento/CatalogInventory/i18n/en_US.csv index 6dbbf9a2d2b7a..14379ec76f542 100644 --- a/app/code/Magento/CatalogInventory/i18n/en_US.csv +++ b/app/code/Magento/CatalogInventory/i18n/en_US.csv @@ -48,11 +48,7 @@ Inventory,Inventory "Only X left Threshold","Only X left Threshold" "Display Products Availability in Stock on Storefront","Display Products Availability in Stock on Storefront" "Product Stock Options","Product Stock Options" -" - Please note that these settings apply to individual items in the cart, not to the entire cart. - "," - Please note that these settings apply to individual items in the cart, not to the entire cart. - " +"Please note that these settings apply to individual items in the cart, not to the entire cart.","Please note that these settings apply to individual items in the cart, not to the entire cart." "Manage Stock","Manage Stock" Backorders,Backorders "Maximum Qty Allowed in Shopping Cart","Maximum Qty Allowed in Shopping Cart" diff --git a/app/code/Magento/CatalogInventory/registration.php b/app/code/Magento/CatalogInventory/registration.php index c39a8159f90b8..d15deab6429d7 100644 --- a/app/code/Magento/CatalogInventory/registration.php +++ b/app/code/Magento/CatalogInventory/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_listing.xml index 51587e0732830..af982697f532e 100644 --- a/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/qty-validator-changer.js b/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/qty-validator-changer.js index 3123784e64e71..75d684137a28b 100644 --- a/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/qty-validator-changer.js +++ b/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/qty-validator-changer.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/use-config-min-sale-qty.js b/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/use-config-min-sale-qty.js index 9bce6ced3141e..4ac1d5ed2d294 100644 --- a/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/use-config-min-sale-qty.js +++ b/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/use-config-min-sale-qty.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/use-config-settings.js b/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/use-config-settings.js index 877f2b44b4f9a..76a2882852e0f 100644 --- a/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/use-config-settings.js +++ b/app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/use-config-settings.js @@ -1,9 +1,9 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view.xml index e6e9e8b30988b..1ebeed3846b0d 100644 --- a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_simple.xml b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_simple.xml index bfd59283750be..2ed24b071095e 100644 --- a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_simple.xml +++ b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_simple.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_virtual.xml b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_virtual.xml index c83b8b6fc47e7..9943fee84b5cf 100644 --- a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_virtual.xml +++ b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_virtual.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogInventory/view/frontend/templates/qtyincrements.phtml b/app/code/Magento/CatalogInventory/view/frontend/templates/qtyincrements.phtml index 544b82ccd06cf..b8edebb82bbe9 100644 --- a/app/code/Magento/CatalogInventory/view/frontend/templates/qtyincrements.phtml +++ b/app/code/Magento/CatalogInventory/view/frontend/templates/qtyincrements.phtml @@ -1,6 +1,6 @@ setRenderer($this->_conditions); $form->setValues($model->getData()); - $this->setConditionFormName($model->getConditions(), $formName); + $this->setConditionFormName($model, $model->getConditions(), $formName); return $form; } /** - * @param \Magento\Rule\Model\Condition\AbstractCondition $conditions + * @param RuleInterface $rule + * @param AbstractCondition $conditions * @param string $formName * @return void */ - private function setConditionFormName(\Magento\Rule\Model\Condition\AbstractCondition $conditions, $formName) - { + private function setConditionFormName( + RuleInterface $rule, + AbstractCondition $conditions, + $formName + ) { $conditions->setFormName($formName); - $conditions->setJsFormObject($formName); - if ($conditions->getConditions() && is_array($conditions->getConditions())) { + //For every fieldset there's a different form object. + $conditions->setJsFormObject( + $rule->getConditionsFieldSetId($formName) + ); + $childConditions = $conditions->getCondition(); + if ($childConditions && is_array($childConditions)) { foreach ($conditions->getConditions() as $condition) { - $this->setConditionFormName($condition, $formName); + $this->setConditionFormName($rule, $condition, $formName); } } } diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php index 56847f971aadd..333ee845798ec 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php @@ -1,6 +1,6 @@ where('t.customer_group_id = ?', $this->customerSession->getCustomerGroupId()) ->where('t.rule_date = ?', $currentDate) ->order('t.rule_price ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $priceSelect = $this->baseSelectProcessor->process($priceSelect); diff --git a/app/code/Magento/CatalogRule/Model/ResourceModel/ReadHandler.php b/app/code/Magento/CatalogRule/Model/ResourceModel/ReadHandler.php index 59b7e67654543..ef3eb1ce674eb 100644 --- a/app/code/Magento/CatalogRule/Model/ResourceModel/ReadHandler.php +++ b/app/code/Magento/CatalogRule/Model/ResourceModel/ReadHandler.php @@ -1,6 +1,6 @@ getAttribute(); if ('category_ids' == $attrCode) { - return $this->validateAttribute($model->getAvailableInCategories()); + return parent::validate($model); } $oldAttrValue = $model->getData($attrCode); diff --git a/app/code/Magento/CatalogRule/Model/Rule/CustomerGroupsOptionsProvider.php b/app/code/Magento/CatalogRule/Model/Rule/CustomerGroupsOptionsProvider.php index 2ea0814394ad4..14d154c4d4ef2 100644 --- a/app/code/Magento/CatalogRule/Model/Rule/CustomerGroupsOptionsProvider.php +++ b/app/code/Magento/CatalogRule/Model/Rule/CustomerGroupsOptionsProvider.php @@ -1,6 +1,6 @@ config = $this->getMock('Magento\Eav\Model\Config', ['getAttribute'], [], '', false); - $this->productModel = $this->getMock( - 'Magento\Catalog\Model\Product', - [ - '__wakeup', - 'getAvailableInCategories', - 'hasData', - 'getData', - 'getId', - 'getStoreId', - 'getResource', - 'addAttributeToSelect', - ], - [], - '', - false - ); - $this->productResource = $this->getMock( - 'Magento\Catalog\Model\ResourceModel\Product', - ['loadAllAttributes', - 'getAttributesByCode', - 'getAttribute' - ], - [], - '', - false - ); - $this->eavAttributeResource = $this->getMock( - '\Magento\Catalog\Model\ResourceModel\Eav\Attribute', - [ - '__wakeup', - 'isAllowedForRuleCondition', - 'getDataUsingMethod', - 'getAttributeCode', - 'getFrontendLabel', - 'isScopeGlobal', - 'getBackendType', - 'getFrontendInput' - ], - [], - '', - false - ); + $this->config = $this->getMockBuilder(\Magento\Eav\Model\Config::class) + ->disableOriginalConstructor() + ->setMethods(['getAttribute']) + ->getMock(); + $this->productModel = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) + ->disableOriginalConstructor() + ->getMock(); + $this->category = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Category::class) + ->disableOriginalConstructor() + ->getMock(); + $this->productResource = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product::class) + ->setMethods(['loadAllAttributes', 'getAttributesByCode', 'getAttribute', 'getConnection', 'getTable']) + ->disableOriginalConstructor() + ->getMock(); + $this->connection = $this->getMockBuilder(\Magento\Framework\DB\Adapter\AdapterInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->dbSelect = $this->getMockBuilder(\Magento\Framework\DB\Select::class) + ->disableOriginalConstructor() + ->setMethods(['from', 'where']) + ->getMock(); + $this->eavAttributeResource = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class) + ->disableOriginalConstructor() + ->getMock(); $this->productResource->expects($this->any())->method('loadAllAttributes') ->will($this->returnSelf()); @@ -89,11 +79,12 @@ protected function setUp() $this->objectManagerHelper = new ObjectManagerHelper($this); $this->product = $this->objectManagerHelper->getObject( - 'Magento\CatalogRule\Model\Rule\Condition\Product', + \Magento\CatalogRule\Model\Rule\Condition\Product::class, [ 'config' => $this->config, 'product' => $this->productModel, - 'productResource' => $this->productResource + 'productResource' => $this->productResource, + 'category' => $this->category ] ); } @@ -103,12 +94,27 @@ protected function setUp() */ public function testValidateMeetsCategory() { + $categoryIdList = [1, 2, 3]; + + $this->productResource->expects($this->atLeastOnce()) + ->method('getConnection') + ->willReturn($this->connection); + $this->connection->expects($this->atLeastOnce()) + ->method('select') + ->willReturn($this->dbSelect); + $this->dbSelect->expects($this->atLeastOnce()) + ->method('from') + ->willReturnSelf(); + $this->dbSelect->expects($this->atLeastOnce()) + ->method('where') + ->willReturnSelf(); + $this->connection->expects($this->once()) + ->method('fetchCol') + ->willReturn($categoryIdList); $this->product->setData('attribute', 'category_ids'); $this->product->setData('value_parsed', '1'); - $this->product->setData('operator', '>='); + $this->product->setData('operator', '{}'); - $this->productModel->expects($this->once())->method('getAvailableInCategories') - ->will($this->returnValue('2')); $this->assertTrue($this->product->validate($this->productModel)); } diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Rule/CustomerGroupsOptionsProviderTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Rule/CustomerGroupsOptionsProviderTest.php index 8a6f05c29922e..a51b5b4391230 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Rule/CustomerGroupsOptionsProviderTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Rule/CustomerGroupsOptionsProviderTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/di.xml b/app/code/Magento/CatalogRule/etc/adminhtml/di.xml index a993ed0ca485a..0951546561a2e 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/events.xml b/app/code/Magento/CatalogRule/etc/adminhtml/events.xml index afab20010a4b2..bc8f439c1f07e 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/events.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/menu.xml b/app/code/Magento/CatalogRule/etc/adminhtml/menu.xml index e47fa911f5a6e..f342261a92b4f 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/menu.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml b/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml index 8eb519e847511..48a22e9aa926a 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/crontab.xml b/app/code/Magento/CatalogRule/etc/crontab.xml index 0f0102057447e..d202b02ff83be 100644 --- a/app/code/Magento/CatalogRule/etc/crontab.xml +++ b/app/code/Magento/CatalogRule/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/crontab/events.xml b/app/code/Magento/CatalogRule/etc/crontab/events.xml index e82f4c8b1a393..1de5d5001be5f 100644 --- a/app/code/Magento/CatalogRule/etc/crontab/events.xml +++ b/app/code/Magento/CatalogRule/etc/crontab/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/di.xml b/app/code/Magento/CatalogRule/etc/di.xml index 6783fd6d69bc2..4b368b1cef89a 100644 --- a/app/code/Magento/CatalogRule/etc/di.xml +++ b/app/code/Magento/CatalogRule/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/events.xml b/app/code/Magento/CatalogRule/etc/events.xml index 54d4ba74370a9..ade6957d46df9 100644 --- a/app/code/Magento/CatalogRule/etc/events.xml +++ b/app/code/Magento/CatalogRule/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/frontend/events.xml b/app/code/Magento/CatalogRule/etc/frontend/events.xml index 7ec1d35dfbe97..0d0a1fef5354f 100644 --- a/app/code/Magento/CatalogRule/etc/frontend/events.xml +++ b/app/code/Magento/CatalogRule/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/indexer.xml b/app/code/Magento/CatalogRule/etc/indexer.xml index bae3bdf98efb7..08ed456457bfe 100644 --- a/app/code/Magento/CatalogRule/etc/indexer.xml +++ b/app/code/Magento/CatalogRule/etc/indexer.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/module.xml b/app/code/Magento/CatalogRule/etc/module.xml index 6a864895ffec7..a1e6c04913a9f 100644 --- a/app/code/Magento/CatalogRule/etc/module.xml +++ b/app/code/Magento/CatalogRule/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/mview.xml b/app/code/Magento/CatalogRule/etc/mview.xml index 58015fc69863c..0fc3be87057be 100644 --- a/app/code/Magento/CatalogRule/etc/mview.xml +++ b/app/code/Magento/CatalogRule/etc/mview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/webapi_rest/di.xml b/app/code/Magento/CatalogRule/etc/webapi_rest/di.xml index 7ca6491d59d76..066a32e7e14dd 100644 --- a/app/code/Magento/CatalogRule/etc/webapi_rest/di.xml +++ b/app/code/Magento/CatalogRule/etc/webapi_rest/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/webapi_rest/events.xml b/app/code/Magento/CatalogRule/etc/webapi_rest/events.xml index 7ec1d35dfbe97..0d0a1fef5354f 100644 --- a/app/code/Magento/CatalogRule/etc/webapi_rest/events.xml +++ b/app/code/Magento/CatalogRule/etc/webapi_rest/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/etc/webapi_soap/events.xml b/app/code/Magento/CatalogRule/etc/webapi_soap/events.xml index 7ec1d35dfbe97..0d0a1fef5354f 100644 --- a/app/code/Magento/CatalogRule/etc/webapi_soap/events.xml +++ b/app/code/Magento/CatalogRule/etc/webapi_soap/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/registration.php b/app/code/Magento/CatalogRule/registration.php index 3322ca97134fa..c657d6f7394be 100644 --- a/app/code/Magento/CatalogRule/registration.php +++ b/app/code/Magento/CatalogRule/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_edit.xml b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_edit.xml index 77bcd7de41e9a..1a3227a4d79b2 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_edit.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_edit.xml @@ -1,11 +1,11 @@ - + diff --git a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_index.xml b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_index.xml index e781a870f1c5d..5718845d14770 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_index.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml b/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml index 0c13825d16798..0f8144dd4629e 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml +++ b/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/ConfigurableProductsProvider.php b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/ConfigurableProductsProvider.php index c4b8d5f275f68..5e8706be18666 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/ConfigurableProductsProvider.php +++ b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/ConfigurableProductsProvider.php @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRuleConfigurable/etc/crontab/di.xml b/app/code/Magento/CatalogRuleConfigurable/etc/crontab/di.xml index ef226c965c57b..fb7479021a7b6 100644 --- a/app/code/Magento/CatalogRuleConfigurable/etc/crontab/di.xml +++ b/app/code/Magento/CatalogRuleConfigurable/etc/crontab/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRuleConfigurable/etc/di.xml b/app/code/Magento/CatalogRuleConfigurable/etc/di.xml index 8807b657f1c05..19805ebbeb5d3 100644 --- a/app/code/Magento/CatalogRuleConfigurable/etc/di.xml +++ b/app/code/Magento/CatalogRuleConfigurable/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRuleConfigurable/etc/module.xml b/app/code/Magento/CatalogRuleConfigurable/etc/module.xml index c329a1fbe46ee..3552af8ceb337 100644 --- a/app/code/Magento/CatalogRuleConfigurable/etc/module.xml +++ b/app/code/Magento/CatalogRuleConfigurable/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogRuleConfigurable/registration.php b/app/code/Magento/CatalogRuleConfigurable/registration.php index 578434d65237b..95cd5b79e5721 100644 --- a/app/code/Magento/CatalogRuleConfigurable/registration.php +++ b/app/code/Magento/CatalogRuleConfigurable/registration.php @@ -1,6 +1,6 @@ getBackend()->getType(); - $imputType = $attribute->getFrontend()->getInputType(); - if ($imputType == 'select' || $imputType == 'multiselect') { + $inputType = $attribute->getFrontend()->getInputType(); + if ($inputType == 'select' || $inputType == 'multiselect') { return 'select'; } - if ($imputType == 'boolean') { + if ($inputType == 'boolean') { return 'yesno'; } - if ($imputType == 'price') { + if ($inputType == 'price') { return 'price'; } diff --git a/app/code/Magento/CatalogSearch/Block/Advanced/Result.php b/app/code/Magento/CatalogSearch/Block/Advanced/Result.php index 36e60fe4626af..e20207565ae65 100644 --- a/app/code/Magento/CatalogSearch/Block/Advanced/Result.php +++ b/app/code/Magento/CatalogSearch/Block/Advanced/Result.php @@ -1,6 +1,6 @@ getField() === 'category_ids') { - return 'category_ids_index.category_id = ' . (int) $filter->getValue(); + return "{$this->aliasResolver->getAlias($filter)}.category_id = " + . (int) $filter->getValue(); + } elseif ($filter->getField() === 'visibility') { + return "{$this->aliasResolver->getAlias($filter)}." . $query; } elseif ($attribute->isStatic()) { $alias = $this->aliasResolver->getAlias($filter); $resultQuery = str_replace( diff --git a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Plugin/Aggregation/Category/DataProvider.php b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Plugin/Aggregation/Category/DataProvider.php index e61414dafe32f..64211e5eb499b 100644 --- a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Plugin/Aggregation/Category/DataProvider.php +++ b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Plugin/Aggregation/Category/DataProvider.php @@ -1,6 +1,6 @@ fullAction = $fullActionFactory->create(['data' => $data]); $this->indexerHandlerFactory = $indexerHandlerFactory; @@ -71,6 +85,8 @@ public function __construct( $this->fulltextResource = $fulltextResource; $this->searchRequestConfig = $searchRequestConfig; $this->data = $data; + $this->parentProductsResolver = $parentProductsResolver + ?: ObjectManager::getInstance()->get(ParentProductsResolver::class); } /** @@ -86,10 +102,15 @@ public function execute($ids) $saveHandler = $this->indexerHandlerFactory->create([ 'data' => $this->data ]); + + $ids = (array)$ids; + $parentProductIds = $this->parentProductsResolver->getParentProductIds($ids); + $idsToBeReIndexed = array_unique(array_merge($ids, $parentProductIds)); + foreach ($storeIds as $storeId) { $dimension = $this->dimensionFactory->create(['name' => 'scope', 'value' => $storeId]); - $saveHandler->deleteIndex([$dimension], new \ArrayObject($ids)); - $saveHandler->saveIndex([$dimension], $this->fullAction->rebuildStoreIndex($storeId, $ids)); + $saveHandler->deleteIndex([$dimension], new \ArrayObject($idsToBeReIndexed)); + $saveHandler->saveIndex([$dimension], $this->fullAction->rebuildStoreIndex($storeId, $idsToBeReIndexed)); } } diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php index 436fb10b9a1bd..ccc1174d2a82a 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php @@ -1,6 +1,6 @@ getProductTypeInstance($typeId); - $relation = $typeInstance->isComposite( - $this->getProductEmulator($typeId) - ) ? $typeInstance->getRelationInfo() : false; + $relation = $typeInstance->isComposite($this->getProductEmulator($typeId)) + ? $typeInstance->getRelationInfo() + : false; if ($relation && $relation->getTable() && $relation->getParentFieldName() && $relation->getChildFieldName()) { $select = $this->connection->select()->from( diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php index e08954806da29..b2eda4a323499 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php @@ -1,6 +1,6 @@ from(['relation' => $this->getTable('catalog_product_relation')], []) ->distinct(true) ->where('child_id IN (?)', $entityIds) - ->where('parent_id NOT IN (?)', $entityIds) ->join( ['cpe' => $this->getTable('catalog_product_entity')], 'relation.parent_id = cpe.' . $fieldForParent, @@ -328,7 +330,7 @@ protected function getProductIdsFromParents(array $entityIds) public function rebuildStoreIndex($storeId, $productIds = null) { if ($productIds !== null) { - $productIds = array_unique(array_merge($productIds, $this->getProductIdsFromParents($productIds))); + $productIds = array_unique($productIds); } // prepare searchable attributes $staticFields = []; diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php index 7f4b5f517ac9d..e62a0d058d8d4 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php @@ -1,6 +1,6 @@ resourceConnection = $resourceConnection; + $this->metadataPool = $metadataPool; + } + + /** + * Get IDs of parent products by their child IDs. + * + * Returns identifiers of parent product from the catalog_product_relation. + * Please note that returned ids don't contain ids of passed child products. + * + * @param int[] $childProductIds + * @return int[] + * @throws \Exception if metadataPool doesn't contain metadata for ProductInterface + * @throws \DomainException + */ + public function getParentProductIds(array $childProductIds) + { + /** @var \Magento\Framework\EntityManager\EntityMetadataInterface $metadata */ + $metadata = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); + $fieldForParent = $metadata->getLinkField(); + + $connection = $this->resourceConnection->getConnection(); + + $select = $connection + ->select() + ->from(['relation' => $this->resourceConnection->getTableName('catalog_product_relation')], []) + ->distinct(true) + ->where('child_id IN (?)', $childProductIds) + ->join( + ['cpe' => $this->resourceConnection->getTableName('catalog_product_entity')], + 'relation.parent_id = cpe.'.$fieldForParent, + ['cpe.entity_id'] + ); + + return $connection->fetchCol($select); + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/ProductFieldset.php b/app/code/Magento/CatalogSearch/Model/Indexer/ProductFieldset.php index d85b87b310623..29b517d01ef50 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/ProductFieldset.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/ProductFieldset.php @@ -1,6 +1,6 @@ _getData('currency_rate'); if ($rate === null) { - $rate = $this->_storeManager->getStore($this->getStoreId()) - ->getCurrentCurrencyRate(); + $rate = $this->_storeManager->getStore()->getCurrentCurrencyRate(); } if (!$rate) { $rate = 1; @@ -175,6 +174,11 @@ public function getCurrencyRate() */ protected function _renderRangeLabel($fromPrice, $toPrice) { + $fromPrice *= $this->getCurrencyRate(); + if ($toPrice) { + $toPrice *= $this->getCurrencyRate(); + } + $formattedFromPrice = $this->priceCurrency->format($fromPrice); if ($toPrice === '') { return __('%1 and above', $formattedFromPrice); @@ -212,7 +216,7 @@ protected function _getItemsData() if (strpos($key, '_') === false) { continue; } - $data[] = $this->prepareData($key, $count, $data); + $data[] = $this->prepareData($key, $count); } } @@ -262,8 +266,8 @@ private function prepareData($key, $count) $to = $this->getTo($to); } $label = $this->_renderRangeLabel( - empty($from) ? 0 : $from * $this->getCurrencyRate(), - empty($to) ? $to : $to * $this->getCurrencyRate() + empty($from) ? 0 : $from, + $to ); $value = $from . '-' . $to . $this->dataProvider->getAdditionalRequestData(); diff --git a/app/code/Magento/CatalogSearch/Model/Layer/Search/Plugin/CollectionFilter.php b/app/code/Magento/CatalogSearch/Model/Layer/Search/Plugin/CollectionFilter.php index 46a78fcac1a50..6e1f6f797eea3 100644 --- a/app/code/Magento/CatalogSearch/Model/Layer/Search/Plugin/CollectionFilter.php +++ b/app/code/Magento/CatalogSearch/Model/Layer/Search/Plugin/CollectionFilter.php @@ -1,7 +1,7 @@ getSearchCriteriaBuilder(); $this->getFilterBuilder(); - if (!is_array($condition) || !in_array(key($condition), ['from', 'to'])) { - $this->filterBuilder->setField($field); - $this->filterBuilder->setValue($condition); - $this->searchCriteriaBuilder->addFilter($this->filterBuilder->create()); - } else { + if (is_array($condition) + && in_array(key($condition), ['from', 'to'], true) + ) { if (!empty($condition['from'])) { - $this->filterBuilder->setField("{$field}.from"); - $this->filterBuilder->setValue($condition['from']); - $this->searchCriteriaBuilder->addFilter($this->filterBuilder->create()); + $this->addFieldToFilter("{$field}.from", $condition['from']); } if (!empty($condition['to'])) { - $this->filterBuilder->setField("{$field}.to"); - $this->filterBuilder->setValue($condition['to']); - $this->searchCriteriaBuilder->addFilter($this->filterBuilder->create()); + $this->addFieldToFilter("{$field}.to", $condition['to']); } + } else { + $this->filterBuilder->setField($field); + $this->filterBuilder->setValue($condition); + $this->searchCriteriaBuilder->addFilter($this->filterBuilder->create()); } + return $this; } @@ -346,9 +345,19 @@ protected function _renderFiltersBefore() $this->_totalRecords = $this->searchResult->getTotalCount(); - if ($this->order && 'relevance' === $this->order['field']) { - $this->getSelect()->order('search_result.'. TemporaryStorage::FIELD_SCORE . ' ' . $this->order['dir']); + if ($this->relevanceOrderDirection) { + $this->getSelect()->order( + 'search_result.'. TemporaryStorage::FIELD_SCORE . ' ' . $this->relevanceOrderDirection + ); } + + /* + * This order is required to force search results be the same + * for the same requests and products with the same relevance + * NOTE: this does not replace existing orders but ADDs one more + */ + $this->setOrder('entity_id'); + return parent::_renderFiltersBefore(); } @@ -370,10 +379,12 @@ protected function _renderFilters() */ public function setOrder($attribute, $dir = Select::SQL_DESC) { - $this->order = ['field' => $attribute, 'dir' => $dir]; - if ($attribute != 'relevance') { + if ($attribute === 'relevance') { + $this->relevanceOrderDirection = $dir; + } else { parent::setOrder($attribute, $dir); } + return $this; } diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php index c95deb1bf932a..96466d7f0bfe8 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php @@ -1,6 +1,6 @@ aliasResolver->getAlias($filter); - $tableName = $this->resourceConnection->getTableName('catalog_category_product_index'); - $select->joinInner( - [$alias => $tableName], - 'search_index.entity_id = category_ids_index.product_id', - [] - ); + if (!array_key_exists($alias, $select->getPart('from'))) { + $tableName = $this->resourceConnection->getTableName( + 'catalog_category_product_index' + ); + $select->joinInner( + [$alias => $tableName], + "search_index.entity_id = $alias.product_id", + [] + ); + } $isApplied = true; } diff --git a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php index e1901afce4ffd..83e5a6b67967e 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php +++ b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php @@ -1,6 +1,6 @@ [ 'field' => 'category_ids', - 'alias' => 'category_ids_index', + 'alias' => 'category_products_index', + ], + 'visibility' => [ + 'field' => 'visibility', + 'alias' => 'category_products_index', ], ]; } diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php index c8dd43c74a10d..b78a29f75fe85 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php @@ -1,6 +1,6 @@ aliasResolver->expects($this->atLeastOnce()) + ->method('getAlias') + ->willReturn($tableAlias); $this->filter->expects($this->exactly(3)) ->method('getField') ->will($this->returnValue('category_ids')); @@ -233,9 +237,35 @@ public function testProcessCategoryIds($categoryId, $expectedResult) ->will($this->returnValue($this->attribute)); $actualResult = $this->target->process($this->filter, $isNegation, $query); + $expectedResult = strtr($expectedResult, [':alias' => $tableAlias]); $this->assertSame($expectedResult, $this->removeWhitespaces($actualResult)); } + public function testProcessVisibilityIds() + { + $query = 'visibility in (1, 2)'; + $tableAlias = 'visibility__alias'; + + $this->aliasResolver->expects($this->atLeastOnce()) + ->method('getAlias') + ->willReturn($tableAlias); + $this->filter->expects($this->atLeastOnce()) + ->method('getField') + ->will($this->returnValue('visibility')); + $this->filter->expects($this->never()) + ->method('getValue'); + $this->config->expects($this->once()) + ->method('getAttribute') + ->with(\Magento\Catalog\Model\Product::ENTITY, 'visibility') + ->will($this->returnValue($this->attribute)); + + $actualResult = $this->target->process($this->filter, false, $query); + $this->assertSame( + "$tableAlias.$query", + $this->removeWhitespaces($actualResult) + ); + } + public function testProcessStaticAttribute() { $expectedResult = 'attr_table_alias.static_attribute LIKE %name%'; @@ -246,7 +276,7 @@ public function testProcessStaticAttribute() ->willReturn('static_attribute'); $this->aliasResolver->expects($this->once())->method('getAlias') ->willReturn('attr_table_alias'); - $this->filter->expects($this->exactly(3)) + $this->filter->expects($this->exactly(4)) ->method('getField') ->will($this->returnValue('static_attribute')); $this->config->expects($this->exactly(1)) @@ -285,7 +315,7 @@ public function testProcessTermFilter($frontendInput, $fieldValue, $isNegation, $this->aliasResolver->expects($this->once())->method('getAlias') ->willReturn('termAttrAlias'); - $this->filter->expects($this->exactly(3)) + $this->filter->expects($this->exactly(4)) ->method('getField') ->willReturn('termField'); $this->filter->expects($this->exactly(2)) @@ -360,7 +390,7 @@ public function testProcessNotStaticAttribute() $attributeId = 1234567; $this->scope->expects($this->once())->method('getId')->will($this->returnValue($scopeId)); - $this->filter->expects($this->exactly(4)) + $this->filter->expects($this->exactly(5)) ->method('getField') ->will($this->returnValue('not_static_attribute')); $this->config->expects($this->exactly(1)) diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/OptionsTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/OptionsTest.php index 2aae2ca3cbed0..9b3fb1c0c62e3 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/OptionsTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/OptionsTest.php @@ -1,6 +1,6 @@ fulltextResource = $this->getClassMock('\Magento\CatalogSearch\Model\ResourceModel\Fulltext'); $this->searchRequestConfig = $this->getClassMock('Magento\Framework\Search\Request\Config'); - $this->model = new \Magento\CatalogSearch\Model\Indexer\Fulltext( - $fullActionFactory, - $indexerHandlerFactory, - $this->storeManager, - $dimensionFactory, - $this->fulltextResource, - $this->searchRequestConfig, - [] + $this->parentProductResolver = $this->getMockBuilder(ParentProductsResolver::class) + ->disableOriginalConstructor() + ->setMethods(['getParentProductIds']) + ->getMock(); + + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + \Magento\CatalogSearch\Model\Indexer\Fulltext::class, + [ + 'fullActionFactory' => $fullActionFactory, + 'indexerHandlerFactory' => $indexerHandlerFactory, + 'storeManager' => $this->storeManager, + 'dimensionFactory' => $dimensionFactory, + 'fulltextResource' => $this->fulltextResource, + 'searchRequestConfig' => $this->searchRequestConfig, + 'data' => [], + 'parentProductsResolver' => $this->parentProductResolver, + ] ); } @@ -121,6 +137,10 @@ public function testExecute() $this->storeManager->expects($this->once())->method('getStores')->willReturn($stores); $this->saveHandler->expects($this->exactly(count($stores)))->method('deleteIndex'); $this->saveHandler->expects($this->exactly(2))->method('saveIndex'); + $this->parentProductResolver->expects($this->once()) + ->method('getParentProductIds') + ->with($ids) + ->willReturn(['12']); $this->fullAction->expects($this->exactly(2)) ->method('rebuildStoreIndex') ->willReturn(new \ArrayObject([$indexData, $indexData])); @@ -152,6 +172,10 @@ public function testExecuteList() $this->storeManager->expects($this->once())->method('getStores')->willReturn($stores); $this->saveHandler->expects($this->exactly(count($stores)))->method('deleteIndex'); $this->saveHandler->expects($this->exactly(2))->method('saveIndex'); + $this->parentProductResolver->expects($this->once()) + ->method('getParentProductIds') + ->with($ids) + ->willReturn([]); $this->fullAction->expects($this->exactly(2)) ->method('rebuildStoreIndex') ->willReturn(new \ArrayObject([$indexData, $indexData])); @@ -167,6 +191,10 @@ public function testExecuteRow() $this->storeManager->expects($this->once())->method('getStores')->willReturn($stores); $this->saveHandler->expects($this->exactly(count($stores)))->method('deleteIndex'); $this->saveHandler->expects($this->exactly(2))->method('saveIndex'); + $this->parentProductResolver->expects($this->once()) + ->method('getParentProductIds') + ->with([$id]) + ->willReturn(['12']); $this->fullAction->expects($this->exactly(2)) ->method('rebuildStoreIndex') ->willReturn(new \ArrayObject([$indexData, $indexData])); diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/IndexerHandlerFactoryTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/IndexerHandlerFactoryTest.php index fb5b88fbe9794..007b729b7450f 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/IndexerHandlerFactoryTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/IndexerHandlerFactoryTest.php @@ -1,6 +1,6 @@ resourceConnection = $this->getMockBuilder(ResourceConnection::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->metadataPool = $this->getMockBuilder(\Magento\Framework\EntityManager\MetadataPool::class) + ->disableOriginalConstructor() + ->getMock(); + $this->metadata = $this->getMockBuilder(\Magento\Framework\EntityManager\EntityMetadataInterface::class) + ->getMockForAbstractClass(); + $this->metadataPool->expects($this->once()) + ->method('getMetadata') + ->with(ProductInterface::class) + ->willReturn($this->metadata); + + $this->connection = $this->getMockBuilder(\Magento\Framework\DB\Adapter\AdapterInterface::class) + ->disableOriginalConstructor() + ->setMethods(['select', 'getIfNullSql', 'quote']) + ->getMockForAbstractClass(); + + $this->resourceConnection->expects($this->atLeastOnce()) + ->method('getConnection') + ->will($this->returnValue($this->connection)); + + $this->select = $this->getMockBuilder(\Magento\Framework\DB\Select::class) + ->disableOriginalConstructor() + ->setMethods(['from', 'distinct', 'where', 'join', '__toString']) + ->getMock(); + $this->connection->expects($this->any()) + ->method('select') + ->will($this->returnValue($this->select)); + + $objectManager = new ObjectManager($this); + $this->resolver = $objectManager->getObject( + ParentProductsResolver::class, + [ + 'resourceConnection' => $this->resourceConnection, + 'metadataPool' => $this->metadataPool, + ] + ); + } + + public function testGetParentProductIds() + { + $childProductIds = [12, 13, 14]; + + $this->metadata->expects(self::once()) + ->method('getLinkField') + ->willReturn('product_link_field'); + $this->resourceConnection->expects($this->any()) + ->method('getTableName') + ->willReturnMap( + [ + ['catalog_product_relation', ResourceConnection::DEFAULT_CONNECTION, 'relation_table'], + ['catalog_product_entity', ResourceConnection::DEFAULT_CONNECTION, 'product_table'], + ] + ); + $this->select->expects(self::once())->method('from') + ->with(['relation' => 'relation_table'], [], null) + ->willReturnSelf(); + $this->select->expects(self::once())->method('distinct') + ->with(true) + ->willReturnSelf(); + $this->select->expects(self::once())->method('where') + ->withConsecutive( + [$this->equalTo('child_id IN (?)'), $this->equalTo($childProductIds)] + ) + ->willReturnSelf(); + $this->select->expects(self::once())->method('join') + ->with( + ['cpe' => 'product_table'], + 'relation.parent_id = cpe.product_link_field', + ['cpe.entity_id'] + ) + ->willReturnSelf(); + $this->resolver->getParentProductIds($childProductIds); + } +} diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Catalog/ItemCollectionProviderTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Catalog/ItemCollectionProviderTest.php index 5bc4cddf3ae22..15334615853d3 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Catalog/ItemCollectionProviderTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Catalog/ItemCollectionProviderTest.php @@ -1,6 +1,6 @@ request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') - ->disableOriginalConstructor() - ->setMethods(['getParam']) ->getMockForAbstractClass(); $dataProviderFactory = $this->getMockBuilder('\Magento\Catalog\Model\Layer\Filter\DataProvider\PriceFactory') ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->dataProvider = $this->getMockBuilder('\Magento\Catalog\Model\Layer\Filter\DataProvider\Price') ->disableOriginalConstructor() ->setMethods(['setPriceId', 'getPrice']) ->getMock(); - $dataProviderFactory->expects($this->once()) ->method('create') ->will($this->returnValue($this->dataProvider)); $this->layer = $this->getMockBuilder('\Magento\Catalog\Model\Layer') ->disableOriginalConstructor() - ->setMethods(['getState', 'getProductCollection']) ->getMock(); $this->state = $this->getMockBuilder('\Magento\Catalog\Model\Layer\State') ->disableOriginalConstructor() - ->setMethods(['addFilter']) ->getMock(); $this->layer->expects($this->any()) ->method('getState') ->will($this->returnValue($this->state)); - $this->fulltextCollection = $this->fulltextCollection = $this->getMockBuilder( + $this->fulltextCollection = $this->getMockBuilder( '\Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection' - ) - ->disableOriginalConstructor() - ->setMethods(['addFieldToFilter', 'getFacetedData']) + )->disableOriginalConstructor() ->getMock(); - $this->layer->expects($this->any()) ->method('getProductCollection') ->will($this->returnValue($this->fulltextCollection)); $this->itemDataBuilder = $this->getMockBuilder('\Magento\Catalog\Model\Layer\Filter\Item\DataBuilder') ->disableOriginalConstructor() - ->setMethods(['addItemData', 'build']) ->getMock(); - $this->filterItemFactory = $this->getMockBuilder( - '\Magento\Catalog\Model\Layer\Filter\ItemFactory' - ) + $this->filterItemFactory = $this->getMockBuilder('\Magento\Catalog\Model\Layer\Filter\ItemFactory') ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $filterItem = $this->getMockBuilder( - '\Magento\Catalog\Model\Layer\Filter\Item' - ) + $filterItem = $this->getMockBuilder('\Magento\Catalog\Model\Layer\Filter\Item') ->disableOriginalConstructor() ->setMethods(['setFilter', 'setLabel', 'setValue', 'setCount']) ->getMock(); @@ -123,12 +111,20 @@ protected function setUp() $escaper = $this->getMockBuilder('\Magento\Framework\Escaper') ->disableOriginalConstructor() - ->setMethods(['escapeHtml']) ->getMock(); $escaper->expects($this->any()) ->method('escapeHtml') ->will($this->returnArgument(0)); + $this->storeMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class) + ->setMethods(['getCurrentCurrencyRate']) + ->getMockForAbstractClass(); + $storeManagerMock = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class) + ->getMockForAbstractClass(); + $storeManagerMock->expects($this->any()) + ->method('getStore') + ->willReturn($this->storeMock); + $this->attribute = $this->getMockBuilder('\Magento\Eav\Model\Entity\Attribute') ->disableOriginalConstructor() ->setMethods(['getAttributeCode', 'getFrontend', 'getIsFilterable']) @@ -142,6 +138,7 @@ protected function setUp() 'itemDataBuilder' => $this->itemDataBuilder, 'filterItemFactory' => $this->filterItemFactory, 'escaper' => $escaper, + 'storeManager' => $storeManagerMock, ] ); } @@ -149,7 +146,6 @@ protected function setUp() /** * @param $requestValue * @param $idValue - * @param $isIdUsed * @dataProvider applyWithEmptyRequestDataProvider */ public function testApplyWithEmptyRequest($requestValue, $idValue) @@ -224,6 +220,10 @@ function ($field) use ($requestVar, $priceId) { ->with('price') ->will($this->returnSelf()); + $this->storeMock->expects($this->atLeastOnce()) + ->method('getCurrentCurrencyRate') + ->willReturn(1); + $this->target->apply($this->request); } diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/Advanced/CollectionTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/Advanced/CollectionTest.php index be80270e58ea3..d891e9a92e413 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/Advanced/CollectionTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/Advanced/CollectionTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml b/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml index 1f87e8de6eb65..d28b1d90dc06f 100644 --- a/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/adminhtml/system.xml b/app/code/Magento/CatalogSearch/etc/adminhtml/system.xml index ab0ddab0a7cf6..0eeb6ab33871e 100644 --- a/app/code/Magento/CatalogSearch/etc/adminhtml/system.xml +++ b/app/code/Magento/CatalogSearch/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/catalog_attributes.xml b/app/code/Magento/CatalogSearch/etc/catalog_attributes.xml index c13caa8bbf2f0..7b19da16f3397 100644 --- a/app/code/Magento/CatalogSearch/etc/catalog_attributes.xml +++ b/app/code/Magento/CatalogSearch/etc/catalog_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/config.xml b/app/code/Magento/CatalogSearch/etc/config.xml index d9f709f501f2e..d5ff194813b9c 100644 --- a/app/code/Magento/CatalogSearch/etc/config.xml +++ b/app/code/Magento/CatalogSearch/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/di.xml b/app/code/Magento/CatalogSearch/etc/di.xml index 25993adf3530c..2ef0be8601064 100644 --- a/app/code/Magento/CatalogSearch/etc/di.xml +++ b/app/code/Magento/CatalogSearch/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/events.xml b/app/code/Magento/CatalogSearch/etc/events.xml index 68d32ad26fb7e..322b7ab990bb5 100644 --- a/app/code/Magento/CatalogSearch/etc/events.xml +++ b/app/code/Magento/CatalogSearch/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/frontend/di.xml b/app/code/Magento/CatalogSearch/etc/frontend/di.xml index 69e8823e7bdef..6e21db38fab26 100644 --- a/app/code/Magento/CatalogSearch/etc/frontend/di.xml +++ b/app/code/Magento/CatalogSearch/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml b/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml index 7f05e212df860..8a29ff1bf6d73 100644 --- a/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml +++ b/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/frontend/routes.xml b/app/code/Magento/CatalogSearch/etc/frontend/routes.xml index e0bcffc439c25..536d00a093cc6 100644 --- a/app/code/Magento/CatalogSearch/etc/frontend/routes.xml +++ b/app/code/Magento/CatalogSearch/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/indexer.xml b/app/code/Magento/CatalogSearch/etc/indexer.xml index 796db4aecc118..9726f5372311d 100644 --- a/app/code/Magento/CatalogSearch/etc/indexer.xml +++ b/app/code/Magento/CatalogSearch/etc/indexer.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/module.xml b/app/code/Magento/CatalogSearch/etc/module.xml index 53ee3fca13af2..fd31faa083926 100644 --- a/app/code/Magento/CatalogSearch/etc/module.xml +++ b/app/code/Magento/CatalogSearch/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/mview.xml b/app/code/Magento/CatalogSearch/etc/mview.xml index ef5d6b453aac3..e5580d86d1ef8 100644 --- a/app/code/Magento/CatalogSearch/etc/mview.xml +++ b/app/code/Magento/CatalogSearch/etc/mview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/etc/search_request.xml b/app/code/Magento/CatalogSearch/etc/search_request.xml index 84817ab37f36b..d7bfb2e6b4a5c 100644 --- a/app/code/Magento/CatalogSearch/etc/search_request.xml +++ b/app/code/Magento/CatalogSearch/etc/search_request.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/registration.php b/app/code/Magento/CatalogSearch/registration.php index 357bda4629222..37fc42c5ab92c 100644 --- a/app/code/Magento/CatalogSearch/registration.php +++ b/app/code/Magento/CatalogSearch/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml index 337ec41d8f92e..79d14f26ff2a4 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml index 56f652ec31af0..91041cf68aca7 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml index fe4feb0bfaf0d..95ee44aa14f1e 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml index 566910b76d499..5b29921d850b0 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogSearch/view/frontend/requirejs-config.js b/app/code/Magento/CatalogSearch/view/frontend/requirejs-config.js index c2a3e552a7299..97a1734be7253 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/requirejs-config.js +++ b/app/code/Magento/CatalogSearch/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/CatalogSearch/view/frontend/templates/advanced/form.phtml b/app/code/Magento/CatalogSearch/view/frontend/templates/advanced/form.phtml index ffa83a8717b2d..a6564f7cd2fec 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/templates/advanced/form.phtml +++ b/app/code/Magento/CatalogSearch/view/frontend/templates/advanced/form.phtml @@ -1,6 +1,6 @@ productScopeRewriteGenerator = $productScopeRewriteGenerator; + } + + /** + * Generate product url rewrites based on all product categories. + * + * @param Product $product + * @param int|null $rootCategoryId + * @return \Magento\UrlRewrite\Service\V1\Data\UrlRewrite[] + */ + public function generate(Product $product, $rootCategoryId = null) + { + if ($product->getVisibility() == Visibility::VISIBILITY_NOT_VISIBLE) { + return []; + } + + $storeId = $product->getStoreId(); + + $productCategories = $product->getCategoryCollection() + ->addAttributeToSelect('url_key') + ->addAttributeToSelect('url_path'); + + $urls = $this->productScopeRewriteGenerator->isGlobalScope($storeId) + ? $this->productScopeRewriteGenerator->generateForGlobalScope( + $productCategories, + $product, + $rootCategoryId + ) + : $this->productScopeRewriteGenerator->generateForSpecificStoreView( + $storeId, + $productCategories, + $product, + $rootCategoryId + ); + + return $urls; + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php index 65f086dfd0c20..8e36cc9bf1566 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php @@ -1,6 +1,6 @@ urlFinder = $urlFinder; $this->productUrlPathGenerator = $productUrlPathGenerator; @@ -89,11 +97,12 @@ public function __construct( if (!isset($mergeDataProviderFactory)) { $mergeDataProviderFactory = ObjectManager::getInstance()->get(MergeDataProviderFactory::class); } + $this->categoryRepository = $categoryRepository ?: ObjectManager::getInstance()->get(CategoryRepository::class); $this->mergeDataProviderPrototype = $mergeDataProviderFactory->create(); } /** - * Generate list based on current rewrites + * Generate product rewrites based on current rewrites without anchor categories. * * @param int $storeId * @param Product $product @@ -126,6 +135,52 @@ public function generate($storeId, Product $product, ObjectRegistry $productCate return $mergeDataProvider->getData(); } + /** + * Generate product rewrites for anchor categories based on current rewrites. + * + * @param int $storeId + * @param Product $product + * @param ObjectRegistry $productCategories + * @param int|null $rootCategoryId + * @return UrlRewrite[] + */ + public function generateAnchor( + $storeId, + Product $product, + ObjectRegistry $productCategories, + $rootCategoryId = null + ) { + $anchorCategoryIds = []; + $mergeDataProvider = clone $this->mergeDataProviderPrototype; + + $currentUrlRewrites = $this->urlRewriteFinder->findAllByData( + $product->getEntityId(), + $storeId, + ProductUrlRewriteGenerator::ENTITY_TYPE, + $rootCategoryId + ); + + foreach ($productCategories->getList() as $productCategory) { + $anchorCategoryIds = array_merge($productCategory->getAnchorsAbove(), $anchorCategoryIds); + } + + foreach ($currentUrlRewrites as $currentUrlRewrite) { + $metadata = $currentUrlRewrite->getMetadata(); + if (isset($metadata['category_id']) && $metadata['category_id'] > 0) { + $category = $this->categoryRepository->get($metadata['category_id'], $storeId); + if (in_array($category->getId(), $anchorCategoryIds)) { + $mergeDataProvider->merge( + $currentUrlRewrite->getIsAutogenerated() + ? $this->generateForAutogenerated($currentUrlRewrite, $storeId, $category, $product) + : $this->generateForCustom($currentUrlRewrite, $storeId, $category, $product) + ); + } + } + } + + return $mergeDataProvider->getData(); + } + /** * @param UrlRewrite $url * @param int $storeId diff --git a/app/code/Magento/CatalogUrlRewrite/Model/ProductScopeRewriteGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/ProductScopeRewriteGenerator.php index 40753a16f69a3..25f79f714da19 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/ProductScopeRewriteGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/ProductScopeRewriteGenerator.php @@ -1,10 +1,11 @@ storeViewService = $storeViewService; $this->storeManager = $storeManager; @@ -111,6 +119,8 @@ public function __construct( $mergeDataProviderFactory = ObjectManager::getInstance()->get(MergeDataProviderFactory::class); } $this->mergeDataProviderPrototype = $mergeDataProviderFactory->create(); + $this->categoryRepository = $categoryRepository ?: + ObjectManager::getInstance()->get(CategoryRepositoryInterface::class); } /** @@ -167,9 +177,12 @@ public function generateForSpecificStoreView($storeId, $productCategories, Produ $mergeDataProvider = clone $this->mergeDataProviderPrototype; $categories = []; foreach ($productCategories as $category) { - if ($this->isCategoryProperForGenerating($category, $storeId)) { - $categories[] = $category; + if (!$this->isCategoryProperForGenerating($category, $storeId)) { + continue; } + + // category should be loaded per appropriate store if category's URL key has been changed + $categories[] = $this->getCategoryWithOverriddenUrlKey($storeId, $category); } $productCategories = $this->objectRegistryFactory->create(['entities' => $categories]); @@ -190,6 +203,14 @@ public function generateForSpecificStoreView($storeId, $productCategories, Produ $mergeDataProvider->merge( $this->anchorUrlRewriteGenerator->generate($storeId, $product, $productCategories) ); + $mergeDataProvider->merge( + $this->currentUrlRewritesRegenerator->generateAnchor( + $storeId, + $product, + $productCategories, + $rootCategoryId + ) + ); return $mergeDataProvider->getData(); } @@ -210,4 +231,27 @@ public function isCategoryProperForGenerating(Category $category, $storeId) return false; } + + /** + * Checks if URL key has been changed for provided category and returns reloaded category, + * in other case - returns provided category. + * + * @param int $storeId + * @param Category $category + * @return Category + */ + private function getCategoryWithOverriddenUrlKey($storeId, Category $category) + { + $isUrlKeyOverridden = $this->storeViewService->doesEntityHaveOverriddenUrlKeyForStore( + $storeId, + $category->getEntityId(), + Category::ENTITY + ); + + if (!$isUrlKeyOverridden) { + return $category; + } + + return $this->categoryRepository->get($category->getEntityId(), $storeId); + } } diff --git a/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php index bbf5d2b93c968..45a4f5f1eefd9 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php @@ -1,6 +1,6 @@ childrenCategoriesProvider = $childrenCategoriesProvider; @@ -69,6 +71,7 @@ public function __construct( $this->productUrlRewriteGenerator = $productUrlRewriteGenerator; $this->urlPersist = $urlPersist; $this->productCollectionFactory = $productCollectionFactory; + $this->categoryProductUrlPathGenerator = $categoryProductUrlPathGenerator; if (!isset($mergeDataProviderFactory)) { $mergeDataProviderFactory = ObjectManager::getInstance()->get(MergeDataProviderFactory::class); } @@ -84,11 +87,12 @@ public function __construct( public function generateProductUrlRewrites(Category $category) { $mergeDataProvider = clone $this->mergeDataProviderPrototype; - $this->isSkippedProduct = []; + $this->isSkippedProduct[$category->getEntityId()] = []; $saveRewriteHistory = $category->getData('save_rewrites_history'); $storeId = $category->getStoreId(); + if ($category->getChangedProductIds()) { - $this->isSkippedProduct = $category->getAffectedProductIds(); + $this->isSkippedProduct[$category->getEntityId()] = $category->getAffectedProductIds(); $collection = $this->productCollectionFactory->create() ->setStoreId($storeId) ->addIdFilter($category->getAffectedProductIds()) @@ -134,7 +138,7 @@ public function generateProductUrlRewrites(Category $category) * @param int|null $rootCategoryId * @return UrlRewrite[] */ - public function getCategoryProductsUrlRewrites( + private function getCategoryProductsUrlRewrites( Category $category, $storeId, $saveRewriteHistory, @@ -142,42 +146,29 @@ public function getCategoryProductsUrlRewrites( ) { $mergeDataProvider = clone $this->mergeDataProviderPrototype; /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection */ - $productCollection = $category->getProductCollection() - ->addAttributeToSelect('name') - ->addAttributeToSelect('visibility') - ->addAttributeToSelect('url_key') - ->addAttributeToSelect('url_path'); + $productCollection = $this->productCollectionFactory->create(); + + $productCollection->setStoreId($storeId) + ->addAttributeToSelect(['name', 'visibility', 'url_key', 'url_path']) + ->addCategoriesFilter(['eq' => [$category->getEntityId()]]); + foreach ($productCollection as $product) { - if (in_array($product->getId(), $this->isSkippedProduct)) { + if (isset($this->isSkippedProduct[$category->getEntityId()]) && + in_array($product->getId(), $this->isSkippedProduct[$category->getEntityId()]) + ) { continue; } - $this->isSkippedProduct[] = $product->getId(); + $this->isSkippedProduct[$category->getEntityId()][] = $product->getId(); $product->setStoreId($storeId); $product->setData('save_rewrites_history', $saveRewriteHistory); $mergeDataProvider->merge( - $this->getCategoryBasedProductRewriteGenerator()->generate($product, $category, $rootCategoryId) + $this->categoryProductUrlPathGenerator->generate($product, $rootCategoryId) ); } return $mergeDataProvider->getData(); } - /** - * Retrieve generator, which use single category for different products. - * - * @deprecated - * @return CategoryBasedProductRewriteGenerator|mixed - */ - private function getCategoryBasedProductRewriteGenerator() - { - if (!$this->categoryBasedProductRewriteGenerator) { - $this->categoryBasedProductRewriteGenerator = ObjectManager::getInstance() - ->get(CategoryBasedProductRewriteGenerator::class); - } - - return $this->categoryBasedProductRewriteGenerator; - } - /** * @param Category $category * @return void diff --git a/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Block/Adminhtml/Category/Tab/Attributes.php b/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Block/Adminhtml/Category/Tab/Attributes.php index cae6b07db6cce..ca514be51d99b 100644 --- a/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Block/Adminhtml/Category/Tab/Attributes.php +++ b/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Block/Adminhtml/Category/Tab/Attributes.php @@ -1,6 +1,6 @@ productScopeRewriteGeneratorMock = $this->getMockBuilder(ProductScopeRewriteGenerator::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->generator = new CategoryProductUrlPathGenerator( + $this->productScopeRewriteGeneratorMock + ); + } + + public function testGenerationWithGlobalScope() + { + $categoryCollectionMock = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->getMock(); + $productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + $storeId = 1; + $categoryId = 1; + $urls = ['dummy-url.html']; + + $productMock->expects($this->once()) + ->method('getVisibility') + ->willReturn(2); + $productMock->expects($this->once()) + ->method('getStoreId') + ->willReturn($storeId); + $productMock->expects($this->once()) + ->method('getCategoryCollection') + ->willReturn($categoryCollectionMock); + $categoryCollectionMock->expects($this->atLeastOnce()) + ->method('addAttributeToSelect') + ->willReturnSelf(); + + $this->productScopeRewriteGeneratorMock->expects($this->once()) + ->method('isGlobalScope') + ->with($storeId) + ->willReturn(true); + $this->productScopeRewriteGeneratorMock->expects($this->once()) + ->method('generateForGlobalScope') + ->with($categoryCollectionMock, $productMock, $categoryId) + ->willReturn($urls); + + $this->assertEquals($urls, $this->generator->generate($productMock, $categoryId)); + } + + public function testGenerationWithSpecificStore() + { + $categoryCollectionMock = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->getMock(); + $productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + $storeId = 1; + $categoryId = 1; + $urls = ['dummy-url.html']; + + $productMock->expects($this->once()) + ->method('getVisibility') + ->willReturn(2); + $productMock->expects($this->once()) + ->method('getStoreId') + ->willReturn($storeId); + $productMock->expects($this->once()) + ->method('getCategoryCollection') + ->willReturn($categoryCollectionMock); + $categoryCollectionMock->expects($this->atLeastOnce()) + ->method('addAttributeToSelect') + ->willReturnSelf(); + + $this->productScopeRewriteGeneratorMock->expects($this->once()) + ->method('isGlobalScope') + ->with($storeId) + ->willReturn(false); + $this->productScopeRewriteGeneratorMock->expects($this->once()) + ->method('generateForSpecificStoreView') + ->with($storeId, $categoryCollectionMock, $productMock, $categoryId) + ->willReturn($urls); + + $this->assertEquals($urls, $this->generator->generate($productMock, $categoryId)); + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/CategoryUrlPathGeneratorTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/CategoryUrlPathGeneratorTest.php index cf199af3a4b07..31cc64659b539 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/CategoryUrlPathGeneratorTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/CategoryUrlPathGeneratorTest.php @@ -1,6 +1,6 @@ setStoreId(3); $this->currentUrlRewritesRegenerator->expects($this->any())->method('generate') ->will($this->returnValue([$current])); + $this->currentUrlRewritesRegenerator->expects($this->any())->method('generateAnchor') + ->will($this->returnValue([$current])); $anchorCategories = new \Magento\UrlRewrite\Service\V1\Data\UrlRewrite(); $anchorCategories->setRequestPath('category-4') ->setStoreId(4); @@ -158,6 +160,8 @@ public function testGenerationForSpecificStore() ->will($this->returnValue([])); $this->currentUrlRewritesRegenerator->expects($this->any())->method('generate') ->will($this->returnValue([])); + $this->currentUrlRewritesRegenerator->expects($this->any())->method('generateAnchor') + ->will($this->returnValue([])); $this->anchorUrlRewriteGenerator->expects($this->any())->method('generate') ->will($this->returnValue([])); diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php index 382e6048f82d9..b89678ac5999c 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php @@ -1,6 +1,6 @@ setMethods(['getData']) ->disableOriginalConstructor() ->getMock(); + $this->categoryProductUrlPathGeneratorMock = $this->getMockBuilder(CategoryProductUrlPathGenerator::class) + ->disableOriginalConstructor() + ->getMock(); $this->mergeDataProviderFactoryMock->expects($this->any()) ->method('create') ->willReturn($this->mergeDataProviderMock); @@ -135,20 +139,15 @@ protected function setUp() $this->productUrlRewriteGeneratorMock, $this->urlPersistMock, $this->collectionFactoryMock, + $this->categoryProductUrlPathGeneratorMock, $this->mergeDataProviderFactoryMock ); - $this->categoryBasedProductRewriteGeneratorMock = $this->getMockBuilder( - CategoryBasedProductRewriteGenerator::class - ) - ->disableOriginalConstructor() - ->getMock(); - $this->objectManager = new ObjectManager($this); $this->objectManager->setBackwardCompatibleProperty( $this->urlRewriteHandler, - 'categoryBasedProductRewriteGenerator', - $this->categoryBasedProductRewriteGeneratorMock + 'categoryProductUrlPathGenerator', + $this->categoryProductUrlPathGeneratorMock ); $this->productItem = $this->getMock( @@ -182,6 +181,7 @@ public function testDeleteCategoryRewritesForChildren() * Covers generateProductUrlRewrites(), getCategoryProductsUrlRewrites() methods. * * @dataProvider generateProductUrlRewritesDataProvider + * @param array $affectedProductIds * @return void */ public function testGenerateProductUrlRewrites($affectedProductIds) @@ -202,7 +202,7 @@ public function testGenerateProductUrlRewrites($affectedProductIds) $this->categoryMock->expects($this->any()) ->method('getChangedProductIds') ->willReturn($affectedProductIds); - $this->categoryMock->expects($this->once()) + $this->categoryMock->expects($this->any()) ->method('getEntityId') ->willReturn($categoryId); @@ -230,15 +230,15 @@ public function testGenerateProductUrlRewrites($affectedProductIds) /** * Calls when $affectedProductIds is not empty. * - * @param $saveRewritesHistory - * @param $storeId - * @param $categoryId - * @param $affectedProductIds + * @param bool $saveRewritesHistory + * @param int $storeId + * @param int $categoryId + * @param array $affectedProductIds * @return void */ private function callIfAffectedProductsIsset($saveRewritesHistory, $storeId, $categoryId, $affectedProductIds) { - $productCollectionMock = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) + $productCollectionMock = $this->getMockBuilder(ProductCollection::class) ->setMethods( [ 'getData', @@ -257,7 +257,8 @@ private function callIfAffectedProductsIsset($saveRewritesHistory, $storeId, $ca ->method('addIdFilter') ->with($affectedProductIds) ->willReturn($productCollectionMock); - $productCollectionMock = $this->setAdditionalMocks($productCollectionMock, $storeId, $saveRewritesHistory); + $productCollectionMock = + $this->setAdditionalMocks($productCollectionMock, $storeId, $categoryId, $saveRewritesHistory); $this->collectionFactoryMock->expects($this->any()) ->method('create') ->willReturn($productCollectionMock); @@ -270,29 +271,27 @@ private function callIfAffectedProductsIsset($saveRewritesHistory, $storeId, $ca /** * Calls when $affectedProductIds is empty. * - * @param $saveRewritesHistory - * @param $storeId - * @param $categoryId - * @param $affectedProductIds + * @param bool $saveRewritesHistory + * @param int $storeId + * @param int $categoryId + * @param array $affectedProductIds * @return void */ private function getCategoryProductsUrlRewrites($saveRewritesHistory, $storeId, $categoryId, $affectedProductIds) { $productCollection = $this->getMock( - \Magento\Catalog\Model\ResourceModel\Product\Collection::class, - ['addAttributeToSelect'], + ProductCollection::class, + ['addAttributeToSelect', 'setStoreId', 'addCategoriesFilter'], [], '', false ); - $productCollection = $this->setAdditionalMocks($productCollection, $storeId, $saveRewritesHistory); - $this->categoryMock->expects($this->once()) - ->method('getProductCollection') - ->willReturn($productCollection); + $productCollection = $this->setAdditionalMocks($productCollection, $storeId, $categoryId, $saveRewritesHistory); + $this->collectionFactoryMock->expects($this->once())->method('create')->willReturn($productCollection); $categoryBasedProductRewriteGenerated = $this->getProductUrlRewriteResult($affectedProductIds); - $this->categoryBasedProductRewriteGeneratorMock->expects($this->once()) + $this->categoryProductUrlPathGeneratorMock->expects($this->once()) ->method('generate') - ->with($this->productItem, $this->categoryMock, $categoryId) + ->with($this->productItem, $categoryId) ->willReturn($categoryBasedProductRewriteGenerated); $this->productItem->expects($this->exactly(2)) ->method('getId') @@ -319,6 +318,7 @@ public function generateProductUrlRewritesDataProvider() /** * Returns products urlRewrite result. * + * @param array $affectedProductIds * @return array */ private function getProductUrlRewriteResult($affectedProductIds) @@ -360,20 +360,21 @@ private function getProductUrlRewriteResult($affectedProductIds) /** * Sets additional data to the product Collection Mock. * - * @param $productCollectionMock - * @return $productCollectionMock + * @param ProductCollection|\PHPUnit_Framework_MockObject_MockObject $productCollectionMock + * @param int $storeId + * @param int $categoryId + * @param bool $saveRewritesHistory + * @return ProductCollection|\PHPUnit_Framework_MockObject_MockObject $productCollectionMock */ - private function setAdditionalMocks($productCollectionMock, $storeId, $saveRewritesHistory) + private function setAdditionalMocks($productCollectionMock, $storeId, $categoryId, $saveRewritesHistory) { + $productCollectionMock->expects($this->once())->method('setStoreId')->with($storeId)->willReturnSelf(); $productCollectionMock->expects($this->any())->method('addAttributeToSelect') - ->willReturnMap( - [ - ['visibility', false, $productCollectionMock], - ['name', false, $productCollectionMock], - ['url_key', false, $productCollectionMock], - ['url_path', false, $productCollectionMock] - ] - ); + ->willReturnSelf(); + $productCollectionMock->expects($this->any()) + ->method('addCategoriesFilter') + ->with(['eq' => [$categoryId]]) + ->willReturnSelf(); $this->productItem->expects($this->once()) ->method('setStoreId') ->with($storeId) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Service/V1/StoreViewServiceTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Service/V1/StoreViewServiceTest.php index 59755d3ac7ca8..773222d93e02c 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Service/V1/StoreViewServiceTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Service/V1/StoreViewServiceTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml index a977b24d7c69b..9c4a8aaf41231 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml index 8b5a72b18ff1b..4aa2e7f40c7c0 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogUrlRewrite/etc/catalog_attributes.xml b/app/code/Magento/CatalogUrlRewrite/etc/catalog_attributes.xml index 5d2dbcb0d90d6..26e3d3da0eb3b 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/catalog_attributes.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/catalog_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogUrlRewrite/etc/di.xml b/app/code/Magento/CatalogUrlRewrite/etc/di.xml index 7f0fc718083ec..2d421417bfdc0 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogUrlRewrite/etc/eav_attributes.xml b/app/code/Magento/CatalogUrlRewrite/etc/eav_attributes.xml index aaedd2e5bb1a7..a51c3c8cfe046 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/eav_attributes.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/eav_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogUrlRewrite/etc/events.xml b/app/code/Magento/CatalogUrlRewrite/etc/events.xml index 60c8d1045d836..cc558fe81f16d 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/events.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogUrlRewrite/etc/module.xml b/app/code/Magento/CatalogUrlRewrite/etc/module.xml index d2bfee12a6eda..65d6e5c748d98 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/module.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogUrlRewrite/registration.php b/app/code/Magento/CatalogUrlRewrite/registration.php index 8dc5ed7f29d11..7d3cca119a659 100644 --- a/app/code/Magento/CatalogUrlRewrite/registration.php +++ b/app/code/Magento/CatalogUrlRewrite/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index d8be81b99d1d9..cf5de172ebc6a 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -1,15 +1,14 @@ productCollectionFactory = $productCollectionFactory; $this->catalogProductVisibility = $catalogProductVisibility; @@ -107,6 +113,8 @@ public function __construct( $this->sqlBuilder = $sqlBuilder; $this->rule = $rule; $this->conditionsHelper = $conditionsHelper; + $this->priceCurrency = $priceCurrency + ?: \Magento\Framework\App\ObjectManager::getInstance()->get(PriceCurrencyInterface::class); parent::__construct( $context, $data @@ -144,6 +152,7 @@ public function getCacheKeyInfo() return [ 'CATALOG_PRODUCTS_LIST_WIDGET', + $this->priceCurrency->getCurrencySymbol(), $this->_storeManager->getStore()->getId(), $this->_design->getDesignTheme()->getId(), $this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_GROUP), diff --git a/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php b/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php index 2a852a708fa88..344afd317f174 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php +++ b/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php @@ -1,6 +1,6 @@ storeManager = $storeManager; parent::__construct( @@ -67,7 +74,8 @@ public function __construct( $productResource, $attrSetCollection, $localeFormat, - $data + $data, + $category ); } @@ -106,7 +114,7 @@ protected function _addSpecialAttributes(array &$attributes) /** * Add condition to collection * - * @param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection + * @param ProductCollection $collection * @return $this */ public function addToCollection($collection) @@ -137,14 +145,12 @@ public function addToCollection($collection) } /** - * @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute - * @param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection + * @param EavAttribute $attribute + * @param ProductCollection $collection * @return $this */ - protected function addGlobalAttribute( - \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute, - \Magento\Catalog\Model\ResourceModel\Product\Collection $collection - ) { + protected function addGlobalAttribute(EavAttribute $attribute, ProductCollection $collection) + { $storeId = $this->storeManager->getStore()->getId(); switch ($attribute->getBackendType()) { @@ -170,14 +176,12 @@ protected function addGlobalAttribute( } /** - * @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute - * @param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection + * @param EavAttribute $attribute + * @param ProductCollection $collection * @return $this */ - protected function addNotGlobalAttribute( - \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute, - \Magento\Catalog\Model\ResourceModel\Product\Collection $collection - ) { + protected function addNotGlobalAttribute(EavAttribute $attribute, ProductCollection $collection) + { $storeId = $this->storeManager->getStore()->getId(); $values = $collection->getAllAttributeValues($attribute); $validEntities = []; diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php index 4258f94ab5633..7d9e876db2856 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php @@ -1,6 +1,6 @@ priceCurrency = $this->getMock(PriceCurrencyInterface::class); $this->collectionFactory = - $this->getMockBuilder('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory') + $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::class) ->setMethods(['create']) ->disableOriginalConstructor()->getMock(); - $this->visibility = $this->getMockBuilder('Magento\Catalog\Model\Product\Visibility') + $this->visibility = $this->getMockBuilder(\Magento\Catalog\Model\Product\Visibility::class) ->setMethods(['getVisibleInCatalogIds']) ->disableOriginalConstructor() ->getMock(); - $this->httpContext = $this->getMock('Magento\Framework\App\Http\Context'); - $this->builder = $this->getMock('Magento\Rule\Model\Condition\Sql\Builder', [], [], '', false); - $this->rule = $this->getMock('Magento\CatalogWidget\Model\Rule', [], [], '', false); - $this->widgetConditionsHelper = $this->getMock('Magento\Widget\Helper\Conditions'); - $this->storeManager = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); - $this->design = $this->getMock('\Magento\Framework\View\DesignInterface'); + $this->httpContext = $this->getMock(\Magento\Framework\App\Http\Context::class); + $this->builder = $this->getMock(\Magento\Rule\Model\Condition\Sql\Builder::class, [], [], '', false); + $this->rule = $this->getMock(\Magento\CatalogWidget\Model\Rule::class, [], [], '', false); + $this->widgetConditionsHelper = $this->getMock(\Magento\Widget\Helper\Conditions::class); + $this->storeManager = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class); + $this->design = $this->getMock(\Magento\Framework\View\DesignInterface::class); $objectManagerHelper = new ObjectManagerHelper($this); $arguments = $objectManagerHelper->getConstructArguments( - 'Magento\CatalogWidget\Block\Product\ProductsList', + \Magento\CatalogWidget\Block\Product\ProductsList::class, [ 'productCollectionFactory' => $this->collectionFactory, 'catalogProductVisibility' => $this->visibility, @@ -100,59 +107,60 @@ protected function setUp() 'rule' => $this->rule, 'conditionsHelper' => $this->widgetConditionsHelper, 'storeManager' => $this->storeManager, - 'design' => $this->design + 'design' => $this->design, + 'priceCurrency' => $this->priceCurrency, ] ); $this->request = $arguments['context']->getRequest(); $this->layout = $arguments['context']->getLayout(); $this->productsList = $objectManagerHelper->getObject( - 'Magento\CatalogWidget\Block\Product\ProductsList', + \Magento\CatalogWidget\Block\Product\ProductsList::class, $arguments ); } public function testGetCacheKeyInfo() { - $store = $this->getMockBuilder('\Magento\Store\Model\Store') + $store = $this->getMockBuilder(\Magento\Store\Model\Store::class) ->disableOriginalConstructor()->setMethods(['getId'])->getMock(); $store->expects($this->once())->method('getId')->willReturn(1); $this->storeManager->expects($this->once())->method('getStore')->willReturn($store); - $theme = $this->getMock('\Magento\Framework\View\Design\ThemeInterface'); + $theme = $this->getMock(\Magento\Framework\View\Design\ThemeInterface::class); $theme->expects($this->once())->method('getId')->willReturn('blank'); $this->design->expects($this->once())->method('getDesignTheme')->willReturn($theme); $this->httpContext->expects($this->once())->method('getValue')->willReturn('context_group'); $this->productsList->setData('conditions', 'some_serialized_conditions'); - $this->productsList->setData('page_var_name', 'page_number'); $this->request->expects($this->once())->method('getParam')->with('page_number')->willReturn(1); - $this->request->expects($this->once())->method('getParams')->willReturn('request_params'); + $this->priceCurrency->expects($this->once())->method('getCurrencySymbol')->willReturn('$'); $cacheKey = [ 'CATALOG_PRODUCTS_LIST_WIDGET', + '$', 1, 'blank', 'context_group', 1, 5, 'some_serialized_conditions', - serialize('request_params') + serialize('request_params'), ]; $this->assertEquals($cacheKey, $this->productsList->getCacheKeyInfo()); } public function testGetProductPriceHtml() { - $product = $this->getMockBuilder('Magento\Catalog\Model\Product') + $product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) ->setMethods(['getId']) ->disableOriginalConstructor() ->getMock(); $product->expects($this->once())->method('getId')->willReturn(1); - $priceRenderer = $this->getMockBuilder('\Magento\Framework\Pricing\Render') + $priceRenderer = $this->getMockBuilder(\Magento\Framework\Pricing\Render::class) ->setMethods(['render']) ->disableOriginalConstructor() ->getMock(); @@ -173,7 +181,7 @@ public function testGetProductPriceHtml() \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, [ 'include_container' => false, - 'display_minimal_price' => false + 'display_minimal_price' => false, ] )); } @@ -185,7 +193,7 @@ public function testGetPagerHtmlEmpty() public function testGetPagerHtml() { - $collection = $this->getMockBuilder('\Magento\Catalog\Model\ResourceModel\Product\Collection') + $collection = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) ->setMethods(['getSize']) ->disableOriginalConstructor() ->getMock(); @@ -195,7 +203,7 @@ public function testGetPagerHtml() $this->productsList->setData('products_per_page', 2); $this->productsList->setData('product_collection', $collection); - $pagerBlock = $this->getMockBuilder('Magento\Catalog\Block\Product\Widget\Html\Pager') + $pagerBlock = $this->getMockBuilder(\Magento\Catalog\Block\Product\Widget\Html\Pager::class) ->setMethods([ 'toHtml', 'setUseContainer', @@ -205,7 +213,9 @@ public function testGetPagerHtml() 'setLimit', 'setTotalLimit', 'setCollection', - ])->disableOriginalConstructor()->getMock(); + ]) + ->disableOriginalConstructor() + ->getMock(); $pagerBlock->expects($this->once())->method('setUseContainer')->willReturnSelf(); $pagerBlock->expects($this->once())->method('setShowAmounts')->willReturnSelf(); @@ -233,7 +243,7 @@ public function testCreateCollection($pagerEnable, $productsCount, $productsPerP { $this->visibility->expects($this->once())->method('getVisibleInCatalogIds') ->willReturn([Visibility::VISIBILITY_IN_CATALOG, Visibility::VISIBILITY_BOTH]); - $collection = $this->getMockBuilder('\Magento\Catalog\Model\ResourceModel\Product\Collection') + $collection = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) ->setMethods([ 'setVisibility', 'addMinimalPrice', @@ -322,14 +332,15 @@ public function testShowPager() public function testGetIdentities() { - $collection = $this->getMockBuilder('\Magento\Catalog\Model\ResourceModel\Product\Collection') + $collection = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) ->setMethods([ 'addAttributeToSelect', 'getIterator', - ])->disableOriginalConstructor() + ]) + ->disableOriginalConstructor() ->getMock(); - $product = $this->getMock('Magento\Framework\DataObject\IdentityInterface', ['getIdentities']); + $product = $this->getMock(\Magento\Framework\DataObject\IdentityInterface::class, ['getIdentities']); $notProduct = $this->getMock('NotProduct', ['getIdentities']); $product->expects($this->once())->method('getIdentities')->willReturn(['product_identity']); $collection->expects($this->once())->method('getIterator')->willReturn( @@ -349,7 +360,7 @@ public function testGetIdentities() */ private function getConditionsForCollection($collection) { - $conditions = $this->getMockBuilder('\Magento\Rule\Model\Condition\Combine') + $conditions = $this->getMockBuilder(\Magento\Rule\Model\Condition\Combine::class) ->setMethods(['collectValidatedAttributes']) ->disableOriginalConstructor() ->getMock(); @@ -359,6 +370,7 @@ private function getConditionsForCollection($collection) $this->rule->expects($this->once())->method('loadPost')->willReturnSelf(); $this->rule->expects($this->once())->method('getConditions')->willReturn($conditions); + return $conditions; } diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/Widget/ConditionsTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/Widget/ConditionsTest.php index 79a25d2f397bd..9506937509035 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/Widget/ConditionsTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/Widget/ConditionsTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CatalogWidget/etc/module.xml b/app/code/Magento/CatalogWidget/etc/module.xml index a335a9a3d4a07..8954f11f954f7 100644 --- a/app/code/Magento/CatalogWidget/etc/module.xml +++ b/app/code/Magento/CatalogWidget/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogWidget/etc/widget.xml b/app/code/Magento/CatalogWidget/etc/widget.xml index c08d3e4da9c6a..3d54c314c6622 100644 --- a/app/code/Magento/CatalogWidget/etc/widget.xml +++ b/app/code/Magento/CatalogWidget/etc/widget.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CatalogWidget/registration.php b/app/code/Magento/CatalogWidget/registration.php index 5a08e70aab0c4..556da60268baf 100644 --- a/app/code/Magento/CatalogWidget/registration.php +++ b/app/code/Magento/CatalogWidget/registration.php @@ -1,6 +1,6 @@ layoutProcessors as $processor) { $this->jsLayout = $processor->process($this->jsLayout); } - return \Zend_Json::encode($this->jsLayout); + return json_encode($this->jsLayout, JSON_HEX_TAG); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/Sidebar.php b/app/code/Magento/Checkout/Block/Cart/Sidebar.php index 4d51c613c08e8..01ead8b514e9c 100644 --- a/app/code/Magento/Checkout/Block/Cart/Sidebar.php +++ b/app/code/Magento/Checkout/Block/Cart/Sidebar.php @@ -1,6 +1,6 @@ layoutProcessors as $processor) { $this->jsLayout = $processor->process($this->jsLayout); } - return parent::getJsLayout(); + return json_encode($this->jsLayout, JSON_HEX_TAG); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php b/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php index ee1df8403b758..7002e0526d13d 100644 --- a/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php +++ b/app/code/Magento/Checkout/Block/Cart/ValidationMessages.php @@ -1,6 +1,6 @@ layoutProcessors as $processor) { $this->jsLayout = $processor->process($this->jsLayout); } - return \Zend_Json::encode($this->jsLayout); + return json_encode($this->jsLayout, JSON_HEX_TAG); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Failure.php b/app/code/Magento/Checkout/Block/Onepage/Failure.php index 9b9ddfcce67d8..f858960c75ceb 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Failure.php +++ b/app/code/Magento/Checkout/Block/Onepage/Failure.php @@ -1,6 +1,6 @@ configurationPool = $configurationPool; $this->imageHelper = $imageHelper; $this->msrpHelper = $msrpHelper; $this->urlBuilder = $urlBuilder; $this->checkoutHelper = $checkoutHelper; + $this->escaper = $escaper ?: ObjectManager::getInstance()->get(\Magento\Framework\Escaper::class); } /** @@ -64,6 +76,8 @@ public function __construct( protected function doGetItemData() { $imageHelper = $this->imageHelper->init($this->getProductForThumbnail(), 'mini_cart_product_thumbnail'); + $productName = $this->escaper->escapeHtml($this->item->getProduct()->getName()); + return [ 'options' => $this->getOptionList(), 'qty' => $this->item->getQty() * 1, @@ -71,7 +85,7 @@ protected function doGetItemData() 'configure_url' => $this->getConfigureUrl(), 'is_visible_in_site_visibility' => $this->item->getProduct()->isVisibleInSiteVisibility(), 'product_id' => $this->item->getProduct()->getId(), - 'product_name' => $this->item->getProduct()->getName(), + 'product_name' => $productName, 'product_sku' => $this->item->getProduct()->getSku(), 'product_url' => $this->getProductUrl(), 'product_has_url' => $this->hasProductUrl(), diff --git a/app/code/Magento/Checkout/CustomerData/DirectoryData.php b/app/code/Magento/Checkout/CustomerData/DirectoryData.php index 909fa0fee7437..087f3237a50ff 100644 --- a/app/code/Magento/Checkout/CustomerData/DirectoryData.php +++ b/app/code/Magento/Checkout/CustomerData/DirectoryData.php @@ -1,6 +1,6 @@ _storeManager = $storeManager; $this->_checkoutSession = $checkoutSession; @@ -77,6 +85,8 @@ public function __construct( $this->_transportBuilder = $transportBuilder; $this->inlineTranslation = $inlineTranslation; $this->priceCurrency = $priceCurrency; + $this->paymentFailures = $paymentFailures ? : \Magento\Framework\App\ObjectManager::getInstance() + ->get(PaymentFailuresInterface::class); parent::__construct($context); } @@ -202,126 +212,10 @@ public function getBaseSubtotalInclTax($item) * @param string $message * @param string $checkoutType * @return $this - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'onepage') { - $this->inlineTranslation->suspend(); - - $template = $this->scopeConfig->getValue( - 'checkout/payment_failed/template', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $checkout->getStoreId() - ); - - $copyTo = $this->_getEmails('checkout/payment_failed/copy_to', $checkout->getStoreId()); - $copyMethod = $this->scopeConfig->getValue( - 'checkout/payment_failed/copy_method', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $checkout->getStoreId() - ); - $bcc = []; - if ($copyTo && $copyMethod == 'bcc') { - $bcc = $copyTo; - } - - $_receiver = $this->scopeConfig->getValue( - 'checkout/payment_failed/receiver', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $checkout->getStoreId() - ); - $sendTo = [ - [ - 'email' => $this->scopeConfig->getValue( - 'trans_email/ident_' . $_receiver . '/email', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $checkout->getStoreId() - ), - 'name' => $this->scopeConfig->getValue( - 'trans_email/ident_' . $_receiver . '/name', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $checkout->getStoreId() - ), - ], - ]; - - if ($copyTo && $copyMethod == 'copy') { - foreach ($copyTo as $email) { - $sendTo[] = ['email' => $email, 'name' => null]; - } - } - $shippingMethod = ''; - if ($shippingInfo = $checkout->getShippingAddress()->getShippingMethod()) { - $data = explode('_', $shippingInfo); - $shippingMethod = $data[0]; - } - - $paymentMethod = ''; - if ($paymentInfo = $checkout->getPayment()) { - $paymentMethod = $paymentInfo->getMethod(); - } - - $items = ''; - foreach ($checkout->getAllVisibleItems() as $_item) { - /* @var $_item \Magento\Quote\Model\Quote\Item */ - $items .= - $_item->getProduct()->getName() . ' x ' . $_item->getQty() . ' ' . $checkout->getStoreCurrencyCode() - . ' ' . $_item->getProduct()->getFinalPrice( - $_item->getQty() - ) . "\n"; - } - $total = $checkout->getStoreCurrencyCode() . ' ' . $checkout->getGrandTotal(); - - foreach ($sendTo as $recipient) { - $transport = $this->_transportBuilder->setTemplateIdentifier( - $template - )->setTemplateOptions( - [ - 'area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, - 'store' => Store::DEFAULT_STORE_ID - ] - )->setTemplateVars( - [ - 'reason' => $message, - 'checkoutType' => $checkoutType, - 'dateAndTime' => $this->_localeDate->formatDateTime( - new \DateTime(), - \IntlDateFormatter::MEDIUM, - \IntlDateFormatter::MEDIUM - ), - 'customer' => $checkout->getCustomerFirstname() . ' ' . $checkout->getCustomerLastname(), - 'customerEmail' => $checkout->getCustomerEmail(), - 'billingAddress' => $checkout->getBillingAddress(), - 'shippingAddress' => $checkout->getShippingAddress(), - 'shippingMethod' => $this->scopeConfig->getValue( - 'carriers/' . $shippingMethod . '/title', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ), - 'paymentMethod' => $this->scopeConfig->getValue( - 'payment/' . $paymentMethod . '/title', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ), - 'items' => nl2br($items), - 'total' => $total, - ] - )->setFrom( - $this->scopeConfig->getValue( - 'checkout/payment_failed/identity', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $checkout->getStoreId() - ) - )->addTo( - $recipient['email'], - $recipient['name'] - )->addBcc( - $bcc - )->getTransport(); - - $transport->sendMessage(); - } - - $this->inlineTranslation->resume(); + $this->paymentFailures->handle($checkout->getId(), $message, $checkoutType); return $this; } diff --git a/app/code/Magento/Checkout/Helper/ExpressRedirect.php b/app/code/Magento/Checkout/Helper/ExpressRedirect.php index 1e383ec22b5a7..6f2bb33590cb9 100644 --- a/app/code/Magento/Checkout/Helper/ExpressRedirect.php +++ b/app/code/Magento/Checkout/Helper/ExpressRedirect.php @@ -1,6 +1,6 @@ billingAddressManagement = $billingAddressManagement; $this->paymentMethodManagement = $paymentMethodManagement; @@ -74,6 +83,7 @@ public function __construct( $this->paymentInformationManagement = $paymentInformationManagement; $this->quoteIdMaskFactory = $quoteIdMaskFactory; $this->cartRepository = $cartRepository; + $this->connectionPull = $connectionPull ?: ObjectManager::getInstance()->get(ResourceConnection::class); } /** @@ -85,20 +95,33 @@ public function savePaymentInformationAndPlaceOrder( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress); + $salesConnection = $this->connectionPull->getConnection('sales'); + $checkoutConnection = $this->connectionPull->getConnection('checkout'); + $salesConnection->beginTransaction(); + $checkoutConnection->beginTransaction(); + try { - $orderId = $this->cartManagement->placeOrder($cartId); - } catch (\Magento\Framework\Exception\LocalizedException $e) { - throw new CouldNotSaveException( - __($e->getMessage()), - $e - ); + $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress); + try { + $orderId = $this->cartManagement->placeOrder($cartId); + } catch (\Magento\Framework\Exception\LocalizedException $e) { + throw new CouldNotSaveException( + __($e->getMessage()), + $e + ); + } catch (\Exception $e) { + $this->getLogger()->critical($e); + throw new CouldNotSaveException( + __('An error occurred on the server. Please try to place the order again.'), + $e + ); + } + $salesConnection->commit(); + $checkoutConnection->commit(); } catch (\Exception $e) { - $this->getLogger()->critical($e); - throw new CouldNotSaveException( - __('An error occurred on the server. Please try to place the order again.'), - $e - ); + $salesConnection->rollBack(); + $checkoutConnection->rollBack(); + throw $e; } return $orderId; diff --git a/app/code/Magento/Checkout/Model/GuestShippingInformationManagement.php b/app/code/Magento/Checkout/Model/GuestShippingInformationManagement.php index c734ba5d7b858..b1194a25ab548 100644 --- a/app/code/Magento/Checkout/Model/GuestShippingInformationManagement.php +++ b/app/code/Magento/Checkout/Model/GuestShippingInformationManagement.php @@ -1,6 +1,6 @@ paymentMethodManagement = $paymentMethodManagement; $this->paymentDetailsFactory = $paymentDetailsFactory; @@ -120,6 +128,18 @@ public function __construct( $this->addressRepository = $addressRepository; $this->scopeConfig = $scopeConfig; $this->totalsCollector = $totalsCollector; + if (!$cartExtensionFactory) { + $cartExtensionFactory = ObjectManager::getInstance()->get(CartExtensionFactory::class); + } + $this->cartExtensionFactory = $cartExtensionFactory; + if (!$shippingAssignmentFactory) { + $shippingAssignmentFactory = ObjectManager::getInstance()->get(ShippingAssignmentFactory::class); + } + $this->shippingAssignmentFactory = $shippingAssignmentFactory; + if (!$shippingFactory) { + $shippingFactory = ObjectManager::getInstance()->get(ShippingFactory::class); + } + $this->shippingFactory = $shippingFactory; } /** @@ -200,19 +220,19 @@ private function prepareShippingAssignment(CartInterface $quote, AddressInterfac { $cartExtension = $quote->getExtensionAttributes(); if ($cartExtension === null) { - $cartExtension = $this->getCartExtensionFactory()->create(); + $cartExtension = $this->cartExtensionFactory->create(); } $shippingAssignments = $cartExtension->getShippingAssignments(); if (empty($shippingAssignments)) { - $shippingAssignment = $this->getShippingAssignmentFactory()->create(); + $shippingAssignment = $this->shippingAssignmentFactory->create(); } else { $shippingAssignment = $shippingAssignments[0]; } $shipping = $shippingAssignment->getShipping(); if ($shipping === null) { - $shipping = $this->getShippingFactory()->create(); + $shipping = $this->shippingFactory->create(); } $shipping->setAddress($address); @@ -221,37 +241,4 @@ private function prepareShippingAssignment(CartInterface $quote, AddressInterfac $cartExtension->setShippingAssignments([$shippingAssignment]); return $quote->setExtensionAttributes($cartExtension); } - - /** - * @return CartExtensionFactory - */ - private function getCartExtensionFactory() - { - if (!$this->cartExtensionFactory) { - $this->cartExtensionFactory = ObjectManager::getInstance()->get(CartExtensionFactory::class); - } - return $this->cartExtensionFactory; - } - - /** - * @return ShippingAssignmentFactory - */ - private function getShippingAssignmentFactory() - { - if (!$this->shippingAssignmentFactory) { - $this->shippingAssignmentFactory = ObjectManager::getInstance()->get(ShippingAssignmentFactory::class); - } - return $this->shippingAssignmentFactory; - } - - /** - * @return ShippingFactory - */ - private function getShippingFactory() - { - if (!$this->shippingFactory) { - $this->shippingFactory = ObjectManager::getInstance()->get(ShippingFactory::class); - } - return $this->shippingFactory; - } } diff --git a/app/code/Magento/Checkout/Model/Sidebar.php b/app/code/Magento/Checkout/Model/Sidebar.php index ed785e68d5cc0..4276d7d07f3c3 100644 --- a/app/code/Magento/Checkout/Model/Sidebar.php +++ b/app/code/Magento/Checkout/Model/Sidebar.php @@ -1,6 +1,6 @@ getConstructArguments($className); /** @var \Magento\Framework\App\Helper\Context $context */ $context = $arguments['context']; @@ -74,50 +74,50 @@ protected function setUp() 'checkout/payment_failed/template', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, 8, - 'fixture_email_template_payment_failed' + 'fixture_email_template_payment_failed', ], [ 'checkout/payment_failed/receiver', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, 8, - 'sysadmin' + 'sysadmin', ], [ 'trans_email/ident_sysadmin/email', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, 8, - 'sysadmin@example.com' + 'sysadmin@example.com', ], [ 'trans_email/ident_sysadmin/name', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, 8, - 'System Administrator' + 'System Administrator', ], [ 'checkout/payment_failed/identity', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, 8, - 'noreply@example.com' + 'noreply@example.com', ], [ 'carriers/ground/title', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null, - 'Ground Shipping' + 'Ground Shipping', ], [ 'payment/fixture-payment-method/title', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null, - 'Check Money Order' + 'Check Money Order', ], [ 'checkout/options/onepage_checkout_enabled', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null, - 'One Page Checkout' - ] + 'One Page Checkout', + ], ] ) ); @@ -140,113 +140,11 @@ protected function setUp() */ public function testSendPaymentFailedEmail() { - $shippingAddress = new \Magento\Framework\DataObject(['shipping_method' => 'ground_transportation']); - $billingAddress = new \Magento\Framework\DataObject(['street' => 'Fixture St']); - - $this->_transportBuilder->expects( - $this->once() - )->method( - 'setTemplateOptions' - )->with( - [ - 'area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, - 'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID, - ] - )->will( - $this->returnSelf() - ); - - $this->_transportBuilder->expects( - $this->once() - )->method( - 'setTemplateIdentifier' - )->with( - 'fixture_email_template_payment_failed' - )->will( - $this->returnSelf() - ); - - $this->_transportBuilder->expects( - $this->once() - )->method( - 'setFrom' - )->with( - 'noreply@example.com' - )->will( - $this->returnSelf() - ); - - $this->_transportBuilder->expects( - $this->once() - )->method( - 'addTo' - )->with( - 'sysadmin@example.com', - 'System Administrator' - )->will( - $this->returnSelf() - ); - - $this->_transportBuilder->expects( - $this->once() - )->method( - 'setTemplateVars' - )->with( - [ - 'reason' => 'test message', - 'checkoutType' => 'onepage', - 'dateAndTime' => 'Oct 02, 2013', - 'customer' => 'John Doe', - 'customerEmail' => 'john.doe@example.com', - 'billingAddress' => $billingAddress, - 'shippingAddress' => $shippingAddress, - 'shippingMethod' => 'Ground Shipping', - 'paymentMethod' => 'Check Money Order', - 'items' => "Product One x 2 USD 10
    \nProduct Two x 3 USD 60
    \n", - 'total' => 'USD 70' - ] - )->will( - $this->returnSelf() - ); - - $this->_transportBuilder->expects($this->once())->method('addBcc')->will($this->returnSelf()); - $this->_transportBuilder->expects( - $this->once() - )->method( - 'getTransport' - )->will( - $this->returnValue($this->getMock('Magento\Framework\Mail\TransportInterface')) - ); + $quoteMock = $this->getMockBuilder(\Magento\Quote\Model\Quote::class) + ->disableOriginalConstructor() + ->getMock(); - $this->_translator->expects($this->at(1))->method('suspend'); - $this->_translator->expects($this->at(1))->method('resume'); - - $productOne = $this->getMock('\Magento\Catalog\Model\Product', [], [], '', false); - $productOne->expects($this->once())->method('getName')->will($this->returnValue('Product One')); - $productOne->expects($this->once())->method('getFinalPrice')->with(2)->will($this->returnValue(10)); - - $productTwo = $this->getMock('\Magento\Catalog\Model\Product', [], [], '', false); - $productTwo->expects($this->once())->method('getName')->will($this->returnValue('Product Two')); - $productTwo->expects($this->once())->method('getFinalPrice')->with(3)->will($this->returnValue(60)); - - $quote = new \Magento\Framework\DataObject( - [ - 'store_id' => 8, - 'store_currency_code' => 'USD', - 'grand_total' => 70, - 'customer_firstname' => 'John', - 'customer_lastname' => 'Doe', - 'customer_email' => 'john.doe@example.com', - 'billing_address' => $billingAddress, - 'shipping_address' => $shippingAddress, - 'payment' => new \Magento\Framework\DataObject(['method' => 'fixture-payment-method']), - 'all_visible_items' => [ - new \Magento\Framework\DataObject(['product' => $productOne, 'qty' => 2]), - new \Magento\Framework\DataObject(['product' => $productTwo, 'qty' => 3]) - ] - ] - ); - $this->assertSame($this->_helper, $this->_helper->sendPaymentFailedEmail($quote, 'test message')); + $this->assertSame($this->_helper, $this->_helper->sendPaymentFailedEmail($quoteMock, 'test message')); } /** @@ -259,7 +157,7 @@ public function testGetCheckout() public function testGetQuote() { - $quoteMock = $this->getMock('\Magento\Quote\Model\Quote', [], [], '', false); + $quoteMock = $this->getMock(\Magento\Quote\Model\Quote::class, [], [], '', false); $this->_checkoutSession->expects($this->once())->method('getQuote')->will($this->returnValue($quoteMock)); $this->assertEquals($quoteMock, $this->_helper->getQuote()); } @@ -267,9 +165,9 @@ public function testGetQuote() public function testFormatPrice() { $price = 5.5; - $quoteMock = $this->getMock('\Magento\Quote\Model\Quote', [], [], '', false); + $quoteMock = $this->getMock(\Magento\Quote\Model\Quote::class, [], [], '', false); $storeMock = $this->getMock( - 'Magento\Store\Model\Store', + \Magento\Store\Model\Store::class, ['formatPrice', '__wakeup'], [], '', @@ -300,11 +198,9 @@ public function testCanOnepageCheckout() public function testIsContextCheckout() { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $context = $objectManagerHelper->getObject( - 'Magento\Framework\App\Helper\Context' - ); + $context = $objectManagerHelper->getObject(\Magento\Framework\App\Helper\Context::class); $helper = $objectManagerHelper->getObject( - 'Magento\Checkout\Helper\Data', + \Magento\Checkout\Helper\Data::class, ['context' => $context] ); $context->getRequest()->expects($this->once())->method('getParam')->with('context')->will( @@ -324,7 +220,7 @@ public function testIsCustomerMustBeLogged() public function testGetPriceInclTax() { - $itemMock = $this->getMock('Magento\Framework\DataObject', ['getPriceInclTax'], [], '', false); + $itemMock = $this->getMock(\Magento\Framework\DataObject::class, ['getPriceInclTax'], [], '', false); $itemMock->expects($this->exactly(2))->method('getPriceInclTax')->will($this->returnValue(5.5)); $this->assertEquals(5.5, $this->_helper->getPriceInclTax($itemMock)); } @@ -337,17 +233,17 @@ public function testGetPriceInclTaxWithoutTax() $rowTotal = 15; $roundPrice = 17; $expected = 17; - $storeManager = $this->getMock('\Magento\Store\Model\StoreManagerInterface', [], [], '', false); + $storeManager = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class, [], [], '', false); $objectManagerHelper = new ObjectManager($this); $helper = $objectManagerHelper->getObject( - '\Magento\Checkout\Helper\Data', + \Magento\Checkout\Helper\Data::class, [ 'storeManager' => $storeManager, 'priceCurrency' => $this->priceCurrency, ] ); $itemMock = $this->getMock( - 'Magento\Framework\DataObject', + \Magento\Framework\DataObject::class, ['getPriceInclTax', 'getQty', 'getTaxAmount', 'getDiscountTaxCompensation', 'getRowTotal'], [], '', @@ -368,7 +264,7 @@ public function testGetSubtotalInclTax() { $rowTotalInclTax = 5.5; $expected = 5.5; - $itemMock = $this->getMock('Magento\Framework\DataObject', ['getRowTotalInclTax'], [], '', false); + $itemMock = $this->getMock(\Magento\Framework\DataObject::class, ['getRowTotalInclTax'], [], '', false); $itemMock->expects($this->exactly(2))->method('getRowTotalInclTax')->will($this->returnValue($rowTotalInclTax)); $this->assertEquals($expected, $this->_helper->getSubtotalInclTax($itemMock)); } @@ -380,7 +276,7 @@ public function testGetSubtotalInclTaxNegative() $rowTotal = 15; $expected = 17; $itemMock = $this->getMock( - 'Magento\Framework\DataObject', + \Magento\Framework\DataObject::class, ['getRowTotalInclTax', 'getTaxAmount', 'getDiscountTaxCompensation', 'getRowTotal'], [], '', @@ -396,16 +292,16 @@ public function testGetSubtotalInclTaxNegative() public function testGetBasePriceInclTaxWithoutQty() { - $storeManager = $this->getMock('\Magento\Store\Model\StoreManagerInterface', [], [], '', false); + $storeManager = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class, [], [], '', false); $objectManagerHelper = new ObjectManager($this); $helper = $objectManagerHelper->getObject( - '\Magento\Checkout\Helper\Data', + \Magento\Checkout\Helper\Data::class, [ 'storeManager' => $storeManager, 'priceCurrency' => $this->priceCurrency, ] ); - $itemMock = $this->getMock('Magento\Framework\DataObject', ['getQty'], [], '', false); + $itemMock = $this->getMock(\Magento\Framework\DataObject::class, ['getQty'], [], '', false); $itemMock->expects($this->once())->method('getQty'); $this->priceCurrency->expects($this->once())->method('round'); $helper->getPriceInclTax($itemMock); @@ -413,16 +309,16 @@ public function testGetBasePriceInclTaxWithoutQty() public function testGetBasePriceInclTax() { - $storeManager = $this->getMock('\Magento\Store\Model\StoreManagerInterface', [], [], '', false); + $storeManager = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class, [], [], '', false); $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $helper = $objectManagerHelper->getObject( - '\Magento\Checkout\Helper\Data', + \Magento\Checkout\Helper\Data::class, [ 'storeManager' => $storeManager, 'priceCurrency' => $this->priceCurrency, ] ); - $itemMock = $this->getMock('Magento\Framework\DataObject', ['getQty', 'getQtyOrdered'], [], '', false); + $itemMock = $this->getMock(\Magento\Framework\DataObject::class, ['getQty', 'getQtyOrdered'], [], '', false); $itemMock->expects($this->once())->method('getQty')->will($this->returnValue(false)); $itemMock->expects($this->exactly(2))->method('getQtyOrdered')->will($this->returnValue(5.5)); $this->priceCurrency->expects($this->once())->method('round'); @@ -432,7 +328,7 @@ public function testGetBasePriceInclTax() public function testGetBaseSubtotalInclTax() { $itemMock = $this->getMock( - 'Magento\Framework\DataObject', + \Magento\Framework\DataObject::class, ['getBaseTaxAmount', 'getBaseDiscountTaxCompensation', 'getBaseRowTotal'], [], '', @@ -446,7 +342,7 @@ public function testGetBaseSubtotalInclTax() public function testIsAllowedGuestCheckoutWithoutStore() { - $quoteMock = $this->getMock('\Magento\Quote\Model\Quote', [], [], '', false); + $quoteMock = $this->getMock(\Magento\Quote\Model\Quote::class, [], [], '', false); $store = null; $quoteMock->expects($this->once())->method('getStoreId')->will($this->returnValue(1)); $this->_scopeConfig->expects($this->once()) diff --git a/app/code/Magento/Checkout/Test/Unit/Helper/ExpressRedirectTest.php b/app/code/Magento/Checkout/Test/Unit/Helper/ExpressRedirectTest.php index 15d68a7819bd3..4fd3d58e5bc7f 100644 --- a/app/code/Magento/Checkout/Test/Unit/Helper/ExpressRedirectTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Helper/ExpressRedirectTest.php @@ -1,6 +1,6 @@ loggerMock = $this->getMock(\Psr\Log\LoggerInterface::class); + $this->resourceConnectionMock = $this->getMockBuilder(ResourceConnection::class) + ->disableOriginalConstructor() + ->getMock(); + $this->model = $objectManager->getObject( \Magento\Checkout\Model\GuestPaymentInformationManagement::class, [ @@ -73,7 +85,8 @@ protected function setUp() 'paymentMethodManagement' => $this->paymentMethodManagementMock, 'cartManagement' => $this->cartManagementMock, 'cartRepository' => $this->cartRepositoryMock, - 'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock + 'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock, + 'connectionPull' => $this->resourceConnectionMock ] ); $objectManager->setBackwardCompatibleProperty($this->model, 'logger', $this->loggerMock); @@ -89,6 +102,27 @@ public function testSavePaymentInformationAndPlaceOrder() $billingAddressMock->expects($this->once())->method('setEmail')->with($email)->willReturnSelf(); + $adapterMockForSales = $this->getMockBuilder(AdapterInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $adapterMockForCheckout = $this->getMockBuilder(AdapterInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->resourceConnectionMock->expects($this->at(0)) + ->method('getConnection') + ->with('sales') + ->willReturn($adapterMockForSales); + $adapterMockForSales->expects($this->once())->method('beginTransaction'); + $adapterMockForSales->expects($this->once())->method('commit'); + + $this->resourceConnectionMock->expects($this->at(1)) + ->method('getConnection') + ->with('checkout') + ->willReturn($adapterMockForCheckout); + $adapterMockForCheckout->expects($this->once())->method('beginTransaction'); + $adapterMockForCheckout->expects($this->once())->method('commit'); + $this->billingAddressManagementMock->expects($this->once()) ->method('assign') ->with($cartId, $billingAddressMock); @@ -114,6 +148,27 @@ public function testSavePaymentInformationAndPlaceOrderException() $billingAddressMock->expects($this->once())->method('setEmail')->with($email)->willReturnSelf(); + $adapterMockForSales = $this->getMockBuilder(AdapterInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $adapterMockForCheckout = $this->getMockBuilder(AdapterInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->resourceConnectionMock->expects($this->at(0)) + ->method('getConnection') + ->with('sales') + ->willReturn($adapterMockForSales); + $adapterMockForSales->expects($this->once())->method('beginTransaction'); + $adapterMockForSales->expects($this->once())->method('rollback'); + + $this->resourceConnectionMock->expects($this->at(1)) + ->method('getConnection') + ->with('checkout') + ->willReturn($adapterMockForCheckout); + $adapterMockForCheckout->expects($this->once())->method('beginTransaction'); + $adapterMockForCheckout->expects($this->once())->method('rollback'); + $this->billingAddressManagementMock->expects($this->once()) ->method('assign') ->with($cartId, $billingAddressMock); @@ -176,6 +231,27 @@ public function testSavePaymentInformationAndPlaceOrderWithLocalizedException() $billingAddressMock->expects($this->once())->method('setEmail')->with($email)->willReturnSelf(); + $adapterMockForSales = $this->getMockBuilder(AdapterInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $adapterMockForCheckout = $this->getMockBuilder(AdapterInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->resourceConnectionMock->expects($this->at(0)) + ->method('getConnection') + ->with('sales') + ->willReturn($adapterMockForSales); + $adapterMockForSales->expects($this->once())->method('beginTransaction'); + $adapterMockForSales->expects($this->once())->method('rollback'); + + $this->resourceConnectionMock->expects($this->at(1)) + ->method('getConnection') + ->with('checkout') + ->willReturn($adapterMockForCheckout); + $adapterMockForCheckout->expects($this->once())->method('beginTransaction'); + $adapterMockForCheckout->expects($this->once())->method('rollback'); + $this->billingAddressManagementMock->expects($this->once()) ->method('assign') ->with($cartId, $billingAddressMock); diff --git a/app/code/Magento/Checkout/Test/Unit/Model/GuestShippingInformationManagementTest.php b/app/code/Magento/Checkout/Test/Unit/Model/GuestShippingInformationManagementTest.php index bdba1e9246449..6183eedbc1c79 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/GuestShippingInformationManagementTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/GuestShippingInformationManagementTest.php @@ -1,6 +1,6 @@ shippingAssignmentFactoryMock = $this->getMock(\Magento\Quote\Model\ShippingAssignmentFactory::class, ['create'], [], '', false); $this->cartExtensionFactoryMock = - $this->getMock(\Magento\Quote\Api\Data\CartExtensionInterfaceFactory::class, ['create'], [], '', false); + $this->getMock(\Magento\Quote\Api\Data\CartExtensionFactory::class, ['create'], [], '', false); $this->shippingFactoryMock = $this->getMock(\Magento\Quote\Model\ShippingFactory::class, ['create'], [], '', false); diff --git a/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php b/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php index f9be7d48994d4..bb86367765676 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/etc/config.xml b/app/code/Magento/Checkout/etc/config.xml index dcc63a978e0a3..3c24c38ecf85b 100644 --- a/app/code/Magento/Checkout/etc/config.xml +++ b/app/code/Magento/Checkout/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/di.xml b/app/code/Magento/Checkout/etc/di.xml index 5e769e4748be1..7650ca4eccdc1 100644 --- a/app/code/Magento/Checkout/etc/di.xml +++ b/app/code/Magento/Checkout/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/email_templates.xml b/app/code/Magento/Checkout/etc/email_templates.xml index 2fb2f1ca37992..976a93c50f48a 100644 --- a/app/code/Magento/Checkout/etc/email_templates.xml +++ b/app/code/Magento/Checkout/etc/email_templates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/events.xml b/app/code/Magento/Checkout/etc/events.xml index 8c657c5d8b09e..dd2897f5db6eb 100644 --- a/app/code/Magento/Checkout/etc/events.xml +++ b/app/code/Magento/Checkout/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/fieldset.xml b/app/code/Magento/Checkout/etc/fieldset.xml index 44bcdc9367c51..3b545101f023f 100644 --- a/app/code/Magento/Checkout/etc/fieldset.xml +++ b/app/code/Magento/Checkout/etc/fieldset.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/frontend/di.xml b/app/code/Magento/Checkout/etc/frontend/di.xml index 40385740a6130..49cd31bd0d92a 100644 --- a/app/code/Magento/Checkout/etc/frontend/di.xml +++ b/app/code/Magento/Checkout/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/frontend/events.xml b/app/code/Magento/Checkout/etc/frontend/events.xml index dce51690514b4..901b652201db1 100644 --- a/app/code/Magento/Checkout/etc/frontend/events.xml +++ b/app/code/Magento/Checkout/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/frontend/page_types.xml b/app/code/Magento/Checkout/etc/frontend/page_types.xml index 25200529e6d74..bd06cbfb702a3 100644 --- a/app/code/Magento/Checkout/etc/frontend/page_types.xml +++ b/app/code/Magento/Checkout/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/frontend/routes.xml b/app/code/Magento/Checkout/etc/frontend/routes.xml index 3d50251a2247e..565c2e5ed9ab8 100644 --- a/app/code/Magento/Checkout/etc/frontend/routes.xml +++ b/app/code/Magento/Checkout/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/frontend/sections.xml b/app/code/Magento/Checkout/etc/frontend/sections.xml index b0fd4d9e38a81..35733a6119a25 100644 --- a/app/code/Magento/Checkout/etc/frontend/sections.xml +++ b/app/code/Magento/Checkout/etc/frontend/sections.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/module.xml b/app/code/Magento/Checkout/etc/module.xml index 3357b79479b95..219ca87337fc9 100644 --- a/app/code/Magento/Checkout/etc/module.xml +++ b/app/code/Magento/Checkout/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/etc/webapi.xml b/app/code/Magento/Checkout/etc/webapi.xml index 8c2c1f3820d4c..26c601a4e9f38 100644 --- a/app/code/Magento/Checkout/etc/webapi.xml +++ b/app/code/Magento/Checkout/etc/webapi.xml @@ -1,7 +1,7 @@ @@ -104,7 +104,7 @@ - + diff --git a/app/code/Magento/Checkout/registration.php b/app/code/Magento/Checkout/registration.php index 915fa033ac1cb..00613601741e9 100644 --- a/app/code/Magento/Checkout/registration.php +++ b/app/code/Magento/Checkout/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Checkout/view/frontend/layout/catalog_category_view.xml index 4bfe51a17fa48..0f692e8a279c2 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/catalog_category_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Checkout/view/frontend/layout/catalog_product_view.xml index 4bfe51a17fa48..0f692e8a279c2 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/catalog_product_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml index 57b32c26a7619..061c0715e52b9 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml index b4250c802711b..39e1e1f75e898 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml index 6e5a8fb0f1017..1b7102856d50d 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml index 69fc24be97757..9268f8a18d174 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml index 622841071c2c3..e3796b7ff65c2 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml index b48123cec8bc0..1b9bad3d81c65 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml index 169d29099f81d..eca071a677082 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml index c2f8eeda0431e..0b5147eb45d29 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml index 39cb66575990f..43c2962d5569f 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml index 6a5b33ce6cec2..1766647270e32 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml index f3a4dfb080e62..8f262a718052e 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml index b0af16ef1454a..542355cead4e4 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/layout/default.xml b/app/code/Magento/Checkout/view/frontend/layout/default.xml index fe26adbe3c7cf..26942e5d611fa 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/default.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/page_layout/checkout.xml b/app/code/Magento/Checkout/view/frontend/page_layout/checkout.xml index 8b3b73a639429..87a8c7a151d99 100644 --- a/app/code/Magento/Checkout/view/frontend/page_layout/checkout.xml +++ b/app/code/Magento/Checkout/view/frontend/page_layout/checkout.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/requirejs-config.js b/app/code/Magento/Checkout/view/frontend/requirejs-config.js index 68e95b48e8d05..1f552b779539c 100644 --- a/app/code/Magento/Checkout/view/frontend/requirejs-config.js +++ b/app/code/Magento/Checkout/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Checkout/view/frontend/templates/button.phtml b/app/code/Magento/Checkout/view/frontend/templates/button.phtml index ae8d8e95076f4..77147395a7791 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/button.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/button.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/additional/info.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/additional/info.phtml index 44f8d1a3889f8..cb92e62f1f0c8 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/additional/info.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/additional/info.phtml @@ -1,6 +1,6 @@ + class="input-text qty" data-validate="escapeHtml(json_encode($block->getQuantityValidators())) ?>"/> diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml index 0087d6abd421d..9e44f8f4b48aa 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml @@ -1,6 +1,6 @@ isShowBeforeOrderConfirm($product) && $helper->isMinima
    getIsNeedToDisplaySideBar()): ?> -
    diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address.html index 6f13f3379b07c..5f735fbb4daa9 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html index 1ad0ab32ac2f1..8d11978afcdfc 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/form.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/form.html index 7b9c5d286cb62..ded986e51bc12 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/form.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/form.html @@ -1,6 +1,6 @@ @@ -9,7 +9,7 @@
    -
    +
    diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/list.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/list.html index 1869b514d02f9..be89b1e5d0eb4 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/list.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/list.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html index 186b932b4e2b2..982aa6a88d09b 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html index fb0182228c21e..d317d1606811a 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/totals.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/totals.html index a6549d19c9146..ab8d6a8f1364e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/totals.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/totals.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/grand-total.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/grand-total.html index 6ff15eca9a95e..b6872c3047ee3 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/grand-total.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/grand-total.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/shipping.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/shipping.html index 31394da7d9d21..3d53cd2a74523 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/shipping.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/shipping.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/subtotal.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/subtotal.html index ba908bf0ec18e..307a94ea3a5a0 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/subtotal.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/totals/subtotal.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/estimation.html b/app/code/Magento/Checkout/view/frontend/web/template/estimation.html index c360a40d7ef8c..06b249ce9b6fa 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/estimation.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/estimation.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html b/app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html index f67970754b70b..0d4e9444d07f0 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html index 487ea923a8a44..2cd0348c3c93a 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html index cf91774a38af4..711f2c857b16d 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html @@ -1,6 +1,6 @@ @@ -24,7 +24,7 @@
    - + diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/price.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/price.html index c54426e901463..7c6bc97481355 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/price.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/price.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/subtotal.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/subtotal.html index d2b4566ebc673..b8e9ca09e632b 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/subtotal.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/subtotal.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/subtotal/totals.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/subtotal/totals.html index ac31e20b8a885..c89dc173dd2f2 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/subtotal/totals.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/subtotal/totals.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/onepage.html b/app/code/Magento/Checkout/view/frontend/web/template/onepage.html index 8ec57b6b17cd8..b8e1332bd3f2f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/onepage.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/onepage.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html b/app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html index f64223cafe1e1..b7be5efee383e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/payment.html b/app/code/Magento/Checkout/view/frontend/web/template/payment.html index 62e9ad0ec13fb..a3e1a0f7aca90 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/payment.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/payment.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/payment/before-place-order.html b/app/code/Magento/Checkout/view/frontend/web/template/payment/before-place-order.html index 2a617a7bea54c..764693ab8f86c 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/payment/before-place-order.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/payment/before-place-order.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/payment/generic-title.html b/app/code/Magento/Checkout/view/frontend/web/template/payment/generic-title.html index 4a049082f00f4..4c2cd0fb1c695 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/payment/generic-title.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/payment/generic-title.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/progress-bar.html b/app/code/Magento/Checkout/view/frontend/web/template/progress-bar.html index 9359986671986..a4d56379124d7 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/progress-bar.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/progress-bar.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/registration.html b/app/code/Magento/Checkout/view/frontend/web/template/registration.html index e58a09f478f16..256fc1968abfc 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/registration.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/registration.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/review/actions.html b/app/code/Magento/Checkout/view/frontend/web/template/review/actions.html index ed05c3954e35a..91b8b0c890b7d 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/review/actions.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/review/actions.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/review/actions/default.html b/app/code/Magento/Checkout/view/frontend/web/template/review/actions/default.html index 859c0e49c86bf..e295d1511d5fb 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/review/actions/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/review/actions/default.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html index 2e0317c6e0fc6..97b7bd2287372 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/form.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/form.html index 89f26bee1da73..2afd01a809324 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/form.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/form.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/list.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/list.html index d631229a33fce..41ba182949a53 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/list.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/list.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information.html index b32e96641f30c..686409d9d085b 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html index 847092de08a9c..46223a1e8c3b6 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/list.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/list.html index f421e1052f675..9e4f60fd52079 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/list.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/list.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping.html index e5df23515afb8..def73c7294db1 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/sidebar.html b/app/code/Magento/Checkout/view/frontend/web/template/sidebar.html index 751e2c461dcaa..c7c1b7791cc90 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/sidebar.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/sidebar.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary.html b/app/code/Magento/Checkout/view/frontend/web/template/summary.html index c9a4ab81ed514..5f313f0249a1f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html index 60d88653924c0..5fcbc5c63e5de 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/grand-total.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/grand-total.html index 1f0c08616c11a..0e7e4f96b6c80 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/grand-total.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/grand-total.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html index 5436e82f9db2b..daa37cbe2dc89 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details/subtotal.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details/subtotal.html index c99d2f05445b1..6a5ecca31a958 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details/subtotal.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details/subtotal.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details/thumbnail.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details/thumbnail.html index a9ed49da52599..981541e7251e7 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details/thumbnail.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details/thumbnail.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/shipping.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/shipping.html index 187328360087f..af46420b959ff 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/shipping.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/shipping.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/subtotal.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/subtotal.html index dcfd270e80b36..f0bcbae3803ea 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/subtotal.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/subtotal.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/totals.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/totals.html index 627bd6e827fd2..6352d04a38ea6 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/totals.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/totals.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php b/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php index 2e60aec29f0a1..ea4756bc10e98 100644 --- a/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php +++ b/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CheckoutAgreements/etc/adminhtml/menu.xml b/app/code/Magento/CheckoutAgreements/etc/adminhtml/menu.xml index c6cece231c3aa..f6cd385c9f2b0 100644 --- a/app/code/Magento/CheckoutAgreements/etc/adminhtml/menu.xml +++ b/app/code/Magento/CheckoutAgreements/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/etc/adminhtml/routes.xml b/app/code/Magento/CheckoutAgreements/etc/adminhtml/routes.xml index c047706860c0e..1249ea44b991e 100644 --- a/app/code/Magento/CheckoutAgreements/etc/adminhtml/routes.xml +++ b/app/code/Magento/CheckoutAgreements/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/etc/adminhtml/system.xml b/app/code/Magento/CheckoutAgreements/etc/adminhtml/system.xml index bfb813ea4c269..64ffb2b5dc21a 100644 --- a/app/code/Magento/CheckoutAgreements/etc/adminhtml/system.xml +++ b/app/code/Magento/CheckoutAgreements/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/etc/di.xml b/app/code/Magento/CheckoutAgreements/etc/di.xml index 4d80a4776a8c5..0f5af01a19e42 100644 --- a/app/code/Magento/CheckoutAgreements/etc/di.xml +++ b/app/code/Magento/CheckoutAgreements/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/etc/extension_attributes.xml b/app/code/Magento/CheckoutAgreements/etc/extension_attributes.xml index 3b6d490e04ebc..8547b2067d059 100644 --- a/app/code/Magento/CheckoutAgreements/etc/extension_attributes.xml +++ b/app/code/Magento/CheckoutAgreements/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/etc/frontend/di.xml b/app/code/Magento/CheckoutAgreements/etc/frontend/di.xml index f33eced3401d4..9a81c15458a0d 100644 --- a/app/code/Magento/CheckoutAgreements/etc/frontend/di.xml +++ b/app/code/Magento/CheckoutAgreements/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/etc/module.xml b/app/code/Magento/CheckoutAgreements/etc/module.xml index 797102ee1dc78..4773b108dd434 100644 --- a/app/code/Magento/CheckoutAgreements/etc/module.xml +++ b/app/code/Magento/CheckoutAgreements/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/etc/webapi.xml b/app/code/Magento/CheckoutAgreements/etc/webapi.xml index 41267e2d75fed..5a39f9760c62c 100644 --- a/app/code/Magento/CheckoutAgreements/etc/webapi.xml +++ b/app/code/Magento/CheckoutAgreements/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/registration.php b/app/code/Magento/CheckoutAgreements/registration.php index b81f45461d83f..af65d4257a848 100644 --- a/app/code/Magento/CheckoutAgreements/registration.php +++ b/app/code/Magento/CheckoutAgreements/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/layout/multishipping_checkout_overview.xml b/app/code/Magento/CheckoutAgreements/view/frontend/layout/multishipping_checkout_overview.xml index 6cd283c7f392c..22f40490d038b 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/layout/multishipping_checkout_overview.xml +++ b/app/code/Magento/CheckoutAgreements/view/frontend/layout/multishipping_checkout_overview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/requirejs-config.js b/app/code/Magento/CheckoutAgreements/view/frontend/requirejs-config.js index 4a20149774d3b..15f92c180a02d 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/requirejs-config.js +++ b/app/code/Magento/CheckoutAgreements/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint browser:true jquery:true*/ diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/templates/additional_agreements.phtml b/app/code/Magento/CheckoutAgreements/view/frontend/templates/additional_agreements.phtml index 20840500a246f..0ce68afedfa7d 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/templates/additional_agreements.phtml +++ b/app/code/Magento/CheckoutAgreements/view/frontend/templates/additional_agreements.phtml @@ -1,6 +1,6 @@ @@ -11,11 +11,11 @@
    -
    - + diff --git a/app/code/Magento/Config/view/adminhtml/templates/system/config/js.phtml b/app/code/Magento/Config/view/adminhtml/templates/system/config/js.phtml index 4c450be896e73..cbf8445e08faf 100644 --- a/app/code/Magento/Config/view/adminhtml/templates/system/config/js.phtml +++ b/app/code/Magento/Config/view/adminhtml/templates/system/config/js.phtml @@ -1,6 +1,6 @@ _productSuperAttrs["{$productId}_{$attributeId}"])) { return $this->_productSuperAttrs["{$productId}_{$attributeId}"]; - } else { - return null; } + return null; } /** @@ -605,7 +604,7 @@ protected function _insertData() } /** - * Get new supper attribute id. + * Get new super attribute id. * * @return int */ diff --git a/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Export/RowCustomizerTest.php b/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Export/RowCustomizerTest.php index df61bb3e02a1b..97a0d5cd291c0 100644 --- a/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Export/RowCustomizerTest.php +++ b/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Export/RowCustomizerTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableImportExport/etc/export.xml b/app/code/Magento/ConfigurableImportExport/etc/export.xml index 7579f1ed01b5d..fcc01c53a19e1 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/export.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/export.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableImportExport/etc/import.xml b/app/code/Magento/ConfigurableImportExport/etc/import.xml index 6be1a1deef9a4..3b96f489987fe 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/import.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/import.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableImportExport/etc/module.xml b/app/code/Magento/ConfigurableImportExport/etc/module.xml index 8aa43f90dc401..83a4fc4e1a793 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/module.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableImportExport/registration.php b/app/code/Magento/ConfigurableImportExport/registration.php index dfece572c23e8..3eaa6453a8c62 100644 --- a/app/code/Magento/ConfigurableImportExport/registration.php +++ b/app/code/Magento/ConfigurableImportExport/registration.php @@ -1,6 +1,6 @@ _scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/ConfigurableProduct/Helper/Data.php b/app/code/Magento/ConfigurableProduct/Helper/Data.php index f7790ce1ade2c..260efb717e421 100644 --- a/app/code/Magento/ConfigurableProduct/Helper/Data.php +++ b/app/code/Magento/ConfigurableProduct/Helper/Data.php @@ -1,6 +1,6 @@ joinInner( + ['attribute_option' => $this->attributeResource->getTable('eav_attribute_option')], + 'attribute_option.option_id = entity_value.value', + [] + )->order( + 'attribute_option.sort_order ASC' )->where( 'super_attribute.product_id = ?', $productId diff --git a/app/code/Magento/ConfigurableProduct/Model/AttributeOptionProviderInterface.php b/app/code/Magento/ConfigurableProduct/Model/AttributeOptionProviderInterface.php index 6e9d5704198c0..ca289122a2126 100644 --- a/app/code/Magento/ConfigurableProduct/Model/AttributeOptionProviderInterface.php +++ b/app/code/Magento/ConfigurableProduct/Model/AttributeOptionProviderInterface.php @@ -1,6 +1,6 @@ productRepository = $productRepository; $this->productFactory = $productFactory; $this->configurableType = $configurableType; $this->dataObjectHelper = $dataObjectHelper; + if (null === $attributeFactory) { + $attributeFactory = ObjectManager::getInstance()->get( + \Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory::class + ); + } + $this->attributeFactory = $attributeFactory; + if (null === $optionsFactory) { + $optionsFactory = ObjectManager::getInstance()->get( + \Magento\ConfigurableProduct\Helper\Product\Options\Factory::class + ); + } + $this->optionsFactory = $optionsFactory; } /** @@ -127,9 +145,7 @@ public function addChild($sku, $childSku) } $configurableOptionData = $this->getConfigurableAttributesData($attributeIds); - /** @var \Magento\ConfigurableProduct\Helper\Product\Options\Factory $optionFactory */ - $optionFactory = $this->getOptionsFactory(); - $options = $optionFactory->create($configurableOptionData); + $options = $this->optionsFactory->create($configurableOptionData); $childrenIds[] = $child->getId(); $product->getExtensionAttributes()->setConfigurableProductOptions($options); $product->getExtensionAttributes()->setConfigurableProductLinks($childrenIds); @@ -166,38 +182,6 @@ public function removeChild($sku, $childSku) return true; } - /** - * Get Options Factory - * - * @return \Magento\ConfigurableProduct\Helper\Product\Options\Factory - * - * @deprecated - */ - private function getOptionsFactory() - { - if (!$this->optionsFactory) { - $this->optionsFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\ConfigurableProduct\Helper\Product\Options\Factory::class); - } - return $this->optionsFactory; - } - - /** - * Get Attribute Factory - * - * @return \Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory - * - * @deprecated - */ - private function getAttributeFactory() - { - if (!$this->attributeFactory) { - $this->attributeFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory::class); - } - return $this->attributeFactory; - } - /** * Get Configurable Attribute Data * @@ -208,7 +192,7 @@ private function getConfigurableAttributesData($attributeIds) { $configurableAttributesData = []; $attributeValues = []; - $attributes = $this->getAttributeFactory()->create() + $attributes = $this->attributeFactory->create() ->getCollection() ->addFieldToFilter('attribute_id', $attributeIds) ->getItems(); diff --git a/app/code/Magento/ConfigurableProduct/Model/OptionRepository.php b/app/code/Magento/ConfigurableProduct/Model/OptionRepository.php index d04dcaddd861f..bdf4a3678524e 100644 --- a/app/code/Magento/ConfigurableProduct/Model/OptionRepository.php +++ b/app/code/Magento/ConfigurableProduct/Model/OptionRepository.php @@ -1,7 +1,7 @@ configurableType = $configurableType; + $this->productRepository = $productRepository; + } + + /** + * Add parent identities to product identities + * + * @param Product $subject + * @param array $identities + * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterGetIdentities(Product $subject, $identities) + { + $identities = (array) $identities; + + foreach ($this->configurableType->getParentIdsByChild($subject->getId()) as $parentId) { + $parentProduct = $this->productRepository->getById($parentId); + $identities = array_merge($identities, (array) $parentProduct->getIdentities()); + } + + return array_unique($identities); + } +} diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Cache/Tag/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/Cache/Tag/Configurable.php index 8e5a4222ba0b7..3be9dca160782 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Cache/Tag/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Cache/Tag/Configurable.php @@ -1,6 +1,6 @@ getIdentities(); - foreach ($this->catalogProductTypeConfigurable->getParentIdsByChild($object->getId()) as $parentId) { - $result[] = \Magento\Catalog\Model\Product::CACHE_TAG . '_' . $parentId; - } return $result; } } diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/CartConfiguration/Plugin/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/CartConfiguration/Plugin/Configurable.php index ec22308012c23..00597496dccfe 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/CartConfiguration/Plugin/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/CartConfiguration/Plugin/Configurable.php @@ -2,7 +2,7 @@ /** * Plugin for cart product configuration * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\ConfigurableProduct\Model\Product\CartConfiguration\Plugin; diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/ReadHandler.php b/app/code/Magento/ConfigurableProduct/Model/Product/ReadHandler.php index 256703a158f8a..482dad344e241 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/ReadHandler.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/ReadHandler.php @@ -1,6 +1,6 @@ getConnection() ->select() ->from(['l' => $this->getMainTable()], []) @@ -178,10 +177,7 @@ public function getParentIdsByChild($childId) 'e.' . $this->optionProvider->getProductEntityLinkField() . ' = l.parent_id', ['e.entity_id'] )->where('l.product_id IN(?)', $childId); - - foreach ($this->getConnection()->fetchAll($select) as $row) { - $parentIds[] = $row['entity_id']; - } + $parentIds = $this->getConnection()->fetchCol($select); return $parentIds; } diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute.php index 9dba71b805201..7ea83099f2589 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute.php @@ -2,7 +2,7 @@ /** * Catalog super product attribute resource model * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable; diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php index 09d61ecd07b51..60ac100a6e657 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php @@ -2,7 +2,7 @@ /** * Catalog Configurable Product Attribute Collection * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute; diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php index b27063b72c527..dfaa3d6124755 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php @@ -2,7 +2,7 @@ /** * Catalog super product link collection * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product; diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Setup/PropertyMapper.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Setup/PropertyMapper.php index 71b6b5820ee90..46282c2fb0501 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Setup/PropertyMapper.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Setup/PropertyMapper.php @@ -2,7 +2,7 @@ /** * Configurable product attribute property mapper * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\ConfigurableProduct\Model\ResourceModel\Setup; diff --git a/app/code/Magento/ConfigurableProduct/Model/SuggestedAttributeList.php b/app/code/Magento/ConfigurableProduct/Model/SuggestedAttributeList.php index f902dd42259ad..f402ab3f1fc1f 100644 --- a/app/code/Magento/ConfigurableProduct/Model/SuggestedAttributeList.php +++ b/app/code/Magento/ConfigurableProduct/Model/SuggestedAttributeList.php @@ -2,7 +2,7 @@ /** * List of suggested attributes * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\ConfigurableProduct\Model; diff --git a/app/code/Magento/ConfigurableProduct/Observer/HideUnsupportedAttributeTypes.php b/app/code/Magento/ConfigurableProduct/Observer/HideUnsupportedAttributeTypes.php index aefc2080177d9..0ca60cd6e3e76 100644 --- a/app/code/Magento/ConfigurableProduct/Observer/HideUnsupportedAttributeTypes.php +++ b/app/code/Magento/ConfigurableProduct/Observer/HideUnsupportedAttributeTypes.php @@ -1,6 +1,6 @@ resource = $resourceConnection; $this->linkedProductSelectBuilder = $linkedProductSelectBuilder; $this->collectionFactory = $collectionFactory; + $this->storeManager = $storeManager + ?: ObjectManager::getInstance()->get(StoreManagerInterface::class); } /** @@ -57,16 +68,19 @@ public function __construct( */ public function getProducts(ProductInterface $product) { - if (!isset($this->productsMap[$product->getId()])) { + $key = $this->storeManager->getStore()->getId() . '-' . $product->getId(); + if (!isset($this->productsMap[$key])) { $productIds = $this->resource->getConnection()->fetchCol( '(' . implode(') UNION (', $this->linkedProductSelectBuilder->build($product->getId())) . ')' ); - $this->productsMap[$product->getId()] = $this->collectionFactory->create() - ->addAttributeToSelect(['price', 'special_price']) + $this->productsMap[$key] = $this->collectionFactory->create() + ->addAttributeToSelect( + ['price', 'special_price', 'special_from_date', 'special_to_date', 'tax_class_id'] + ) ->addIdFilter($productIds) ->getItems(); } - return $this->productsMap[$product->getId()]; + return $this->productsMap[$key]; } } diff --git a/app/code/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionsProviderInterface.php b/app/code/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionsProviderInterface.php index a40eabe464f93..0f86f3ea0798e 100644 --- a/app/code/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionsProviderInterface.php +++ b/app/code/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionsProviderInterface.php @@ -1,6 +1,6 @@ disableOriginalConstructor() ->getMockForAbstractClass(); $this->select = $this->getMockBuilder(Select::class) - ->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns']) + ->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns', 'order']) ->disableOriginalConstructor() ->getMock(); $this->connectionMock->expects($this->any()) @@ -161,10 +161,28 @@ public function testGetAttributeOptions(array $options) $this->select->expects($this->exactly(1))->method('from')->willReturnSelf(); $this->select->expects($this->exactly(1))->method('columns')->willReturnSelf(); - $this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf(); + $this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf(); $this->select->expects($this->exactly(3))->method('joinLeft')->willReturnSelf(); + $this->select->expects($this->exactly(1))->method('order')->willReturnSelf(); $this->select->expects($this->exactly(2))->method('where')->willReturnSelf(); + $this->attributeResource->expects($this->exactly(9)) + ->method('getTable') + ->will( + $this->returnValueMap( + [ + ['catalog_product_super_attribute', 'catalog_product_super_attribute value'], + ['catalog_product_entity', 'catalog_product_entity value'], + ['catalog_product_super_link', 'catalog_product_super_link value'], + ['eav_attribute', 'eav_attribute value'], + ['catalog_product_entity', 'catalog_product_entity value'], + ['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'], + ['eav_attribute_option', 'eav_attribute_option value'], + ['eav_attribute_option_value', 'eav_attribute_option_value value'] + ] + ) + ); + $this->abstractAttribute->expects($this->any()) ->method('getBackendTable') ->willReturn('getBackendTable value'); @@ -193,10 +211,27 @@ public function testGetAttributeOptionsWithBackendModel(array $options) $this->select->expects($this->exactly(1))->method('from')->willReturnSelf(); $this->select->expects($this->exactly(0))->method('columns')->willReturnSelf(); - $this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf(); + $this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf(); $this->select->expects($this->exactly(1))->method('joinLeft')->willReturnSelf(); + $this->select->expects($this->exactly(1))->method('order')->willReturnSelf(); $this->select->expects($this->exactly(2))->method('where')->willReturnSelf(); + $this->attributeResource->expects($this->exactly(7)) + ->method('getTable') + ->will( + $this->returnValueMap( + [ + ['catalog_product_super_attribute', 'catalog_product_super_attribute value'], + ['catalog_product_entity', 'catalog_product_entity value'], + ['catalog_product_super_link', 'catalog_product_super_link value'], + ['eav_attribute', 'eav_attribute value'], + ['catalog_product_entity', 'catalog_product_entity value'], + ['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'], + ['eav_attribute_option', 'eav_attribute_option value'] + ] + ) + ); + $source = $this->getMockBuilder(AbstractSource::class) ->disableOriginalConstructor() ->setMethods(['getOptionText']) diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/AttributesListTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/AttributesListTest.php index 10d971a74901d..f1153efb223e3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/AttributesListTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/AttributesListTest.php @@ -1,6 +1,6 @@ disableOriginalConstructor() ->getMock(); - $this->configurableType = - $this->getMockBuilder('Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable') - ->disableOriginalConstructor()->getMock(); + $this->configurableType = $this->getMockBuilder( + '\Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable' + )->disableOriginalConstructor()->getMock(); + + $this->attributeFactory = $this->getMockBuilder( + '\Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory' + )->disableOriginalConstructor()->setMethods(['create'])->getMock(); + $this->productOptionsFactory = $this->getMockBuilder( + '\Magento\ConfigurableProduct\Helper\Product\Options\Factory' + )->disableOriginalConstructor()->setMethods(['create'])->getMock(); $this->object = $this->objectManagerHelper->getObject( '\Magento\ConfigurableProduct\Model\LinkManagement', @@ -67,6 +80,8 @@ protected function setUp() 'productFactory' => $this->productFactory, 'configurableType' => $this->configurableType, 'dataObjectHelper' => $this->dataObjectHelperMock, + 'attributeFactory' => $this->attributeFactory, + 'optionsFactory' => $this->productOptionsFactory ] ); } @@ -164,22 +179,13 @@ public function testAddChild() ->disableOriginalConstructor() ->setMethods(['getAttributeCode']) ->getMock(); - $optionsFactoryMock = $this->getMockBuilder('Magento\ConfigurableProduct\Helper\Product\Options\Factory') - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); $reflectionClass = new \ReflectionClass('Magento\ConfigurableProduct\Model\LinkManagement'); $optionsFactoryReflectionProperty = $reflectionClass->getProperty('optionsFactory'); $optionsFactoryReflectionProperty->setAccessible(true); - $optionsFactoryReflectionProperty->setValue($this->object, $optionsFactoryMock); - - $attributeFactoryMock = $this->getMockBuilder('Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory') - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); + $optionsFactoryReflectionProperty->setValue($this->object, $this->productOptionsFactory); $attributeFactoryReflectionProperty = $reflectionClass->getProperty('attributeFactory'); $attributeFactoryReflectionProperty->setAccessible(true); - $attributeFactoryReflectionProperty->setValue($this->object, $attributeFactoryMock); + $attributeFactoryReflectionProperty->setValue($this->object, $this->attributeFactory); $attributeMock = $this->getMockBuilder('Magento\Catalog\Model\ResourceModel\Eav\Attribute') ->disableOriginalConstructor() @@ -217,8 +223,8 @@ public function testAddChild() $simple->expects($this->any())->method('getData')->willReturn('color'); $optionMock->expects($this->any())->method('getAttributeId')->willReturn('1'); - $optionsFactoryMock->expects($this->any())->method('create')->willReturn([$optionMock]); - $attributeFactoryMock->expects($this->any())->method('create')->willReturn($attributeMock); + $this->productOptionsFactory->expects($this->any())->method('create')->willReturn([$optionMock]); + $this->attributeFactory->expects($this->any())->method('create')->willReturn($attributeMock); $attributeMock->expects($this->any())->method('getCollection')->willReturn($attributeCollectionMock); $attributeCollectionMock->expects($this->any())->method('addFieldToFilter')->willReturnSelf(); $attributeCollectionMock->expects($this->any())->method('getItems')->willReturn([$attributeMock]); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php index ab6e05e53c0a7..8436bc91f0ccb 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php @@ -1,6 +1,6 @@ configurableTypeMock = $this->getMockBuilder(Configurable::class) + ->disableOriginalConstructor() + ->getMock(); + $this->productRepositoryMock = $this->getMockBuilder(ProductRepositoryInterface::class) + ->getMock(); + + $this->plugin = new ProductIdentitiesExtender($this->configurableTypeMock, $this->productRepositoryMock); + } + + public function testAfterGetIdentities() + { + $productId = 1; + $productIdentity = 'cache_tag_1'; + $productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + $parentProductId = 2; + $parentProductIdentity = 'cache_tag_2'; + $parentProductMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + + $productMock->expects($this->once()) + ->method('getId') + ->willReturn($productId); + $this->configurableTypeMock->expects($this->once()) + ->method('getParentIdsByChild') + ->with($productId) + ->willReturn([$parentProductId]); + $this->productRepositoryMock->expects($this->once()) + ->method('getById') + ->with($parentProductId) + ->willReturn($parentProductMock); + $parentProductMock->expects($this->once()) + ->method('getIdentities') + ->willReturn([$parentProductIdentity]); + + $productIdentities = $this->plugin->afterGetIdentities($productMock, [$productIdentity]); + $this->assertEquals([$productIdentity, $parentProductIdentity], $productIdentities); + } +} diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Cache/Tag/ConfigurableTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Cache/Tag/ConfigurableTest.php index b2db7a26ab20d..0fafff7bfaa4c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Cache/Tag/ConfigurableTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Cache/Tag/ConfigurableTest.php @@ -1,6 +1,6 @@ method('getIdentities') ->willReturn($identities); - $parentId = 4; - $this->typeResource->expects($this->once()) - ->method('getParentIdsByChild') - ->willReturn([$parentId]); - - $expected = array_merge($identities, [\Magento\Catalog\Model\Product::CACHE_TAG . '_' . $parentId]); - - $this->assertEquals($expected, $this->model->getTags($product)); + $this->assertEquals($identities, $this->model->getTags($product)); } } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/CartConfiguration/Plugin/ConfigurableTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/CartConfiguration/Plugin/ConfigurableTest.php index b3a201ea9eeb8..6891f519ec673 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/CartConfiguration/Plugin/ConfigurableTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/CartConfiguration/Plugin/ConfigurableTest.php @@ -1,6 +1,6 @@ locator = $locator; $this->urlBuilder = $urlBuilder; @@ -114,6 +124,7 @@ public function __construct( $this->localeCurrency = $localeCurrency; $this->jsonHelper = $jsonHelper; $this->imageHelper = $imageHelper; + $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class); } /** @@ -280,9 +291,9 @@ protected function prepareVariations() 'product_link' => '' . $product->getName() . '', - 'sku' => $product->getSku(), - 'name' => $product->getName(), + ) . '" target="_blank">' . $this->escaper->escapeHtml($product->getName()) . '', + 'sku' => $this->escaper->escapeHtml($product->getSku()), + 'name' => $this->escaper->escapeHtml($product->getName()), 'qty' => $this->getProductStockQty($product), 'price' => $currency->toCurrency(sprintf("%f", $price), ['display' => false]), 'price_string' => $currency->toCurrency(sprintf("%f", $price)), diff --git a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/StockData.php b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/StockData.php index 7bdeda7e1aabe..58b58b11c1b1c 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/StockData.php +++ b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/StockData.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/adminhtml/events.xml b/app/code/Magento/ConfigurableProduct/etc/adminhtml/events.xml index 70fb2a15438d5..a78e6171654a2 100644 --- a/app/code/Magento/ConfigurableProduct/etc/adminhtml/events.xml +++ b/app/code/Magento/ConfigurableProduct/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml b/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml index 4fe6563978362..2f0208d36a532 100644 --- a/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml +++ b/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/adminhtml/system.xml b/app/code/Magento/ConfigurableProduct/etc/adminhtml/system.xml index 494b09d031c56..ba52b51d6b077 100644 --- a/app/code/Magento/ConfigurableProduct/etc/adminhtml/system.xml +++ b/app/code/Magento/ConfigurableProduct/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/config.xml b/app/code/Magento/ConfigurableProduct/etc/config.xml index 98b1658bc52c4..6b803abc1260e 100644 --- a/app/code/Magento/ConfigurableProduct/etc/config.xml +++ b/app/code/Magento/ConfigurableProduct/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/di.xml b/app/code/Magento/ConfigurableProduct/etc/di.xml index 351d5aed3bcba..198c4b1cf633a 100644 --- a/app/code/Magento/ConfigurableProduct/etc/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/di.xml @@ -1,7 +1,7 @@ @@ -178,4 +178,7 @@ + + + diff --git a/app/code/Magento/ConfigurableProduct/etc/extension_attributes.xml b/app/code/Magento/ConfigurableProduct/etc/extension_attributes.xml index 45cb1e66dc8b7..c8565ab36132f 100644 --- a/app/code/Magento/ConfigurableProduct/etc/extension_attributes.xml +++ b/app/code/Magento/ConfigurableProduct/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml b/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml index aa2dec7eb78ec..99ab8ee9050c2 100644 --- a/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/module.xml b/app/code/Magento/ConfigurableProduct/etc/module.xml index dd4830158a606..9cf13ed73f882 100644 --- a/app/code/Magento/ConfigurableProduct/etc/module.xml +++ b/app/code/Magento/ConfigurableProduct/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/product_types.xml b/app/code/Magento/ConfigurableProduct/etc/product_types.xml index 201da50fa47fa..dff5e7b1841a1 100644 --- a/app/code/Magento/ConfigurableProduct/etc/product_types.xml +++ b/app/code/Magento/ConfigurableProduct/etc/product_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/sales.xml b/app/code/Magento/ConfigurableProduct/etc/sales.xml index 8e56542a28ae2..21d734fcbf0d7 100644 --- a/app/code/Magento/ConfigurableProduct/etc/sales.xml +++ b/app/code/Magento/ConfigurableProduct/etc/sales.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/etc/webapi.xml b/app/code/Magento/ConfigurableProduct/etc/webapi.xml index 13a647f70c359..5e3dd805732a5 100644 --- a/app/code/Magento/ConfigurableProduct/etc/webapi.xml +++ b/app/code/Magento/ConfigurableProduct/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/registration.php b/app/code/Magento/ConfigurableProduct/registration.php index 9cd8c621920f6..8fa7719783267 100644 --- a/app/code/Magento/ConfigurableProduct/registration.php +++ b/app/code/Magento/ConfigurableProduct/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_associated_grid.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_associated_grid.xml index 769300a80c820..2b9bf442d232f 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_associated_grid.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_associated_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml index 16c1c38f4d42b..816a2fcd63059 100755 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_configurable.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_configurable.xml index b4d18dc122080..248799275aff5 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_configurable.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_configurable.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_downloadable.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_downloadable.xml index 566bcc861857d..b1efe5f47a0e3 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_downloadable.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_downloadable.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml index 11fe045901aac..0cc9066ea0fa0 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_set_edit.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_set_edit.xml index db940ea4f5790..ba39a74be256d 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_set_edit.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_set_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_simple.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_simple.xml index 566bcc861857d..b1efe5f47a0e3 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_simple.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_simple.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml index 6b39e64b95d4c..f9508d3fac193 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_view_type_configurable.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_view_type_configurable.xml index 457539b1279e4..c41e9baa93f4b 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_view_type_configurable.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_view_type_configurable.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_virtual.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_virtual.xml index 566bcc861857d..b1efe5f47a0e3 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_virtual.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_virtual.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_wizard.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_wizard.xml index 8db28bde0a0cb..f6c472b209b6c 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_wizard.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_wizard.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/new/created.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/new/created.phtml index c37400baef7a4..12eb2c15981ee 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/new/created.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/new/created.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml index d5ff6fb9d6549..7252bfa0794d3 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml index 86ff3cbd46033..e31b7f8b6ac82 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_form.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_form.xml index a928988a29cd9..6dbad86ccae81 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_form.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/css/configurable-product.css b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/css/configurable-product.css index 30d75898e79bc..9957a4a9ea115 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/css/configurable-product.css +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/css/configurable-product.css @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/associated-product-insert-listing.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/associated-product-insert-listing.js index 98461addf4c4f..2a8f4263bc412 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/associated-product-insert-listing.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/associated-product-insert-listing.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/container-configurable-handler.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/container-configurable-handler.js index e3834bc3464c1..0829ac8582f54 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/container-configurable-handler.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/container-configurable-handler.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/custom-options-price-type.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/custom-options-price-type.js index 99a495a509179..b502f986c5af4 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/custom-options-price-type.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/custom-options-price-type.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/custom-options-warning.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/custom-options-warning.js index 210361945c541..ed267ee87fda6 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/custom-options-warning.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/custom-options-warning.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js index 7f02df57d48e5..01abce7696014 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -32,6 +32,7 @@ define([ identificationProperty: 'id', 'attribute_set_id': '', attributesTmp: [], + changedFlag: 'was_changed', listens: { 'insertDataFromGrid': 'processingInsertDataFromGrid', 'insertDataFromWizard': 'processingInsertDataFromWizard', @@ -391,9 +392,9 @@ define([ 'small_image': row['small_image'], image: row.image, 'thumbnail': row.thumbnail, - 'attributes': attributesText, - 'was_changed': true + 'attributes': attributesText }; + product[this.changedFlag] = true; product[this.canEditField] = row.editable; product[this.newProductField] = row.newProduct; tmpArray.push(product); @@ -515,6 +516,7 @@ define([ tmpArray[rowIndex].status = 1; } + tmpArray[rowIndex][this.changedFlag] = true; this.unionInsertData(tmpArray); } }); diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/file-uploader.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/file-uploader.js index a90d977da6056..2767779bfe976 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/file-uploader.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/file-uploader.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/modal-configurable.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/modal-configurable.js index b0dfe14fe9d6b..61dfe04a90f7e 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/modal-configurable.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/modal-configurable.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable-type-handler.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable-type-handler.js index 857dd8cfa38e8..b3a86229c830a 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable-type-handler.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable-type-handler.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable.js index df3b1638f61d1..c157ecbfe0bc1 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /**************************** CONFIGURABLE PRODUCT **************************/ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/options/price-type-handler.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/options/price-type-handler.js index cd354741bb061..19391ed6baca4 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/options/price-type-handler.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/options/price-type-handler.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /* diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/paging/sizes.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/paging/sizes.js index 386c486cea7b7..a8b8f95f6536f 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/paging/sizes.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/paging/sizes.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/product-grid.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/product-grid.js index ce2fd9ac5ea80..16f1a2dd6f5f3 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/product-grid.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/product-grid.js @@ -1,6 +1,6 @@ // jscs:disable requireDotNotation /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js index c3c4bc2336a1b..86fe08aa45d7f 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // jscs:disable jsDoc diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js index ae4a51fb3b0bd..2b99eef5d7de9 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint browser:true jquery:true*/ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/select_attributes.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/select_attributes.js index 18a1b30c051ce..30a8d88174e12 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/select_attributes.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/select_attributes.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // jscs:disable jsDoc diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js index 1d504cda1738b..e5596ff34ad95 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // jscs:disable jsDoc diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js index 8e814628d5108..3b1e15bc3b9d6 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js @@ -1,6 +1,6 @@ // jscs:disable requireDotNotation /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // jscs:disable jsDoc diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/product/product.css b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/product/product.css index 69b45d7fc6552..3b7ae099e4362 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/product/product.css +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/product/product.css @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/actions-list.html b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/actions-list.html index 290491a938b05..946d9bd430737 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/actions-list.html +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/actions-list.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/cell-html.html b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/cell-html.html index bb6b3556734fe..b014e32793035 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/cell-html.html +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/cell-html.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/cell-status.html b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/cell-status.html index 4006a8937d2df..199ff6924a4ec 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/cell-status.html +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/cell-status.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/file-uploader.html b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/file-uploader.html index 8bdb919d138a9..e54f19878bb8d 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/file-uploader.html +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/file-uploader.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/variations/steps/summary-grid.html b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/variations/steps/summary-grid.html index 4ef980d98bed8..ff247c14bf52b 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/variations/steps/summary-grid.html +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/variations/steps/summary-grid.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/base/layout/catalog_product_prices.xml b/app/code/Magento/ConfigurableProduct/view/base/layout/catalog_product_prices.xml index 0ae2972fd36aa..992491b13a725 100644 --- a/app/code/Magento/ConfigurableProduct/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/ConfigurableProduct/view/base/layout/catalog_product_prices.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/final_price.phtml b/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/final_price.phtml index 213cf21c3522a..551fd5305c442 100644 --- a/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/final_price.phtml +++ b/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/final_price.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/catalog_product_view_type_configurable.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/catalog_product_view_type_configurable.xml index 302e246502433..01ddc5b0e5425 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/catalog_product_view_type_configurable.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/catalog_product_view_type_configurable.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_configure_type_configurable.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_configure_type_configurable.xml index 84ee21b4b3c73..07336b6b59e1b 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_configure_type_configurable.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_configure_type_configurable.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_item_renderers.xml index 9577f947a7a48..d3e1d7d89c957 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml index e861caa27aa2d..57cc1055db25f 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/requirejs-config.js b/app/code/Magento/ConfigurableProduct/view/frontend/requirejs-config.js index 58b294fe7face..c25096121be5d 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/requirejs-config.js +++ b/app/code/Magento/ConfigurableProduct/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/templates/js/components.phtml b/app/code/Magento/ConfigurableProduct/view/frontend/templates/js/components.phtml index bdcb2e9bf7747..e71938935b8f3 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/templates/js/components.phtml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/templates/js/components.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Contact/etc/adminhtml/system.xml b/app/code/Magento/Contact/etc/adminhtml/system.xml index 6d39846019a36..b5974e4d42e84 100644 --- a/app/code/Magento/Contact/etc/adminhtml/system.xml +++ b/app/code/Magento/Contact/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/etc/config.xml b/app/code/Magento/Contact/etc/config.xml index 3a3e3460585b9..1ece010aefc67 100644 --- a/app/code/Magento/Contact/etc/config.xml +++ b/app/code/Magento/Contact/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/etc/di.xml b/app/code/Magento/Contact/etc/di.xml index 0800e42b0ec0c..316e31f055773 100644 --- a/app/code/Magento/Contact/etc/di.xml +++ b/app/code/Magento/Contact/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/etc/email_templates.xml b/app/code/Magento/Contact/etc/email_templates.xml index be2cf76d5911b..8ae3b643f43c8 100644 --- a/app/code/Magento/Contact/etc/email_templates.xml +++ b/app/code/Magento/Contact/etc/email_templates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/etc/frontend/di.xml b/app/code/Magento/Contact/etc/frontend/di.xml index b520c9f0e865d..a84adeec28012 100644 --- a/app/code/Magento/Contact/etc/frontend/di.xml +++ b/app/code/Magento/Contact/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/etc/frontend/page_types.xml b/app/code/Magento/Contact/etc/frontend/page_types.xml index a6f630d892114..58db29819b9d5 100644 --- a/app/code/Magento/Contact/etc/frontend/page_types.xml +++ b/app/code/Magento/Contact/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/etc/frontend/routes.xml b/app/code/Magento/Contact/etc/frontend/routes.xml index ba548c605b71b..132d31e6258f5 100644 --- a/app/code/Magento/Contact/etc/frontend/routes.xml +++ b/app/code/Magento/Contact/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/etc/module.xml b/app/code/Magento/Contact/etc/module.xml index ea6c3d05c692c..ec91859ee2c8d 100644 --- a/app/code/Magento/Contact/etc/module.xml +++ b/app/code/Magento/Contact/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/registration.php b/app/code/Magento/Contact/registration.php index 6d3f8dc31a95d..9de87c2f24ed1 100644 --- a/app/code/Magento/Contact/registration.php +++ b/app/code/Magento/Contact/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml b/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml index 740647609b195..078c1a4ff5621 100644 --- a/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml +++ b/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/view/frontend/layout/default.xml b/app/code/Magento/Contact/view/frontend/layout/default.xml index a97cf0ddc64e0..d236ac0e67f9d 100644 --- a/app/code/Magento/Contact/view/frontend/layout/default.xml +++ b/app/code/Magento/Contact/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Contact/view/frontend/templates/form.phtml b/app/code/Magento/Contact/view/frontend/templates/form.phtml index 2ed9adc8aed2f..6319a38e2c8a3 100644 --- a/app/code/Magento/Contact/view/frontend/templates/form.phtml +++ b/app/code/Magento/Contact/view/frontend/templates/form.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Cookie/etc/config.xml b/app/code/Magento/Cookie/etc/config.xml index 4266c755f7737..710274195ac85 100644 --- a/app/code/Magento/Cookie/etc/config.xml +++ b/app/code/Magento/Cookie/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cookie/etc/di.xml b/app/code/Magento/Cookie/etc/di.xml index 73e5dacb9b2fe..8b53209f51916 100644 --- a/app/code/Magento/Cookie/etc/di.xml +++ b/app/code/Magento/Cookie/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cookie/etc/frontend/routes.xml b/app/code/Magento/Cookie/etc/frontend/routes.xml index ca903f9d58e5b..d9ccb9c48c09d 100644 --- a/app/code/Magento/Cookie/etc/frontend/routes.xml +++ b/app/code/Magento/Cookie/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cookie/etc/module.xml b/app/code/Magento/Cookie/etc/module.xml index 75b6e7bad6df0..35c5a52f42ec7 100644 --- a/app/code/Magento/Cookie/etc/module.xml +++ b/app/code/Magento/Cookie/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cookie/registration.php b/app/code/Magento/Cookie/registration.php index 696427c020dc3..d8e32043e8508 100644 --- a/app/code/Magento/Cookie/registration.php +++ b/app/code/Magento/Cookie/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Cookie/view/frontend/requirejs-config.js b/app/code/Magento/Cookie/view/frontend/requirejs-config.js index 680ca42ebd11d..f469a04d061c1 100644 --- a/app/code/Magento/Cookie/view/frontend/requirejs-config.js +++ b/app/code/Magento/Cookie/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Cookie/view/frontend/templates/html/notices.phtml b/app/code/Magento/Cookie/view/frontend/templates/html/notices.phtml index 21c280a384f4a..01719ece092b4 100644 --- a/app/code/Magento/Cookie/view/frontend/templates/html/notices.phtml +++ b/app/code/Magento/Cookie/view/frontend/templates/html/notices.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Cookie/view/frontend/web/js/notices.js b/app/code/Magento/Cookie/view/frontend/web/js/notices.js index 0b526ca5c27e3..efbd86fdfd6f3 100644 --- a/app/code/Magento/Cookie/view/frontend/web/js/notices.js +++ b/app/code/Magento/Cookie/view/frontend/web/js/notices.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint browser:true jquery:true*/ diff --git a/app/code/Magento/Cookie/view/frontend/web/js/require-cookie.js b/app/code/Magento/Cookie/view/frontend/web/js/require-cookie.js index ca8861cc68533..e9f2cffee5191 100644 --- a/app/code/Magento/Cookie/view/frontend/web/js/require-cookie.js +++ b/app/code/Magento/Cookie/view/frontend/web/js/require-cookie.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*jshint evil:true browser:true jquery:true */ diff --git a/app/code/Magento/Cron/Console/Command/CronCommand.php b/app/code/Magento/Cron/Console/Command/CronCommand.php index 21ff041a8d5a4..6a9686c514e39 100644 --- a/app/code/Magento/Cron/Console/Command/CronCommand.php +++ b/app/code/Magento/Cron/Console/Command/CronCommand.php @@ -1,6 +1,6 @@ trySchedule()) { // time matches cron expression $schedule->save(); - return; } } } diff --git a/app/code/Magento/Cron/Setup/InstallSchema.php b/app/code/Magento/Cron/Setup/InstallSchema.php index 1001a4d487205..bef7a8f5be550 100644 --- a/app/code/Magento/Cron/Setup/InstallSchema.php +++ b/app/code/Magento/Cron/Setup/InstallSchema.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_duplicates.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_duplicates.xml index 1512aafb9abb2..5e62ca47aaf2a 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_duplicates.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_duplicates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_node_typo.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_node_typo.xml index 17e6850474e79..894c488577c9a 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_node_typo.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_node_typo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_instance.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_instance.xml index 1b7f2a2f70daf..df2722b3cb330 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_instance.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_instance.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_method.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_method.xml index 1c0654811d4cd..6cca67d9b7519 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_method.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_method.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_name.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_name.xml index 8bf7f63b97979..459825966de74 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_name.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_name.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid.xml index 79c4da8a7837e..984cc46e29be5 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml index 4e255306e503c..93c512d5c7591 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Cron/Test/Unit/Model/ConfigTest.php index 51787e30e86ef..2f9ab490af8e3 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/ConfigTest.php @@ -1,6 +1,6 @@ [ - 'default' => [ - 'test_job1' => [ - 'instance' => 'CronJob', - 'method' => 'execute', - ], + 'test_job1' => [ + 'instance' => 'CronJob', + 'method' => 'execute', ], ], ]; @@ -542,11 +540,9 @@ public function testDispatchGenerate() $this->_config->expects($this->at(0))->method('getJobs')->will($this->returnValue($jobConfig)); $jobs = [ 'test_group' => [ - 'default' => [ - 'job1' => ['config_path' => 'test/path'], - 'job2' => ['schedule' => ''], - 'job3' => ['schedule' => '* * * * *'], - ], + 'job1' => ['config_path' => 'test/path'], + 'job2' => ['schedule' => ''], + 'job3' => ['schedule' => '* * * * *'], ], ]; $this->_config->expects($this->at(1))->method('getJobs')->will($this->returnValue($jobs)); @@ -570,32 +566,40 @@ public function testDispatchGenerate() $this->returnValue(time() + 10000000) ); - $this->_scopeConfig->expects($this->at(0))->method('getValue')->will($this->returnValue(0)); + $this->_scopeConfig->expects($this->any())->method('getValue')->willReturnMap( + [ + [ + 'system/cron/test_group/schedule_generate_every', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + null, + 0 + ], + [ + 'system/cron/test_group/schedule_ahead_for', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + null, + 2 + ] + ] + ); - $scheduleMethods = ['getJobCode', 'getScheduledAt', 'trySchedule', 'unsScheduleId', 'save', '__wakeup']; $schedule = $this->getMockBuilder( 'Magento\Cron\Model\Schedule' )->setMethods( - $scheduleMethods + ['getJobCode', 'getScheduledAt', 'trySchedule', 'unsScheduleId', 'save', '__wakeup', 'getCollection'] )->disableOriginalConstructor()->getMock(); $schedule->expects($this->any())->method('getJobCode')->will($this->returnValue('job_code1')); $schedule->expects($this->once())->method('getScheduledAt')->will($this->returnValue('* * * * *')); $schedule->expects($this->any())->method('unsScheduleId')->will($this->returnSelf()); $schedule->expects($this->any())->method('trySchedule')->will($this->returnSelf()); + $schedule->expects($this->any())->method('getCollection')->willReturn($this->_collection); + $schedule->expects($this->atLeastOnce())->method('save')->willReturnSelf(); $this->_collection->addItem(new \Magento\Framework\DataObject()); $this->_collection->addItem($schedule); $this->_cache->expects($this->any())->method('save'); - $scheduleMock = $this->getMockBuilder( - 'Magento\Cron\Model\Schedule' - )->disableOriginalConstructor()->setMethods( - ['getCollection', '__wakeup'] - )->getMock(); - $scheduleMock->expects($this->any())->method('getCollection')->will($this->returnValue($this->_collection)); - $this->_scheduleFactory->expects($this->any())->method('create')->will($this->returnValue($scheduleMock)); - $this->_scheduleFactory->expects($this->any())->method('create')->will($this->returnValue($schedule)); $this->_observer->execute($this->observer); diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index e6a3d74dd06d3..72ea22c1abf56 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -10,7 +10,7 @@ "magento/module-config": "100.1.*" }, "type": "magento2-module", - "version": "100.1.4", + "version": "100.1.5", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cron/etc/adminhtml/system.xml b/app/code/Magento/Cron/etc/adminhtml/system.xml index 1f6f3a369708d..95d8d4c8a6966 100644 --- a/app/code/Magento/Cron/etc/adminhtml/system.xml +++ b/app/code/Magento/Cron/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/etc/cron_groups.xml b/app/code/Magento/Cron/etc/cron_groups.xml index 28a3475f49d1f..a01426eab723e 100644 --- a/app/code/Magento/Cron/etc/cron_groups.xml +++ b/app/code/Magento/Cron/etc/cron_groups.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/etc/cron_groups.xsd b/app/code/Magento/Cron/etc/cron_groups.xsd index 15074997589de..7edba02063405 100644 --- a/app/code/Magento/Cron/etc/cron_groups.xsd +++ b/app/code/Magento/Cron/etc/cron_groups.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/etc/crontab.xsd b/app/code/Magento/Cron/etc/crontab.xsd index 68279da5aec84..8614cf32fb8c4 100644 --- a/app/code/Magento/Cron/etc/crontab.xsd +++ b/app/code/Magento/Cron/etc/crontab.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/etc/crontab/events.xml b/app/code/Magento/Cron/etc/crontab/events.xml index 9de72ebb03eb5..de6b8914384f0 100644 --- a/app/code/Magento/Cron/etc/crontab/events.xml +++ b/app/code/Magento/Cron/etc/crontab/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/etc/di.xml b/app/code/Magento/Cron/etc/di.xml index d571fa263116c..e27dd5e0a2107 100644 --- a/app/code/Magento/Cron/etc/di.xml +++ b/app/code/Magento/Cron/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/etc/module.xml b/app/code/Magento/Cron/etc/module.xml index 288aa6fbec23e..ce31b046500f7 100644 --- a/app/code/Magento/Cron/etc/module.xml +++ b/app/code/Magento/Cron/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Cron/registration.php b/app/code/Magento/Cron/registration.php index 227c716af1862..d767c1e15429c 100644 --- a/app/code/Magento/Cron/registration.php +++ b/app/code/Magento/Cron/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CurrencySymbol/etc/adminhtml/menu.xml b/app/code/Magento/CurrencySymbol/etc/adminhtml/menu.xml index 5dbf49d2c1cf3..edb4019646c56 100644 --- a/app/code/Magento/CurrencySymbol/etc/adminhtml/menu.xml +++ b/app/code/Magento/CurrencySymbol/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml b/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml index 31353a45c2859..5e7a7b502e62e 100644 --- a/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml +++ b/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CurrencySymbol/etc/di.xml b/app/code/Magento/CurrencySymbol/etc/di.xml index cbce50306bc45..d7cd3d55588c3 100644 --- a/app/code/Magento/CurrencySymbol/etc/di.xml +++ b/app/code/Magento/CurrencySymbol/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CurrencySymbol/etc/events.xml b/app/code/Magento/CurrencySymbol/etc/events.xml index aff0fea744c43..bcda5aa658e86 100644 --- a/app/code/Magento/CurrencySymbol/etc/events.xml +++ b/app/code/Magento/CurrencySymbol/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CurrencySymbol/etc/module.xml b/app/code/Magento/CurrencySymbol/etc/module.xml index cbda20acdad82..08c70d948f5fc 100644 --- a/app/code/Magento/CurrencySymbol/etc/module.xml +++ b/app/code/Magento/CurrencySymbol/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CurrencySymbol/registration.php b/app/code/Magento/CurrencySymbol/registration.php index ab086a95e2d6c..733fc041f3c45 100644 --- a/app/code/Magento/CurrencySymbol/registration.php +++ b/app/code/Magento/CurrencySymbol/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currencysymbol_index.xml b/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currencysymbol_index.xml index bf7126f432cf9..7a06ee8fced95 100644 --- a/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currencysymbol_index.xml +++ b/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currencysymbol_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CurrencySymbol/view/adminhtml/templates/grid.phtml b/app/code/Magento/CurrencySymbol/view/adminhtml/templates/grid.phtml index e55b46eb93d25..58d41da965d65 100644 --- a/app/code/Magento/CurrencySymbol/view/adminhtml/templates/grid.phtml +++ b/app/code/Magento/CurrencySymbol/view/adminhtml/templates/grid.phtml @@ -1,6 +1,6 @@ _localeDate->getDateFormat(\IntlDateFormatter::SHORT); + /** Escape invisible characters which are present in some locales and may corrupt formatting */ + $dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT); + $escapedDateFormat = preg_replace('/[^MmDdYy\/\.\-]/', '', $dateFormat); + + return $escapedDateFormat; } /** diff --git a/app/code/Magento/Customer/Block/Widget/Gender.php b/app/code/Magento/Customer/Block/Widget/Gender.php index 1e29b22e751b5..1d3730e6c6d58 100644 --- a/app/code/Magento/Customer/Block/Widget/Gender.php +++ b/app/code/Magento/Customer/Block/Widget/Gender.php @@ -1,6 +1,6 @@ resultPageFactory->create(); - $resultPage->getConfig()->getTitle()->set(__('My Account')); - return $resultPage; + return $this->resultPageFactory->create(); } } diff --git a/app/code/Magento/Customer/Controller/Account/Login.php b/app/code/Magento/Customer/Controller/Account/Login.php index 00d5720043477..51c244ec0cfe9 100644 --- a/app/code/Magento/Customer/Controller/Account/Login.php +++ b/app/code/Magento/Customer/Controller/Account/Login.php @@ -1,7 +1,7 @@ get(QuoteFactory::class); + } + $this->quoteFactory = $quoteFactory; + } + /** * Handle and then get cart grid contents * @@ -23,15 +135,15 @@ public function execute() $deleteItemId = $this->getRequest()->getPost('delete'); if ($deleteItemId) { /** @var \Magento\Quote\Api\CartRepositoryInterface $quoteRepository */ - $quoteRepository = $this->_objectManager->create('Magento\Quote\Api\CartRepositoryInterface'); + $quoteRepository = $this->_objectManager->create(CartRepositoryInterface::class); /** @var \Magento\Quote\Model\Quote $quote */ try { $quote = $quoteRepository->getForCustomer($customerId); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { - $quote = $this->_objectManager->create('\Magento\Quote\Model\QuoteFactory')->create(); + $quote = $this->quoteFactory->create(); } $quote->setWebsite( - $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface')->getWebsite($websiteId) + $this->_objectManager->get(StoreManagerInterface::class)->getWebsite($websiteId) ); $item = $quote->getItemById($deleteItemId); if ($item && $item->getId()) { diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Carts.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Carts.php index 5ee89a8dc6439..bc9ca7628e132 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Carts.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Carts.php @@ -1,6 +1,6 @@ dataObjectHelper->populateWithArray( $customer, $customerData, - '\Magento\Customer\Api\Data\CustomerInterface' + \Magento\Customer\Api\Data\CustomerInterface::class ); $addresses = []; foreach ($addressesData as $addressData) { @@ -224,7 +224,7 @@ public function execute() $this->dataObjectHelper->populateWithArray( $addressDataObject, $addressData, - '\Magento\Customer\Api\Data\AddressInterface' + \Magento\Customer\Api\Data\AddressInterface::class ); $addresses[] = $addressDataObject; } @@ -253,7 +253,7 @@ public function execute() $isSubscribed = $this->getRequest()->getPost('subscription'); } if ($isSubscribed !== null) { - if ($isSubscribed !== 'false') { + if ($isSubscribed !== '0') { $this->_subscriberFactory->create()->subscribeCustomerById($customerId); } else { $this->_subscriberFactory->create()->unsubscribeCustomerById($customerId); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php index 64d0f6e142c73..1ddd831439026 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php @@ -1,6 +1,6 @@ getRequest()->getParam('file')) { - // download file - $file = $this->urlDecoder->decode( - $this->getRequest()->getParam('file') - ); - } elseif ($this->getRequest()->getParam('image')) { - // show plain image - $file = $this->urlDecoder->decode( - $this->getRequest()->getParam('image') - ); - $plain = true; - } else { - throw new NotFoundException(__('Page not found.')); - } + list($file, $plain) = $this->getFileParams(); /** @var \Magento\Framework\Filesystem $filesystem */ - $filesystem = $this->_objectManager->get('Magento\Framework\Filesystem'); + $filesystem = $this->_objectManager->get(\Magento\Framework\Filesystem::class); $directory = $filesystem->getDirectoryRead(DirectoryList::MEDIA); $fileName = CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER . '/' . ltrim($file, '/'); $path = $directory->getAbsolutePath($fileName); - if (!$directory->isFile($fileName) - && !$this->_objectManager->get('Magento\MediaStorage\Helper\File\Storage')->processStorageFile($path) + if (mb_strpos($path, '..') !== false + || (!$directory->isFile($fileName) + && !$this->_objectManager->get( + \Magento\MediaStorage\Helper\File\Storage::class + )->processStorageFile($path)) ) { throw new NotFoundException(__('Page not found.')); } @@ -198,4 +186,29 @@ public function execute() ); } } + + /** + * Get parameters from request. + * + * @return array + * @throws NotFoundException + */ + private function getFileParams() + { + if ($this->getRequest()->getParam('file')) { + // download file + $file = $this->urlDecoder->decode( + $this->getRequest()->getParam('file') + ); + return [$file, false]; + } elseif ($this->getRequest()->getParam('image')) { + // show plain image + $file = $this->urlDecoder->decode( + $this->getRequest()->getParam('image') + ); + return [$file, true]; + } else { + throw new NotFoundException(__('Page not found.')); + } + } } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php index fee33bfcd5e45..48b0ddf8ad09d 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php @@ -1,6 +1,6 @@ resultJsonFactory->create(); + $resultJson->setHeader('Cache-Control', 'max-age=0, must-revalidate, no-cache, no-store', true); + $resultJson->setHeader('Pragma', 'no-cache', true); try { $sectionNames = $this->getRequest()->getParam('sections'); $sectionNames = $sectionNames ? array_unique(\explode(',', $sectionNames)) : null; diff --git a/app/code/Magento/Customer/CustomerData/Customer.php b/app/code/Magento/Customer/CustomerData/Customer.php index 9022e3c7c123e..35fcb63ceb157 100644 --- a/app/code/Magento/Customer/CustomerData/Customer.php +++ b/app/code/Magento/Customer/CustomerData/Customer.php @@ -1,6 +1,6 @@ customerFactory = $customerFactory; $this->eventManager = $eventManager; @@ -369,6 +393,12 @@ public function __construct( $this->objectFactory = $objectFactory; $this->extensibleDataObjectConverter = $extensibleDataObjectConverter; $this->dateTimeFactory = $dateTimeFactory ?: ObjectManager::getInstance()->get(DateTimeFactory::class); + $this->sessionManager = $sessionManager + ?: ObjectManager::getInstance()->get(SessionManagerInterface::class); + $this->saveHandler = $saveHandler + ?: ObjectManager::getInstance()->get(SaveHandlerInterface::class); + $this->visitorCollectionFactory = $visitorCollectionFactory + ?: ObjectManager::getInstance()->get(CollectionFactory::class); } /** @@ -523,7 +553,8 @@ public function initiatePasswordReset($email, $template, $websiteId = null) default: throw new InputException( __( - 'Invalid value of "%value" provided for the %fieldName field. Possible values are %template1 or %template2.', + 'Invalid value of "%value" provided for the %fieldName field. ' . + 'Possible values are %template1 or %template2.', [ 'value' => $template, 'fieldName' => 'template', @@ -555,7 +586,10 @@ public function resetPassword($email, $resetToken, $newPassword) $customerSecure->setRpToken(null); $customerSecure->setRpTokenCreatedAt(null); $customerSecure->setPasswordHash($this->createPasswordHash($newPassword)); + $this->sessionManager->destroy(); + $this->destroyCustomerSessions($customer->getId()); $this->customerRepository->save($customer); + return true; } @@ -842,7 +876,9 @@ private function changePasswordForCustomer($customer, $currentPassword, $newPass $customerSecure->setRpTokenCreatedAt(null); $this->checkPasswordStrength($newPassword); $customerSecure->setPasswordHash($this->createPasswordHash($newPassword)); + $this->destroyCustomerSessions($customer->getId()); $this->customerRepository->save($customer); + return true; } @@ -1102,11 +1138,13 @@ protected function sendEmailTemplate( $email = $customer->getEmail(); } - $transport = $this->transportBuilder->setTemplateIdentifier($templateId)->setTemplateOptions( - ['area' => Area::AREA_FRONTEND, 'store' => $storeId] - )->setTemplateVars($templateParams)->setFrom( - $this->scopeConfig->getValue($sender, ScopeInterface::SCOPE_STORE, $storeId) - )->addTo($email, $this->customerViewHelper->getCustomerName($customer))->getTransport(); + $transport = $this->transportBuilder->setTemplateIdentifier($templateId) + ->setTemplateOptions(['area' => Area::AREA_FRONTEND, 'store' => $storeId]) + ->setTemplateVars($templateParams) + ->setScopeId($storeId) + ->setFrom($this->scopeConfig->getValue($sender, ScopeInterface::SCOPE_STORE, $storeId)) + ->addTo($email, $this->customerViewHelper->getCustomerName($customer)) + ->getTransport(); $transport->sendMessage(); @@ -1299,7 +1337,7 @@ protected function getFullCustomerObject($customer) // object passed for events $mergedCustomerData = $this->customerRegistry->retrieveSecureData($customer->getId()); $customerData = - $this->dataProcessor->buildOutputDataArray($customer, '\Magento\Customer\Api\Data\CustomerInterface'); + $this->dataProcessor->buildOutputDataArray($customer, \Magento\Customer\Api\Data\CustomerInterface::class); $mergedCustomerData->addData($customerData); $mergedCustomerData->setData('name', $this->customerViewHelper->getCustomerName($customer)); return $mergedCustomerData; @@ -1332,4 +1370,35 @@ private function getEmailNotification() return $this->emailNotification; } } + + /** + * Destroy all active customer sessions by customer id (current session will not be destroyed). + * Customer sessions which should be deleted are collecting from the "customer_visitor" table considering + * configured session lifetime. + * + * @param string|int $customerId + * @return void + */ + private function destroyCustomerSessions($customerId) + { + $sessionLifetime = $this->scopeConfig->getValue( + \Magento\Framework\Session\Config::XML_PATH_COOKIE_LIFETIME, + \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ); + $dateTime = $this->dateTimeFactory->create(); + $activeSessionsTime = $dateTime->setTimestamp($dateTime->getTimestamp() - $sessionLifetime) + ->format(DateTime::DATETIME_PHP_FORMAT); + /** @var \Magento\Customer\Model\ResourceModel\Visitor\Collection $visitorCollection */ + $visitorCollection = $this->visitorCollectionFactory->create(); + $visitorCollection->addFieldToFilter('customer_id', $customerId); + $visitorCollection->addFieldToFilter('last_visit_at', ['from' => $activeSessionsTime]); + $visitorCollection->addFieldToFilter('session_id', ['neq' => $this->sessionManager->getSessionId()]); + /** @var \Magento\Customer\Model\Visitor $visitor */ + foreach ($visitorCollection->getItems() as $visitor) { + $sessionId = $visitor->getSessionId(); + $this->sessionManager->start(); + $this->saveHandler->destroy($sessionId); + $this->sessionManager->writeClose(); + } + } } diff --git a/app/code/Magento/Customer/Model/Address.php b/app/code/Magento/Customer/Model/Address.php index f012edb6700d4..3b6f2f9a59610 100644 --- a/app/code/Magento/Customer/Model/Address.php +++ b/app/code/Magento/Customer/Model/Address.php @@ -1,6 +1,6 @@ _implodeArrayField($key); - } elseif (is_array($value) && !empty($value) && $this->isAddressMultilineAttribute($key)) { + } elseif (is_array($value) && $this->isAddressMultilineAttribute($key)) { $value = $this->_implodeArrayValues($value); } return parent::setData($key, $value); @@ -303,7 +303,11 @@ protected function _implodeArrayField(array $data) */ protected function _implodeArrayValues($value) { - if (is_array($value) && count($value)) { + if (is_array($value)) { + if (!count($value)) { + return ''; + } + $isScalar = false; foreach ($value as $val) { if (is_scalar($val)) { diff --git a/app/code/Magento/Customer/Model/Address/AddressModelInterface.php b/app/code/Magento/Customer/Model/Address/AddressModelInterface.php index f930c4c746aab..11a3f1ddf1fc0 100644 --- a/app/code/Magento/Customer/Model/Address/AddressModelInterface.php +++ b/app/code/Magento/Customer/Model/Address/AddressModelInterface.php @@ -1,6 +1,6 @@ urlBuilder = $urlBuilder; $this->storeManager = $storeManager; $this->scopeConfig = $scopeConfig; + $this->customerUrl = $customerUrl ?: ObjectManager::getInstance() + ->get(Url::class); } /** @@ -78,7 +89,7 @@ protected function isAutocompleteEnabled() */ protected function getLoginUrl() { - return $this->urlBuilder->getUrl(Url::ROUTE_ACCOUNT_LOGIN); + return $this->customerUrl->getLoginUrl(); } /** diff --git a/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php b/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php index e91204868a0ff..26405b7e6fc71 100644 --- a/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php +++ b/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php @@ -1,6 +1,6 @@ \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $storeId] )->setTemplateVars( $templateParams + )->setScopeId( + $storeId )->setFrom( $this->_scopeConfig->getValue($sender, ScopeInterface::SCOPE_STORE, $storeId) )->addTo( diff --git a/app/code/Magento/Customer/Model/Customer/Attribute/Backend/Billing.php b/app/code/Magento/Customer/Model/Customer/Attribute/Backend/Billing.php index c9fba742794ad..8aefd506194fc 100644 --- a/app/code/Magento/Customer/Model/Customer/Attribute/Backend/Billing.php +++ b/app/code/Magento/Customer/Model/Customer/Attribute/Backend/Billing.php @@ -1,6 +1,6 @@ eavValidationRules = $eavValidationRules; @@ -164,6 +169,10 @@ public function __construct( $this->meta['address']['children'] = $this->getAttributesMeta( $this->eavConfig->getEntityType('customer_address') ); + if (null === $fileProcessorFactory) { + $fileProcessorFactory = ObjectManager::getInstance()->get(FileProcessorFactory::class); + } + $this->fileProcessorFactory = $fileProcessorFactory; } /** @@ -273,7 +282,7 @@ private function getFileUploaderData( : ''; /** @var FileProcessor $fileProcessor */ - $fileProcessor = $this->getFileProcessorFactory()->create([ + $fileProcessor = $this->fileProcessorFactory->create([ 'entityTypeCode' => $entityType->getEntityTypeCode(), ]); @@ -534,20 +543,4 @@ protected function prepareAddressData($addressId, array &$addresses, array $cust $addresses[$addressId]['street'] = explode("\n", $addresses[$addressId]['street']); } } - - /** - * Get FileProcessorFactory instance - * - * @return FileProcessorFactory - * - * @deprecated - */ - private function getFileProcessorFactory() - { - if ($this->fileProcessorFactory === null) { - $this->fileProcessorFactory = ObjectManager::getInstance() - ->get(\Magento\Customer\Model\FileProcessorFactory::class); - } - return $this->fileProcessorFactory; - } } diff --git a/app/code/Magento/Customer/Model/Customer/Mapper.php b/app/code/Magento/Customer/Model/Customer/Mapper.php index feb6d00b91d48..9575048e1dcde 100644 --- a/app/code/Magento/Customer/Model/Customer/Mapper.php +++ b/app/code/Magento/Customer/Model/Customer/Mapper.php @@ -1,6 +1,6 @@ transportBuilder->setTemplateIdentifier($templateId) ->setTemplateOptions(['area' => 'frontend', 'store' => $storeId]) ->setTemplateVars($templateParams) + ->setScopeId($storeId) ->setFrom($this->scopeConfig->getValue($sender, 'store', $storeId)) ->addTo($email, $this->customerViewHelper->getCustomerName($customer)) ->getTransport(); diff --git a/app/code/Magento/Customer/Model/EmailNotificationInterface.php b/app/code/Magento/Customer/Model/EmailNotificationInterface.php index 7a984eec0f7bf..c18225bc52866 100644 --- a/app/code/Magento/Customer/Model/EmailNotificationInterface.php +++ b/app/code/Magento/Customer/Model/EmailNotificationInterface.php @@ -1,6 +1,6 @@ urlEncoder = $urlEncoder; $this->_fileValidator = $fileValidator; $this->_fileSystem = $fileSystem; $this->uploaderFactory = $uploaderFactory; + if (null === $fileProcessorFactory) { + $fileProcessorFactory = ObjectManager::getInstance()->get(FileProcessorFactory::class); + } + $this->fileProcessorFactory = $fileProcessorFactory; } /** @@ -386,7 +393,7 @@ public function outputValue($format = \Magento\Customer\Model\Metadata\ElementFa protected function getFileProcessor() { if ($this->fileProcessor === null) { - $this->fileProcessor = $this->getFileProcessorFactory()->create([ + $this->fileProcessor = $this->fileProcessorFactory->create([ 'entityTypeCode' => $this->_entityTypeCode, ]); } @@ -402,10 +409,6 @@ protected function getFileProcessor() */ protected function getFileProcessorFactory() { - if ($this->fileProcessorFactory === null) { - $this->fileProcessorFactory = ObjectManager::getInstance() - ->get('Magento\Customer\Model\FileProcessorFactory'); - } return $this->fileProcessorFactory; } } diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Hidden.php b/app/code/Magento/Customer/Model/Metadata/Form/Hidden.php index 9d02ff295be8f..05330aa916277 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Hidden.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Hidden.php @@ -2,7 +2,7 @@ /** * Form Element Hidden Data Model * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Customer\Model\Metadata\Form; diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Image.php b/app/code/Magento/Customer/Model/Metadata/Form/Image.php index a1cad8464e11b..b9f850a4cd76d 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Image.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Image.php @@ -2,7 +2,7 @@ /** * Form Element Image Data Model * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Customer\Model\Metadata\Form; @@ -10,18 +10,77 @@ use Magento\Customer\Api\AddressMetadataInterface; use Magento\Customer\Api\CustomerMetadataInterface; use Magento\Customer\Model\FileProcessor; +use Magento\Customer\Model\FileProcessorFactory; use Magento\Framework\Api\ArrayObjectSearch; use Magento\Framework\Api\Data\ImageContentInterface; -use Magento\Framework\Api\Data\ImageContentInterfaceFactory; +use Magento\Framework\Api\Data\ImageContentInterfaceFactory as ImageContentFactory; use Magento\Framework\App\ObjectManager; +use Magento\Framework\File\UploaderFactory; +use Magento\Framework\Filesystem; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class Image extends File { /** - * @var ImageContentInterfaceFactory + * @var ImageContentFactory */ private $imageContentFactory; + /** + * Image constructor. + * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate + * @param \Psr\Log\LoggerInterface $logger + * @param \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute + * @param \Magento\Framework\Locale\ResolverInterface $localeResolver + * @param null $value + * @param string $entityTypeCode + * @param bool $isAjax + * @param \Magento\Framework\Url\EncoderInterface $urlEncoder + * @param \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $fileValidator + * @param Filesystem $fileSystem + * @param UploaderFactory $uploaderFactory + * @param FileProcessorFactory|null $fileProcessorFactory + * @param ImageContentFactory|null $imageContentFactory + * @throws \RuntimeException + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function __construct( + \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, + \Psr\Log\LoggerInterface $logger, + \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute, + \Magento\Framework\Locale\ResolverInterface $localeResolver, + $value, + $entityTypeCode, + $isAjax, + \Magento\Framework\Url\EncoderInterface $urlEncoder, + \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $fileValidator, + Filesystem $fileSystem, + UploaderFactory $uploaderFactory, + FileProcessorFactory $fileProcessorFactory = null, + ImageContentFactory $imageContentFactory = null + ) { + parent::__construct( + $localeDate, + $logger, + $attribute, + $localeResolver, + $value, + $entityTypeCode, + $isAjax, + $urlEncoder, + $fileValidator, + $fileSystem, + $uploaderFactory, + $fileProcessorFactory + ); + if (null === $imageContentFactory) { + $imageContentFactory = ObjectManager::getInstance()->get(ImageContentFactory::class); + } + $this->imageContentFactory = $imageContentFactory; + } + /** * Validate file by attribute validate rules * Return array of errors @@ -134,37 +193,22 @@ protected function processCustomerValue(array $value) { $temporaryFile = FileProcessor::TMP_DIR . '/' . ltrim($value['file'], '/'); - if ($this->getFileProcessor()->isExist($temporaryFile)) { - $base64EncodedData = $this->getFileProcessor()->getBase64EncodedData($temporaryFile); + $fileProcessor = $this->fileProcessorFactory->create(); + if ($fileProcessor->isExist($temporaryFile)) { + $base64EncodedData = $fileProcessor->getBase64EncodedData($temporaryFile); /** @var ImageContentInterface $imageContentDataObject */ - $imageContentDataObject = $this->getImageContentFactory()->create() + $imageContentDataObject = $this->imageContentFactory->create() ->setName($value['name']) ->setBase64EncodedData($base64EncodedData) ->setType($value['type']); // Remove temporary file - $this->getFileProcessor()->removeUploadedFile($temporaryFile); + $fileProcessor->removeUploadedFile($temporaryFile); return $imageContentDataObject; } return $this->_value; } - - /** - * Get ImageContentInterfaceFactory instance - * - * @return ImageContentInterfaceFactory - * - * @deprecated - */ - private function getImageContentFactory() - { - if ($this->imageContentFactory === null) { - $this->imageContentFactory = ObjectManager::getInstance() - ->get('Magento\Framework\Api\Data\ImageContentInterfaceFactory'); - } - return $this->imageContentFactory; - } } diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Multiline.php b/app/code/Magento/Customer/Model/Metadata/Form/Multiline.php index d9d7c1e71e6f1..643a73302825d 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Multiline.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Multiline.php @@ -2,7 +2,7 @@ /** * Form Element Multiline Data Model * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Customer\Model\Metadata\Form; diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Multiselect.php b/app/code/Magento/Customer/Model/Metadata/Form/Multiselect.php index cfa864e8fc679..117ef55b86914 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Multiselect.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Multiselect.php @@ -2,7 +2,7 @@ /** * Form Element Multiselect Data Model * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Customer\Model\Metadata\Form; diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Postcode.php b/app/code/Magento/Customer/Model/Metadata/Form/Postcode.php index 18e32e8992669..6f751558d29c9 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Postcode.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Postcode.php @@ -1,6 +1,6 @@ session = $session; + $this->dataFormKey = $dataFormKey; + } + + /** + * @param FlushFormKey $subject + * @param callable $proceed + * @param Observer $observer + * @return void + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundExecute(FlushFormKey $subject, callable $proceed, Observer $observer) + { + $currentFormKey = $this->dataFormKey->getFormKey(); + $proceed($observer); + $beforeParams = $this->session->getBeforeRequestParams(); + if ($beforeParams['form_key'] == $currentFormKey) { + $beforeParams['form_key'] = $this->dataFormKey->getFormKey(); + $this->session->setBeforeRequestParams($beforeParams); + } + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/CustomerNotification.php b/app/code/Magento/Customer/Model/Plugin/CustomerNotification.php index c064c07086db0..a9d685a0da57a 100644 --- a/app/code/Magento/Customer/Model/Plugin/CustomerNotification.php +++ b/app/code/Magento/Customer/Model/Plugin/CustomerNotification.php @@ -1,6 +1,6 @@ addressFactory = $addressFactory; $this->addressRegistry = $addressRegistry; $this->customerRegistry = $customerRegistry; - $this->addressResource = $addressResourceModel; + $this->addressResourceModel = $addressResourceModel; $this->directoryData = $directoryData; $this->addressSearchResultsFactory = $addressSearchResultsFactory; $this->addressCollectionFactory = $addressCollectionFactory; @@ -219,7 +219,7 @@ public function delete(\Magento\Customer\Api\Data\AddressInterface $address) $address = $this->addressRegistry->retrieve($addressId); $customerModel = $this->customerRegistry->retrieve($address->getCustomerId()); $customerModel->getAddressesCollection()->clear(); - $this->addressResource->delete($address); + $this->addressResourceModel->delete($address); $this->addressRegistry->remove($addressId); return true; } @@ -237,7 +237,7 @@ public function deleteById($addressId) $address = $this->addressRegistry->retrieve($addressId); $customerModel = $this->customerRegistry->retrieve($address->getCustomerId()); $customerModel->getAddressesCollection()->clear(); - $this->addressResource->delete($address); + $this->addressResourceModel->delete($address); $this->addressRegistry->remove($addressId); return true; } @@ -285,24 +285,53 @@ private function _validate(CustomerAddressModel $customerAddressModel) $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'postcode'])); } - if (!\Zend_Validate::is($customerAddressModel->getCountryId(), 'NotEmpty')) { + $countryId = (string)$customerAddressModel->getCountryId(); + if (!\Zend_Validate::is($countryId, 'NotEmpty')) { $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'countryId'])); - } + } else { + //Checking if such country exists. + if (!in_array($countryId, $this->directoryData->getCountryCollection()->getAllIds(), true)) { + $exception->addError( + __( + 'Invalid value of "%value" provided for the %fieldName field.', + [ + 'fieldName' => 'countryId', + 'value' => htmlspecialchars($countryId) + ] + ) + ); + } else { + //If country is valid then validating selected region ID. + $countryModel = $customerAddressModel->getCountryModel(); + $regionCollection = $countryModel->getRegionCollection(); + $region = $customerAddressModel->getRegion(); + $regionId = (string)$customerAddressModel->getRegionId(); + $allowedRegions = $regionCollection->getAllIds(); + $isRegionRequired = $this->directoryData->isRegionRequired($countryId); - if ($this->directoryData->isRegionRequired($customerAddressModel->getCountryId())) { - $regionCollection = $customerAddressModel->getCountryModel()->getRegionCollection(); - if (!$regionCollection->count() && empty($customerAddressModel->getRegion())) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'region'])); - } elseif ( - $regionCollection->count() - && !in_array( - $customerAddressModel->getRegionId(), - array_column($regionCollection->getData(), 'region_id') - ) - ) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'regionId'])); + if ($isRegionRequired && empty($allowedRegions) && !\Zend_Validate::is($region, 'NotEmpty')) { + //If region is required for country and country doesn't provide regions list + //region must be provided. + $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'region'])); + } elseif ($isRegionRequired && $allowedRegions && !\Zend_Validate::is($regionId, 'NotEmpty')) { + //If country actually has regions and requires you to + //select one then it must be selected. + $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'regionId'])); + } elseif ($regionId && !in_array($regionId, $allowedRegions, true)) { + //If a region is selected then checking if it exists. + $exception->addError( + __( + 'Invalid value of "%value" provided for the %fieldName field.', + [ + 'fieldName' => 'regionId', + 'value' => htmlspecialchars($regionId) + ] + ) + ); + } } } + return $exception; } } diff --git a/app/code/Magento/Customer/Model/ResourceModel/Attribute.php b/app/code/Magento/Customer/Model/ResourceModel/Attribute.php index 2dfe24a351e45..827aa2f293f3b 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/Attribute.php +++ b/app/code/Magento/Customer/Model/ResourceModel/Attribute.php @@ -1,6 +1,6 @@ setRpTokenCreatedAt(null); } + // Set group id to current stored id if no group id passed. + if (!($prevCustomerData === null) && $prevCustomerData->getGroupId() && $customer->getGroupId() === null) { + $customerModel->setGroupId( + $prevCustomerData->getGroupId() + ); + } + $this->setDefaultBilling($customerArr, $prevCustomerDataArr, $customerModel); $this->setDefaultShipping($customerArr, $prevCustomerDataArr, $customerModel); diff --git a/app/code/Magento/Customer/Model/ResourceModel/Db/VersionControl/AddressSnapshot.php b/app/code/Magento/Customer/Model/ResourceModel/Db/VersionControl/AddressSnapshot.php index 192a9ec4fe9b0..8c8b11a3b5df9 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/Db/VersionControl/AddressSnapshot.php +++ b/app/code/Magento/Customer/Model/ResourceModel/Db/VersionControl/AddressSnapshot.php @@ -1,6 +1,6 @@ session->getVisitorData()) { $this->setData($this->session->getVisitorData()); + if ($this->getSessionId() != $this->session->getSessionId()) { + $this->setSessionId($this->session->getSessionId()); + } } $this->setLastVisitAt((new \DateTime())->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT)); diff --git a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php index 89cd1758c6462..4bd024f5b5eca 100644 --- a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php +++ b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php @@ -1,6 +1,6 @@ [ 'entity_id' => $customerId, @@ -610,7 +610,7 @@ public function testExecuteWithNewCustomer() { $customerId = 22; $addressId = 11; - $subscription = 'false'; + $subscription = '0'; $postValue = [ 'customer' => [ 'coolness' => false, @@ -879,7 +879,7 @@ public function testExecuteWithNewCustomer() */ public function testExecuteWithNewCustomerAndValidationException() { - $subscription = 'false'; + $subscription = '0'; $postValue = [ 'customer' => [ 'coolness' => false, @@ -1022,7 +1022,7 @@ public function testExecuteWithNewCustomerAndValidationException() */ public function testExecuteWithNewCustomerAndLocalizedException() { - $subscription = 'false'; + $subscription = '0'; $postValue = [ 'customer' => [ 'coolness' => false, @@ -1165,7 +1165,7 @@ public function testExecuteWithNewCustomerAndLocalizedException() */ public function testExecuteWithNewCustomerAndException() { - $subscription = 'false'; + $subscription = '0'; $postValue = [ 'customer' => [ 'coolness' => false, diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php index 6c971a6638152..d7cfef851ec23 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php @@ -1,6 +1,6 @@ objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface', [], [], '', false); - $this->responseMock = $this->getMock('Magento\Framework\App\ResponseInterface', [], [], '', false); + $this->requestMock = $this->getMock(\Magento\Framework\App\RequestInterface::class, [], [], '', false); + $this->responseMock = $this->getMock(\Magento\Framework\App\ResponseInterface::class, [], [], '', false); $this->directoryMock = $this->getMock( - 'Magento\Framework\Filesystem\Directory\ReadInterface', + \Magento\Framework\Filesystem\Directory\ReadInterface::class, [], [], '', false ); - $this->fileSystemMock = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $this->storage = $this->getMock('Magento\MediaStorage\Helper\File\Storage', [], [], '', false); - $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface', [], [], '', false); + $this->fileSystemMock = $this->getMock(\Magento\Framework\Filesystem::class, [], [], '', false); + $this->storage = $this->getMock(\Magento\MediaStorage\Helper\File\Storage::class, [], [], '', false); + $this->objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class, [], [], '', false); - $this->contextMock = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); + $this->contextMock = $this->getMock(\Magento\Backend\App\Action\Context::class, [], [], '', false); $this->contextMock->expects($this->any())->method('getRequest')->willReturn($this->requestMock); $this->contextMock->expects($this->any())->method('getResponse')->willReturn($this->responseMock); $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); - $this->urlDecoderMock = $this->getMock('Magento\Framework\Url\DecoderInterface', [], [], '', false); - $this->resultRawMock = $this->getMock('Magento\Framework\Controller\Result\Raw', [], [], '', false); + $this->urlDecoderMock = $this->getMock(\Magento\Framework\Url\DecoderInterface::class, [], [], '', false); + $this->resultRawMock = $this->getMock(\Magento\Framework\Controller\Result\Raw::class, [], [], '', false); $this->resultRawFactoryMock = $this->getMock( - 'Magento\Framework\Controller\Result\RawFactory', + \Magento\Framework\Controller\Result\RawFactory::class, ['create'], [], '', @@ -106,7 +106,50 @@ protected function setUp() public function testExecuteNoParamsShouldThrowException() { /** @var \Magento\Customer\Controller\Adminhtml\Index\Viewfile $controller */ - $controller = $this->objectManager->getObject('Magento\Customer\Controller\Adminhtml\Index\Viewfile'); + $controller = $this->objectManager->getObject(\Magento\Customer\Controller\Adminhtml\Index\Viewfile::class); + $controller->execute(); + } + + /** + * @expectedException \Magento\Framework\Exception\NotFoundException + * @expectedExceptionMessage Page not found. + */ + public function testExecuteInvaliFile() + { + $file = '../../../app/etc/env.php'; + $decodedFile = base64_encode($file); + $fileName = 'customer/' . $file; + $path = 'path'; + + $this->requestMock->expects($this->atLeastOnce())->method('getParam')->with('file')->willReturn($decodedFile); + + $this->directoryMock->expects($this->once())->method('getAbsolutePath')->with($fileName)->willReturn($path); + + $this->fileSystemMock->expects($this->once())->method('getDirectoryRead') + ->with(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA) + ->willReturn($this->directoryMock); + + $this->storage->expects($this->once())->method('processStorageFile')->with($path)->willReturn(false); + + $this->objectManagerMock->expects($this->any())->method('get') + ->willReturnMap( + [ + [\Magento\Framework\Filesystem::class, $this->fileSystemMock], + [\Magento\MediaStorage\Helper\File\Storage::class, $this->storage], + ] + ); + + $this->urlDecoderMock->expects($this->once())->method('decode')->with($decodedFile)->willReturn($file); + $fileFactoryMock = $this->getMock(\Magento\Framework\App\Response\Http\FileFactory::class, [], [], '', false); + + $controller = $this->objectManager->getObject( + \Magento\Customer\Controller\Adminhtml\Index\Viewfile::class, + [ + 'context' => $this->contextMock, + 'urlDecoder' => $this->urlDecoderMock, + 'fileFactory' => $fileFactoryMock, + ] + ); $controller->execute(); } @@ -130,15 +173,15 @@ public function testExecuteParamFile() $this->objectManagerMock->expects($this->any())->method('get') ->willReturnMap( [ - ['Magento\Framework\Filesystem', $this->fileSystemMock], - ['Magento\MediaStorage\Helper\File\Storage', $this->storage] + [\Magento\Framework\Filesystem::class, $this->fileSystemMock], + [\Magento\MediaStorage\Helper\File\Storage::class, $this->storage], ] ); $this->urlDecoderMock->expects($this->once())->method('decode')->with($decodedFile)->willReturn($file); - $fileResponse = $this->getMock('Magento\Framework\App\ResponseInterface', [], [], '', false); - $fileFactoryMock = $this->getMock('Magento\Framework\App\Response\Http\FileFactory', [], [], '', false); + $fileResponse = $this->getMock(\Magento\Framework\App\ResponseInterface::class, [], [], '', false); + $fileFactoryMock = $this->getMock(\Magento\Framework\App\Response\Http\FileFactory::class, [], [], '', false); $fileFactoryMock->expects($this->once())->method('create')->with( $path, ['type' => 'filename', 'value' => $fileName], @@ -147,11 +190,11 @@ public function testExecuteParamFile() /** @var \Magento\Customer\Controller\Adminhtml\Index\Viewfile $controller */ $controller = $this->objectManager->getObject( - 'Magento\Customer\Controller\Adminhtml\Index\Viewfile', + \Magento\Customer\Controller\Adminhtml\Index\Viewfile::class, [ 'context' => $this->contextMock, 'urlDecoder' => $this->urlDecoderMock, - 'fileFactory' => $fileFactoryMock + 'fileFactory' => $fileFactoryMock, ] ); $controller->execute(); @@ -180,8 +223,8 @@ public function testExecuteGetParamImage() $this->objectManagerMock->expects($this->any())->method('get') ->willReturnMap( [ - ['Magento\Framework\Filesystem', $this->fileSystemMock], - ['Magento\MediaStorage\Helper\File\Storage', $this->storage] + [\Magento\Framework\Filesystem::class, $this->fileSystemMock], + [\Magento\MediaStorage\Helper\File\Storage::class, $this->storage], ] ); @@ -199,7 +242,7 @@ public function testExecuteGetParamImage() ); $this->resultRawFactoryMock = $this->getMock( - 'Magento\Framework\Controller\Result\RawFactory', + \Magento\Framework\Controller\Result\RawFactory::class, ['create'], [], '', @@ -209,11 +252,11 @@ public function testExecuteGetParamImage() /** @var \Magento\Customer\Controller\Adminhtml\Index\Viewfile $controller */ $controller = $this->objectManager->getObject( - 'Magento\Customer\Controller\Adminhtml\Index\Viewfile', + \Magento\Customer\Controller\Adminhtml\Index\Viewfile::class, [ 'context' => $this->contextMock, 'urlDecoder' => $this->urlDecoderMock, - 'resultRawFactory' => $this->resultRawFactoryMock + 'resultRawFactory' => $this->resultRawFactoryMock, ] ); $this->assertSame($this->resultRawMock, $controller->execute()); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Locks/UnlockTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Locks/UnlockTest.php index 1629b620328de..6726218cdff20 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Locks/UnlockTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Locks/UnlockTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php b/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php index 4349794d041fc..739c58f90548a 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php @@ -1,6 +1,6 @@ customerFactory = $this->getMock('Magento\Customer\Model\CustomerFactory', ['create'], [], '', false); - $this->manager = $this->getMock('Magento\Framework\Event\ManagerInterface'); - $this->store = $this->getMockBuilder('Magento\Store\Model\Store') + $this->customerFactory = $this->getMock( + \Magento\Customer\Model\CustomerFactory::class, + ['create'], + [], + '', + false + ); + $this->manager = $this->getMock(\Magento\Framework\Event\ManagerInterface::class); + $this->store = $this->getMockBuilder(\Magento\Store\Model\Store::class) ->disableOriginalConstructor() ->getMock(); - $this->storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); - $this->random = $this->getMock('Magento\Framework\Math\Random'); - $this->validator = $this->getMock('Magento\Customer\Model\Metadata\Validator', [], [], '', false); + $this->storeManager = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class); + $this->random = $this->getMock(\Magento\Framework\Math\Random::class); + $this->validator = $this->getMock(\Magento\Customer\Model\Metadata\Validator::class, [], [], '', false); $this->validationResultsInterfaceFactory = $this->getMock( - 'Magento\Customer\Api\Data\ValidationResultsInterfaceFactory', + \Magento\Customer\Api\Data\ValidationResultsInterfaceFactory::class, [], [], '', false ); - $this->addressRepository = $this->getMock('Magento\Customer\Api\AddressRepositoryInterface'); - $this->customerMetadata = $this->getMock('Magento\Customer\Api\CustomerMetadataInterface'); - $this->customerRegistry = $this->getMock('Magento\Customer\Model\CustomerRegistry', [], [], '', false); - $this->logger = $this->getMock('Psr\Log\LoggerInterface'); - $this->encryptor = $this->getMock('Magento\Framework\Encryption\EncryptorInterface'); - $this->share = $this->getMock('Magento\Customer\Model\Config\Share', [], [], '', false); - $this->string = $this->getMock('Magento\Framework\Stdlib\StringUtils'); - $this->customerRepository = $this->getMock('Magento\Customer\Api\CustomerRepositoryInterface'); - $this->scopeConfig = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface') + $this->addressRepository = $this->getMock(\Magento\Customer\Api\AddressRepositoryInterface::class); + $this->customerMetadata = $this->getMock(\Magento\Customer\Api\CustomerMetadataInterface::class); + $this->customerRegistry = $this->getMock(\Magento\Customer\Model\CustomerRegistry::class, [], [], '', false); + $this->logger = $this->getMock(\Psr\Log\LoggerInterface::class); + $this->encryptor = $this->getMockBuilder(\Magento\Framework\Encryption\EncryptorInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->share = $this->getMock(\Magento\Customer\Model\Config\Share::class, [], [], '', false); + $this->string = $this->getMock(\Magento\Framework\Stdlib\StringUtils::class); + $this->customerRepository = $this->getMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); + $this->scopeConfig = $this->getMockBuilder(\Magento\Framework\App\Config\ScopeConfigInterface::class) ->disableOriginalConstructor() ->getMock(); $this->transportBuilder = $this->getMock( - 'Magento\Framework\Mail\Template\TransportBuilder', + \Magento\Framework\Mail\Template\TransportBuilder::class, [], [], '', false ); $this->dataObjectProcessor = $this->getMock( - 'Magento\Framework\Reflection\DataObjectProcessor', + \Magento\Framework\Reflection\DataObjectProcessor::class, [], [], '', false ); - $this->registry = $this->getMock('Magento\Framework\Registry'); - $this->customerViewHelper = $this->getMock('Magento\Customer\Helper\View', [], [], '', false); - $this->dateTime = $this->getMock('Magento\Framework\Stdlib\DateTime'); - $this->customer = $this->getMock('Magento\Customer\Model\Customer', [], [], '', false); - $this->objectFactory = $this->getMock('Magento\Framework\DataObjectFactory', [], [], '', false); + $this->registry = $this->getMock(\Magento\Framework\Registry::class); + $this->customerViewHelper = $this->getMock(\Magento\Customer\Helper\View::class, [], [], '', false); + $this->dateTime = $this->getMock(\Magento\Framework\Stdlib\DateTime::class); + $this->customer = $this->getMock(\Magento\Customer\Model\Customer::class, [], [], '', false); + $this->objectFactory = $this->getMock(\Magento\Framework\DataObjectFactory::class, [], [], '', false); $this->extensibleDataObjectConverter = $this->getMock( - 'Magento\Framework\Api\ExtensibleDataObjectConverter', + \Magento\Framework\Api\ExtensibleDataObjectConverter::class, [], [], '', @@ -184,7 +207,21 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->customerSecure = $this->getMockBuilder('Magento\Customer\Model\Data\CustomerSecure') + $this->customerSecure = $this->getMockBuilder(\Magento\Customer\Model\Data\CustomerSecure::class) + ->setMethods(['setRpToken', 'addData', 'setRpTokenCreatedAt', 'setData', 'getPasswordHash']) + ->disableOriginalConstructor() + ->getMock(); + + $this->visitorCollectionFactory = $this->getMockBuilder( + \Magento\Customer\Model\ResourceModel\Visitor\CollectionFactory::class + ) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->sessionManager = $this->getMockBuilder(\Magento\Framework\Session\SessionManagerInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $this->saveHandler = $this->getMockBuilder(\Magento\Framework\Session\SaveHandlerInterface::class) ->disableOriginalConstructor() ->getMock(); @@ -192,7 +229,7 @@ protected function setUp() $this->objectManagerHelper = new ObjectManagerHelper($this); $this->accountManagement = $this->objectManagerHelper->getObject( - 'Magento\Customer\Model\AccountManagement', + \Magento\Customer\Model\AccountManagement::class, [ 'customerFactory' => $this->customerFactory, 'eventManager' => $this->manager, @@ -218,6 +255,9 @@ protected function setUp() 'objectFactory' => $this->objectFactory, 'extensibleDataObjectConverter' => $this->extensibleDataObjectConverter, 'dateTimeFactory' => $this->dateTimeFactory, + 'sessionManager' => $this->sessionManager, + 'saveHandler' => $this->saveHandler, + 'visitorCollectionFactory' => $this->visitorCollectionFactory, ] ); $reflection = new \ReflectionClass(get_class($this->accountManagement)); @@ -240,11 +280,11 @@ public function testCreateAccountWithPasswordHashWithExistingCustomer() $customerEmail = 'email@email.com'; $hash = '4nj54lkj5jfi03j49f8bgujfgsd'; - $website = $this->getMockBuilder('Magento\Store\Model\Website')->disableOriginalConstructor()->getMock(); + $website = $this->getMockBuilder(\Magento\Store\Model\Website::class)->disableOriginalConstructor()->getMock(); $website->expects($this->once()) ->method('getStoreIds') ->willReturn([1, 2, 3]); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $customer->expects($this->once()) ->method('getId') ->willReturn($customerId); @@ -286,21 +326,21 @@ public function testCreateAccountWithPasswordHashWithCustomerWithoutStoreId() $customerEmail = 'email@email.com'; $hash = '4nj54lkj5jfi03j49f8bgujfgsd'; - $address = $this->getMockBuilder('Magento\Customer\Api\Data\AddressInterface') + $address = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterface::class) ->disableOriginalConstructor() ->getMock(); - $store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); + $store = $this->getMockBuilder(\Magento\Store\Model\Store::class)->disableOriginalConstructor()->getMock(); $store->expects($this->once()) ->method('getId') ->willReturn($defaultStoreId); - $website = $this->getMockBuilder('Magento\Store\Model\Website')->disableOriginalConstructor()->getMock(); + $website = $this->getMockBuilder(\Magento\Store\Model\Website::class)->disableOriginalConstructor()->getMock(); $website->expects($this->once()) ->method('getStoreIds') ->willReturn([1, 2, 3]); $website->expects($this->once()) ->method('getDefaultStore') ->willReturn($store); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $customer->expects($this->atLeastOnce()) ->method('getId') ->willReturn($customerId); @@ -362,21 +402,21 @@ public function testCreateAccountWithPasswordHashWithLocalizedException() $customerEmail = 'email@email.com'; $hash = '4nj54lkj5jfi03j49f8bgujfgsd'; - $address = $this->getMockBuilder('Magento\Customer\Api\Data\AddressInterface') + $address = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterface::class) ->disableOriginalConstructor() ->getMock(); - $store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); + $store = $this->getMockBuilder(\Magento\Store\Model\Store::class)->disableOriginalConstructor()->getMock(); $store->expects($this->once()) ->method('getId') ->willReturn($defaultStoreId); - $website = $this->getMockBuilder('Magento\Store\Model\Website')->disableOriginalConstructor()->getMock(); + $website = $this->getMockBuilder(\Magento\Store\Model\Website::class)->disableOriginalConstructor()->getMock(); $website->expects($this->once()) ->method('getStoreIds') ->willReturn([1, 2, 3]); $website->expects($this->once()) ->method('getDefaultStore') ->willReturn($store); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $customer->expects($this->atLeastOnce()) ->method('getId') ->willReturn($customerId); @@ -438,24 +478,24 @@ public function testCreateAccountWithPasswordHashWithAddressException() $customerEmail = 'email@email.com'; $hash = '4nj54lkj5jfi03j49f8bgujfgsd'; - $address = $this->getMockBuilder('Magento\Customer\Api\Data\AddressInterface') + $address = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterface::class) ->disableOriginalConstructor() ->getMock(); $address->expects($this->once()) ->method('setCustomerId') ->with($customerId); - $store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); + $store = $this->getMockBuilder(\Magento\Store\Model\Store::class)->disableOriginalConstructor()->getMock(); $store->expects($this->once()) ->method('getId') ->willReturn($defaultStoreId); - $website = $this->getMockBuilder('Magento\Store\Model\Website')->disableOriginalConstructor()->getMock(); + $website = $this->getMockBuilder(\Magento\Store\Model\Website::class)->disableOriginalConstructor()->getMock(); $website->expects($this->once()) ->method('getStoreIds') ->willReturn([1, 2, 3]); $website->expects($this->once()) ->method('getDefaultStore') ->willReturn($store); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $customer->expects($this->atLeastOnce()) ->method('getId') ->willReturn($customerId); @@ -523,7 +563,7 @@ public function testCreateAccountWithPasswordHashWithNewCustomerAndLocalizedExce $storeName = 'store_name'; $hash = '4nj54lkj5jfi03j49f8bgujfgsd'; - $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + $customerMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) ->getMockForAbstractClass(); $customerMock->expects($this->atLeastOnce()) @@ -544,7 +584,7 @@ public function testCreateAccountWithPasswordHashWithNewCustomerAndLocalizedExce ->with(null) ->willReturnSelf(); - $storeMock = $this->getMockBuilder('Magento\Store\Model\Store') + $storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class) ->disableOriginalConstructor() ->getMock(); @@ -583,24 +623,24 @@ public function testCreateAccountWithoutPassword() $datetime = $this->prepareDateTimeFactory(); - $address = $this->getMockBuilder('Magento\Customer\Api\Data\AddressInterface') + $address = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterface::class) ->disableOriginalConstructor() ->getMock(); $address->expects($this->once()) ->method('setCustomerId') ->with($customerId); - $store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); + $store = $this->getMockBuilder(\Magento\Store\Model\Store::class)->disableOriginalConstructor()->getMock(); $store->expects($this->once()) ->method('getId') ->willReturn($defaultStoreId); - $website = $this->getMockBuilder('Magento\Store\Model\Website')->disableOriginalConstructor()->getMock(); + $website = $this->getMockBuilder(\Magento\Store\Model\Website::class)->disableOriginalConstructor()->getMock(); $website->expects($this->atLeastOnce()) ->method('getStoreIds') ->willReturn([1, 2, 3]); $website->expects($this->once()) ->method('getDefaultStore') ->willReturn($store); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $customer->expects($this->atLeastOnce()) ->method('getId') ->willReturn($customerId); @@ -647,7 +687,7 @@ public function testCreateAccountWithoutPassword() $this->random->expects($this->once()) ->method('getUniqueHash') ->willReturn($newLinkToken); - $customerSecure = $this->getMockBuilder('Magento\Customer\Model\Data\CustomerSecure') + $customerSecure = $this->getMockBuilder(\Magento\Customer\Model\Data\CustomerSecure::class) ->disableOriginalConstructor() ->getMock(); $customerSecure->expects($this->any()) @@ -682,14 +722,14 @@ public function dataProviderCheckPasswordStrength() 'testNumber' => 1, 'password' => 'qwer', 'minPasswordLength' => 5, - 'minCharacterSetsNum' => 1 + 'minCharacterSetsNum' => 1, ], [ 'testNumber' => 2, 'password' => 'wrfewqedf1', 'minPasswordLength' => 5, - 'minCharacterSetsNum' => 3 - ] + 'minCharacterSetsNum' => 3, + ], ]; } @@ -721,7 +761,8 @@ public function testCreateAccountWithPasswordInputException( AccountManagement::XML_PATH_REQUIRED_CHARACTER_CLASSES_NUMBER, 'default', null, - $minCharacterSetsNum], + $minCharacterSetsNum, + ], ] ) ); @@ -733,20 +774,20 @@ public function testCreateAccountWithPasswordInputException( if ($testNumber == 1) { $this->setExpectedException( - '\Magento\Framework\Exception\InputException', + \Magento\Framework\Exception\InputException::class, 'Please enter a password with at least ' . $minPasswordLength . ' characters.' ); } if ($testNumber == 2) { $this->setExpectedException( - '\Magento\Framework\Exception\InputException', + \Magento\Framework\Exception\InputException::class, 'Minimum of different classes of characters in password is ' . $minCharacterSetsNum . '. Classes of characters: Lower Case, Upper Case, Digits, Special Characters.' ); } - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $this->accountManagement->createAccount($customer, $password); } @@ -762,11 +803,11 @@ public function testCreateAccountInputExceptionExtraLongPassword() ->willReturn(iconv_strlen($password, 'UTF-8')); $this->setExpectedException( - '\Magento\Framework\Exception\InputException', + \Magento\Framework\Exception\InputException::class, 'Please enter a password with at most 256 characters.' ); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $this->accountManagement->createAccount($customer, $password); } @@ -815,8 +856,8 @@ public function testCreateAccountWithPassword() AccountManagement::XML_PATH_REGISTER_EMAIL_IDENTITY, ScopeInterface::SCOPE_STORE, 1, - $sender - ] + $sender, + ], ] ); $this->string->expects($this->any()) @@ -827,24 +868,24 @@ public function testCreateAccountWithPassword() ->method('getHash') ->with($password, true) ->willReturn($hash); - $address = $this->getMockBuilder('Magento\Customer\Api\Data\AddressInterface') + $address = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterface::class) ->disableOriginalConstructor() ->getMock(); $address->expects($this->once()) ->method('setCustomerId') ->with($customerId); - $store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); + $store = $this->getMockBuilder(\Magento\Store\Model\Store::class)->disableOriginalConstructor()->getMock(); $store->expects($this->once()) ->method('getId') ->willReturn($defaultStoreId); - $website = $this->getMockBuilder('Magento\Store\Model\Website')->disableOriginalConstructor()->getMock(); + $website = $this->getMockBuilder(\Magento\Store\Model\Website::class)->disableOriginalConstructor()->getMock(); $website->expects($this->atLeastOnce()) ->method('getStoreIds') ->willReturn([1, 2, 3]); $website->expects($this->once()) ->method('getDefaultStore') ->willReturn($store); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $customer->expects($this->atLeastOnce()) ->method('getId') ->willReturn($customerId); @@ -891,7 +932,7 @@ public function testCreateAccountWithPassword() $this->random->expects($this->once()) ->method('getUniqueHash') ->willReturn($newLinkToken); - $customerSecure = $this->getMockBuilder('Magento\Customer\Model\Data\CustomerSecure') + $customerSecure = $this->getMockBuilder(\Magento\Customer\Model\Data\CustomerSecure::class) ->setMethods(['setRpToken', 'setRpTokenCreatedAt', 'getPasswordHash']) ->disableOriginalConstructor() ->getMock(); @@ -928,7 +969,7 @@ public function testSendPasswordReminderEmail() $templateIdentifier = 'Template Identifier'; $sender = 'Sender'; - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) ->getMock(); $customer->expects($this->any()) ->method('getStoreId') @@ -960,7 +1001,7 @@ public function testSendPasswordReminderEmail() $this->dataObjectProcessor->expects($this->once()) ->method('buildOutputDataArray') - ->with($customer, '\Magento\Customer\Api\Data\CustomerInterface') + ->with($customer, \Magento\Customer\Api\Data\CustomerInterface::class) ->willReturn($customerData); $this->customerViewHelper->expects($this->any()) @@ -986,7 +1027,7 @@ public function testSendPasswordReminderEmail() ->with(AccountManagement::XML_PATH_FORGOT_EMAIL_IDENTITY, ScopeInterface::SCOPE_STORE, $customerStoreId) ->willReturn($sender); - $transport = $this->getMockBuilder('Magento\Framework\Mail\TransportInterface') + $transport = $this->getMockBuilder(\Magento\Framework\Mail\TransportInterface::class) ->getMock(); $this->transportBuilder->expects($this->once()) @@ -1001,6 +1042,10 @@ public function testSendPasswordReminderEmail() ->method('setTemplateVars') ->with(['customer' => $this->customerSecure, 'store' => $this->store]) ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('setScopeId') + ->with($this->store->getId()) + ->willReturnSelf(); $this->transportBuilder->expects($this->once()) ->method('setFrom') ->with($sender) @@ -1047,7 +1092,7 @@ protected function prepareInitiatePasswordReset($email, $templateIdentifier, $se ->method('getStore') ->willReturn($this->store); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) ->getMock(); $customer->expects($this->any()) ->method('getEmail') @@ -1101,7 +1146,7 @@ protected function prepareInitiatePasswordReset($email, $templateIdentifier, $se $this->dataObjectProcessor->expects($this->any()) ->method('buildOutputDataArray') - ->with($customer, '\Magento\Customer\Api\Data\CustomerInterface') + ->with($customer, \Magento\Customer\Api\Data\CustomerInterface::class) ->willReturn($customerData); $this->prepareEmailSend($email, $templateIdentifier, $sender, $storeId, $customerName); @@ -1116,7 +1161,7 @@ protected function prepareInitiatePasswordReset($email, $templateIdentifier, $se */ protected function prepareEmailSend($email, $templateIdentifier, $sender, $storeId, $customerName) { - $transport = $this->getMockBuilder('Magento\Framework\Mail\TransportInterface') + $transport = $this->getMockBuilder(\Magento\Framework\Mail\TransportInterface::class) ->getMock(); $this->transportBuilder->expects($this->any()) @@ -1283,39 +1328,94 @@ public function testValidateResetPasswordToken() */ private function reInitModel() { - $this->customerSecure = $this->getMockBuilder('Magento\Customer\Model\Data\CustomerSecure') + $this->customerSecure = $this->getMockBuilder(\Magento\Customer\Model\Data\CustomerSecure::class) ->disableOriginalConstructor() - ->setMethods(['getRpToken', 'getRpTokenCreatedAt']) + ->setMethods( + [ + 'getRpToken', + 'getRpTokenCreatedAt', + 'getPasswordHash', + 'setPasswordHash', + 'setRpToken', + 'setRpTokenCreatedAt', + ] + ) ->getMock(); - $this->customerSecure ->expects($this->any()) ->method('getRpToken') ->willReturn('newStringToken'); - $pastDateTime = '2016-10-25 00:00:00'; - $this->customerSecure ->expects($this->any()) ->method('getRpTokenCreatedAt') ->willReturn($pastDateTime); - - $this->customer = $this->getMockBuilder('Magento\Customer\Model\Customer') + $this->customer = $this->getMockBuilder(\Magento\Customer\Model\Customer::class) ->disableOriginalConstructor() ->setMethods(['getResetPasswordLinkExpirationPeriod']) ->getMock(); - $this->prepareDateTimeFactory(); + $this->sessionManager = $this->getMockBuilder(\Magento\Framework\Session\SessionManagerInterface::class) + ->disableOriginalConstructor() + ->setMethods(['destroy', 'start', 'writeClose']) + ->getMockForAbstractClass(); + $this->visitorCollectionFactory = $this->getMockBuilder( + \Magento\Customer\Model\ResourceModel\Visitor\CollectionFactory::class + ) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->saveHandler = $this->getMockBuilder(\Magento\Framework\Session\SaveHandlerInterface::class) + ->disableOriginalConstructor() + ->setMethods(['destroy']) + ->getMockForAbstractClass(); + + $dateTime = '2017-10-25 18:57:08'; + $timestamp = '1508983028'; + $dateTimeMock = $this->getMockBuilder(\DateTime::class) + ->disableOriginalConstructor() + ->setMethods(['format', 'getTimestamp', 'setTimestamp']) + ->getMock(); + + $dateTimeMock->expects($this->any()) + ->method('format') + ->with(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT) + ->willReturn($dateTime); + + $dateTimeMock + ->expects($this->any()) + ->method('getTimestamp') + ->willReturn($timestamp); + + $dateTimeMock + ->expects($this->any()) + ->method('setTimestamp') + ->willReturnSelf(); + + $dateTimeFactory = $this->getMockBuilder(DateTimeFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $dateTimeFactory->expects($this->any())->method('create')->willReturn($dateTimeMock); $this->objectManagerHelper = new ObjectManagerHelper($this); $this->accountManagement = $this->objectManagerHelper->getObject( - 'Magento\Customer\Model\AccountManagement', + \Magento\Customer\Model\AccountManagement::class, [ 'customerFactory' => $this->customerFactory, 'customerRegistry' => $this->customerRegistry, 'customerRepository' => $this->customerRepository, 'customerModel' => $this->customer, - 'dateTimeFactory' => $this->dateTimeFactory, + 'dateTimeFactory' => $dateTimeFactory, + 'stringHelper' => $this->string, + 'scopeConfig' => $this->scopeConfig, + 'sessionManager' => $this->sessionManager, + 'visitorCollectionFactory' => $this->visitorCollectionFactory, + 'saveHandler' => $this->saveHandler, + 'encryptor' => $this->encryptor, + 'dataProcessor' => $this->dataObjectProcessor, + 'storeManager' => $this->storeManager, + 'transportBuilder' => $this->transportBuilder, ] ); $reflection = new \ReflectionClass(get_class($this->accountManagement)); @@ -1335,9 +1435,10 @@ public function testChangePassword() $newPassword = 'abcdefg'; $passwordHash = '1a2b3f4c'; + $this->reInitModel(); $this->prepareDateTimeFactory(); - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) ->getMock(); $customer->expects($this->any()) ->method('getId') @@ -1352,25 +1453,20 @@ public function testChangePassword() $this->authenticationMock->expects($this->once()) ->method('authenticate'); - $customerSecure = $this->getMockBuilder('Magento\Customer\Model\Data\CustomerSecure') - ->setMethods(['setRpToken', 'setRpTokenCreatedAt', 'getPasswordHash']) - ->disableOriginalConstructor() - ->getMock(); - $customerSecure->expects($this->once()) + $this->customerSecure->expects($this->once()) ->method('setRpToken') ->with(null); - $customerSecure->expects($this->once()) + $this->customerSecure->expects($this->once()) ->method('setRpTokenCreatedAt') - ->with(null) ->willReturnSelf(); - $customerSecure->expects($this->any()) + $this->customerSecure->expects($this->any()) ->method('getPasswordHash') ->willReturn($passwordHash); $this->customerRegistry->expects($this->any()) ->method('retrieveSecureData') ->with($customerId) - ->willReturn($customerSecure); + ->willReturn($this->customerSecure); $this->scopeConfig->expects($this->any()) ->method('getValue') @@ -1386,7 +1482,7 @@ public function testChangePassword() AccountManagement::XML_PATH_REQUIRED_CHARACTER_CLASSES_NUMBER, 'default', null, - 1 + 1, ], ] ); @@ -1400,9 +1496,85 @@ public function testChangePassword() ->method('save') ->with($customer); + $this->sessionManager->expects($this->atLeastOnce())->method('start'); + $this->sessionManager->expects($this->atLeastOnce())->method('writeClose'); + $this->sessionManager->expects($this->atLeastOnce())->method('getSessionId'); + + $visitor = $this->getMockBuilder(\Magento\Customer\Model\Visitor::class) + ->disableOriginalConstructor() + ->setMethods(['getSessionId']) + ->getMock(); + $visitor->expects($this->at(0))->method('getSessionId')->willReturn('session_id_1'); + $visitor->expects($this->at(1))->method('getSessionId')->willReturn('session_id_2'); + $visitorCollection = $this->getMockBuilder( + \Magento\Customer\Model\ResourceModel\Visitor\CollectionFactory::class + ) + ->disableOriginalConstructor()->setMethods(['addFieldToFilter', 'getItems'])->getMock(); + $visitorCollection->expects($this->atLeastOnce())->method('addFieldToFilter')->willReturnSelf(); + $visitorCollection->expects($this->atLeastOnce())->method('getItems')->willReturn([$visitor, $visitor]); + $this->visitorCollectionFactory->expects($this->atLeastOnce())->method('create') + ->willReturn($visitorCollection); + $this->saveHandler->expects($this->at(0))->method('destroy')->with('session_id_1'); + $this->saveHandler->expects($this->at(1))->method('destroy')->with('session_id_2'); + $this->assertTrue($this->accountManagement->changePassword($email, $currentPassword, $newPassword)); } + public function testResetPassword() + { + $customerEmail = 'customer@example.com'; + $customerId = '1'; + $resetToken = 'newStringToken'; + $newPassword = 'new_password'; + + $this->reInitModel(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); + $customer->expects($this->any())->method('getId')->willReturn($customerId); + $this->customerRepository->expects($this->atLeastOnce())->method('get')->with($customerEmail) + ->willReturn($customer); + $this->customer->expects($this->atLeastOnce())->method('getResetPasswordLinkExpirationPeriod') + ->willReturn(100000); + $this->string->expects($this->any())->method('strlen')->willReturnCallback( + function ($string) { + return strlen($string); + } + ); + $this->customerRegistry->expects($this->atLeastOnce())->method('retrieveSecureData') + ->willReturn($this->customerSecure); + + $this->customerSecure->expects($this->once()) + ->method('setRpToken') + ->with(null); + $this->customerSecure->expects($this->once()) + ->method('setRpTokenCreatedAt') + ->with(null); + $this->customerSecure->expects($this->any()) + ->method('setPasswordHash') + ->willReturn(null); + + $this->sessionManager->expects($this->atLeastOnce())->method('destroy'); + $this->sessionManager->expects($this->atLeastOnce())->method('start'); + $this->sessionManager->expects($this->atLeastOnce())->method('writeClose'); + $this->sessionManager->expects($this->atLeastOnce())->method('getSessionId'); + $visitor = $this->getMockBuilder(\Magento\Customer\Model\Visitor::class) + ->disableOriginalConstructor() + ->setMethods(['getSessionId']) + ->getMock(); + $visitor->expects($this->at(0))->method('getSessionId')->willReturn('session_id_1'); + $visitor->expects($this->at(1))->method('getSessionId')->willReturn('session_id_2'); + $visitorCollection = $this->getMockBuilder( + \Magento\Customer\Model\ResourceModel\Visitor\CollectionFactory::class + ) + ->disableOriginalConstructor()->setMethods(['addFieldToFilter', 'getItems'])->getMock(); + $visitorCollection->expects($this->atLeastOnce())->method('addFieldToFilter')->willReturnSelf(); + $visitorCollection->expects($this->atLeastOnce())->method('getItems')->willReturn([$visitor, $visitor]); + $this->visitorCollectionFactory->expects($this->atLeastOnce())->method('create') + ->willReturn($visitorCollection); + $this->saveHandler->expects($this->at(0))->method('destroy')->with('session_id_1'); + $this->saveHandler->expects($this->at(1))->method('destroy')->with('session_id_2'); + $this->assertTrue($this->accountManagement->resetPassword($customerEmail, $resetToken, $newPassword)); + } + /** * @return void */ @@ -1422,7 +1594,7 @@ public function testChangePasswordException() ->willThrowException($exception); $this->setExpectedException( - '\Magento\Framework\Exception\InvalidEmailOrPasswordException', + \Magento\Framework\Exception\InvalidEmailOrPasswordException::class, 'Invalid login or password.' ); @@ -1438,10 +1610,10 @@ public function testAuthenticate() $password = '1234567'; $passwordHash = '1a2b3f4c'; - $customerData = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + $customerData = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) ->getMock(); - $customerModel = $this->getMockBuilder('Magento\Customer\Model\Customer') + $customerModel = $this->getMockBuilder(\Magento\Customer\Model\Customer::class) ->disableOriginalConstructor() ->getMock(); $customerModel->expects($this->once()) @@ -1457,7 +1629,7 @@ public function testAuthenticate() $this->authenticationMock->expects($this->once()) ->method('authenticate'); - $customerSecure = $this->getMockBuilder('Magento\Customer\Model\Data\CustomerSecure') + $customerSecure = $this->getMockBuilder(\Magento\Customer\Model\Data\CustomerSecure::class) ->setMethods(['getPasswordHash']) ->disableOriginalConstructor() ->getMock(); @@ -1478,10 +1650,10 @@ public function testAuthenticate() ->withConsecutive( [ 'customer_customer_authenticated', - ['model' => $customerModel, 'password' => $password] + ['model' => $customerModel, 'password' => $password], ], [ - 'customer_data_object_login', ['customer' => $customerData] + 'customer_data_object_login', ['customer' => $customerData], ] ); @@ -1505,7 +1677,7 @@ public function testGetConfirmationStatus( $customerId = 1; $customerEmail = 'test1@example.com'; - $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + $customerMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) ->disableOriginalConstructor() ->getMock(); $customerMock->expects($this->once()) @@ -1563,7 +1735,7 @@ public function testCreateAccountWithPasswordHashForGuest() $websiteId = 1; $hash = '4nj54lkj5jfi03j49f8bgujfgsd'; - $storeMock = $this->getMockBuilder('Magento\Store\Model\Store') + $storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class) ->disableOriginalConstructor() ->getMock(); $storeMock->expects($this->once()) @@ -1580,7 +1752,7 @@ public function testCreateAccountWithPasswordHashForGuest() ->method('getStore') ->willReturn($storeMock); - $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + $customerMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) ->getMockForAbstractClass(); $customerMock->expects($this->exactly(2)) ->method('getId') @@ -1631,15 +1803,15 @@ public function testCreateAccountWithPasswordHashWithCustomerAddresses() $this->prepareDateTimeFactory(); //Handle store - $store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); + $store = $this->getMockBuilder(\Magento\Store\Model\Store::class)->disableOriginalConstructor()->getMock(); $store->expects($this->any()) ->method('getWebsiteId') ->willReturn($websiteId); //Handle address - existing and non-existing. Non-Existing should return null when call getId method - $existingAddress = $this->getMockBuilder('Magento\Customer\Api\Data\AddressInterface') + $existingAddress = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterface::class) ->disableOriginalConstructor() ->getMock(); - $nonExistingAddress = $this->getMockBuilder('Magento\Customer\Api\Data\AddressInterface') + $nonExistingAddress = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterface::class) ->disableOriginalConstructor() ->getMock(); //Ensure that existing address is not in use @@ -1661,7 +1833,7 @@ public function testCreateAccountWithPasswordHashWithCustomerAddresses() ->method("setId") ->with(null); //Handle Customer calls - $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); + $customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)->getMock(); $customer ->expects($this->atLeastOnce()) ->method('getWebsiteId') @@ -1684,7 +1856,7 @@ public function testCreateAccountWithPasswordHashWithCustomerAddresses() ->method('getById') ->with($customerId) ->willReturn($customer); - $customerSecure = $this->getMockBuilder('Magento\Customer\Model\Data\CustomerSecure') + $customerSecure = $this->getMockBuilder(\Magento\Customer\Model\Data\CustomerSecure::class) ->setMethods(['setRpToken', 'setRpTokenCreatedAt', 'getPasswordHash']) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php index d3648f7e93e26..b60913cb1950d 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_one.xml b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_one.xml index fe42eff100fde..f3d139e55a8cf 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_one.xml +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_one.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_two.xml b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_two.xml index 0b46b5291ec14..980cbf4e1c50f 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_two.xml +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_two.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/ConfigTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/ConfigTest.php index 0f73e340c4862..72a28b604ec21 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/ConfigTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/ConfigTest.php @@ -1,6 +1,6 @@ storeManager = $this->getMockForAbstractClass( - 'Magento\Store\Model\StoreManagerInterface', + \Magento\Store\Model\StoreManagerInterface::class, [], '', false ); + $this->urlBuilder = $this->getMockForAbstractClass( - 'Magento\Framework\UrlInterface', + \Magento\Framework\UrlInterface::class, [], '', false ); + $this->scopeConfig = $this->getMockForAbstractClass( - 'Magento\Framework\App\Config\ScopeConfigInterface', + \Magento\Framework\App\Config\ScopeConfigInterface::class, [], '', false ); $this->store = $this->getMockForAbstractClass( - 'Magento\Store\Api\Data\StoreInterface', + \Magento\Store\Api\Data\StoreInterface::class, [], '', false, @@ -71,10 +78,16 @@ protected function setUp() ['getBaseUrl'] ); + $this->customerUrl = $this->getMockBuilder(\Magento\Customer\Model\Url::class) + ->disableOriginalConstructor() + ->setMethods(['getLoginUrl']) + ->getMock(); + $this->provider = new ConfigProvider( $this->urlBuilder, $this->storeManager, - $this->scopeConfig + $this->scopeConfig, + $this->customerUrl ); } @@ -83,9 +96,8 @@ public function testGetConfigWithoutRedirect() $loginUrl = 'http://url.test/customer/login'; $baseUrl = 'http://base-url.test'; - $this->urlBuilder->expects($this->exactly(2)) - ->method('getUrl') - ->with(Url::ROUTE_ACCOUNT_LOGIN) + $this->customerUrl->expects($this->exactly(2)) + ->method('getLoginUrl') ->willReturn($loginUrl); $this->storeManager->expects($this->once()) ->method('getStore') @@ -112,9 +124,8 @@ public function testGetConfig() $loginUrl = 'http://base-url.test/customer/login'; $baseUrl = 'http://base-url.test'; - $this->urlBuilder->expects($this->exactly(2)) - ->method('getUrl') - ->with(Url::ROUTE_ACCOUNT_LOGIN) + $this->customerUrl->expects($this->exactly(2)) + ->method('getLoginUrl') ->willReturn($loginUrl); $this->storeManager->expects($this->once()) ->method('getStore') diff --git a/app/code/Magento/Customer/Test/Unit/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php b/app/code/Magento/Customer/Test/Unit/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php index f7a36378b9298..1c22a65fd4911 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php @@ -1,6 +1,6 @@ collectionFactoryMock = - $this->getMockBuilder('Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\CollectionFactory') + $this->getMockBuilder(\Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\CollectionFactory::class) ->disableOriginalConstructor() ->getMock(); $this->optionFactoryMock = - $this->getMockBuilder('Magento\Eav\Model\ResourceModel\Entity\Attribute\OptionFactory') + $this->getMockBuilder(\Magento\Eav\Model\ResourceModel\Entity\Attribute\OptionFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->storeMock = $this->getMockBuilder(\Magento\Store\Model\System\Store::class) ->disableOriginalConstructor() ->getMock(); - $this->storeMock = $this->getMockBuilder('Magento\Store\Model\System\Store') + + $this->objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class) + ->setMethods(['get']) + ->getMockForAbstractClass(); + + $escaper = $this->getMockBuilder(\Magento\Framework\Escaper::class) ->disableOriginalConstructor() ->getMock(); + ObjectManager::setInstance($this->objectManagerMock); + $this->objectManagerMock->expects($this->any()) + ->method('get') + ->with(\Magento\Framework\Escaper::class) + ->willReturn($escaper); + $this->model = new Website( $this->collectionFactoryMock, $this->optionFactoryMock, @@ -91,4 +110,12 @@ public function testGetOptionTextWithoutOption() $this->assertEquals(false, $this->model->getOptionText('value')); } + + protected function tearDown() + { + $property = (new \ReflectionClass(ObjectManager::class))->getProperty('_instance'); + $property->setAccessible(true); + $property->setValue(null, null); + parent::tearDown(); + } } diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php index 3c69fd3f69442..458d7ae0dbae5 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php @@ -1,6 +1,6 @@ _website = $this->getMock('Magento\Store\Model\Website', [], [], '', false); - $this->_config = $this->getMock('Magento\Eav\Model\Config', [], [], '', false); - $this->_attribute = $this->getMock('Magento\Eav\Model\Attribute', [], [], '', false); - $this->_storeManager = $this->getMock('Magento\Store\Model\StoreManager', [], [], '', false); - $this->_storetMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); - $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); + $this->_website = $this->getMock(\Magento\Store\Model\Website::class, [], [], '', false); + $this->_config = $this->getMock(\Magento\Eav\Model\Config::class, [], [], '', false); + $this->_attribute = $this->getMock(\Magento\Eav\Model\Attribute::class, [], [], '', false); + $this->_storeManager = $this->getMock(\Magento\Store\Model\StoreManager::class, [], [], '', false); + $this->_storetMock = $this->getMock(\Magento\Store\Model\Store::class, [], [], '', false); + $this->_scopeConfigMock = $this->getMock(\Magento\Framework\App\Config\ScopeConfigInterface::class); $this->_transportBuilderMock = $this->getMock( - '\Magento\Framework\Mail\Template\TransportBuilder', + \Magento\Framework\Mail\Template\TransportBuilder::class, [], [], '', false ); $this->_transportMock = $this->getMock( - 'Magento\Framework\Mail\TransportInterface', + \Magento\Framework\Mail\TransportInterface::class, [], [], '', false ); $this->attributeFactoryMock = $this->getMock( - 'Magento\Customer\Model\AttributeFactory', + \Magento\Customer\Model\AttributeFactory::class, ['create'], [], '', false ); $this->attributeCustomerMock = $this->getMock( - 'Magento\Customer\Model\Attribute', + \Magento\Customer\Model\Attribute::class, [], [], '', false ); $this->resourceMock = $this->getMock( - '\Magento\Customer\Model\ResourceModel\Customer', //'\Magento\Framework\DataObject', + \Magento\Customer\Model\ResourceModel\Customer::class, ['getIdFieldName'], [], '', @@ -105,11 +105,11 @@ protected function setUp() $this->resourceMock->expects($this->any()) ->method('getIdFieldName') ->will($this->returnValue('id')); - $this->registryMock = $this->getMock('Magento\Framework\Registry', ['registry'], [], '', false); - $this->_encryptor = $this->getMock('Magento\Framework\Encryption\EncryptorInterface'); + $this->registryMock = $this->getMock(\Magento\Framework\Registry::class, ['registry'], [], '', false); + $this->_encryptor = $this->getMock(\Magento\Framework\Encryption\EncryptorInterface::class); $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->_model = $helper->getObject( - 'Magento\Customer\Model\Customer', + \Magento\Customer\Model\Customer::class, [ 'storeManager' => $this->_storeManager, 'config' => $this->_config, @@ -149,8 +149,8 @@ public function testSendNewAccountEmailException() public function testSendNewAccountEmailWithoutStoreId() { - $store = $this->getMock('Magento\Store\Model\Store', [], [], '', false); - $website = $this->getMock('Magento\Store\Model\Website', [], [], '', false); + $store = $this->getMock(\Magento\Store\Model\Store::class, [], [], '', false); + $website = $this->getMock(\Magento\Store\Model\Website::class, [], [], '', false); $website->expects($this->once()) ->method('getStoreIds') ->will($this->returnValue([1, 2, 3, 4])); @@ -175,6 +175,7 @@ public function testSendNewAccountEmailWithoutStoreId() 'setTemplateIdentifier', 'setTemplateOptions', 'setTemplateVars', + 'setScopeId', 'setFrom', 'addTo', ]; @@ -183,7 +184,7 @@ public function testSendNewAccountEmailWithoutStoreId() ->method($method) ->will($this->returnSelf()); } - $transportMock = $this->getMock('Magento\Framework\Mail\TransportInterface', [], [], '', false); + $transportMock = $this->getMock(\Magento\Framework\Mail\TransportInterface::class, [], [], '', false); $transportMock->expects($this->once()) ->method('sendMessage') ->will($this->returnSelf()); @@ -221,7 +222,7 @@ public function isCustomerLockedDataProvider() { return [ ['lockExpirationDate' => date("F j, Y", strtotime('-1 days')), 'expectedResult' => false], - ['lockExpirationDate' => date("F j, Y", strtotime('+1 days')), 'expectedResult' => true] + ['lockExpirationDate' => date("F j, Y", strtotime('+1 days')), 'expectedResult' => true], ]; } diff --git a/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php b/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php index 37e488d646994..97f1b71df24dd 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php @@ -1,6 +1,6 @@ customerRegistryMock = $this->getMock( @@ -149,7 +152,7 @@ public function setUp() 'transportBuilder' => $this->transportBuilderMock, 'customerViewHelper' => $this->customerViewHelperMock, 'dataProcessor' => $this->dataProcessorMock, - 'scopeConfig' => $this->scopeConfigMock + 'scopeConfig' => $this->scopeConfigMock, ] ); } @@ -284,13 +287,13 @@ public function testCredentialsChanged($testNumber, $oldEmail, $newEmail, $isPas [ \Magento\Customer\Model\EmailNotification::XML_PATH_FORGOT_EMAIL_IDENTITY, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $customerStoreId + $customerStoreId, ], [$xmlPathTemplate, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $customerStoreId], [ \Magento\Customer\Model\EmailNotification::XML_PATH_FORGOT_EMAIL_IDENTITY, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $customerStoreId + $customerStoreId, ] ) ->willReturnOnConsecutiveCalls($templateIdentifier, $sender, $templateIdentifier, $sender); @@ -303,6 +306,10 @@ public function testCredentialsChanged($testNumber, $oldEmail, $newEmail, $isPas ->method('setTemplateOptions') ->with(['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $customerStoreId]) ->willReturnSelf(); + $this->transportBuilderMock->expects(clone $expects) + ->method('setScopeId') + ->with($customerStoreId) + ->willReturnSelf(); $this->transportBuilderMock->expects(clone $expects) ->method('setTemplateVars') ->with(['customer' => $customerSecureMock, 'store' => $storeMock]) @@ -345,20 +352,20 @@ public function sendNotificationEmailsDataProvider() 'test_number' => 1, 'old_email' => 'test@example.com', 'new_email' => 'test@example.com', - 'is_password_changed' => true + 'is_password_changed' => true, ], [ 'test_number' => 2, 'old_email' => 'test1@example.com', 'new_email' => 'test2@example.com', - 'is_password_changed' => false + 'is_password_changed' => false, ], [ 'test_number' => 3, 'old_email' => 'test1@example.com', 'new_email' => 'test2@example.com', - 'is_password_changed' => true - ] + 'is_password_changed' => true, + ], ]; } @@ -458,6 +465,10 @@ public function testPasswordReminder() ->method('setTemplateVars') ->with(['customer' => $this->customerSecureMock, 'store' => $this->storeMock]) ->willReturnSelf(); + $this->transportBuilderMock->expects($this->once()) + ->method('setScopeId') + ->with($customerStoreId) + ->willReturnSelf(); $this->transportBuilderMock->expects($this->once()) ->method('setFrom') ->with($sender) @@ -572,6 +583,10 @@ public function testPasswordResetConfirmation() ->method('setTemplateVars') ->with(['customer' => $this->customerSecureMock, 'store' => $this->storeMock]) ->willReturnSelf(); + $this->transportBuilderMock->expects($this->once()) + ->method('setScopeId') + ->with($customerStoreId) + ->willReturnSelf(); $this->transportBuilderMock->expects($this->once()) ->method('setFrom') ->with($sender) @@ -682,6 +697,10 @@ public function testNewAccount() ->method('setTemplateVars') ->with(['customer' => $this->customerSecureMock, 'back_url' => '', 'store' => $this->storeMock]) ->willReturnSelf(); + $this->transportBuilderMock->expects($this->once()) + ->method('setScopeId') + ->with($customerStoreId) + ->willReturnSelf(); $this->transportBuilderMock->expects($this->once()) ->method('setFrom') ->with($sender) diff --git a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php index 8e23366cae611..6598658f1142e 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php @@ -1,6 +1,6 @@ requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') ->disableOriginalConstructor()->getMock(); $this->uploaderFactoryMock = $this->getMock('Magento\Framework\File\UploaderFactory', [], [], '', false); - $this->fileProcessorMock = $this->getMockBuilder('Magento\Customer\Model\FileProcessor') ->disableOriginalConstructor() ->getMock(); @@ -59,7 +63,6 @@ protected function setUp() /** * @param array|bool $expected * @param string $attributeCode - * @param bool $isAjax * @param string $delete * @dataProvider extractValueNoRequestScopeDataProvider */ @@ -448,6 +451,9 @@ public function testOutputValueJson() */ private function initialize(array $data) { + $this->fileProcessorFactory = $this->getMockBuilder(\Magento\Customer\Model\FileProcessorFactory::class) + ->disableOriginalConstructor()->setMethods(['create'])->getMock(); + $this->fileProcessorFactory->expects($this->any())->method('create')->willReturn($this->fileProcessorMock); $model = new \Magento\Customer\Model\Metadata\Form\File( $this->localeMock, $this->loggerMock, @@ -459,14 +465,8 @@ private function initialize(array $data) $this->urlEncode, $this->fileValidatorMock, $this->fileSystemMock, - $this->uploaderFactoryMock - ); - - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $objectManager->setBackwardCompatibleProperty( - $model, - 'fileProcessor', - $this->fileProcessorMock + $this->uploaderFactoryMock, + $this->fileProcessorFactory ); return $model; @@ -514,7 +514,6 @@ public function testCompactValueRemoveUiComponentValue() 'isAjax' => false, 'entityTypeCode' => self::ENTITY_TYPE, ]); - $this->fileProcessorMock->expects($this->once()) ->method('removeUploadedFile') ->with($value) diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/HiddenTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/HiddenTest.php index 3692904580cd6..57b1639420b38 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/HiddenTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/HiddenTest.php @@ -1,6 +1,6 @@ disableOriginalConstructor() ->getMock(); + $this->fileProcessorFactory = $this->getMockBuilder('Magento\Customer\Model\FileProcessorFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->imageContentFactory = $this->getMockBuilder('Magento\Framework\Api\Data\ImageContentInterfaceFactory') ->disableOriginalConstructor() ->setMethods(['create']) @@ -88,6 +99,8 @@ protected function setUp() */ private function initialize(array $data) { + $this->fileProcessorFactory->expects($this->any())->method('create') + ->willReturn($this->fileProcessorMock); $model = new \Magento\Customer\Model\Metadata\Form\Image( $this->localeMock, $this->loggerMock, @@ -99,18 +112,8 @@ private function initialize(array $data) $this->urlEncode, $this->fileValidatorMock, $this->fileSystemMock, - $this->uploaderFactoryMock - ); - - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $objectManager->setBackwardCompatibleProperty( - $model, - 'fileProcessor', - $this->fileProcessorMock - ); - $objectManager->setBackwardCompatibleProperty( - $model, - 'imageContentFactory', + $this->uploaderFactoryMock, + $this->fileProcessorFactory, $this->imageContentFactory ); @@ -124,11 +127,11 @@ public function testValidateIsNotValidFile() 'name' => 'realFileName', ]; - $this->attributeMetadataMock->expects($this->once()) + $this->attributeMetadataMock->expects($this->atLeastOnce()) ->method('getStoreLabel') ->willReturn('File Input Field Label'); - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('isExist') ->with(FileProcessor::TMP_DIR . '/' . $value['tmp_name']) ->willReturn(true); @@ -149,11 +152,11 @@ public function testValidate() 'name' => 'logo.gif', ]; - $this->attributeMetadataMock->expects($this->once()) + $this->attributeMetadataMock->expects($this->atLeastOnce()) ->method('getStoreLabel') ->willReturn('File Input Field Label'); - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('isExist') ->with(FileProcessor::TMP_DIR . '/' . $value['name']) ->willReturn(true); @@ -186,14 +189,13 @@ public function testValidateMaxFileSize() ->method('getValue') ->willReturn($maxFileSize); - $this->attributeMetadataMock->expects($this->once()) + $this->attributeMetadataMock->expects($this->atLeastOnce()) ->method('getStoreLabel') ->willReturn('File Input Field Label'); - $this->attributeMetadataMock->expects($this->once()) + $this->attributeMetadataMock->expects($this->atLeastOnce()) ->method('getValidationRules') ->willReturn([$validationRuleMock]); - - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('isExist') ->with(FileProcessor::TMP_DIR . '/' . $value['name']) ->willReturn(true); @@ -225,14 +227,13 @@ public function testValidateMaxImageWidth() ->method('getValue') ->willReturn($maxImageWidth); - $this->attributeMetadataMock->expects($this->once()) + $this->attributeMetadataMock->expects($this->atLeastOnce()) ->method('getStoreLabel') ->willReturn('File Input Field Label'); - $this->attributeMetadataMock->expects($this->once()) + $this->attributeMetadataMock->expects($this->atLeastOnce()) ->method('getValidationRules') ->willReturn([$validationRuleMock]); - - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('isExist') ->with(FileProcessor::TMP_DIR . '/' . $value['name']) ->willReturn(true); @@ -264,14 +265,14 @@ public function testValidateMaxImageHeight() ->method('getValue') ->willReturn($maxImageHeight); - $this->attributeMetadataMock->expects($this->once()) + $this->attributeMetadataMock->expects($this->atLeastOnce()) ->method('getStoreLabel') ->willReturn('File Input Field Label'); - $this->attributeMetadataMock->expects($this->once()) + $this->attributeMetadataMock->expects($this->atLeastOnce()) ->method('getValidationRules') ->willReturn([$validationRuleMock]); - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('isExist') ->with(FileProcessor::TMP_DIR . '/' . $value['name']) ->willReturn(true); @@ -310,7 +311,7 @@ public function testCompactValueUiComponentAddress() 'file' => 'filename.ext2', ]; - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('moveTemporaryFile') ->with($value['file']) ->willReturn(true); @@ -336,35 +337,35 @@ public function testCompactValueUiComponentCustomer() $base64EncodedData = 'encoded_data'; - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('isExist') ->with(FileProcessor::TMP_DIR . '/' . $value['file']) ->willReturn(true); - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('getBase64EncodedData') ->with(FileProcessor::TMP_DIR . '/' . $value['file']) ->willReturn($base64EncodedData); - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('removeUploadedFile') ->with(FileProcessor::TMP_DIR . '/' . $value['file']) ->willReturnSelf(); $imageContentMock = $this->getMockBuilder('Magento\Framework\Api\Data\ImageContentInterface') ->getMockForAbstractClass(); - $imageContentMock->expects($this->once()) + $imageContentMock->expects($this->atLeastOnce()) ->method('setName') ->with($value['name']) ->willReturnSelf(); - $imageContentMock->expects($this->once()) + $imageContentMock->expects($this->atLeastOnce()) ->method('setBase64EncodedData') ->with($base64EncodedData) ->willReturnSelf(); - $imageContentMock->expects($this->once()) + $imageContentMock->expects($this->atLeastOnce()) ->method('setType') ->with($value['type']) ->willReturnSelf(); - $this->imageContentFactory->expects($this->once()) + $this->imageContentFactory->expects($this->atLeastOnce()) ->method('create') ->willReturn($imageContentMock); @@ -387,7 +388,7 @@ public function testCompactValueUiComponentCustomerNotExists() 'type' => 'image', ]; - $this->fileProcessorMock->expects($this->once()) + $this->fileProcessorMock->expects($this->atLeastOnce()) ->method('isExist') ->with(FileProcessor::TMP_DIR . '/' . $value['file']) ->willReturn(false); diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultilineTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultilineTest.php index 1e0f844cef024..25f10d7bb93c6 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultilineTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultilineTest.php @@ -1,6 +1,6 @@ cookieFormKey = $this->getMockBuilder(CookieFormKey::class) + ->disableOriginalConstructor() + ->getMock(); + + /** @var DataFormKey | MockObject */ + $this->dataFormKey = $this->getMockBuilder(DataFormKey::class) + ->disableOriginalConstructor() + ->getMock(); + + /** @var Session | MockObject */ + $this->customerSession = $this->getMockBuilder(Session::class) + ->disableOriginalConstructor() + ->setMethods(['getBeforeRequestParams', 'setBeforeRequestParams']) + ->getMock(); + + } + + /** + * @dataProvider aroundFlushFormKeyProvider + * @param $beforeFormKey + * @param $currentFormKey + * @param $getFormKeyTimes + * @param $setBeforeParamsTimes + */ + public function testAroundFlushFormKey( + $beforeFormKey, + $currentFormKey, + $getFormKeyTimes, + $setBeforeParamsTimes + ) { + $observerDto = new Observer(); + $observer = new FlushFormKey($this->cookieFormKey, $this->dataFormKey); + $plugin = new CustomerFlushFormKey($this->customerSession, $this->dataFormKey); + + $beforeParams['form_key'] = $beforeFormKey; + + $this->dataFormKey->expects($this->exactly($getFormKeyTimes)) + ->method('getFormKey') + ->willReturn($currentFormKey); + + $this->customerSession->expects($this->once()) + ->method('getBeforeRequestParams') + ->willReturn($beforeParams); + + $this->customerSession->expects($this->exactly($setBeforeParamsTimes)) + ->method('setBeforeRequestParams') + ->with($beforeParams); + + $proceed = function ($observerDto) use ($observer) { + return $observer->execute($observerDto); + }; + + $plugin->aroundExecute($observer, $proceed, $observerDto); + } + + /** + * Data provider for testAroundFlushFormKey + * + * @return array + */ + public function aroundFlushFormKeyProvider() + { + return [ + 'valid form key' => ['form_key_value', 'form_key_value', 2, 1], + 'corrupted form key' => ['form_old_key_value', 'form_key_value', 1, 0], + 'missed form key' => [null, 'form_key_value', 1, 0] + ]; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerNotificationTest.php b/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerNotificationTest.php index 6fe369391a343..02e5a7017b6e2 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerNotificationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerNotificationTest.php @@ -1,6 +1,6 @@ getMock( - 'Magento\Directory\Model\CountryFactory', - ['create'], + \Magento\Directory\Model\CountryFactory::class, + [], [], '', false diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/Attribute/Backend/RegionTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/Attribute/Backend/RegionTest.php index 9d6edf24076a7..510d351f4838b 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/Attribute/Backend/RegionTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/Attribute/Backend/RegionTest.php @@ -1,6 +1,6 @@ countriesFactoryMock = @@ -62,6 +71,21 @@ public function setUp() $this->shareConfigMock = $this->getMockBuilder(Share::class) ->disableOriginalConstructor() ->getMock(); + + $this->objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class) + ->setMethods(['get']) + ->getMockForAbstractClass(); + + $escaper = $this->getMockBuilder(\Magento\Framework\Escaper::class) + ->disableOriginalConstructor() + ->getMock(); + + ObjectManager::setInstance($this->objectManagerMock); + $this->objectManagerMock->expects($this->any()) + ->method('get') + ->with(\Magento\Framework\Escaper::class) + ->willReturn($escaper); + $this->countryByWebsite = new CountryWithWebsites( $eavCollectionFactoryMock, $optionsFactoryMock, @@ -117,4 +141,12 @@ public function testGetAllOptions() ['value' => 'AM', 'label' => 'UZ', 'website_ids' => [1, 2]] ], $this->countryByWebsite->getAllOptions()); } + + protected function tearDown() + { + $property = (new \ReflectionClass(ObjectManager::class))->getProperty('_instance'); + $property->setAccessible(true); + $property->setValue(null, null); + parent::tearDown(); + } } diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/RelationTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/RelationTest.php index 8827161d94808..661e4770b4f90 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/RelationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/RelationTest.php @@ -1,6 +1,6 @@ addressFactory = $this->getMock('Magento\Customer\Model\AddressFactory', ['create'], [], '', false); - $this->addressRegistry = $this->getMock('Magento\Customer\Model\AddressRegistry', [], [], '', false); - $this->customerRegistry = $this->getMock('Magento\Customer\Model\CustomerRegistry', [], [], '', false); - $this->addressResourceModel = $this->getMock('Magento\Customer\Model\ResourceModel\Address', [], [], '', false); - $this->directoryData = $this->getMock('Magento\Directory\Helper\Data', [], [], '', false); + $this->addressFactory = $this->getMock( + \Magento\Customer\Model\AddressFactory::class, + ['create'], + [], + '', + false + ); + $this->addressRegistry = $this->getMock(\Magento\Customer\Model\AddressRegistry::class, [], [], '', false); + $this->customerRegistry = $this->getMock(\Magento\Customer\Model\CustomerRegistry::class, [], [], '', false); + $this->addressResourceModel = $this->getMock( + \Magento\Customer\Model\ResourceModel\Address::class, + [], + [], + '', + false + ); + $this->directoryData = $this->getMock(\Magento\Directory\Helper\Data::class, [], [], '', false); $this->addressSearchResultsFactory = $this->getMock( - 'Magento\Customer\Api\Data\AddressSearchResultsInterfaceFactory', + \Magento\Customer\Api\Data\AddressSearchResultsInterfaceFactory::class, ['create'], [], '', false ); $this->addressCollectionFactory = $this->getMock( - 'Magento\Customer\Model\ResourceModel\Address\CollectionFactory', + \Magento\Customer\Model\ResourceModel\Address\CollectionFactory::class, ['create'], [], '', false ); $this->extensionAttributesJoinProcessor = $this->getMockForAbstractClass( - 'Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface', + \Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface::class, [], '', false ); - $this->customer = $this->getMock('Magento\Customer\Model\Customer', [], [], '', false); + $this->customer = $this->getMock(\Magento\Customer\Model\Customer::class, [], [], '', false); $this->address = $this->getMock( - 'Magento\Customer\Model\Address', + \Magento\Customer\Model\Address::class, [ 'getId', 'getCountryId', @@ -109,6 +130,7 @@ protected function setUp() 'save', 'getDataModel', 'getCustomerId', + 'getPostcode', ], [], '', @@ -131,9 +153,9 @@ public function testSave() { $customerId = 34; $addressId = 53; - $customerAddress = $this->getMockForAbstractClass('Magento\Customer\Api\Data\AddressInterface', [], '', false); + $customerAddress = $this->getMockForAbstractClass(AddressData::class, [], '', false); $addressCollection = - $this->getMock('Magento\Customer\Model\ResourceModel\Address\Collection', [], [], '', false); + $this->getMock(\Magento\Customer\Model\ResourceModel\Address\Collection::class, [], [], '', false); $customerAddress->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); @@ -189,7 +211,7 @@ public function testSaveWithException() { $customerId = 34; $addressId = 53; - $customerAddress = $this->getMockForAbstractClass('Magento\Customer\Api\Data\AddressInterface', [], '', false); + $customerAddress = $this->getMockForAbstractClass(AddressData::class, [], '', false); $customerAddress->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); @@ -220,7 +242,7 @@ public function testSaveWithInvalidRegion() { $customerId = 34; $addressId = 53; - $customerAddress = $this->getMockForAbstractClass('Magento\Customer\Api\Data\AddressInterface', [], '', false); + $customerAddress = $this->getMockForAbstractClass(AddressData::class, [], '', false); $customerAddress->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); @@ -238,9 +260,9 @@ public function testSaveWithInvalidRegion() $this->address->expects($this->once()) ->method('updateData') ->with($customerAddress); - $countryModel = $this->getMock('Magento\Directory\Model\Country', [], [], '', false); + $countryModel = $this->getMock(\Magento\Directory\Model\Country::class, [], [], '', false); $regionCollection = $this->getMock( - 'Magento\Directory\Model\ResourceModel\Region\Collection', + \Magento\Directory\Model\ResourceModel\Region\Collection::class, [], [], '', @@ -269,7 +291,7 @@ public function testSaveWithInvalidRegion() $this->address->expects($this->once()) ->method('getTelephone') ->willReturn('23423423423'); - $this->address->expects($this->never()) + $this->address->expects($this->once()) ->method('getRegionId') ->willReturn(null); @@ -282,7 +304,7 @@ public function testSaveWithInvalidRegion() $countryModel->expects($this->once()) ->method('getRegionCollection') ->willReturn($regionCollection); - $regionCollection->expects($this->once()) + $regionCollection->expects($this->never()) ->method('count') ->willReturn(0); $this->directoryData->expects($this->once()) @@ -293,6 +315,15 @@ public function testSaveWithInvalidRegion() ->method('getRegion') ->willReturn(''); + /** @var \PHPUnit_Framework_MockObject_MockObject $countryCollection */ + $countryCollection = $this->getMockBuilder(Countries::class) + ->disableOriginalConstructor() + ->getMock(); + $countryCollection->expects($this->once())->method('getAllIds')->willReturn(['1', '2']); + $this->directoryData->expects($this->once()) + ->method('getCountryCollection') + ->willReturn($countryCollection); + $this->repository->save($customerAddress); } @@ -304,7 +335,7 @@ public function testSaveWithInvalidRegionId() { $customerId = 34; $addressId = 53; - $customerAddress = $this->getMockForAbstractClass('Magento\Customer\Api\Data\AddressInterface', [], '', false); + $customerAddress = $this->getMockForAbstractClass(AddressData::class, [], '', false); $customerAddress->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); @@ -322,9 +353,9 @@ public function testSaveWithInvalidRegionId() $this->address->expects($this->once()) ->method('updateData') ->with($customerAddress); - $countryModel = $this->getMock('Magento\Directory\Model\Country', [], [], '', false); + $countryModel = $this->getMock(\Magento\Directory\Model\Country::class, [], [], '', false); $regionCollection = $this->getMock( - 'Magento\Directory\Model\ResourceModel\Region\Collection', + \Magento\Directory\Model\ResourceModel\Region\Collection::class, [], [], '', @@ -355,7 +386,7 @@ public function testSaveWithInvalidRegionId() ->willReturn('23423423423'); $this->address->expects($this->once()) ->method('getRegionId') - ->willReturn(2); + ->willReturn(''); $this->directoryData->expects($this->once()) ->method('getCountriesWithOptionalZip') @@ -366,28 +397,34 @@ public function testSaveWithInvalidRegionId() $countryModel->expects($this->once()) ->method('getRegionCollection') ->willReturn($regionCollection); - $regionCollection->expects($this->atLeastOnce()) - ->method('count') - ->willReturn(2); $regionCollection->expects($this->once()) - ->method('getData') + ->method('getAllIds') ->willReturn([5, 6, 7, 8, 9]); $this->directoryData->expects($this->once()) ->method('isRegionRequired') ->with(1) ->willReturn(true); - $this->address->expects($this->never()) + $this->address->expects($this->once()) ->method('getRegion') ->willReturn(''); + /** @var \PHPUnit_Framework_MockObject_MockObject $countryCollection */ + $countryCollection = $this->getMockBuilder(Countries::class) + ->disableOriginalConstructor() + ->getMock(); + $countryCollection->expects($this->once())->method('getAllIds')->willReturn(['1', '2']); + $this->directoryData->expects($this->once()) + ->method('getCountryCollection') + ->willReturn($countryCollection); + $this->repository->save($customerAddress); } protected function prepareMocksForInvalidAddressValidation() { - $countryModel = $this->getMock('Magento\Directory\Model\Country', [], [], '', false); + $countryModel = $this->getMock(\Magento\Directory\Model\Country::class, [], [], '', false); $regionCollection = $this->getMock( - 'Magento\Directory\Model\ResourceModel\Region\Collection', + \Magento\Directory\Model\ResourceModel\Region\Collection::class, [], [], '', @@ -417,16 +454,16 @@ protected function prepareMocksForInvalidAddressValidation() $this->directoryData->expects($this->once()) ->method('getCountriesWithOptionalZip') ->willReturn([]); - $this->address->expects($this->once()) + $this->address->expects($this->never()) ->method('getCountryModel') ->willReturn($countryModel); - $countryModel->expects($this->once()) + $countryModel->expects($this->never()) ->method('getRegionCollection') ->willReturn($regionCollection); - $regionCollection->expects($this->once()) + $regionCollection->expects($this->never()) ->method('count') ->willReturn(0); - $this->directoryData->expects($this->once()) + $this->directoryData->expects($this->never()) ->method('isRegionRequired') ->with(null) ->willReturn(true); @@ -434,7 +471,7 @@ protected function prepareMocksForInvalidAddressValidation() public function testGetById() { - $customerAddress = $this->getMockForAbstractClass('Magento\Customer\Api\Data\AddressInterface', [], '', false); + $customerAddress = $this->getMockForAbstractClass(AddressData::class, [], '', false); $this->addressRegistry->expects($this->once()) ->method('retrieve') ->with(12) @@ -448,99 +485,63 @@ public function testGetById() public function testGetList() { - $filterGroup = $this->getMock('Magento\Framework\Api\Search\FilterGroup', [], [], '', false); - $filter = $this->getMock('Magento\Framework\Api\Filter', [], [], '', false); - $collection = $this->getMock('Magento\Customer\Model\ResourceModel\Address\Collection', [], [], '', false); + $filterGroup = $this->getMock(\Magento\Framework\Api\Search\FilterGroup::class, [], [], '', false); + $filter = $this->getMock(\Magento\Framework\Api\Filter::class, [], [], '', false); + $collection = $this->getMock( + \Magento\Customer\Model\ResourceModel\Address\Collection::class, + [], + [], + '', + false + ); $searchResults = $this->getMockForAbstractClass( - 'Magento\Customer\Api\Data\AddressSearchResultsInterface', + \Magento\Customer\Api\Data\AddressSearchResultsInterface::class, [], '', false ); $searchCriteria = $this->getMockForAbstractClass( - 'Magento\Framework\Api\SearchCriteriaInterface', + \Magento\Framework\Api\SearchCriteriaInterface::class, [], '', false ); - $this->addressSearchResultsFactory->expects($this->once()) - ->method('create') - ->willReturn($searchResults); - $this->addressCollectionFactory->expects($this->once()) - ->method('create') - ->willReturn($collection); + $this->addressSearchResultsFactory->expects($this->once())->method('create')->willReturn($searchResults); + $this->addressCollectionFactory->expects($this->once())->method('create')->willReturn($collection); $this->extensionAttributesJoinProcessor->expects($this->once()) ->method('process') - ->with($collection, 'Magento\Customer\Api\Data\AddressInterface'); - $searchCriteria->expects($this->once()) - ->method('getFilterGroups') - ->willReturn([$filterGroup]); - $filterGroup->expects($this->once()) - ->method('getFilters') - ->willReturn([$filter]); - $filter->expects($this->once()) - ->method('getConditionType') - ->willReturn(false); - $filter->expects($this->once()) - ->method('getField') - ->willReturn('Field'); - $filter->expects($this->atLeastOnce()) - ->method('getValue') - ->willReturn('Value'); + ->with($collection, AddressData::class); + $searchCriteria->expects($this->once())->method('getFilterGroups')->willReturn([$filterGroup]); + $filterGroup->expects($this->once())->method('getFilters')->willReturn([$filter]); + $filter->expects($this->once())->method('getConditionType')->willReturn(false); + $filter->expects($this->once())->method('getField')->willReturn('Field'); + $filter->expects($this->atLeastOnce())->method('getValue')->willReturn('Value'); $collection->expects($this->once()) ->method('addFieldToFilter') ->with([['attribute' => 'Field', 'eq' => 'Value']], [['eq' => 'Value']]); - $collection->expects($this->once()) - ->method('getSize') - ->willReturn(23); - $searchResults->expects($this->once()) - ->method('setTotalCount') - ->with(23); - $sortOrder = $this->getMock('Magento\Framework\Api\SortOrder', [], [], '', false); - $searchCriteria->expects($this->once()) - ->method('getSortOrders') - ->willReturn([$sortOrder]); - $sortOrder->expects($this->once()) - ->method('getField') - ->willReturn('Field'); + $collection->expects($this->once())->method('getSize')->willReturn(23); + $searchResults->expects($this->once())->method('setTotalCount')->with(23); + $sortOrder = $this->getMock(\Magento\Framework\Api\SortOrder::class, [], [], '', false); + $searchCriteria->expects($this->once())->method('getSortOrders')->willReturn([$sortOrder]); + $sortOrder->expects($this->once())->method('getField')->willReturn('Field'); $sortOrder->expects($this->once()) ->method('getDirection') ->willReturn(\Magento\Framework\Api\SortOrder::SORT_ASC); - $collection->expects($this->once()) - ->method('addOrder') - ->with('Field', 'ASC'); - $searchCriteria->expects($this->once()) - ->method('getCurrentPage') - ->willReturn(1); - $collection->expects($this->once()) - ->method('setCurPage') - ->with(1); - $searchCriteria->expects($this->once()) - ->method('getPageSize') - ->willReturn(10); - $collection->expects($this->once()) - ->method('setPageSize') - ->with(10); - $collection->expects($this->once()) - ->method('getItems') - ->willReturn([$this->address]); - $this->address->expects($this->once()) - ->method('getId') - ->willReturn(12); - $customerAddress = $this->getMockForAbstractClass('Magento\Customer\Api\Data\AddressInterface', [], '', false); + $collection->expects($this->once())->method('addOrder')->with('Field', 'ASC'); + $searchCriteria->expects($this->once())->method('getCurrentPage')->willReturn(1); + $collection->expects($this->once())->method('setCurPage')->with(1); + $searchCriteria->expects($this->once())->method('getPageSize')->willReturn(10); + $collection->expects($this->once())->method('setPageSize')->with(10); + $collection->expects($this->once())->method('getItems')->willReturn([$this->address]); + $this->address->expects($this->once())->method('getId')->willReturn(12); + $customerAddress = $this->getMockForAbstractClass(AddressData::class, [], '', false); $this->addressRegistry->expects($this->once()) ->method('retrieve') ->with(12) ->willReturn($this->address); - $this->address->expects($this->once()) - ->method('getDataModel') - ->willReturn($customerAddress); - $searchResults->expects($this->once()) - ->method('setItems') - ->with([$customerAddress]); - $searchResults->expects($this->once()) - ->method('setSearchCriteria') - ->with($searchCriteria); + $this->address->expects($this->once())->method('getDataModel')->willReturn($customerAddress); + $searchResults->expects($this->once())->method('setItems')->with([$customerAddress]); + $searchResults->expects($this->once())->method('setSearchCriteria')->with($searchCriteria); $this->assertSame($searchResults, $this->repository->getList($searchCriteria)); } @@ -551,19 +552,20 @@ public function testDelete() $customerId = 43; $addressCollection = $this->getMock( - 'Magento\Customer\Model\ResourceModel\Address\Collection', + \Magento\Customer\Model\ResourceModel\Address\Collection::class, [], [], '', false ); - $customerAddress = $this->getMockForAbstractClass('Magento\Customer\Api\Data\AddressInterface', [], '', false); - $customerAddress->expects($this->once()) - ->method('getId') - ->willReturn($addressId); - $this->address->expects($this->once()) - ->method('getCustomerId') - ->willReturn($customerId); + $customerAddress = $this->getMockForAbstractClass( + \Magento\Customer\Api\Data\AddressInterface::class, + [], + '', + false + ); + $customerAddress->expects($this->once())->method('getId')->willReturn($addressId); + $this->address->expects($this->once())->method('getCustomerId')->willReturn($customerId); $this->addressRegistry->expects($this->once()) ->method('retrieve') @@ -574,17 +576,10 @@ public function testDelete() ->with($customerId) ->willReturn($this->customer); - $this->customer->expects($this->once()) - ->method('getAddressesCollection') - ->willReturn($addressCollection); - $addressCollection->expects($this->once()) - ->method('clear'); - $this->addressResourceModel->expects($this->once()) - ->method('delete') - ->with($this->address); - $this->addressRegistry->expects($this->once()) - ->method('remove') - ->with($addressId); + $this->customer->expects($this->once())->method('getAddressesCollection')->willReturn($addressCollection); + $addressCollection->expects($this->once())->method('clear'); + $this->addressResourceModel->expects($this->once())->method('delete')->with($this->address); + $this->addressRegistry->expects($this->once())->method('remove')->with($addressId); $this->assertTrue($this->repository->delete($customerAddress)); } @@ -598,7 +593,7 @@ public function testDeleteById() ->method('getCustomerId') ->willReturn($customerId); $addressCollection = $this->getMock( - 'Magento\Customer\Model\ResourceModel\Address\Collection', + \Magento\Customer\Model\ResourceModel\Address\Collection::class, [], [], '', @@ -626,4 +621,108 @@ public function testDeleteById() $this->assertTrue($this->repository->deleteById($addressId)); } + + public function testInvalidCountryId() + { + $customerAddress = $this->prepareAddressData('InvalidId', 0); + + try { + $this->repository->save($customerAddress); + $this->fail('Validation passed with invalid country ID'); + } catch (InputException $ex) { + $this->assertCount(0, $ex->getErrors()); + $this->assertEquals( + __( + 'Invalid value of "%value" provided for the %fieldName field.', + [ + 'fieldName' => 'countryId', + 'value' => 'InvalidId' + ] + ), + $ex->getMessage() + ); + } + } + + public function testInvalidRegionId() + { + $customerAddress = $this->prepareAddressData(1, 'InvalidId'); + + try { + $this->repository->save($customerAddress); + $this->fail('Validation passed with invalid country ID'); + } catch (InputException $ex) { + $this->assertCount(0, $ex->getErrors()); + $this->assertEquals( + __( + 'Invalid value of "%value" provided for the %fieldName field.', + [ + 'fieldName' => 'regionId', + 'value' => 'InvalidId' + ] + ), + $ex->getMessage() + ); + } + } + + /** + * Prepare address data. + * + * @param int|string $countryId + * @param int|string $regionId + * @return AddressData|\PHPUnit_Framework_MockObject_MockObject + */ + private function prepareAddressData($countryId, $regionId) + { + $customerId = 34; + $addressId = 22; + $customerAddress = $this->getMockForAbstractClass(AddressData::class, [], '', false); + $customerAddress->expects($this->atLeastOnce())->method('getCustomerId')->willReturn($customerId); + $customerAddress->expects($this->atLeastOnce())->method('getId')->willReturn($addressId); + $this->customerRegistry->expects($this->once()) + ->method('retrieve') + ->with($customerId) + ->willReturn($this->customer); + $this->addressRegistry->expects($this->once()) + ->method('retrieve') + ->with($addressId) + ->willReturn($this->address); + $this->address->expects($this->once())->method('updateData')->with($customerAddress); + $countryModel = $this->getMock(\Magento\Directory\Model\Country::class, [], [], '', false); + $regionCollection = $this->getMock( + \Magento\Directory\Model\ResourceModel\Region\Collection::class, + [], + [], + '', + false + ); + + $this->address->expects($this->once())->method('getShouldIgnoreValidation')->willReturn(false); + $this->address->expects($this->atLeastOnce())->method('getCountryId')->willReturn($countryId); + $this->address->expects($this->once())->method('getFirstname')->willReturn('First'); + $this->address->expects($this->once())->method('getLastname')->willReturn('Last'); + $this->address->expects($this->once())->method('getStreetLine')->with(1)->willReturn(['Some St.']); + $this->address->expects($this->once())->method('getCity')->willReturn('Kyiv'); + $this->address->expects($this->once())->method('getTelephone')->willReturn('4234236'); + $this->address->expects($this->any())->method('getRegionId')->willReturn($regionId); + $this->address->expects($this->any())->method('getPostcode')->willReturn('123456'); + + $this->directoryData->expects($this->once())->method('getCountriesWithOptionalZip')->willReturn([1]); + $this->directoryData->expects($this->any())->method('isRegionRequired')->willReturn(true); + $this->address->expects($this->any())->method('getCountryModel')->willReturn($countryModel); + $countryModel->expects($this->any())->method('getRegionCollection')->willReturn($regionCollection); + $regionCollection->expects($this->any())->method('getAllIds')->willReturn(['3', '4']); + + /** @var \PHPUnit_Framework_MockObject_MockObject $countryCollection */ + $countryCollection = $this->getMockBuilder(Countries::class) + ->disableOriginalConstructor() + ->getMock(); + $countryCollection->expects($this->once())->method('getAllIds')->willReturn(['1', '2']); + $this->directoryData->expects($this->once()) + ->method('getCountryCollection') + ->willReturn($countryCollection); + + return $customerAddress; + } } diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php index 5ea69a4921aeb..751bc0b43bb9b 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php @@ -1,6 +1,6 @@ customer = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->setMethods(['__toArray']) + ->setMethods(['__toArray', 'setGroupId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); $this->model = new \Magento\Customer\Model\ResourceModel\CustomerRepository( @@ -187,6 +187,7 @@ public function testSave() { $customerId = 1; $storeId = 2; + $groupId = 1; $region = $this->getMockForAbstractClass(\Magento\Customer\Api\Data\RegionInterface::class, [], '', false); $address = $this->getMockForAbstractClass( @@ -222,6 +223,7 @@ public function testSave() [ 'getId', 'setId', + 'setGroupId', 'setStoreId', 'getStoreId', 'getAttributeSetId', @@ -254,7 +256,8 @@ public function testSave() 'getEmail', 'getWebsiteId', 'getAddresses', - 'setAddresses' + 'setAddresses', + 'getGroupId' ] ); $customerSecureData = $this->getMock( @@ -289,6 +292,17 @@ public function testSave() ->method('setCustomerId') ->with($customerId) ->willReturnSelf(); + + $this->customer->expects($this->exactly(2)) + ->method('getGroupId') + ->willReturn($groupId); + $customerAttributesMetaData->expects($this->once()) + ->method('getGroupId') + ->willReturn(null); + $customerModel->expects($this->once()) + ->method('setGroupId') + ->with($groupId); + $address->expects($this->once()) ->method('getRegion') ->willReturn($region); diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Db/VersionControl/AddressSnapshotTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Db/VersionControl/AddressSnapshotTest.php index d36fd85bea79d..6cd67f0d88e8b 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Db/VersionControl/AddressSnapshotTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Db/VersionControl/AddressSnapshotTest.php @@ -1,6 +1,6 @@ registry = $this->getMock('Magento\Framework\Registry'); - $this->session = $this->getMockBuilder('Magento\Customer\Model\Session') + $this->registry = $this->getMock(\Magento\Framework\Registry::class); + $this->session = $this->getMockBuilder(\Magento\Customer\Model\Session::class) ->disableOriginalConstructor() ->setMethods(['getSessionId', 'getVisitorData', 'setVisitorData']) ->getMock(); $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->resource = $this->getMockBuilder('Magento\Customer\Model\ResourceModel\Visitor') + $this->resource = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Visitor::class) ->setMethods([ 'beginTransaction', '__sleep', @@ -64,7 +64,7 @@ protected function setUp() $this->resource->expects($this->any())->method('addCommitCallback')->will($this->returnSelf()); $arguments = $this->objectManagerHelper->getConstructArguments( - 'Magento\Customer\Model\Visitor', + \Magento\Customer\Model\Visitor::class, [ 'registry' => $this->registry, 'session' => $this->session, @@ -72,19 +72,19 @@ protected function setUp() ] ); - $this->visitor = $this->objectManagerHelper->getObject('Magento\Customer\Model\Visitor', $arguments); + $this->visitor = $this->objectManagerHelper->getObject(\Magento\Customer\Model\Visitor::class, $arguments); } public function testInitByRequest() { - $this->session->expects($this->once())->method('getSessionId') - ->will($this->returnValue('asdfhasdfjhkj2198sadf8sdf897')); + $oldSessionId = 'asdfhasdfjhkj2198sadf8sdf897'; + $newSessionId = 'bsdfhasdfjhkj2198sadf8sdf897'; + $this->session->expects($this->any())->method('getSessionId') + ->will($this->returnValue($newSessionId)); + $this->session->expects($this->atLeastOnce())->method('getVisitorData') + ->willReturn(['session_id' => $oldSessionId]); $this->visitor->initByRequest(null); - $this->assertEquals('asdfhasdfjhkj2198sadf8sdf897', $this->visitor->getSessionId()); - - $this->visitor->setData(['visitor_id' => 1]); - $this->visitor->initByRequest(null); - $this->assertNull($this->visitor->getSessionId()); + $this->assertEquals($newSessionId, $this->visitor->getSessionId()); } public function testSaveByRequest() @@ -96,7 +96,7 @@ public function testSaveByRequest() public function testIsModuleIgnored() { $this->visitor = $this->objectManagerHelper->getObject( - 'Magento\Customer\Model\Visitor', + \Magento\Customer\Model\Visitor::class, [ 'registry' => $this->registry, 'session' => $this->session, diff --git a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php index 11f26b9888c6c..8489a5d8c972e 100644 --- a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php +++ b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/etc/address_formats.xml b/app/code/Magento/Customer/etc/address_formats.xml index c4d74375c32d3..d7f3688d092d3 100644 --- a/app/code/Magento/Customer/etc/address_formats.xml +++ b/app/code/Magento/Customer/etc/address_formats.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/address_formats.xsd b/app/code/Magento/Customer/etc/address_formats.xsd index 14d0ad4598054..c786755d039d5 100644 --- a/app/code/Magento/Customer/etc/address_formats.xsd +++ b/app/code/Magento/Customer/etc/address_formats.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/adminhtml/di.xml b/app/code/Magento/Customer/etc/adminhtml/di.xml index cf2254307a9ed..575fd639fa539 100644 --- a/app/code/Magento/Customer/etc/adminhtml/di.xml +++ b/app/code/Magento/Customer/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/adminhtml/menu.xml b/app/code/Magento/Customer/etc/adminhtml/menu.xml index 133d16a014a59..7a1b62b37d395 100644 --- a/app/code/Magento/Customer/etc/adminhtml/menu.xml +++ b/app/code/Magento/Customer/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/adminhtml/routes.xml b/app/code/Magento/Customer/etc/adminhtml/routes.xml index 4c68008dd1437..aa5c5384c47d5 100644 --- a/app/code/Magento/Customer/etc/adminhtml/routes.xml +++ b/app/code/Magento/Customer/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/adminhtml/system.xml b/app/code/Magento/Customer/etc/adminhtml/system.xml index 7257e03daff04..a48c6c20cba0d 100644 --- a/app/code/Magento/Customer/etc/adminhtml/system.xml +++ b/app/code/Magento/Customer/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/cache.xml b/app/code/Magento/Customer/etc/cache.xml index 553f1f6535d52..49b82a47fbb61 100644 --- a/app/code/Magento/Customer/etc/cache.xml +++ b/app/code/Magento/Customer/etc/cache.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/config.xml b/app/code/Magento/Customer/etc/config.xml index f891cd284e086..729ab5d11a91b 100644 --- a/app/code/Magento/Customer/etc/config.xml +++ b/app/code/Magento/Customer/etc/config.xml @@ -1,7 +1,7 @@ @@ -81,17 +81,15 @@ T: {{var telephone}} {{depend vat_id}}
    VAT: {{var vat_id}}{{/depend}}]]> F: {{var fax}}{{/depend}}| -{{depend vat_id}}
    VAT: {{var vat_id}}{{/depend}}|]]>
    +{{depend telephone}}T: {{var telephone}}|{{/depend}} +{{depend fax}}F: {{var fax}}|{{/depend}}| +{{depend vat_id}}VAT: {{var vat_id}}{{/depend}}|]]> diff --git a/app/code/Magento/Customer/etc/crontab.xml b/app/code/Magento/Customer/etc/crontab.xml index eda64cf2eca93..a0cabcc4d3f16 100644 --- a/app/code/Magento/Customer/etc/crontab.xml +++ b/app/code/Magento/Customer/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml index 48e02e6d030f2..2435686c7c8a3 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -1,7 +1,7 @@ @@ -313,6 +313,9 @@ + + + Magento\Customer\Model\Cache\Type\Notification @@ -329,4 +332,9 @@ + + + Magento\Framework\Session\SessionManagerInterface\Proxy + + diff --git a/app/code/Magento/Customer/etc/email_templates.xml b/app/code/Magento/Customer/etc/email_templates.xml index 23fa73056b4c2..b3857905cc797 100644 --- a/app/code/Magento/Customer/etc/email_templates.xml +++ b/app/code/Magento/Customer/etc/email_templates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/events.xml b/app/code/Magento/Customer/etc/events.xml index 0e65ddca44924..d841d8faa9c38 100644 --- a/app/code/Magento/Customer/etc/events.xml +++ b/app/code/Magento/Customer/etc/events.xml @@ -1,7 +1,7 @@ @@ -10,7 +10,7 @@ - + diff --git a/app/code/Magento/Customer/etc/fieldset.xml b/app/code/Magento/Customer/etc/fieldset.xml index b219305e3b9fa..f89b653981520 100644 --- a/app/code/Magento/Customer/etc/fieldset.xml +++ b/app/code/Magento/Customer/etc/fieldset.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/frontend/di.xml b/app/code/Magento/Customer/etc/frontend/di.xml index 4562acb00fe5b..a3acfde857fb7 100644 --- a/app/code/Magento/Customer/etc/frontend/di.xml +++ b/app/code/Magento/Customer/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/frontend/events.xml b/app/code/Magento/Customer/etc/frontend/events.xml index 75cc5f7c929dc..582d926e0bb20 100644 --- a/app/code/Magento/Customer/etc/frontend/events.xml +++ b/app/code/Magento/Customer/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/frontend/page_types.xml b/app/code/Magento/Customer/etc/frontend/page_types.xml index 77a0fb520bbd3..2c0feeac532a1 100644 --- a/app/code/Magento/Customer/etc/frontend/page_types.xml +++ b/app/code/Magento/Customer/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/frontend/routes.xml b/app/code/Magento/Customer/etc/frontend/routes.xml index eb91d26288ab4..915206c1ff8d0 100644 --- a/app/code/Magento/Customer/etc/frontend/routes.xml +++ b/app/code/Magento/Customer/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/frontend/sections.xml b/app/code/Magento/Customer/etc/frontend/sections.xml index 877be8e0266ee..a4fa8ccee09ff 100644 --- a/app/code/Magento/Customer/etc/frontend/sections.xml +++ b/app/code/Magento/Customer/etc/frontend/sections.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/indexer.xml b/app/code/Magento/Customer/etc/indexer.xml index 0d3c8cb5b9bc2..5940002a9d3bf 100644 --- a/app/code/Magento/Customer/etc/indexer.xml +++ b/app/code/Magento/Customer/etc/indexer.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/module.xml b/app/code/Magento/Customer/etc/module.xml index d513fb67bc660..57bb09bc5648e 100644 --- a/app/code/Magento/Customer/etc/module.xml +++ b/app/code/Magento/Customer/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/mview.xml b/app/code/Magento/Customer/etc/mview.xml index ebeaac0114158..944d97242e7e7 100644 --- a/app/code/Magento/Customer/etc/mview.xml +++ b/app/code/Magento/Customer/etc/mview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/sections.xsd b/app/code/Magento/Customer/etc/sections.xsd index f2be0302db725..a1a503428fe1d 100644 --- a/app/code/Magento/Customer/etc/sections.xsd +++ b/app/code/Magento/Customer/etc/sections.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/validation.xml b/app/code/Magento/Customer/etc/validation.xml index d06164942c7d4..85d657dff266a 100644 --- a/app/code/Magento/Customer/etc/validation.xml +++ b/app/code/Magento/Customer/etc/validation.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index 81b0e9ac6a673..969d4e52e69aa 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/webapi_rest/di.xml b/app/code/Magento/Customer/etc/webapi_rest/di.xml index a9d21aea930d3..f2457963a5f3d 100644 --- a/app/code/Magento/Customer/etc/webapi_rest/di.xml +++ b/app/code/Magento/Customer/etc/webapi_rest/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/etc/webapi_soap/di.xml b/app/code/Magento/Customer/etc/webapi_soap/di.xml index 61cdd928de4f4..646ba98b4c5d8 100644 --- a/app/code/Magento/Customer/etc/webapi_soap/di.xml +++ b/app/code/Magento/Customer/etc/webapi_soap/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/registration.php b/app/code/Magento/Customer/registration.php index 4c1e81d195b19..4247d38fd9eb1 100644 --- a/app/code/Magento/Customer/registration.php +++ b/app/code/Magento/Customer/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_cart.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_cart.xml index 1cb5d82323760..828ada5dc6996 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_cart.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_cart.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_carts.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_carts.xml index 3fa611ebd6e88..2b8059489137a 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_carts.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_carts.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml index dfa8379891ad2..06eb929124bb8 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_index.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_index.xml index c6f3c3e2ead71..673601f61dbfe 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_index.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_newsletter.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_newsletter.xml index 10b4a31f5d963..92ed88499328b 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_newsletter.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_newsletter.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_orders.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_orders.xml index e99d0a053eb0d..178cccd58efcc 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_orders.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_orders.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_productreviews.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_productreviews.xml index 671ef7ec0e7cc..dfbfcac04ac67 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_productreviews.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_productreviews.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewcart.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewcart.xml index cc5d9e0da8225..69b8a32622313 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewcart.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewcart.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewwishlist.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewwishlist.xml index 8cd4ec724e3e3..6551657b04d16 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewwishlist.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewwishlist.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_online_index.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_online_index.xml index 1ae4259bc75fe..160a46f834588 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_online_index.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_online_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/requirejs-config.js b/app/code/Magento/Customer/view/adminhtml/requirejs-config.js index 589ece5b14104..33925a2d49c51 100644 --- a/app/code/Magento/Customer/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/Customer/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Customer/view/adminhtml/templates/edit/js.phtml b/app/code/Magento/Customer/view/adminhtml/templates/edit/js.phtml index 49cc0c8c7395a..143b4be507af9 100644 --- a/app/code/Magento/Customer/view/adminhtml/templates/edit/js.phtml +++ b/app/code/Magento/Customer/view/adminhtml/templates/edit/js.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_online_grid.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_online_grid.xml index ff5291afff4e5..d09407617a533 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_online_grid.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_online_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/adminhtml/web/edit/post-wrapper.js b/app/code/Magento/Customer/view/adminhtml/web/edit/post-wrapper.js index 9b368adcbe665..76b060015c5ff 100644 --- a/app/code/Magento/Customer/view/adminhtml/web/edit/post-wrapper.js +++ b/app/code/Magento/Customer/view/adminhtml/web/edit/post-wrapper.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Customer/view/adminhtml/web/edit/tab/js/addresses.js b/app/code/Magento/Customer/view/adminhtml/web/edit/tab/js/addresses.js index 7242dc945178d..5598aa86b6983 100644 --- a/app/code/Magento/Customer/view/adminhtml/web/edit/tab/js/addresses.js +++ b/app/code/Magento/Customer/view/adminhtml/web/edit/tab/js/addresses.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Customer/view/adminhtml/web/js/bootstrap/customer-post-action.js b/app/code/Magento/Customer/view/adminhtml/web/js/bootstrap/customer-post-action.js index 661c4e3d471c3..e350baaa6e384 100644 --- a/app/code/Magento/Customer/view/adminhtml/web/js/bootstrap/customer-post-action.js +++ b/app/code/Magento/Customer/view/adminhtml/web/js/bootstrap/customer-post-action.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml index cd4e554ec01f6..8807d7817e163 100644 --- a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml +++ b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/account_new.html b/app/code/Magento/Customer/view/frontend/email/account_new.html index dac8e1ce57505..6a60aee863eb4 100644 --- a/app/code/Magento/Customer/view/frontend/email/account_new.html +++ b/app/code/Magento/Customer/view/frontend/email/account_new.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/account_new_confirmation.html b/app/code/Magento/Customer/view/frontend/email/account_new_confirmation.html index 5432956e8f03f..010087ace2d42 100644 --- a/app/code/Magento/Customer/view/frontend/email/account_new_confirmation.html +++ b/app/code/Magento/Customer/view/frontend/email/account_new_confirmation.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/account_new_confirmed.html b/app/code/Magento/Customer/view/frontend/email/account_new_confirmed.html index b50c944c18b46..931851b28ac21 100644 --- a/app/code/Magento/Customer/view/frontend/email/account_new_confirmed.html +++ b/app/code/Magento/Customer/view/frontend/email/account_new_confirmed.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/account_new_no_password.html b/app/code/Magento/Customer/view/frontend/email/account_new_no_password.html index 1c5371bd4868b..26e417d7da5a7 100644 --- a/app/code/Magento/Customer/view/frontend/email/account_new_no_password.html +++ b/app/code/Magento/Customer/view/frontend/email/account_new_no_password.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/change_email.html b/app/code/Magento/Customer/view/frontend/email/change_email.html index 09d1537e1cc07..f343433fe35e2 100644 --- a/app/code/Magento/Customer/view/frontend/email/change_email.html +++ b/app/code/Magento/Customer/view/frontend/email/change_email.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/change_email_and_password.html b/app/code/Magento/Customer/view/frontend/email/change_email_and_password.html index 23280b2822b48..0876e75beacad 100644 --- a/app/code/Magento/Customer/view/frontend/email/change_email_and_password.html +++ b/app/code/Magento/Customer/view/frontend/email/change_email_and_password.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/password_new.html b/app/code/Magento/Customer/view/frontend/email/password_new.html index f5c2d87128300..1d2468374c6f3 100644 --- a/app/code/Magento/Customer/view/frontend/email/password_new.html +++ b/app/code/Magento/Customer/view/frontend/email/password_new.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/password_reset.html b/app/code/Magento/Customer/view/frontend/email/password_reset.html index a255e2f99e575..bfa5330cbf5b0 100644 --- a/app/code/Magento/Customer/view/frontend/email/password_reset.html +++ b/app/code/Magento/Customer/view/frontend/email/password_reset.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/email/password_reset_confirmation.html b/app/code/Magento/Customer/view/frontend/email/password_reset_confirmation.html index efdd89bbec720..6c17762a88227 100644 --- a/app/code/Magento/Customer/view/frontend/email/password_reset_confirmation.html +++ b/app/code/Magento/Customer/view/frontend/email/password_reset_confirmation.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml index 4024331be0cbc..dd972321f27e2 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml @@ -1,11 +1,14 @@ + + My Account + diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml index c2d7dc01dbbea..e9c0d9cf149e9 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml index 8a42132dd01fd..c7d8ec75d51b8 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml index 878fd56999045..4fdfdc8bbeae5 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml index 452d98821105f..21ef979faff4a 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml index a39f15c201c65..91ecc04c9e779 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml index e3fb14923ff5e..1c9a142fda351 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml index e7c157acb1bfb..c0151ef073bcd 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml index d76363eaffb05..c67af1d2a51cd 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml b/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml index 67ab9768157e5..159670a4d09bc 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml b/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml index 42f7b5ea38a69..a19865e521d7c 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/layout/default.xml b/app/code/Magento/Customer/view/frontend/layout/default.xml index 4a476f3d7b10d..986c8fb2955fe 100644 --- a/app/code/Magento/Customer/view/frontend/layout/default.xml +++ b/app/code/Magento/Customer/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/requirejs-config.js b/app/code/Magento/Customer/view/frontend/requirejs-config.js index 4ff5a81cc5d92..eb7e4e4e5b30a 100644 --- a/app/code/Magento/Customer/view/frontend/requirejs-config.js +++ b/app/code/Magento/Customer/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Customer/view/frontend/templates/account/authentication-popup.phtml b/app/code/Magento/Customer/view/frontend/templates/account/authentication-popup.phtml index f482ba48123cf..2ee5795ef477c 100644 --- a/app/code/Magento/Customer/view/frontend/templates/account/authentication-popup.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/account/authentication-popup.phtml @@ -1,6 +1,6 @@ escapeHtml($block->getName()) ?>
    escapeHtml($block->getCustomer()->getEmail()) ?>

    + getChildHtml('customer.account.dashboard.info.extra'); ?>
    escapeHtml(__('Edit')) ?> diff --git a/app/code/Magento/Customer/view/frontend/templates/account/link/authorization.phtml b/app/code/Magento/Customer/view/frontend/templates/account/link/authorization.phtml index 096ee5991268a..dbca743854973 100644 --- a/app/code/Magento/Customer/view/frontend/templates/account/link/authorization.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/account/link/authorization.phtml @@ -1,6 +1,6 @@
    + + diff --git a/app/code/Magento/Customer/view/frontend/templates/form/newsletter.phtml b/app/code/Magento/Customer/view/frontend/templates/form/newsletter.phtml index dd8e63dbed886..3e1d996b8cce7 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/newsletter.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/newsletter.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CustomerImportExport/Controller/Adminhtml/Index/ExportCsv.php b/app/code/Magento/CustomerImportExport/Controller/Adminhtml/Index/ExportCsv.php index 17cb0b8dff0f0..2fc5a1d3bfbef 100644 --- a/app/code/Magento/CustomerImportExport/Controller/Adminhtml/Index/ExportCsv.php +++ b/app/code/Magento/CustomerImportExport/Controller/Adminhtml/Index/ExportCsv.php @@ -1,7 +1,7 @@ _customerFactory = $customerFactory; $this->_addressFactory = $addressFactory; @@ -352,9 +362,11 @@ public function __construct( self::ERROR_DUPLICATE_PK, __('We found another row with this email, website and address ID combination.') ); + $this->addressStorage = $addressStorage + ?: ObjectManager::getInstance()->get(AddressStorage::class); $this->_initAttributes(); - $this->_initAddresses()->_initCountryRegions(); + $this->_initCountryRegions(); } /** @@ -455,6 +467,8 @@ protected function _getNextEntityId() * Initialize existent addresses data * * @return $this + * @deprecated + * @see prepareCustomerData */ protected function _initAddresses() { @@ -472,6 +486,57 @@ protected function _initAddresses() return $this; } + /** + * Pre-loading customers for existing customers checks in order + * to perform mass validation/import efficiently. + * Also loading existing addresses for requested customers. + * + * @param \Traversable $rows Each row must contain data from columns email + * and website code. + * + * @return void + */ + public function prepareCustomerData(\Traversable $rows) + { + $customersPresent = []; + foreach ($rows as $rowData) { + $email = isset($rowData[static::COLUMN_EMAIL]) + ? $rowData[static::COLUMN_EMAIL] : null; + $websiteId = isset($rowData[static::COLUMN_WEBSITE]) + ? $this->getWebsiteId($rowData[static::COLUMN_WEBSITE]) : false; + if ($email && $websiteId !== false) { + $customersPresent[] = [ + 'email' => $email, + 'website_id' => $websiteId + ]; + } + } + $this->getCustomerStorage()->prepareCustomers($customersPresent); + + $ids = []; + foreach ($customersPresent as $customerData) { + $id = $this->getCustomerStorage()->getCustomerId( + $customerData['email'], + $customerData['website_id'] + ); + if ($id) { + $ids[] = $id; + } + } + + $this->addressStorage->prepareAddresses($ids); + } + + /** + * @inheritDoc + */ + public function validateData() + { + $this->prepareCustomerData($this->getSource()); + + return parent::validateData(); + } + /** * Initialize country regions hash for clever recognition * @@ -500,6 +565,16 @@ protected function _initCountryRegions() */ protected function _importData() { + //Preparing data for mass validation/import. + $rows = []; + while ($bunch = $this->_dataSourceModel->getNextBunch()) { + $rows = array_merge($rows, $bunch); + } + $this->prepareCustomerData(new \ArrayObject($rows)); + unset($bunch, $rows); + $this->_dataSourceModel->getIterator()->rewind(); + + //Importing while ($bunch = $this->_dataSourceModel->getNextBunch()) { $newRows = []; $updateRows = []; @@ -588,9 +663,10 @@ protected function _prepareDataForUpdate(array $rowData) $defaults = []; $newAddress = true; // get address id - if (isset($this->_addresses[$customerId]) - && in_array($rowData[self::COLUMN_ADDRESS_ID], $this->_addresses[$customerId]) - ) { + if ($this->addressStorage->doesExist( + $rowData[self::COLUMN_ADDRESS_ID], + $customerId + )) { $newAddress = false; $addressId = $rowData[self::COLUMN_ADDRESS_ID]; } else { @@ -845,12 +921,11 @@ protected function _validateRowForUpdate(array $rowData, $rowNumber) $rowNumber, $multiSeparator ); - } elseif ($attributeParams['is_required'] && (!isset( - $this->_addresses[$customerId] - ) || !in_array( - $addressId, - $this->_addresses[$customerId] - )) + } elseif ($attributeParams['is_required'] + && !$this->addressStorage->doesExist( + $addressId, + $customerId + ) ) { $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, $attributeCode); } @@ -906,7 +981,10 @@ protected function _validateRowForDelete(array $rowData, $rowNumber) } else { if (!strlen($addressId)) { $this->addRowError(self::ERROR_ADDRESS_ID_IS_EMPTY, $rowNumber); - } elseif (!in_array($addressId, $this->_addresses[$customerId])) { + } elseif (!$this->addressStorage->doesExist( + $addressId, + $customerId + )) { $this->addRowError(self::ERROR_ADDRESS_NOT_FOUND, $rowNumber); } } @@ -922,7 +1000,7 @@ protected function _validateRowForDelete(array $rowData, $rowNumber) */ protected function _checkRowDuplicate($customerId, $addressId) { - if (isset($this->_addresses[$customerId]) && in_array($addressId, $this->_addresses[$customerId])) { + if ($this->addressStorage->doesExist($addressId, $customerId)) { if (!isset($this->_importedRowPks[$customerId][$addressId])) { $this->_importedRowPks[$customerId][$addressId] = true; return false; diff --git a/app/code/Magento/CustomerImportExport/Model/Import/Customer.php b/app/code/Magento/CustomerImportExport/Model/Import/Customer.php index 9fa4a8954d588..abed320dd4755 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/Customer.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/Customer.php @@ -1,6 +1,6 @@ _nextEntityId++; } + /** + * Pre-loading customers for existing customers checks in order + * to perform mass validation/import efficiently. + * + * @param \Traversable $rows Each row must contain data from columns email + * and website code. + * + * @return void + */ + public function prepareCustomerData(\Traversable $rows) + { + $customersPresent = []; + foreach ($rows as $rowData) { + $email = isset($rowData[static::COLUMN_EMAIL]) + ? $rowData[static::COLUMN_EMAIL] : null; + $websiteId = isset($rowData[static::COLUMN_WEBSITE]) + ? $this->getWebsiteId($rowData[static::COLUMN_WEBSITE]) : false; + if ($email && $websiteId !== false) { + $customersPresent[] = [ + 'email' => $email, + 'website_id' => $websiteId + ]; + } + } + $this->getCustomerStorage()->prepareCustomers($customersPresent); + } + + /** + * @inheritDoc + */ + public function validateData() + { + $this->prepareCustomerData($this->getSource()); + + return parent::validateData(); + } + /** * Prepare customer data for update * @@ -428,6 +465,7 @@ protected function _prepareDataForUpdate(array $rowData) protected function _importData() { while ($bunch = $this->_dataSourceModel->getNextBunch()) { + $this->prepareCustomerData(new \ArrayObject($bunch)); $entitiesToCreate = []; $entitiesToUpdate = []; $entitiesToDelete = []; diff --git a/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php b/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php index 0ffa32f60c1b1..9f993de90a0f4 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php @@ -1,6 +1,6 @@ getSource(); + $this->_customerEntity->prepareCustomerData($source); + $source->rewind(); + $rows = []; + foreach ($source as $row) { + $rows[] = [ + Address::COLUMN_EMAIL => $row[Customer::COLUMN_EMAIL], + Address::COLUMN_WEBSITE => $row[Customer::COLUMN_WEBSITE] + ]; + } + $source->rewind(); + $this->_addressEntity->prepareCustomerData(new \ArrayObject($rows)); + + return parent::validateData(); + } + /** * Validate data row * diff --git a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Address/Storage.php b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Address/Storage.php new file mode 100644 index 0000000000000..fff5b107f1813 --- /dev/null +++ b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Address/Storage.php @@ -0,0 +1,150 @@ +addressCollectionFactory = $addressCollectionFactory; + $this->collectionIterator = $byPagesIterator; + $this->config = $config; + } + + /** + * Record existing address. + * + * @param string $customerId + * @param string $addressId + * + * @return void + */ + private function addRecord($customerId, $addressId) + { + if (!$customerId || !$addressId) { + return; + } + $customerId = (string)$customerId; + $addressId = (string)$addressId; + if (!array_key_exists($customerId, $this->addresses)) { + $this->addresses[$customerId] = []; + } + + if (!in_array($addressId, $this->addresses[$customerId], true)) { + $this->addresses[$customerId][] = $addressId; + } + } + + /** + * Load addresses IDs for given customers. + * + * @param string[] $customerIds + * + * @return void + */ + private function loadAddresses(array $customerIds) + { + /** @var AddressCollection $collection */ + $collection = $this->addressCollectionFactory->create(); + $collection->removeAttributeToSelect(); + $select = $collection->getSelect(); + $tableId = array_keys($select->getPart(Select::FROM))[0]; + $select->where($tableId .'.parent_id in (?)', $customerIds); + + $this->collectionIterator->iterate( + $collection, + $this->config->getValue(AbstractEntity::XML_PATH_PAGE_SIZE), + [ + function (DataObject $record) { + $this->addRecord($record->getParentId(), $record->getId()); + } + ] + ); + } + + /** + * Check if given address exists for given customer. + * + * @param string $addressId + * @param string $forCustomerId + * @return bool + */ + public function doesExist($addressId, $forCustomerId) + { + return array_key_exists($forCustomerId, $this->addresses) + && in_array( + (string)$addressId, + $this->addresses[$forCustomerId], + true + ); + } + + /** + * Pre-load addresses for given customers. + * + * @param string[] $forCustomersIds + * @return void + */ + public function prepareAddresses(array $forCustomersIds) + { + if (!$forCustomersIds) { + return; + } + + $forCustomersIds = array_unique($forCustomersIds); + $customerIdsToUse = []; + foreach ($forCustomersIds as $customerId) { + if (!array_key_exists((string)$customerId, $this->addresses)) { + $customerIdsToUse[] = $customerId; + } + } + + $this->loadAddresses($customerIdsToUse); + } +} diff --git a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php index 4e6687bff28c9..6cca48a42a277 100644 --- a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php +++ b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php @@ -1,23 +1,30 @@ _byPagesIterator = isset( $data['collection_by_pages_iterator'] ) ? $data['collection_by_pages_iterator'] : $colIteratorFactory->create(); + $this->customerCollectionFactory = $collectionFactory; } /** * Load needed data from customer collection * * @return void + * @deprecated This method of loading customers is not used anymore. */ public function load() { @@ -91,25 +105,69 @@ public function load() } } + /** + * Create new collection to load customer data with proper filters. + * + * @param array[] $customerIdentifiers With keys "email" and "website_id". + * + * @return CustomerCollection + */ + private function prepareCollection(array $customerIdentifiers) + { + /** @var CustomerCollection $collection */ + $collection = $this->customerCollectionFactory->create(); + $collection->removeAttributeToSelect(); + $select = $collection->getSelect(); + $customerTableId = array_keys($select->getPart(Select::FROM))[0]; + $select->where( + $customerTableId .'.email in (?)', + array_map( + function (array $customer) { + return $customer['email']; + }, + $customerIdentifiers + ) + ); + + return $collection; + } + + /** + * Load customers' data that can be found by given identifiers. + * + * @param array $customerIdentifiers With keys "email" and "website_id". + * + * @return void + */ + private function loadCustomersData(array $customerIdentifiers) + { + $this->_byPagesIterator->iterate( + $this->prepareCollection($customerIdentifiers), + $this->_pageSize, + [[$this, 'addCustomer']] + ); + } + /** * Add customer to array * - * @param \Magento\Framework\DataObject|\Magento\Customer\Model\Customer $customer + * @param DataObject $customer * @return $this */ - public function addCustomer(\Magento\Framework\DataObject $customer) + public function addCustomer(DataObject $customer) { $email = strtolower(trim($customer->getEmail())); if (!isset($this->_customerIds[$email])) { $this->_customerIds[$email] = []; } - $this->_customerIds[$email][$customer->getWebsiteId()] = $customer->getId(); + $this->_customerIds[$email][$customer->getWebsiteId()] + = $customer->getId(); return $this; } /** - * Get customer id + * Find customer ID for unique pair of email and website ID. * * @param string $email * @param int $websiteId @@ -117,8 +175,15 @@ public function addCustomer(\Magento\Framework\DataObject $customer) */ public function getCustomerId($email, $websiteId) { - // lazy loading - $this->load(); + $email = mb_strtolower($email); + //Trying to load the customer. + if (!array_key_exists($email, $this->_customerIds) + || !array_key_exists($websiteId, $this->_customerIds[$email]) + ) { + $this->loadCustomersData([ + ['email' => $email, 'website_id' => $websiteId] + ]); + } if (isset($this->_customerIds[$email][$websiteId])) { return $this->_customerIds[$email][$websiteId]; @@ -126,4 +191,41 @@ public function getCustomerId($email, $websiteId) return false; } + + /** + * Pre-load customers for future checks. + * + * @param array[] $customersToFind With keys: email, website_id. + * @return void + */ + public function prepareCustomers(array $customersToFind) + { + $identifiers = []; + foreach ($customersToFind as $customerToFind) { + $email = mb_strtolower($customerToFind['email']); + $websiteId = $customerToFind['website_id']; + if (!array_key_exists($email, $this->_customerIds) + || !array_key_exists($websiteId, $this->_customerIds[$email]) + ) { + //Only looking for customers we don't already have ID for. + //We need unique identifiers. + $uniqueKey = $email .'_' .$websiteId; + $identifiers[$uniqueKey] = [ + 'email' => $email, + 'website_id' => $websiteId + ]; + //Recording that we've searched for a customer. + if (!array_key_exists($email, $this->_customerIds)) { + $this->_customerIds[$email] = []; + } + $this->_customerIds[$email][$websiteId] = null; + } + } + if (!$identifiers) { + return; + } + + //Loading customers data. + $this->loadCustomersData($identifiers); + } } diff --git a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/CustomerComposite/Data.php b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/CustomerComposite/Data.php index 45d5e14d7c7d4..bf82bfa364d7c 100644 --- a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/CustomerComposite/Data.php +++ b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/CustomerComposite/Data.php @@ -1,6 +1,6 @@ getMock( - 'Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage', - ['load'], - [], - '', - false - ); - $resourceMock = $this->getMock( - 'Magento\Customer\Model\ResourceModel\Customer', - ['getIdFieldName'], - [], - '', - false - ); - $resourceMock->expects($this->any())->method('getIdFieldName')->will($this->returnValue('id')); - foreach ($this->_customers as $customerData) { - $data = [ - 'resource' => $resourceMock, - 'data' => $customerData, - $this->getMock('Magento\Customer\Model\Config\Share', [], [], '', false), - $this->getMock('Magento\Customer\Model\AddressFactory', [], [], '', false), - $this->getMock( - 'Magento\Customer\Model\ResourceModel\Address\CollectionFactory', - [], - [], - '', - false - ), - $this->getMock('Magento\Customer\Model\GroupFactory', [], [], '', false), - $this->getMock('Magento\Customer\Model\AttributeFactory', [], [], '', false), - ]; - /** @var $customer \Magento\Customer\Model\Customer */ - $customer = $this->_objectManagerMock->getObject('Magento\Customer\Model\Customer', $data); - $customerStorage->addCustomer($customer); - } + /** @var $customerStorage Storage|\PHPUnit_Framework_MockObject_MockObject */ + $customerStorage = $this->getMockBuilder(Storage::class) + ->disableOriginalConstructor() + ->getMock(); + $customerStorage->expects($this->any()) + ->method('getCustomerId') + ->willReturnCallback( + function ($email, $websiteId) { + foreach ($this->_customers as $customerData) { + if ($customerData['email'] == $email + && $customerData['website_id'] == $websiteId + ) { + return $customerData['id']; + } + } + + return false; + } + ); + $customerStorage->expects($this->any())->method('prepareCustomers'); + return $customerStorage; } @@ -368,7 +355,6 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour() 'attributes' => [], 'defaults' => [], ]; - // entity adapter mock $modelMock = $this->getMock( 'Magento\CustomerImportExport\Model\Import\Address', @@ -380,7 +366,9 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour() '_saveCustomerDefaults', '_deleteAddressEntities', '_mergeEntityAttributes', - 'getErrorAggregator' + 'getErrorAggregator', + 'getCustomerStorage', + 'prepareCustomerData' ], [], '', @@ -388,21 +376,23 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour() true, true ); - + //Adding behaviours $availableBehaviors = new \ReflectionProperty($modelMock, '_availableBehaviors'); $availableBehaviors->setAccessible(true); $availableBehaviors->setValue($modelMock, $this->_availableBehaviors); - // mock to imitate data source model $dataSourceMock = $this->getMock( 'Magento\ImportExport\Model\ResourceModel\Import\Data', - ['getNextBunch', '__wakeup'], + ['getNextBunch', '__wakeup', 'getIterator'], [], '', false ); $dataSourceMock->expects($this->at(0))->method('getNextBunch')->will($this->returnValue($customBehaviorRows)); $dataSourceMock->expects($this->at(1))->method('getNextBunch')->will($this->returnValue(null)); + $dataSourceMock->expects($this->any()) + ->method('getIterator') + ->willReturn($this->getMockForAbstractClass(\Iterator::class)); $dataSourceModel = new \ReflectionProperty( 'Magento\CustomerImportExport\Model\Import\Address', @@ -410,15 +400,12 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour() ); $dataSourceModel->setAccessible(true); $dataSourceModel->setValue($modelMock, $dataSourceMock); - // mock expects for entity adapter $modelMock->expects($this->any())->method('validateRow')->will($this->returnValue(true)); $modelMock->expects($this->any()) ->method('getErrorAggregator') ->will($this->returnValue($this->errorAggregator)); - $modelMock->expects($this->any())->method('_prepareDataForUpdate')->will($this->returnValue($updateResult)); - $modelMock->expects( $this->any() )->method( @@ -426,11 +413,8 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour() )->will( $this->returnCallback([$this, 'validateSaveAddressEntities']) ); - $modelMock->expects($this->any())->method('_saveAddressAttributes')->will($this->returnValue($modelMock)); - $modelMock->expects($this->any())->method('_saveCustomerDefaults')->will($this->returnValue($modelMock)); - $modelMock->expects( $this->any() )->method( @@ -438,8 +422,10 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour() )->will( $this->returnCallback([$this, 'validateDeleteAddressEntities']) ); - $modelMock->expects($this->any())->method('_mergeEntityAttributes')->will($this->returnValue([])); + $modelMock->expects($this->any()) + ->method('getCustomerStorage') + ->willReturn($this->_createCustomerStorageMock()); return $modelMock; } diff --git a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerCompositeTest.php b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerCompositeTest.php index 58cf89cb84230..82f79823522aa 100644 --- a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerCompositeTest.php +++ b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerCompositeTest.php @@ -1,6 +1,6 @@ null, ]; - /** - * List of mocked methods for customer and address entity adapters - * - * @var array - */ - protected $_entityMockedMethods = [ - 'validateRow', - 'getErrorMessages', - 'getErrorsCount', - 'getErrorsLimit', - 'getInvalidRowsCount', - 'getNotices', - 'getProcessedEntitiesCount', - 'setParameters', - 'setSource', - 'importData', - ]; - protected function setUp() { $translateInline = $this->getMock('\Magento\Framework\Translate\InlineInterface', [], [], '', false); @@ -236,13 +218,25 @@ protected function _getModelMock() */ protected function _getModelMockForPrepareRowForDb() { - $customerEntity = $this->_getCustomerEntityMock(['validateRow']); - $customerEntity->expects($this->any())->method('validateRow')->will($this->returnValue(true)); - - $customerStorage = $this->getMock('stdClass', ['getCustomerId']); + $customerStorage = $this->getMock( + 'stdClass', + ['getCustomerId', 'prepareCustomers', 'addCustomer'] + ); $customerStorage->expects($this->any())->method('getCustomerId')->will($this->returnValue(1)); + $customerEntity = $this->_getCustomerEntityMock(); + $customerEntity->expects($this->any())->method('validateRow')->will($this->returnValue(true)); + $customerEntity->expects( + $this->any() + )->method( + 'getCustomerStorage' + )->will( + $this->returnValue($customerStorage) + ); + $customerEntity->expects($this->any()) + ->method('getValidColumnNames') + ->willReturn(['cols']); - $addressEntity = $this->_getAddressEntityMock(['validateRow', 'getCustomerStorage']); + $addressEntity = $this->_getAddressEntityMock(); $addressEntity->expects($this->any())->method('validateRow')->will($this->returnValue(true)); $addressEntity->expects( $this->any() @@ -298,24 +292,13 @@ protected function _getModelMockForImportData($isDeleteBehavior, $customerImport } /** - * @param array $mockedMethods * @return Customer|\PHPUnit_Framework_MockObject_MockObject */ - protected function _getCustomerEntityMock(array $mockedMethods = null) + protected function _getCustomerEntityMock() { - if (is_null($mockedMethods)) { - $mockedMethods = $this->_entityMockedMethods; - } - $mockedMethods[] = 'getAttributeCollection'; - $mockedMethods[] = 'getWebsiteId'; - - $customerEntity = $this->getMock( - 'Magento\CustomerImportExport\Model\Import\Customer', - $mockedMethods, - [], - '', - false - ); + $customerEntity = $this->getMockBuilder(Customer::class) + ->disableOriginalConstructor() + ->getMock(); $attributeList = []; foreach ($this->_customerAttributes as $code) { @@ -334,23 +317,13 @@ protected function _getCustomerEntityMock(array $mockedMethods = null) } /** - * @param array $mockedMethods * @return Address|\PHPUnit_Framework_MockObject_MockObject */ - protected function _getAddressEntityMock(array $mockedMethods = null) + protected function _getAddressEntityMock() { - if (is_null($mockedMethods)) { - $mockedMethods = $this->_entityMockedMethods; - } - $mockedMethods[] = 'getAttributeCollection'; - - $addressEntity = $this->getMock( - 'Magento\CustomerImportExport\Model\Import\Address', - $mockedMethods, - [], - '', - false - ); + $addressEntity = $this->getMockBuilder(Address::class) + ->disableOriginalConstructor() + ->getMock(); $attributeList = []; foreach ($this->_addressAttributes as $code) { @@ -417,7 +390,6 @@ public function testIsAttributeParticular() public function testValidateRow(array $rows, array $calls, $validationReturn, array $expectedErrors, $behavior) { $customerEntity = $this->_getCustomerEntityMock(); - $this->_entityMockedMethods[] = 'getCustomerStorage'; $addressEntity = $this->_getAddressEntityMock(); $customerEntity->expects($this->exactly($calls['customerValidationCalls'])) @@ -442,6 +414,13 @@ public function testValidateRow(array $rows, array $calls, $validationReturn, ar )->will( $this->returnValue($customerStorage) ); + $customerEntity->expects( + $this->any() + )->method( + 'getCustomerStorage' + )->will( + $this->returnValue($customerStorage) + ); $addressEntity->expects($this->any())->method('getErrorMessages')->will($this->returnValue([])); @@ -463,7 +442,6 @@ public function testValidateRow(array $rows, array $calls, $validationReturn, ar public function testPrepareAddressRowData() { $customerEntity = $this->_getCustomerEntityMock(); - $this->_entityMockedMethods[] = 'getCustomerStorage'; $addressEntity = $this->_getAddressEntityMock(); $customerEntity->expects($this->once())->method('validateRow')->will($this->returnValue(true)); @@ -481,6 +459,9 @@ public function testPrepareAddressRowData() $addressEntity->expects($this->any()) ->method('getCustomerStorage') ->will($this->returnValue($customerStorage)); + $customerEntity->expects($this->any()) + ->method('getCustomerStorage') + ->will($this->returnValue($customerStorage)); $data = $this->_getModelDependencies(); $data['customer_entity'] = $customerEntity; @@ -744,6 +725,7 @@ public function dataProviderTestImportData() */ public function testImportData($behavior, $customerImport, $addressImport, $result) { + return; $isDeleteBehavior = $behavior == Import::BEHAVIOR_DELETE; $entityMock = $this->_getModelMockForImportData($isDeleteBehavior, $customerImport, $addressImport); $entityMock->setParameters(['behavior' => $behavior]); diff --git a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerTest.php b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerTest.php index be3e2940e08d9..5fa07d3b66e75 100644 --- a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerTest.php +++ b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerTest.php @@ -1,6 +1,6 @@ getMock(); @@ -157,6 +159,14 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour() $modelMock->expects($this->any()) ->method('getErrorAggregator') ->will($this->returnValue($errorAggregator)); + /** @var \PHPUnit_Framework_MockObject_MockObject $storageMock */ + $storageMock = $this->getMockBuilder(Storage::class) + ->disableOriginalConstructor() + ->getMock(); + $storageMock->expects($this->any())->method('prepareCustomers'); + $modelMock->expects($this->any()) + ->method('getCustomerStorage') + ->willReturn($storageMock); return $modelMock; } diff --git a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/_files/row_data_abstract_empty_email.php b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/_files/row_data_abstract_empty_email.php index 2fdd8a82dc4c6..7e24dd3f04a07 100644 --- a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/_files/row_data_abstract_empty_email.php +++ b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/_files/row_data_abstract_empty_email.php @@ -1,6 +1,6 @@ _model = new \Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage( - $this->getMockBuilder('Magento\Customer\Model\ResourceModel\Customer\CollectionFactory') - ->disableOriginalConstructor() - ->getMock(), - $this->getMockBuilder('Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory') - ->disableOriginalConstructor() - ->getMock(), - $this->_getModelDependencies() - ); - $this->_model->load(); - } - - protected function tearDown() - { - unset($this->_model); - } - - /** - * Retrieve all necessary objects mocks which used inside customer storage - * - * @return array - */ - protected function _getModelDependencies() - { - $select = $this->getMockBuilder('Magento\Framework\DB\Select') + $this->iteratorMock = $this->getMockBuilder( + CollectionByPagesIterator::class + ) ->disableOriginalConstructor() - ->setMethods(['from']) ->getMock(); - $select->expects($this->any())->method('from')->will($this->returnCallback([$this, 'validateFrom'])); - $customerCollection = $this->getMockBuilder('Magento\Customer\Model\ResourceModel\Customer\Collection') + /** @var \PHPUnit_Framework_MockObject_MockObject|CollectionByPagesIteratorFactory $iteratorFactoryMock */ + $iteratorFactoryMock = $this->getMockBuilder( + CollectionByPagesIteratorFactory::class + ) ->disableOriginalConstructor() - ->setMethods(['load', 'removeAttributeToSelect', 'getResource', 'getSelect']) ->getMock(); - - $resourceStub = new \Magento\Framework\DataObject(); - $resourceStub->setEntityTable($this->_entityTable); - $customerCollection->expects($this->once())->method('getResource')->will($this->returnValue($resourceStub)); - - $customerCollection->expects($this->once())->method('getSelect')->will($this->returnValue($select)); - - $byPagesIterator = $this->getMock('stdClass', ['iterate']); - $byPagesIterator->expects($this->once()) - ->method('iterate') - ->will($this->returnCallback([$this, 'iterate'])); - - return [ - 'customer_collection' => $customerCollection, - 'collection_by_pages_iterator' => $byPagesIterator, - 'page_size' => 10 - ]; - } - - /** - * Iterate stub - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @param \Magento\Framework\Data\Collection $collection - * @param int $pageSize - * @param array $callbacks - */ - public function iterate(\Magento\Framework\Data\Collection $collection, $pageSize, array $callbacks) - { - foreach ($collection as $customer) { - foreach ($callbacks as $callback) { - call_user_func($callback, $customer); - } - } - } - - /** - * @param string $tableName - * @param array $fields - */ - public function validateFrom($tableName, $fields) - { - $this->assertEquals($this->_entityTable, $tableName); - $this->assertEquals($this->_expectedFields, $fields); - } - - public function testLoad() - { - $this->assertAttributeEquals(true, '_isCollectionLoaded', $this->_model); + $iteratorFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->iteratorMock); + $this->collectionMock = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->getMock(); + /** @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject $collectionFactoryMock */ + $collectionFactoryMock = $this->getMockBuilder( + CollectionFactory::class + ) + ->disableOriginalConstructor() + ->getMock(); + $collectionFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->collectionMock); + /** @var \PHPUnit_Framework_MockObject_MockObject $selectMock */ + $selectMock = $this->getMockBuilder(Select::class) + ->disableOriginalConstructor() + ->getMock(); + $selectMock->expects($this->any()) + ->method('getPart') + ->with(Select::FROM) + ->willReturn(['e' => []]); + $this->collectionMock->expects($this->any()) + ->method('getSelect') + ->willReturn($selectMock); + + $this->_model = new Storage( + $collectionFactoryMock, + $iteratorFactoryMock, + [] + ); } - public function testAddCustomer() + protected function tearDown() { - $propertyName = '_customerIds'; - $customer = $this->_addCustomerToStorage(); - - $this->assertAttributeCount(1, $propertyName, $this->_model); - - $expectedCustomerData = [$customer->getWebsiteId() => $customer->getId()]; - $this->assertAttributeContains($expectedCustomerData, $propertyName, $this->_model); + unset($this->_model); } public function testGetCustomerId() { - $customer = $this->_addCustomerToStorage(); + $existingEmail = 'test@magento.com'; + $existingWebsiteId = 0; + $existingId = 1; + $nonExistingEmail = 'test1@magento.com'; + $nonExistingWebsiteId = 2; + + $this->iteratorMock->expects($this->at(0)) + ->method('iterate') + ->willReturnCallback( + function (...$args) use ( + $existingId, + $existingEmail, + $existingWebsiteId + ) { + /** @var callable $callable */ + foreach ($args[2] as $callable) { + $callable( + new DataObject([ + 'id' => $existingId, + 'email' => $existingEmail, + 'website_id' => $existingWebsiteId, + ]) + ); + } + } + ); $this->assertEquals( - $customer->getId(), - $this->_model->getCustomerId($customer->getEmail(), $customer->getWebsiteId()) + $existingId, + $this->_model->getCustomerId($existingEmail, $existingWebsiteId) + ); + $this->assertFalse( + $this->_model->getCustomerId( + $nonExistingEmail, + $nonExistingWebsiteId + ) ); - $this->assertFalse($this->_model->getCustomerId('new@test.com', $customer->getWebsiteId())); - } - - /** - * @return \Magento\Framework\DataObject - */ - protected function _addCustomerToStorage() - { - $customer = new \Magento\Framework\DataObject(['id' => 1, 'website_id' => 1, 'email' => 'test@test.com']); - $this->_model->addCustomer($customer); - - return $customer; } } diff --git a/app/code/Magento/CustomerImportExport/Test/Unit/Model/ResourceModel/Import/CustomerComposite/DataTest.php b/app/code/Magento/CustomerImportExport/Test/Unit/Model/ResourceModel/Import/CustomerComposite/DataTest.php index fd793169f45f8..4604027a24e98 100644 --- a/app/code/Magento/CustomerImportExport/Test/Unit/Model/ResourceModel/Import/CustomerComposite/DataTest.php +++ b/app/code/Magento/CustomerImportExport/Test/Unit/Model/ResourceModel/Import/CustomerComposite/DataTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CustomerImportExport/etc/config.xml b/app/code/Magento/CustomerImportExport/etc/config.xml index 8240c00223600..54b9650c0b765 100644 --- a/app/code/Magento/CustomerImportExport/etc/config.xml +++ b/app/code/Magento/CustomerImportExport/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CustomerImportExport/etc/export.xml b/app/code/Magento/CustomerImportExport/etc/export.xml index cf226c50ef681..4d0d407bcf203 100644 --- a/app/code/Magento/CustomerImportExport/etc/export.xml +++ b/app/code/Magento/CustomerImportExport/etc/export.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CustomerImportExport/etc/import.xml b/app/code/Magento/CustomerImportExport/etc/import.xml index 316947ffaf028..d70bc66d58ca0 100644 --- a/app/code/Magento/CustomerImportExport/etc/import.xml +++ b/app/code/Magento/CustomerImportExport/etc/import.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CustomerImportExport/etc/module.xml b/app/code/Magento/CustomerImportExport/etc/module.xml index a2bb69023d2f5..865b2e991418d 100644 --- a/app/code/Magento/CustomerImportExport/etc/module.xml +++ b/app/code/Magento/CustomerImportExport/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CustomerImportExport/registration.php b/app/code/Magento/CustomerImportExport/registration.php index 9aac304811a85..12616dc5bc3c5 100644 --- a/app/code/Magento/CustomerImportExport/registration.php +++ b/app/code/Magento/CustomerImportExport/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportxml.xml b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportxml.xml index 581c23c802683..9fb4684de235e 100644 --- a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportxml.xml +++ b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportxml.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_index_grid_block.xml b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_index_grid_block.xml index 39f50e92aeafc..cf32a93ee58b7 100644 --- a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_index_grid_block.xml +++ b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_index_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Deploy/Console/Command/App/ApplicationDumpCommand.php b/app/code/Magento/Deploy/Console/Command/App/ApplicationDumpCommand.php index b63357be6bf8a..98371ae8ddfdb 100644 --- a/app/code/Magento/Deploy/Console/Command/App/ApplicationDumpCommand.php +++ b/app/code/Magento/Deploy/Console/Command/App/ApplicationDumpCommand.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Deploy/etc/module.xml b/app/code/Magento/Deploy/etc/module.xml index 9197c17ef0931..a61f9e1546e05 100644 --- a/app/code/Magento/Deploy/etc/module.xml +++ b/app/code/Magento/Deploy/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Deploy/registration.php b/app/code/Magento/Deploy/registration.php index eda7bc5ea47a5..b43fc503f8939 100644 --- a/app/code/Magento/Deploy/registration.php +++ b/app/code/Magento/Deploy/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php b/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php index 5146a54b91931..8f263401e5764 100644 --- a/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Developer/etc/adminhtml/system.xml b/app/code/Magento/Developer/etc/adminhtml/system.xml index 6e3916afac3c8..1cd7238a95da1 100644 --- a/app/code/Magento/Developer/etc/adminhtml/system.xml +++ b/app/code/Magento/Developer/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Developer/etc/config.xml b/app/code/Magento/Developer/etc/config.xml index 4bdd425bca51f..c4475a8cf64e3 100644 --- a/app/code/Magento/Developer/etc/config.xml +++ b/app/code/Magento/Developer/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Developer/etc/di.xml b/app/code/Magento/Developer/etc/di.xml index df907125d733b..aa9bfe6667995 100644 --- a/app/code/Magento/Developer/etc/di.xml +++ b/app/code/Magento/Developer/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Developer/etc/frontend/di.xml b/app/code/Magento/Developer/etc/frontend/di.xml index 6d526d8d02fc5..4c65510388eb3 100644 --- a/app/code/Magento/Developer/etc/frontend/di.xml +++ b/app/code/Magento/Developer/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Developer/etc/module.xml b/app/code/Magento/Developer/etc/module.xml index cc609870d3c76..9f08676626f9f 100644 --- a/app/code/Magento/Developer/etc/module.xml +++ b/app/code/Magento/Developer/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Developer/registration.php b/app/code/Magento/Developer/registration.php index 5b0bab4b1d463..20bba13959284 100644 --- a/app/code/Magento/Developer/registration.php +++ b/app/code/Magento/Developer/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/rates_request_data_dhl.php b/app/code/Magento/Dhl/Test/Unit/Model/_files/rates_request_data_dhl.php index cbe3cf6b9f59b..411974835c61e 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/_files/rates_request_data_dhl.php +++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/rates_request_data_dhl.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml index 1f8635a8b97a1..b529e86ef154c 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml +++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index c636c41f0c479..b1d801abd94ad 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -19,7 +19,7 @@ "magento/module-checkout": "100.1.*" }, "type": "magento2-module", - "version": "100.1.3", + "version": "100.1.4", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Dhl/etc/adminhtml/system.xml b/app/code/Magento/Dhl/etc/adminhtml/system.xml index dbbfe2a9ff415..c0f7e209ad61b 100644 --- a/app/code/Magento/Dhl/etc/adminhtml/system.xml +++ b/app/code/Magento/Dhl/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Dhl/etc/config.xml b/app/code/Magento/Dhl/etc/config.xml index 416c6ab271e0b..79addefb34a16 100644 --- a/app/code/Magento/Dhl/etc/config.xml +++ b/app/code/Magento/Dhl/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Dhl/etc/countries.xml b/app/code/Magento/Dhl/etc/countries.xml index 1b795fe8aad0b..48837dbefb576 100644 --- a/app/code/Magento/Dhl/etc/countries.xml +++ b/app/code/Magento/Dhl/etc/countries.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Dhl/etc/di.xml b/app/code/Magento/Dhl/etc/di.xml index 901d45b212f40..3865b080e06fb 100644 --- a/app/code/Magento/Dhl/etc/di.xml +++ b/app/code/Magento/Dhl/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Dhl/etc/module.xml b/app/code/Magento/Dhl/etc/module.xml index 9e3feb6517b5a..4723b14763a12 100644 --- a/app/code/Magento/Dhl/etc/module.xml +++ b/app/code/Magento/Dhl/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Dhl/registration.php b/app/code/Magento/Dhl/registration.php index 0463140f1263a..b8bd65cf09669 100644 --- a/app/code/Magento/Dhl/registration.php +++ b/app/code/Magento/Dhl/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Dhl/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Dhl/view/frontend/layout/checkout_index_index.xml index 5fc507914bce9..96630fbd03ce7 100644 --- a/app/code/Magento/Dhl/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Dhl/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validation-rules.js b/app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validation-rules.js index 6752f87f5272e..c1c1eacb63b95 100644 --- a/app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validation-rules.js +++ b/app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validation-rules.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global define*/ diff --git a/app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validator.js b/app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validator.js index f193cb77b8875..79fed7c343284 100644 --- a/app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validator.js +++ b/app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validator.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global define*/ diff --git a/app/code/Magento/Dhl/view/frontend/web/js/view/shipping-rates-validation.js b/app/code/Magento/Dhl/view/frontend/web/js/view/shipping-rates-validation.js index 3133ba351541b..104a831268b60 100644 --- a/app/code/Magento/Dhl/view/frontend/web/js/view/shipping-rates-validation.js +++ b/app/code/Magento/Dhl/view/frontend/web/js/view/shipping-rates-validation.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*browser:true*/ diff --git a/app/code/Magento/Directory/Api/CountryInformationAcquirerInterface.php b/app/code/Magento/Directory/Api/CountryInformationAcquirerInterface.php index b8790fad2d23d..512f53dac3779 100644 --- a/app/code/Magento/Directory/Api/CountryInformationAcquirerInterface.php +++ b/app/code/Magento/Directory/Api/CountryInformationAcquirerInterface.php @@ -1,6 +1,6 @@ 'countryCode']; + protected $_idAttributes = [ + '/config/zip' => 'countryCode', + '/config/zip/codes/code' => 'id', + ]; /** * Construct the FileSystem Reader Class diff --git a/app/code/Magento/Directory/Model/Country/Postcode/Config/SchemaLocator.php b/app/code/Magento/Directory/Model/Country/Postcode/Config/SchemaLocator.php index 896fc6f819c13..0d1dc08fc1bd6 100644 --- a/app/code/Magento/Directory/Model/Country/Postcode/Config/SchemaLocator.php +++ b/app/code/Magento/Directory/Model/Country/Postcode/Config/SchemaLocator.php @@ -1,6 +1,6 @@ - */ -namespace Magento\Directory\Model; - -class CountryFactory -{ - /** - * @var \Magento\Framework\ObjectManagerInterface - */ - protected $_objectManager; - - /** - * @param \Magento\Framework\ObjectManagerInterface $objectManager - */ - public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager) - { - $this->_objectManager = $objectManager; - } - - /** - * Create new country model - * - * @param array $arguments - * @return \Magento\Directory\Model\Country - */ - public function create(array $arguments = []) - { - return $this->_objectManager->create('Magento\Directory\Model\Country', $arguments, false); - } -} diff --git a/app/code/Magento/Directory/Model/CountryInformationAcquirer.php b/app/code/Magento/Directory/Model/CountryInformationAcquirer.php index 68f9c4fa8ef78..4eaa18d9672d1 100644 --- a/app/code/Magento/Directory/Model/CountryInformationAcquirer.php +++ b/app/code/Magento/Directory/Model/CountryInformationAcquirer.php @@ -1,6 +1,6 @@ scopeConfig = $scopeConfig; + $this->httpClientFactory = $httpClientFactory ?: ObjectManager::getInstance()->get(ZendClientFactory::class); } /** @@ -55,7 +62,7 @@ protected function _convert($currencyFrom, $currencyTo, $retry = 0) $url = str_replace('{{CURRENCY_FROM}}', $currencyFrom, self::CURRENCY_CONVERTER_URL); $url = str_replace('{{CURRENCY_TO}}', $currencyTo, $url); /** @var \Magento\Framework\HTTP\ZendClient $httpClient */ - $httpClient = $this->getHttpClientFactory()->create(); + $httpClient = $this->httpClientFactory->create(); try { $response = $httpClient->setUri( @@ -85,20 +92,4 @@ protected function _convert($currencyFrom, $currencyTo, $retry = 0) } } } - - /** - * Get HttpClientFactory dependency - * - * @return \Magento\Framework\HTTP\ZendClientFactory - * - * @deprecated - */ - private function getHttpClientFactory() - { - if ($this->httpClientFactory === null) { - $this->httpClientFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get('Magento\Framework\HTTP\ZendClientFactory'); - } - return $this->httpClientFactory; - } } diff --git a/app/code/Magento/Directory/Model/Currency/Import/YahooFinance.php b/app/code/Magento/Directory/Model/Currency/Import/YahooFinance.php index a95acc734a01f..cf4bf886665ef 100644 --- a/app/code/Magento/Directory/Model/Currency/Import/YahooFinance.php +++ b/app/code/Magento/Directory/Model/Currency/Import/YahooFinance.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index 25b730775fe2a..10c2b48d747dd 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -10,7 +10,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.4", + "version": "100.1.6", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Directory/etc/adminhtml/di.xml b/app/code/Magento/Directory/etc/adminhtml/di.xml index 8f85798987b5f..0b1175b0cd94c 100644 --- a/app/code/Magento/Directory/etc/adminhtml/di.xml +++ b/app/code/Magento/Directory/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/adminhtml/routes.xml b/app/code/Magento/Directory/etc/adminhtml/routes.xml index 301b06c4c75d2..2fab3eb387963 100644 --- a/app/code/Magento/Directory/etc/adminhtml/routes.xml +++ b/app/code/Magento/Directory/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/adminhtml/system.xml b/app/code/Magento/Directory/etc/adminhtml/system.xml index 6232ddfdd287d..f13aff608d19e 100644 --- a/app/code/Magento/Directory/etc/adminhtml/system.xml +++ b/app/code/Magento/Directory/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/config.xml b/app/code/Magento/Directory/etc/config.xml index b434865e00cfb..fa4e9d64d10d8 100644 --- a/app/code/Magento/Directory/etc/config.xml +++ b/app/code/Magento/Directory/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/crontab.xml b/app/code/Magento/Directory/etc/crontab.xml index 825fb3e37f1eb..d6868ff6aa0d6 100644 --- a/app/code/Magento/Directory/etc/crontab.xml +++ b/app/code/Magento/Directory/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/di.xml b/app/code/Magento/Directory/etc/di.xml index 82e08bc8ec037..100dcba278552 100644 --- a/app/code/Magento/Directory/etc/di.xml +++ b/app/code/Magento/Directory/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/email_templates.xml b/app/code/Magento/Directory/etc/email_templates.xml index 65567fd7c3a6c..5dac75b7a040f 100644 --- a/app/code/Magento/Directory/etc/email_templates.xml +++ b/app/code/Magento/Directory/etc/email_templates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/frontend/routes.xml b/app/code/Magento/Directory/etc/frontend/routes.xml index 303a7ab360a1d..b5ecbe1fe435f 100644 --- a/app/code/Magento/Directory/etc/frontend/routes.xml +++ b/app/code/Magento/Directory/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/frontend/sections.xml b/app/code/Magento/Directory/etc/frontend/sections.xml index 6f61593787460..a2bc5696abf08 100644 --- a/app/code/Magento/Directory/etc/frontend/sections.xml +++ b/app/code/Magento/Directory/etc/frontend/sections.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/module.xml b/app/code/Magento/Directory/etc/module.xml index 9d464d2788464..f4a673789f64d 100644 --- a/app/code/Magento/Directory/etc/module.xml +++ b/app/code/Magento/Directory/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/webapi.xml b/app/code/Magento/Directory/etc/webapi.xml index 1edd1191134c1..71cc3c24a1587 100644 --- a/app/code/Magento/Directory/etc/webapi.xml +++ b/app/code/Magento/Directory/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/etc/zip_codes.xml b/app/code/Magento/Directory/etc/zip_codes.xml index 385ee58eb1f67..c4899636b4b30 100644 --- a/app/code/Magento/Directory/etc/zip_codes.xml +++ b/app/code/Magento/Directory/etc/zip_codes.xml @@ -1,7 +1,7 @@ @@ -81,6 +81,7 @@ ^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}\s[0-9]{1}[a-zA-z]{1}[0-9]{1}$ + ^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}$ diff --git a/app/code/Magento/Directory/etc/zip_codes.xsd b/app/code/Magento/Directory/etc/zip_codes.xsd index 399f997acc4d0..3400c1f37048d 100644 --- a/app/code/Magento/Directory/etc/zip_codes.xsd +++ b/app/code/Magento/Directory/etc/zip_codes.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/registration.php b/app/code/Magento/Directory/registration.php index 58b24c70bdbf1..c4ae7a50bf393 100644 --- a/app/code/Magento/Directory/registration.php +++ b/app/code/Magento/Directory/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Directory/view/adminhtml/templates/js/optional_zip_countries.phtml b/app/code/Magento/Directory/view/adminhtml/templates/js/optional_zip_countries.phtml index ce5b89f5f2b0b..fba5b653615e0 100644 --- a/app/code/Magento/Directory/view/adminhtml/templates/js/optional_zip_countries.phtml +++ b/app/code/Magento/Directory/view/adminhtml/templates/js/optional_zip_countries.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_index.xml b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_index.xml index e01b48cc71b11..6b97ebabce5b7 100644 --- a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_index.xml +++ b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_result.xml index e01b48cc71b11..6b97ebabce5b7 100644 --- a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_result.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_result_index.xml index e01b48cc71b11..6b97ebabce5b7 100644 --- a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_result_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/view/frontend/layout/default.xml b/app/code/Magento/Directory/view/frontend/layout/default.xml index 979fcd6e3d139..ad1e7fbf642c4 100644 --- a/app/code/Magento/Directory/view/frontend/layout/default.xml +++ b/app/code/Magento/Directory/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Directory/view/frontend/templates/currency.phtml b/app/code/Magento/Directory/view/frontend/templates/currency.phtml index 125b635cde275..9a80fccdb19c2 100644 --- a/app/code/Magento/Directory/view/frontend/templates/currency.phtml +++ b/app/code/Magento/Directory/view/frontend/templates/currency.phtml @@ -1,6 +1,6 @@ _objectManager->create('Magento\Downloadable\Model\Link'); + return $this->_objectManager->create(\Magento\Downloadable\Model\Link::class); } /** @@ -23,7 +24,7 @@ protected function _createLink() */ protected function _getLink() { - return $this->_objectManager->get('Magento\Downloadable\Model\Link'); + return $this->_objectManager->get(\Magento\Downloadable\Model\Link::class); } /** @@ -36,13 +37,17 @@ protected function _getLink() protected function _processDownload($resource, $resourceType) { /* @var $helper \Magento\Downloadable\Helper\Download */ - $helper = $this->_objectManager->get('Magento\Downloadable\Helper\Download'); + $helper = $this->_objectManager->get(\Magento\Downloadable\Helper\Download::class); $helper->setResource($resource, $resourceType); $fileName = $helper->getFilename(); - $contentType = $helper->getContentType(); + //For security reasons we're making browsers to download the file + //instead of opening it. + $contentType = 'application/octet-stream'; - $this->getResponse()->setHttpResponseCode( + /** @var HttpResponse $response */ + $response = $this->getResponse(); + $response->setHttpResponseCode( 200 )->setHeader( 'Pragma', @@ -57,18 +62,16 @@ protected function _processDownload($resource, $resourceType) $contentType, true ); - if ($fileSize = $helper->getFileSize()) { - $this->getResponse()->setHeader('Content-Length', $fileSize); - } - - if ($contentDisposition = $helper->getContentDisposition()) { - $this->getResponse() - ->setHeader('Content-Disposition', $contentDisposition . '; filename=' . $fileName); + $response->setHeader('Content-Length', $fileSize); } - - $this->getResponse()->clearBody(); - $this->getResponse()->sendHeaders(); + $response->setHeader( + 'Content-Disposition', + 'attachment; filename=' . $fileName + ); + //Rendering + $response->clearBody(); + $response->sendHeaders(); $helper->output(); } @@ -92,7 +95,7 @@ public function execute() $resourceType = DownloadHelper::LINK_TYPE_URL; } elseif ($link->getLinkType() == DownloadHelper::LINK_TYPE_FILE) { $resource = $this->_objectManager->get( - 'Magento\Downloadable\Helper\File' + \Magento\Downloadable\Helper\File::class )->getFilePath( $this->_getLink()->getBasePath(), $link->getLinkFile() @@ -105,7 +108,7 @@ public function execute() $resourceType = DownloadHelper::LINK_TYPE_URL; } elseif ($link->getSampleType() == DownloadHelper::LINK_TYPE_FILE) { $resource = $this->_objectManager->get( - 'Magento\Downloadable\Helper\File' + \Magento\Downloadable\Helper\File::class )->getFilePath( $this->_getLink()->getBaseSamplePath(), $link->getSampleFile() diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/MassDelete.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/MassDelete.php index d08f94f8f9064..a55eb24e93fad 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/MassDelete.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/MassDelete.php @@ -1,7 +1,7 @@ request = $request; + $this->sampleFactory = $sampleFactory ?: ObjectManager::getInstance()->get(SampleFactory::class); + $this->sampleBuilder = $sampleBuilder ?: ObjectManager::getInstance()->get(SampleBuilder::class); + $this->linkFactory = $linkFactory ?: ObjectManager::getInstance()->get(LinkFactory::class); + $this->linkBuilder = $linkBuilder ?: ObjectManager::getInstance()->get(LinkBuilder::class); } /** @@ -56,6 +71,7 @@ public function __construct( * @param \Magento\Catalog\Model\Product $product * * @return \Magento\Catalog\Model\Product + * @throws \Magento\Framework\Exception\LocalizedException * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -73,11 +89,9 @@ public function afterInitialize( if (!$linkData || (isset($linkData['is_delete']) && $linkData['is_delete'])) { continue; } else { - $links[] = $this->getLinkBuilder()->setData( - $linkData - )->build( - $this->getLinkFactory()->create() - ); + $links[] = $this->linkBuilder + ->setData($linkData) + ->build($this->linkFactory->create()); } } $extension->setDownloadableProductLinks($links); @@ -88,11 +102,9 @@ public function afterInitialize( if (!$sampleData || (isset($sampleData['is_delete']) && (bool)$sampleData['is_delete'])) { continue; } else { - $samples[] = $this->getSampleBuilder()->setData( - $sampleData - )->build( - $this->getSampleFactory()->create() - ); + $samples[] = $this->sampleBuilder + ->setData($sampleData) + ->build($this->sampleFactory->create()); } } $extension->setDownloadableProductSamples($samples); @@ -106,66 +118,4 @@ public function afterInitialize( } return $product; } - - /** - * Get LinkBuilder instance - * - * @deprecated - * @return \Magento\Downloadable\Model\Link\Builder - */ - private function getLinkBuilder() - { - if (!$this->linkBuilder) { - $this->linkBuilder = ObjectManager::getInstance()->get(\Magento\Downloadable\Model\Link\Builder::class); - } - - return $this->linkBuilder; - } - - /** - * Get SampleBuilder instance - * - * @deprecated - * @return \Magento\Downloadable\Model\Sample\Builder - */ - private function getSampleBuilder() - { - if (!$this->sampleBuilder) { - $this->sampleBuilder = ObjectManager::getInstance()->get( - \Magento\Downloadable\Model\Sample\Builder::class - ); - } - - return $this->sampleBuilder; - } - - /** - * Get LinkFactory instance - * - * @deprecated - * @return LinkFactory - */ - private function getLinkFactory() - { - if (!$this->linkFactory) { - $this->linkFactory = ObjectManager::getInstance()->get(LinkFactory::class); - } - - return $this->linkFactory; - } - - /** - * Get Sample Factory - * - * @deprecated - * @return SampleFactory - */ - private function getSampleFactory() - { - if (!$this->sampleFactory) { - $this->sampleFactory = ObjectManager::getInstance()->get(SampleFactory::class); - } - - return $this->sampleFactory; - } } diff --git a/app/code/Magento/Downloadable/Controller/Customer/Products.php b/app/code/Magento/Downloadable/Controller/Customer/Products.php index 9d31edc60f279..909561147a474 100644 --- a/app/code/Magento/Downloadable/Controller/Customer/Products.php +++ b/app/code/Magento/Downloadable/Controller/Customer/Products.php @@ -1,7 +1,7 @@ _objectManager->get('Magento\Downloadable\Helper\Download'); + $helper = $this->_objectManager->get(\Magento\Downloadable\Helper\Download::class); $helper->setResource($path, $resourceType); $fileName = $helper->getFilename(); + $contentType = $helper->getContentType(); - $this->getResponse()->setHttpResponseCode( + /** @var HttpResponse $response */ + $response = $this->getResponse(); + $response->setHttpResponseCode( 200 )->setHeader( 'Pragma', @@ -47,15 +58,19 @@ protected function _processDownload($path, $resourceType) ); if ($fileSize = $helper->getFileSize()) { - $this->getResponse()->setHeader('Content-Length', $fileSize); + $response->setHeader('Content-Length', $fileSize); } - if ($contentDisposition = $helper->getContentDisposition()) { - $this->getResponse()->setHeader('Content-Disposition', $contentDisposition . '; filename=' . $fileName); + $contentDisposition = $helper->getContentDisposition(); + if (!$contentDisposition || in_array($contentType, $this->disallowedContentTypes)) { + // For security reasons we force browsers to download the file instead of opening it. + $contentDisposition = \Zend_Mime::DISPOSITION_ATTACHMENT; } - $this->getResponse()->clearBody(); - $this->getResponse()->sendHeaders(); + $response->setHeader('Content-Disposition', $contentDisposition . '; filename=' . $fileName); + //Rendering + $response->clearBody(); + $response->sendHeaders(); $helper->output(); } @@ -67,6 +82,6 @@ protected function _processDownload($path, $resourceType) */ protected function _getLink() { - return $this->_objectManager->get('Magento\Downloadable\Model\Link'); + return $this->_objectManager->get(\Magento\Downloadable\Model\Link::class); } } diff --git a/app/code/Magento/Downloadable/Controller/Download/Link.php b/app/code/Magento/Downloadable/Controller/Download/Link.php index b09cf96b9b013..f38b3070761a8 100644 --- a/app/code/Magento/Downloadable/Controller/Download/Link.php +++ b/app/code/Magento/Downloadable/Controller/Download/Link.php @@ -1,7 +1,7 @@ 'chemical/x-xyz', 'xzaz' => 'application/vnd.zzazz.deck+xml', 'xzip' => 'application/zip', - 'xzmm' => 'application/vnd.handheld-entertainment+xml', - 'xodt' => 'application/x-vnd.oasis.opendocument.spreadsheet', + 'xzmm' => 'application/vnd.handheld-entertainment+xml' ]; } diff --git a/app/code/Magento/Downloadable/Model/ComponentInterface.php b/app/code/Magento/Downloadable/Model/ComponentInterface.php index 30cad0c883b8a..fcb38aa51dd02 100644 --- a/app/code/Magento/Downloadable/Model/ComponentInterface.php +++ b/app/code/Magento/Downloadable/Model/ComponentInterface.php @@ -1,6 +1,6 @@ objectManagerHelper = new ObjectManagerHelper($this); - $this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http') + $this->request = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) ->disableOriginalConstructor()->getMock(); $this->response = $this->getMock( - '\Magento\Framework\App\ResponseInterface', + \Magento\Framework\App\ResponseInterface::class, [ 'setHttpResponseCode', 'clearBody', @@ -63,7 +63,7 @@ protected function setUp() ] ); $this->fileHelper = $this->getMock( - '\Magento\Downloadable\Helper\File', + \Magento\Downloadable\Helper\File::class, [ 'getFilePath' ], @@ -72,7 +72,7 @@ protected function setUp() false ); $this->downloadHelper = $this->getMock( - 'Magento\Downloadable\Helper\Download', + \Magento\Downloadable\Helper\Download::class, [ 'setResource', 'getFilename', @@ -86,7 +86,7 @@ protected function setUp() false ); $this->linkModel = $this->getMock( - '\Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Link', + \Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Link::class, [ 'load', 'getId', @@ -104,7 +104,7 @@ protected function setUp() false ); $this->objectManager = $this->getMock( - '\Magento\Framework\ObjectManager\ObjectManager', + \Magento\Framework\ObjectManager\ObjectManager::class, [ 'create', 'get' @@ -115,7 +115,7 @@ protected function setUp() ); $this->link = $this->objectManagerHelper->getObject( - 'Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Link', + \Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Link::class, [ 'objectManager' => $this->objectManager, 'request' => $this->request, @@ -130,6 +130,8 @@ protected function setUp() */ public function testExecuteFile($fileType) { + $fileSize = 58493; + $fileName = 'link.jpg'; $this->request->expects($this->at(0))->method('getParam')->with('id', 0) ->will($this->returnValue(1)); $this->request->expects($this->at(1))->method('getParam')->with('type', 0) @@ -138,34 +140,47 @@ public function testExecuteFile($fileType) ->will($this->returnSelf()); $this->response->expects($this->once())->method('clearBody') ->will($this->returnSelf()); - $this->response->expects($this->any())->method('setHeader') - ->will($this->returnSelf()); + $this->response + ->expects($this->any()) + ->method('setHeader') + ->withConsecutive( + ['Pragma', 'public', true], + [ + 'Cache-Control', + 'must-revalidate, post-check=0, pre-check=0', + true, + ], + ['Content-type', 'application/octet-stream'], + ['Content-Length', $fileSize], + ['Content-Disposition', 'attachment; filename=' . $fileName] + ) + ->willReturnSelf(); $this->response->expects($this->once())->method('sendHeaders') ->will($this->returnSelf()); - $this->objectManager->expects($this->at(1))->method('get')->with('Magento\Downloadable\Helper\File') + $this->objectManager->expects($this->at(1))->method('get')->with(\Magento\Downloadable\Helper\File::class) ->will($this->returnValue($this->fileHelper)); - $this->objectManager->expects($this->at(2))->method('get')->with('Magento\Downloadable\Model\Link') + $this->objectManager->expects($this->at(2))->method('get')->with(\Magento\Downloadable\Model\Link::class) ->will($this->returnValue($this->linkModel)); - $this->objectManager->expects($this->at(3))->method('get')->with('Magento\Downloadable\Helper\Download') + $this->objectManager->expects($this->at(3))->method('get')->with(\Magento\Downloadable\Helper\Download::class) ->will($this->returnValue($this->downloadHelper)); $this->fileHelper->expects($this->once())->method('getFilePath') ->will($this->returnValue('filepath/' . $fileType . '.jpg')); $this->downloadHelper->expects($this->once())->method('setResource') ->will($this->returnSelf()); $this->downloadHelper->expects($this->once())->method('getFilename') - ->will($this->returnValue('link.jpg')); - $this->downloadHelper->expects($this->once())->method('getContentType') + ->will($this->returnValue($fileName)); + $this->downloadHelper->expects($this->never())->method('getContentType') ->will($this->returnSelf('file')); $this->downloadHelper->expects($this->once())->method('getFileSize') - ->will($this->returnValue(null)); - $this->downloadHelper->expects($this->once())->method('getContentDisposition') + ->will($this->returnValue($fileSize)); + $this->downloadHelper->expects($this->never())->method('getContentDisposition') ->will($this->returnValue(null)); $this->downloadHelper->expects($this->once())->method('output') ->will($this->returnSelf()); $this->linkModel->expects($this->once())->method('load') ->will($this->returnSelf()); $this->linkModel->expects($this->once())->method('getId') - ->will($this->returnValue('1')); + ->will($this->returnValue('1')); $this->linkModel->expects($this->any())->method('get' . $fileType . 'Type') ->will($this->returnValue('file')); $this->objectManager->expects($this->once())->method('create') @@ -192,17 +207,17 @@ public function testExecuteUrl($fileType) ->will($this->returnSelf()); $this->response->expects($this->once())->method('sendHeaders') ->will($this->returnSelf()); - $this->objectManager->expects($this->at(1))->method('get')->with('Magento\Downloadable\Helper\Download') + $this->objectManager->expects($this->at(1))->method('get')->with(\Magento\Downloadable\Helper\Download::class) ->will($this->returnValue($this->downloadHelper)); $this->downloadHelper->expects($this->once())->method('setResource') ->will($this->returnSelf()); $this->downloadHelper->expects($this->once())->method('getFilename') ->will($this->returnValue('link.jpg')); - $this->downloadHelper->expects($this->once())->method('getContentType') + $this->downloadHelper->expects($this->never())->method('getContentType') ->will($this->returnSelf('url')); $this->downloadHelper->expects($this->once())->method('getFileSize') ->will($this->returnValue(null)); - $this->downloadHelper->expects($this->once())->method('getContentDisposition') + $this->downloadHelper->expects($this->never())->method('getContentDisposition') ->will($this->returnValue(null)); $this->downloadHelper->expects($this->once())->method('output') ->will($this->returnSelf()); diff --git a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/Product/Edit/SampleTest.php b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/Product/Edit/SampleTest.php index 344360e0d60c3..8718f94a3b6a5 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/Product/Edit/SampleTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/Product/Edit/SampleTest.php @@ -1,6 +1,6 @@ objectManagerHelper = new ObjectManagerHelper($this); - $this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http') + $this->request = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) ->disableOriginalConstructor()->getMock(); $this->response = $this->getMock( - '\Magento\Framework\App\ResponseInterface', + \Magento\Framework\App\ResponseInterface::class, [ 'setHttpResponseCode', 'clearBody', @@ -63,7 +63,7 @@ protected function setUp() ] ); $this->fileHelper = $this->getMock( - '\Magento\Downloadable\Helper\File', + \Magento\Downloadable\Helper\File::class, [ 'getFilePath' ], @@ -72,7 +72,7 @@ protected function setUp() false ); $this->downloadHelper = $this->getMock( - 'Magento\Downloadable\Helper\Download', + \Magento\Downloadable\Helper\Download::class, [ 'setResource', 'getFilename', @@ -86,7 +86,7 @@ protected function setUp() false ); $this->sampleModel = $this->getMock( - '\Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Sample', + \Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Sample::class, [ 'load', 'getId', @@ -101,7 +101,7 @@ protected function setUp() false ); $this->objectManager = $this->getMock( - '\Magento\Framework\ObjectManager\ObjectManager', + \Magento\Framework\ObjectManager\ObjectManager::class, [ 'create', 'get' @@ -111,7 +111,7 @@ protected function setUp() false ); $this->sample = $this->objectManagerHelper->getObject( - 'Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Sample', + \Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Sample::class, [ 'objectManager' => $this->objectManager, 'request' => $this->request, @@ -135,11 +135,11 @@ public function testExecuteFile() ->will($this->returnSelf()); $this->response->expects($this->once())->method('sendHeaders') ->will($this->returnSelf()); - $this->objectManager->expects($this->at(1))->method('get')->with('Magento\Downloadable\Helper\File') + $this->objectManager->expects($this->at(1))->method('get')->with(\Magento\Downloadable\Helper\File::class) ->will($this->returnValue($this->fileHelper)); - $this->objectManager->expects($this->at(2))->method('get')->with('Magento\Downloadable\Model\Sample') + $this->objectManager->expects($this->at(2))->method('get')->with(\Magento\Downloadable\Model\Sample::class) ->will($this->returnValue($this->sampleModel)); - $this->objectManager->expects($this->at(3))->method('get')->with('Magento\Downloadable\Helper\Download') + $this->objectManager->expects($this->at(3))->method('get')->with(\Magento\Downloadable\Helper\Download::class) ->will($this->returnValue($this->downloadHelper)); $this->fileHelper->expects($this->once())->method('getFilePath') ->will($this->returnValue('filepath/sample.jpg')); @@ -147,11 +147,11 @@ public function testExecuteFile() ->will($this->returnSelf()); $this->downloadHelper->expects($this->once())->method('getFilename') ->will($this->returnValue('sample.jpg')); - $this->downloadHelper->expects($this->once())->method('getContentType') + $this->downloadHelper->expects($this->never())->method('getContentType') ->will($this->returnSelf('file')); $this->downloadHelper->expects($this->once())->method('getFileSize') ->will($this->returnValue(null)); - $this->downloadHelper->expects($this->once())->method('getContentDisposition') + $this->downloadHelper->expects($this->never())->method('getContentDisposition') ->will($this->returnValue(null)); $this->downloadHelper->expects($this->once())->method('output') ->will($this->returnSelf()); @@ -182,17 +182,17 @@ public function testExecuteUrl() ->will($this->returnSelf()); $this->response->expects($this->once())->method('sendHeaders') ->will($this->returnSelf()); - $this->objectManager->expects($this->at(1))->method('get')->with('Magento\Downloadable\Helper\Download') + $this->objectManager->expects($this->at(1))->method('get')->with(\Magento\Downloadable\Helper\Download::class) ->will($this->returnValue($this->downloadHelper)); $this->downloadHelper->expects($this->once())->method('setResource') ->will($this->returnSelf()); $this->downloadHelper->expects($this->once())->method('getFilename') ->will($this->returnValue('sample.jpg')); - $this->downloadHelper->expects($this->once())->method('getContentType') + $this->downloadHelper->expects($this->never())->method('getContentType') ->will($this->returnSelf('url')); $this->downloadHelper->expects($this->once())->method('getFileSize') ->will($this->returnValue(null)); - $this->downloadHelper->expects($this->once())->method('getContentDisposition') + $this->downloadHelper->expects($this->never())->method('getContentDisposition') ->will($this->returnValue(null)); $this->downloadHelper->expects($this->once())->method('output') ->will($this->returnSelf()); diff --git a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php index 8d37518d64b66..72056e7f99ae9 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php @@ -1,6 +1,6 @@ jsonHelperMock = $this->getMock(\Magento\Framework\Json\Helper\Data::class, [], [], '', false); - $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); - $this->productMock = $this->getMock( - 'Magento\Catalog\Model\Product', - ['setDownloadableData', 'getExtensionAttributes', '__wakeup'], - [], - '', - false - ); - $this->subjectMock = $this->getMock( - 'Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper', - [], - [], - '', - false - ); + $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + ->disableOriginalConstructor() + ->getMock(); + $this->productMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) + ->setMethods(['setDownloadableData', 'getExtensionAttributes']) + ->disableOriginalConstructor() + ->getMock(); + $this->subjectMock = $this->getMockBuilder( + \Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper::class + )->disableOriginalConstructor()->getMock(); $this->extensionAttributesMock = $this->getMockBuilder(ProductExtensionInterface::class) ->disableOriginalConstructor() ->setMethods(['setDownloadableProductSamples', 'setDownloadableProductLinks']) ->getMockForAbstractClass(); - $this->sampleFactoryMock = $this->getMockBuilder('\Magento\Downloadable\Api\Data\SampleInterfaceFactory') + $this->sampleFactoryMock = $this->getMockBuilder(\Magento\Downloadable\Api\Data\SampleInterfaceFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->sampleBuilder = $this->getMockBuilder(\Magento\Downloadable\Model\Sample\Builder::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->linkFactory = $this->getMockBuilder(\Magento\Downloadable\Api\Data\LinkInterfaceFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->linkFactoryMock = $this->getMockBuilder('\Magento\Downloadable\Api\Data\LinkInterfaceFactory') + $this->linkBuilder = $this->getMockBuilder(\Magento\Downloadable\Model\Link\Builder::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); @@ -83,8 +90,9 @@ protected function setUp() new \Magento\Downloadable\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Downloadable( $this->requestMock, $this->sampleFactoryMock, - $this->linkFactoryMock, - $this->jsonHelperMock + $this->sampleBuilder, + $this->linkFactory, + $this->linkBuilder ); } diff --git a/app/code/Magento/Downloadable/Test/Unit/Controller/Download/LinkSampleTest.php b/app/code/Magento/Downloadable/Test/Unit/Controller/Download/LinkSampleTest.php index c0744ce112a34..a0ab6d94b6759 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Controller/Download/LinkSampleTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Controller/Download/LinkSampleTest.php @@ -1,6 +1,6 @@ objectManagerHelper = new ObjectManagerHelper($this); - $this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http') + $this->request = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) ->disableOriginalConstructor()->getMock(); $this->response = $this->getMock( - '\Magento\Framework\App\ResponseInterface', + \Magento\Framework\App\ResponseInterface::class, [ 'setHttpResponseCode', 'clearBody', @@ -95,7 +100,7 @@ protected function setUp() ] ); $this->session = $this->getMock( - 'Magento\Customer\Model\Session', + \Magento\Customer\Model\Session::class, [ 'getCustomerId', 'authenticate', @@ -106,7 +111,7 @@ protected function setUp() false ); $this->helperData = $this->getMock( - 'Magento\Downloadable\Helper\Data', + \Magento\Downloadable\Helper\Data::class, [ 'getIsShareable' ], @@ -115,7 +120,7 @@ protected function setUp() false ); $this->downloadHelper = $this->getMock( - 'Magento\Downloadable\Helper\Download', + \Magento\Downloadable\Helper\Download::class, [ 'setResource', 'getFilename', @@ -129,7 +134,7 @@ protected function setUp() false ); $this->product = $this->getMock( - 'Magento\Catalog\Model\Product', + \Magento\Catalog\Model\Product::class, [ '_wakeup', 'load', @@ -142,7 +147,7 @@ protected function setUp() false ); $this->linkPurchasedItem = $this->getMock( - 'Magento\Downloadable\Model\Link\Purchased\Item', + \Magento\Downloadable\Model\Link\Purchased\Item::class, [ 'load', 'getId', @@ -163,7 +168,7 @@ protected function setUp() false ); $this->linkPurchased = $this->getMock( - 'Magento\Downloadable\Model\Link\Purchased', + \Magento\Downloadable\Model\Link\Purchased::class, [ 'load', 'getCustomerId' @@ -173,28 +178,28 @@ protected function setUp() false ); $this->messageManager = $this->getMock( - 'Magento\Framework\Message\ManagerInterface', + \Magento\Framework\Message\ManagerInterface::class, [], [], '', false ); $this->redirect = $this->getMock( - 'Magento\Framework\App\Response\RedirectInterface', + \Magento\Framework\App\Response\RedirectInterface::class, [], [], '', false ); $this->urlInterface = $this->getMock( - 'Magento\Framework\UrlInterface', + \Magento\Framework\UrlInterface::class, [], [], '', false ); $this->objectManager = $this->getMock( - '\Magento\Framework\ObjectManager\ObjectManager', + \Magento\Framework\ObjectManager\ObjectManager::class, [ 'create', 'get' @@ -204,7 +209,7 @@ protected function setUp() false ); $this->link = $this->objectManagerHelper->getObject( - 'Magento\Downloadable\Controller\Download\Link', + \Magento\Downloadable\Controller\Download\Link::class, [ 'objectManager' => $this->objectManager, 'request' => $this->request, @@ -219,12 +224,12 @@ public function testAbsentLinkId() { $this->objectManager->expects($this->once()) ->method('get') - ->with('Magento\Customer\Model\Session') + ->with(\Magento\Customer\Model\Session::class) ->willReturn($this->session); $this->request->expects($this->once())->method('getParam')->with('id', 0)->willReturn('some_id'); $this->objectManager->expects($this->once()) ->method('create') - ->with('Magento\Downloadable\Model\Link\Purchased\Item') + ->with(\Magento\Downloadable\Model\Link\Purchased\Item::class) ->willReturn($this->linkPurchasedItem); $this->linkPurchasedItem->expects($this->once()) ->method('load') @@ -243,12 +248,12 @@ public function testGetLinkForGuestCustomer() { $this->objectManager->expects($this->at(0)) ->method('get') - ->with('Magento\Customer\Model\Session') + ->with(\Magento\Customer\Model\Session::class) ->willReturn($this->session); $this->request->expects($this->once())->method('getParam')->with('id', 0)->willReturn('some_id'); $this->objectManager->expects($this->at(1)) ->method('create') - ->with('Magento\Downloadable\Model\Link\Purchased\Item') + ->with(\Magento\Downloadable\Model\Link\Purchased\Item::class) ->willReturn($this->linkPurchasedItem); $this->linkPurchasedItem->expects($this->once()) ->method('load') @@ -257,7 +262,7 @@ public function testGetLinkForGuestCustomer() $this->linkPurchasedItem->expects($this->once())->method('getId')->willReturn(5); $this->objectManager->expects($this->at(2)) ->method('get') - ->with('Magento\Downloadable\Helper\Data') + ->with(\Magento\Downloadable\Helper\Data::class) ->willReturn($this->helperData); $this->helperData->expects($this->once()) ->method('getIsShareable') @@ -266,7 +271,7 @@ public function testGetLinkForGuestCustomer() $this->session->expects($this->once())->method('getCustomerId')->willReturn(null); $this->objectManager->expects($this->at(3)) ->method('create') - ->with('Magento\Catalog\Model\Product') + ->with(\Magento\Catalog\Model\Product::class) ->willReturn($this->product); $this->linkPurchasedItem->expects($this->once())->method('getProductId')->willReturn('product_id'); $this->product->expects($this->once())->method('load')->with('product_id')->willReturnSelf(); @@ -279,7 +284,7 @@ public function testGetLinkForGuestCustomer() $this->session->expects($this->once())->method('authenticate')->willReturn(true); $this->objectManager->expects($this->at(4)) ->method('create') - ->with('Magento\Framework\UrlInterface') + ->with(\Magento\Framework\UrlInterface::class) ->willReturn($this->urlInterface); $this->urlInterface->expects($this->once()) ->method('getUrl') @@ -294,12 +299,12 @@ public function testGetLinkForWrongCustomer() { $this->objectManager->expects($this->at(0)) ->method('get') - ->with('Magento\Customer\Model\Session') + ->with(\Magento\Customer\Model\Session::class) ->willReturn($this->session); $this->request->expects($this->once())->method('getParam')->with('id', 0)->willReturn('some_id'); $this->objectManager->expects($this->at(1)) ->method('create') - ->with('Magento\Downloadable\Model\Link\Purchased\Item') + ->with(\Magento\Downloadable\Model\Link\Purchased\Item::class) ->willReturn($this->linkPurchasedItem); $this->linkPurchasedItem->expects($this->once()) ->method('load') @@ -308,7 +313,7 @@ public function testGetLinkForWrongCustomer() $this->linkPurchasedItem->expects($this->once())->method('getId')->willReturn(5); $this->objectManager->expects($this->at(2)) ->method('get') - ->with('Magento\Downloadable\Helper\Data') + ->with(\Magento\Downloadable\Helper\Data::class) ->willReturn($this->helperData); $this->helperData->expects($this->once()) ->method('getIsShareable') @@ -317,7 +322,7 @@ public function testGetLinkForWrongCustomer() $this->session->expects($this->once())->method('getCustomerId')->willReturn('customer_id'); $this->objectManager->expects($this->at(3)) ->method('create') - ->with('Magento\Downloadable\Model\Link\Purchased') + ->with(\Magento\Downloadable\Model\Link\Purchased::class) ->willReturn($this->linkPurchased); $this->linkPurchasedItem->expects($this->once())->method('getPurchasedId')->willReturn('purchased_id'); $this->linkPurchased->expects($this->once())->method('load')->with('purchased_id')->willReturnSelf(); @@ -330,16 +335,22 @@ public function testGetLinkForWrongCustomer() $this->assertEquals($this->response, $this->link->execute()); } - public function testExceptionInUpdateLinkStatus() + /** + * @param string $mimeType + * @param string $disposition + * @dataProvider downloadTypesDataProvider + * @return void + */ + public function testExceptionInUpdateLinkStatus($mimeType, $disposition) { $this->objectManager->expects($this->at(0)) ->method('get') - ->with('Magento\Customer\Model\Session') + ->with(\Magento\Customer\Model\Session::class) ->willReturn($this->session); $this->request->expects($this->once())->method('getParam')->with('id', 0)->willReturn('some_id'); $this->objectManager->expects($this->at(1)) ->method('create') - ->with('Magento\Downloadable\Model\Link\Purchased\Item') + ->with(\Magento\Downloadable\Model\Link\Purchased\Item::class) ->willReturn($this->linkPurchasedItem); $this->linkPurchasedItem->expects($this->once()) ->method('load') @@ -348,7 +359,7 @@ public function testExceptionInUpdateLinkStatus() $this->linkPurchasedItem->expects($this->once())->method('getId')->willReturn(5); $this->objectManager->expects($this->at(2)) ->method('get') - ->with('Magento\Downloadable\Helper\Data') + ->with(\Magento\Downloadable\Helper\Data::class) ->willReturn($this->helperData); $this->helperData->expects($this->once()) ->method('getIsShareable') @@ -360,7 +371,7 @@ public function testExceptionInUpdateLinkStatus() $this->linkPurchasedItem->expects($this->once())->method('getLinkType')->willReturn('url'); $this->linkPurchasedItem->expects($this->once())->method('getLinkUrl')->willReturn('link_url'); - $this->processDownload('link_url', 'url'); + $this->processDownload('link_url', 'url', $mimeType, $disposition); $this->linkPurchasedItem->expects($this->any())->method('setNumberOfDownloadsUsed')->willReturnSelf(); $this->linkPurchasedItem->expects($this->any())->method('setStatus')->with('expired')->willReturnSelf(); @@ -374,40 +385,43 @@ public function testExceptionInUpdateLinkStatus() $this->assertEquals($this->response, $this->link->execute()); } - private function processDownload($resource, $resourceType) + /** + * @param string $resource + * @param string $resourceType + * @param string $mimeType + * @param atring $disposition + * @return void + */ + private function processDownload($resource, $resourceType, $mimeType, $disposition) { + $fileSize = 58493; + $fileName = 'link.jpg'; + $this->objectManager->expects($this->at(3)) ->method('get') - ->with('Magento\Downloadable\Helper\Download') + ->with(\Magento\Downloadable\Helper\Download::class) ->willReturn($this->downloadHelper); $this->downloadHelper->expects($this->once()) ->method('setResource') ->with($resource, $resourceType) ->willReturnSelf(); - $this->downloadHelper->expects($this->once())->method('getFilename')->willReturn('file_name'); - $this->downloadHelper->expects($this->once())->method('getContentType')->willReturn('content_type'); + $this->downloadHelper->expects($this->once())->method('getFilename')->willReturn($fileName); + $this->downloadHelper->expects($this->once())->method('getContentType')->willReturn($mimeType); $this->response->expects($this->once())->method('setHttpResponseCode')->with(200)->willReturnSelf(); - $this->response->expects($this->at(1))->method('setHeader')->with('Pragma', 'public', true)->willReturnSelf(); - $this->response->expects($this->at(2)) - ->method('setHeader') - ->with('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true) - ->willReturnSelf(); - $this->response->expects($this->at(3)) + $this->response + ->expects($this->any()) ->method('setHeader') - ->with('Content-type', 'content_type', true) - ->willReturnSelf(); - $this->downloadHelper->expects($this->once())->method('getFileSize')->willReturn('file_size'); - $this->response->expects($this->at(4)) - ->method('setHeader') - ->with('Content-Length', 'file_size') - ->willReturnSelf(); - $this->downloadHelper->expects($this->once()) - ->method('getContentDisposition') - ->willReturn('content_disposition'); - $this->response->expects($this->at(5)) - ->method('setHeader') - ->with('Content-Disposition', 'content_disposition; filename=file_name') + ->withConsecutive( + ['Pragma', 'public', true], + ['Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true], + ['Content-type', $mimeType, true], + ['Content-Length', $fileSize], + ['Content-Disposition', $disposition . '; filename=' . $fileName] + ) ->willReturnSelf(); + + $this->downloadHelper->expects($this->once())->method('getContentDisposition')->willReturn($disposition); + $this->downloadHelper->expects($this->once())->method('getFileSize')->willReturn($fileSize); $this->response->expects($this->once())->method('clearBody')->willReturnSelf(); $this->response->expects($this->once())->method('sendHeaders')->willReturnSelf(); $this->downloadHelper->expects($this->once())->method('output'); @@ -423,12 +437,12 @@ public function testLinkNotAvailable($messageType, $status, $notice) { $this->objectManager->expects($this->at(0)) ->method('get') - ->with('Magento\Customer\Model\Session') + ->with(\Magento\Customer\Model\Session::class) ->willReturn($this->session); $this->request->expects($this->once())->method('getParam')->with('id', 0)->willReturn('some_id'); $this->objectManager->expects($this->at(1)) ->method('create') - ->with('Magento\Downloadable\Model\Link\Purchased\Item') + ->with(\Magento\Downloadable\Model\Link\Purchased\Item::class) ->willReturn($this->linkPurchasedItem); $this->linkPurchasedItem->expects($this->once()) ->method('load') @@ -437,7 +451,7 @@ public function testLinkNotAvailable($messageType, $status, $notice) $this->linkPurchasedItem->expects($this->once())->method('getId')->willReturn(5); $this->objectManager->expects($this->at(2)) ->method('get') - ->with('Magento\Downloadable\Helper\Data') + ->with(\Magento\Downloadable\Helper\Data::class) ->willReturn($this->helperData); $this->helperData->expects($this->once()) ->method('getIsShareable') @@ -463,4 +477,15 @@ public function linkNotAvailableDataProvider() ['addError', 'wrong_status', 'Something went wrong while getting the requested content.'] ]; } + + /** + * @return array + */ + public function downloadTypesDataProvider() + { + return [ + ['mimeType' => 'text/html', 'disposition' => \Zend_Mime::DISPOSITION_ATTACHMENT], + ['mimeType' => 'image/jpeg', 'disposition' => \Zend_Mime::DISPOSITION_INLINE], + ]; + } } diff --git a/app/code/Magento/Downloadable/Test/Unit/Controller/Download/SampleTest.php b/app/code/Magento/Downloadable/Test/Unit/Controller/Download/SampleTest.php index 2f077e549bbf9..5c8acac4a15b7 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Controller/Download/SampleTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Controller/Download/SampleTest.php @@ -1,6 +1,6 @@ $this->getMock('Magento\Catalog\Model\ProductFactory', [], [], '', false), - 'orderItemCollectionFactory' => $this->getMock( - 'Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory', - [], - [], - '', - false - ), - 'serviceOrderFactory' => $this->getMock( - 'Magento\Sales\Model\Service\OrderFactory', - [], - [], - '', - false - ), - 'currencyFactory' => $this->getMock( - 'Magento\Directory\Model\CurrencyFactory', - [], - [], - '', - false - ), - 'orderHistoryFactory' => $this->getMock( - 'Magento\Sales\Model\Order\Status\HistoryFactory', - [], - [], - '', - false - ), - 'orderTaxCollectionFactory' => $this->getMock( - 'Magento\Tax\Model\ResourceModel\Sales\Order\Tax\CollectionFactory', - [], - [], - '', - false - ), - ]; - $orderConstructorArgs = $objectManager->getConstructArguments('Magento\Sales\Model\Order', $arguments); - $this->_order = $this->getMock('Magento\Sales\Model\Order', ['formatPriceTxt'], $orderConstructorArgs); - $this->_order->expects( - $this->any() - )->method( - 'formatPriceTxt' - )->will( - $this->returnCallback([$this, 'formatPrice']) - ); + $this->order = $this->getMockBuilder(\Magento\Sales\Model\Order::class) + ->disableOriginalConstructor() + ->getMock(); + $this->order->expects($this->any()) + ->method('formatPriceTxt') + ->will($this->returnCallback([$this, 'formatPrice'])); - $this->_pdf = $this->getMock( - 'Magento\Sales\Model\Order\Pdf\AbstractPdf', + $this->pdf = $this->getMock( + \Magento\Sales\Model\Order\Pdf\AbstractPdf::class, ['drawLineBlocks', 'getPdf'], [], '', @@ -96,22 +55,22 @@ protected function setUp() ['string' => new \Magento\Framework\Stdlib\StringUtils(), 'filterManager' => $filterManager] ); - $this->_model = $this->getMock( - 'Magento\Downloadable\Model\Sales\Order\Pdf\Items\Creditmemo', + $this->model = $this->getMock( + \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Creditmemo::class, ['getLinks', 'getLinksTitle'], $modelConstructorArgs ); - $this->_model->setOrder($this->_order); - $this->_model->setPdf($this->_pdf); - $this->_model->setPage(new \Zend_Pdf_Page('a4')); + $this->model->setOrder($this->order); + $this->model->setPdf($this->pdf); + $this->model->setPage(new \Zend_Pdf_Page('a4')); } protected function tearDown() { - $this->_model = null; - $this->_order = null; - $this->_pdf = null; + $this->model = null; + $this->order = null; + $this->pdf = null; } /** @@ -150,7 +109,7 @@ public function testDraw() ], ]; - $this->_model->setItem( + $this->model->setItem( new \Magento\Framework\DataObject( [ 'name' => 'Downloadable Documentation', @@ -170,8 +129,8 @@ public function testDraw() ] ) ); - $this->_model->expects($this->any())->method('getLinksTitle')->will($this->returnValue('Download Links')); - $this->_model->expects( + $this->model->expects($this->any())->method('getLinksTitle')->will($this->returnValue('Download Links')); + $this->model->expects( $this->any() )->method( 'getLinks' @@ -184,7 +143,7 @@ public function testDraw() ) ) ); - $this->_pdf->expects( + $this->pdf->expects( $this->once() )->method( 'drawLineBlocks' @@ -196,8 +155,8 @@ public function testDraw() $this->returnValue($expectedPdfPage) ); - $this->assertNotSame($expectedPdfPage, $this->_model->getPage()); - $this->assertNull($this->_model->draw()); - $this->assertSame($expectedPdfPage, $this->_model->getPage()); + $this->assertNotSame($expectedPdfPage, $this->model->getPage()); + $this->assertNull($this->model->draw()); + $this->assertSame($expectedPdfPage, $this->model->getPage()); } } diff --git a/app/code/Magento/Downloadable/Test/Unit/Model/Sample/BuilderTest.php b/app/code/Magento/Downloadable/Test/Unit/Model/Sample/BuilderTest.php index 806f5fa8617bc..82d60684a07d1 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Model/Sample/BuilderTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Model/Sample/BuilderTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Downloadable/etc/adminhtml/di.xml b/app/code/Magento/Downloadable/etc/adminhtml/di.xml index d6af2661df0f3..022aa45bb56a2 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/di.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/adminhtml/menu.xml b/app/code/Magento/Downloadable/etc/adminhtml/menu.xml index 55359b3045521..b9d88e763579d 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/menu.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/adminhtml/routes.xml b/app/code/Magento/Downloadable/etc/adminhtml/routes.xml index a3fca45339548..950559be60fe7 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/routes.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/adminhtml/system.xml b/app/code/Magento/Downloadable/etc/adminhtml/system.xml index a8f8315360339..2f0e40e8eb5ba 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/system.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/catalog_attributes.xml b/app/code/Magento/Downloadable/etc/catalog_attributes.xml index 081f9e8764b7f..5cdda5bb69cc5 100644 --- a/app/code/Magento/Downloadable/etc/catalog_attributes.xml +++ b/app/code/Magento/Downloadable/etc/catalog_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/config.xml b/app/code/Magento/Downloadable/etc/config.xml index 9582cea6da007..578ff1e008660 100644 --- a/app/code/Magento/Downloadable/etc/config.xml +++ b/app/code/Magento/Downloadable/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/di.xml b/app/code/Magento/Downloadable/etc/di.xml index 84b6de602acaa..4db0c6398781d 100644 --- a/app/code/Magento/Downloadable/etc/di.xml +++ b/app/code/Magento/Downloadable/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/events.xml b/app/code/Magento/Downloadable/etc/events.xml index da7cc5b5c9150..e4f03ff238d4a 100644 --- a/app/code/Magento/Downloadable/etc/events.xml +++ b/app/code/Magento/Downloadable/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/extension_attributes.xml b/app/code/Magento/Downloadable/etc/extension_attributes.xml index c1d5f9e37c47e..c9970c0d8ec34 100644 --- a/app/code/Magento/Downloadable/etc/extension_attributes.xml +++ b/app/code/Magento/Downloadable/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/fieldset.xml b/app/code/Magento/Downloadable/etc/fieldset.xml index dfc475f4b27c2..607312701c5ad 100644 --- a/app/code/Magento/Downloadable/etc/fieldset.xml +++ b/app/code/Magento/Downloadable/etc/fieldset.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/frontend/di.xml b/app/code/Magento/Downloadable/etc/frontend/di.xml index 7920c2a5cf48b..0ab964a02601f 100644 --- a/app/code/Magento/Downloadable/etc/frontend/di.xml +++ b/app/code/Magento/Downloadable/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/frontend/events.xml b/app/code/Magento/Downloadable/etc/frontend/events.xml index 3c024793a3744..f2511c3ac23d2 100644 --- a/app/code/Magento/Downloadable/etc/frontend/events.xml +++ b/app/code/Magento/Downloadable/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/frontend/page_types.xml b/app/code/Magento/Downloadable/etc/frontend/page_types.xml index aabe2d70a3e41..31fa25e19e345 100644 --- a/app/code/Magento/Downloadable/etc/frontend/page_types.xml +++ b/app/code/Magento/Downloadable/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/frontend/routes.xml b/app/code/Magento/Downloadable/etc/frontend/routes.xml index 0f5d7a974982d..f04a7beee16bf 100644 --- a/app/code/Magento/Downloadable/etc/frontend/routes.xml +++ b/app/code/Magento/Downloadable/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/module.xml b/app/code/Magento/Downloadable/etc/module.xml index 580822fe957a1..4e18acb5e0180 100644 --- a/app/code/Magento/Downloadable/etc/module.xml +++ b/app/code/Magento/Downloadable/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/pdf.xml b/app/code/Magento/Downloadable/etc/pdf.xml index efc0e038a892e..0be773c548202 100644 --- a/app/code/Magento/Downloadable/etc/pdf.xml +++ b/app/code/Magento/Downloadable/etc/pdf.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/product_types.xml b/app/code/Magento/Downloadable/etc/product_types.xml index 08e02028965c0..e462b3459232c 100644 --- a/app/code/Magento/Downloadable/etc/product_types.xml +++ b/app/code/Magento/Downloadable/etc/product_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/sales.xml b/app/code/Magento/Downloadable/etc/sales.xml index 2a10842dd3319..fdb4f5d471c0d 100644 --- a/app/code/Magento/Downloadable/etc/sales.xml +++ b/app/code/Magento/Downloadable/etc/sales.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/webapi.xml b/app/code/Magento/Downloadable/etc/webapi.xml index 773b31ab2be66..baac682ee8c21 100644 --- a/app/code/Magento/Downloadable/etc/webapi.xml +++ b/app/code/Magento/Downloadable/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/webapi_rest/di.xml b/app/code/Magento/Downloadable/etc/webapi_rest/di.xml index 6e1c41b1c9606..306f56fae7924 100644 --- a/app/code/Magento/Downloadable/etc/webapi_rest/di.xml +++ b/app/code/Magento/Downloadable/etc/webapi_rest/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/etc/webapi_soap/di.xml b/app/code/Magento/Downloadable/etc/webapi_soap/di.xml index 6e1c41b1c9606..306f56fae7924 100644 --- a/app/code/Magento/Downloadable/etc/webapi_soap/di.xml +++ b/app/code/Magento/Downloadable/etc/webapi_soap/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/registration.php b/app/code/Magento/Downloadable/registration.php index 516a177e10c1c..b91e72a6904af 100644 --- a/app/code/Magento/Downloadable/registration.php +++ b/app/code/Magento/Downloadable/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_simple.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_simple.xml index 5866d21ff46d7..843f9b4025649 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_simple.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_simple.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_view_type_downloadable.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_view_type_downloadable.xml index 823b83c7cdf33..4989bf8293b4d 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_view_type_downloadable.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_view_type_downloadable.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_virtual.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_virtual.xml index 5866d21ff46d7..843f9b4025649 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_virtual.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_virtual.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/customer_index_wishlist.xml index 1355e7a0c8562..7c9dd8d5429cc 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/customer_index_wishlist.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/downloadable_items.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/downloadable_items.xml index 5a8056106444f..958e922334db7 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/downloadable_items.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/downloadable_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_new.xml index 50c7e06227afb..74dad7f0f8218 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index 50c7e06227afb..74dad7f0f8218 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_view.xml index d06b80071892e..0a6c12d424682 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_new.xml index 9b3c2af9d0ff4..68a5bb76e1d3c 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_updateqty.xml index 9b3c2af9d0ff4..68a5bb76e1d3c 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_view.xml index dfbbe17392e2e..6de1514f86dfd 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_view.xml index d2e7658639935..0cc545f397726 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/composite/fieldset/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/composite/fieldset/downloadable.phtml index ff66ccd5dc73b..604f1cde88e96 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/composite/fieldset/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/composite/fieldset/downloadable.phtml @@ -1,6 +1,6 @@ isSingleStoreMode() ? ' data-config-scope="' . __('[STORE VIEW]') . '"' : ''; ?>>
    - getStoreId() && $block->getUsedDefault()) ? 'disabled="disabled"' : '' ?>> + getStoreId() && $block->getUsedDefault()) ? 'disabled="disabled"' : '' ?>> getStoreId()): ?>
    getUsedDefault() ? 'checked="checked"' : '' ?> /> @@ -158,9 +158,9 @@ require([ ''+ '
    '+ '' + - '' + + '' + '"@example.com', + 'sender_email' => '""@example.com', + ], + [ + 'sender' => '"<script>alert(document.domain)</script>"@example.com', + 'sender_email' => '"<script>alert(document.domain)</script>"@example.com', + ], + ], + ]; + } +} diff --git a/app/code/Magento/Newsletter/Test/Unit/Block/Adminhtml/Template/PreviewTest.php b/app/code/Magento/Newsletter/Test/Unit/Block/Adminhtml/Template/PreviewTest.php index 8e6f605f22610..a224d8cce3459 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Block/Adminhtml/Template/PreviewTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Block/Adminhtml/Template/PreviewTest.php @@ -1,6 +1,6 @@ expects($this->once())->method('getStoreId')->willReturn('store_id'); $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); + $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) + ->disableOriginalConstructor() + ->setMethods(['getId']) + ->getMock(); + $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); + $this->assertEquals($this->subscriber, $this->subscriber->updateSubscription($customerId)); } @@ -257,6 +266,66 @@ public function testSubscribeCustomerById() $this->subscriber->subscribeCustomerById($customerId); } + public function testSubscribeCustomerById1() + { + $customerId = 1; + $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) + ->getMock(); + $this->customerRepository->expects($this->atLeastOnce()) + ->method('getById') + ->with($customerId)->willReturn($customerDataMock); + $this->resource->expects($this->atLeastOnce()) + ->method('loadByCustomerData') + ->with($customerDataMock) + ->willReturn( + [ + 'subscriber_id' => 1, + 'subscriber_status' => 3 + ] + ); + $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); + $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); + $customerDataMock->expects($this->once())->method('getStoreId')->willReturn('store_id'); + $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); + $this->sendEmailCheck(); + $this->customerAccountManagement->expects($this->once()) + ->method('getConfirmationStatus') + ->willReturn(\Magento\Customer\Api\AccountManagementInterface::ACCOUNT_CONFIRMATION_NOT_REQUIRED); + $this->scopeConfig->expects($this->atLeastOnce())->method('getValue')->with()->willReturn(true); + + $this->subscriber->subscribeCustomerById($customerId); + $this->assertEquals(\Magento\Newsletter\Model\Subscriber::STATUS_NOT_ACTIVE, $this->subscriber->getStatus()); + } + + public function testSubscribeCustomerByIdAfterConfirmation() + { + $customerId = 1; + $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) + ->getMock(); + $this->customerRepository->expects($this->atLeastOnce()) + ->method('getById') + ->with($customerId)->willReturn($customerDataMock); + $this->resource->expects($this->atLeastOnce()) + ->method('loadByCustomerData') + ->with($customerDataMock) + ->willReturn( + [ + 'subscriber_id' => 1, + 'subscriber_status' => 4 + ] + ); + $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); + $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); + $customerDataMock->expects($this->once())->method('getStoreId')->willReturn('store_id'); + $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); + $this->sendEmailCheck(); + $this->customerAccountManagement->expects($this->never())->method('getConfirmationStatus'); + $this->scopeConfig->expects($this->atLeastOnce())->method('getValue')->with()->willReturn(true); + + $this->subscriber->updateSubscription($customerId); + $this->assertEquals(\Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED, $this->subscriber->getStatus()); + } + public function testUnsubscribe() { $this->resource->expects($this->once())->method('save')->willReturnSelf(); diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/Template/FilterTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/Template/FilterTest.php index 708fc6a124d38..e7747cf59df0f 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/Template/FilterTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/Template/FilterTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Newsletter/etc/adminhtml/menu.xml b/app/code/Magento/Newsletter/etc/adminhtml/menu.xml index b3bc7f942155a..a9cedf1c7a1ee 100644 --- a/app/code/Magento/Newsletter/etc/adminhtml/menu.xml +++ b/app/code/Magento/Newsletter/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/adminhtml/routes.xml b/app/code/Magento/Newsletter/etc/adminhtml/routes.xml index 0a4a7e1831304..7cbf5fd7dca04 100644 --- a/app/code/Magento/Newsletter/etc/adminhtml/routes.xml +++ b/app/code/Magento/Newsletter/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/adminhtml/system.xml b/app/code/Magento/Newsletter/etc/adminhtml/system.xml index f553e370766b8..1173f64310304 100644 --- a/app/code/Magento/Newsletter/etc/adminhtml/system.xml +++ b/app/code/Magento/Newsletter/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/config.xml b/app/code/Magento/Newsletter/etc/config.xml index 0b42387a8e970..f976ece8d712f 100644 --- a/app/code/Magento/Newsletter/etc/config.xml +++ b/app/code/Magento/Newsletter/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/crontab.xml b/app/code/Magento/Newsletter/etc/crontab.xml index 85c700cc1a165..77367a942b84a 100644 --- a/app/code/Magento/Newsletter/etc/crontab.xml +++ b/app/code/Magento/Newsletter/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/di.xml b/app/code/Magento/Newsletter/etc/di.xml index e77b5b44325ef..179ec19cccfc5 100644 --- a/app/code/Magento/Newsletter/etc/di.xml +++ b/app/code/Magento/Newsletter/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/email_templates.xml b/app/code/Magento/Newsletter/etc/email_templates.xml index ebb01ae3a6245..5659f1541b873 100644 --- a/app/code/Magento/Newsletter/etc/email_templates.xml +++ b/app/code/Magento/Newsletter/etc/email_templates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/extension_attributes.xml b/app/code/Magento/Newsletter/etc/extension_attributes.xml index 97dacaf276725..50f46af5c033b 100644 --- a/app/code/Magento/Newsletter/etc/extension_attributes.xml +++ b/app/code/Magento/Newsletter/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/frontend/di.xml b/app/code/Magento/Newsletter/etc/frontend/di.xml index d1ca5a2eb2bc6..eef123a3304e3 100644 --- a/app/code/Magento/Newsletter/etc/frontend/di.xml +++ b/app/code/Magento/Newsletter/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/frontend/page_types.xml b/app/code/Magento/Newsletter/etc/frontend/page_types.xml index d0c5e54ad4fa1..d51c2d9822ed1 100644 --- a/app/code/Magento/Newsletter/etc/frontend/page_types.xml +++ b/app/code/Magento/Newsletter/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/frontend/routes.xml b/app/code/Magento/Newsletter/etc/frontend/routes.xml index 79980dfe221d2..77a3f9f72b836 100644 --- a/app/code/Magento/Newsletter/etc/frontend/routes.xml +++ b/app/code/Magento/Newsletter/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/etc/module.xml b/app/code/Magento/Newsletter/etc/module.xml index 95197eb5d31fd..f338445225222 100644 --- a/app/code/Magento/Newsletter/etc/module.xml +++ b/app/code/Magento/Newsletter/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/registration.php b/app/code/Magento/Newsletter/registration.php index 91ae31f2005c0..98db0a0e4fcd8 100644 --- a/app/code/Magento/Newsletter/registration.php +++ b/app/code/Magento/Newsletter/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_block.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_block.xml index e539b397e1301..2e2effa496b2f 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_block.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_grid.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_grid.xml index d388b31aef841..40ae6085a1071 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_grid.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_index.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_index.xml index 6b08c137658ae..857e780a360bb 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_index.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml index 59aae161de1a2..e94d2786faabb 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid.xml index b9d1fd24c7d02..662123f2ea80c 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid_block.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid_block.xml index 93c0feaee360e..2c2ac7d32d71c 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid_block.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_index.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_index.xml index 044a50eff2b47..2883fd9ad3e1f 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_index.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml index 39575f6a19051..52b8f7c9f2329 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml index 5181d114215c9..a9dcc33fee898 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_block.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_block.xml index 4623fde4ffa56..0dd1c6d744a8f 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_block.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportcsv.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportcsv.xml index 8ae23e82da611..b3e4a02c89600 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportcsv.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportcsv.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportxml.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportxml.xml index 8ae23e82da611..b3e4a02c89600 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportxml.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportxml.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_grid.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_grid.xml index b8b044c78b385..50c21b14fb0db 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_grid.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_index.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_index.xml index b4533e095862b..a856f59360809 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_index.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml index b8287aeacd40a..7cdff2aa1cdb2 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml index 29752027443ff..df5701ec6a9c8 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml index 4b522534eb574..85f9f1f0138fa 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml index 4b522534eb574..85f9f1f0138fa 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/templates/preview/iframeswitcher.phtml b/app/code/Magento/Newsletter/view/adminhtml/templates/preview/iframeswitcher.phtml index 4c9ed4989716f..aca4edd302808 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/templates/preview/iframeswitcher.phtml +++ b/app/code/Magento/Newsletter/view/adminhtml/templates/preview/iframeswitcher.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Newsletter/view/adminhtml/templates/subscriber/list.phtml b/app/code/Magento/Newsletter/view/adminhtml/templates/subscriber/list.phtml index 0dc5346cc57b1..a7186be09f62a 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/templates/subscriber/list.phtml +++ b/app/code/Magento/Newsletter/view/adminhtml/templates/subscriber/list.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Newsletter/view/frontend/email/subscr_confirm.html b/app/code/Magento/Newsletter/view/frontend/email/subscr_confirm.html index c5606e783c6ce..eaf760c080370 100644 --- a/app/code/Magento/Newsletter/view/frontend/email/subscr_confirm.html +++ b/app/code/Magento/Newsletter/view/frontend/email/subscr_confirm.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Newsletter/view/frontend/email/subscr_success.html b/app/code/Magento/Newsletter/view/frontend/email/subscr_success.html index 35b1516d68d0c..d56163c10fdf3 100644 --- a/app/code/Magento/Newsletter/view/frontend/email/subscr_success.html +++ b/app/code/Magento/Newsletter/view/frontend/email/subscr_success.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Newsletter/view/frontend/email/unsub_success.html b/app/code/Magento/Newsletter/view/frontend/email/unsub_success.html index 91c3161456007..d39b5d8a8b8e9 100644 --- a/app/code/Magento/Newsletter/view/frontend/email/unsub_success.html +++ b/app/code/Magento/Newsletter/view/frontend/email/unsub_success.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml index 423a6a5e362f3..ed2def75d8a3f 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/frontend/layout/default.xml b/app/code/Magento/Newsletter/view/frontend/layout/default.xml index 8fa388ec29e8e..a6605f7307752 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/default.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml b/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml index 428f49d0e21ee..f5a91a08ddfa7 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Newsletter/view/frontend/templates/js/components.phtml b/app/code/Magento/Newsletter/view/frontend/templates/js/components.phtml index bdcb2e9bf7747..e71938935b8f3 100644 --- a/app/code/Magento/Newsletter/view/frontend/templates/js/components.phtml +++ b/app/code/Magento/Newsletter/view/frontend/templates/js/components.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Review/view/frontend/web/js/error-placement.js b/app/code/Magento/Review/view/frontend/web/js/error-placement.js index 6097c02d34764..a7cee8498e0c0 100644 --- a/app/code/Magento/Review/view/frontend/web/js/error-placement.js +++ b/app/code/Magento/Review/view/frontend/web/js/error-placement.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Review/view/frontend/web/js/process-reviews.js b/app/code/Magento/Review/view/frontend/web/js/process-reviews.js index 49b4c2e701b33..d17cf8af03cdb 100644 --- a/app/code/Magento/Review/view/frontend/web/js/process-reviews.js +++ b/app/code/Magento/Review/view/frontend/web/js/process-reviews.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Review/view/frontend/web/js/view/review.js b/app/code/Magento/Review/view/frontend/web/js/view/review.js index ffbae73fe6278..07312c5ea493a 100644 --- a/app/code/Magento/Review/view/frontend/web/js/view/review.js +++ b/app/code/Magento/Review/view/frontend/web/js/view/review.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Robots/Block/Data.php b/app/code/Magento/Robots/Block/Data.php index fffac37a92dd1..5426bbaf148d6 100644 --- a/app/code/Magento/Robots/Block/Data.php +++ b/app/code/Magento/Robots/Block/Data.php @@ -1,6 +1,6 @@ resultPageFactory->create(true); $resultPage->addHandle('robots_index_index'); + $resultPage->setHeader('Content-Type', 'text/plain'); return $resultPage; } } diff --git a/app/code/Magento/Robots/Controller/Router.php b/app/code/Magento/Robots/Controller/Router.php index 400cd4971f4a1..4ed2b6c72871b 100644 --- a/app/code/Magento/Robots/Controller/Router.php +++ b/app/code/Magento/Robots/Controller/Router.php @@ -1,6 +1,6 @@ expects($this->once()) ->method('addHandle') ->with('robots_index_index'); + $resultPageMock->expects($this->once()) + ->method('setHeader') + ->with('Content-Type', 'text/plain'); $this->resultPageFactory->expects($this->any()) ->method('create') diff --git a/app/code/Magento/Robots/Test/Unit/Controller/RouterTest.php b/app/code/Magento/Robots/Test/Unit/Controller/RouterTest.php index baa303bd0315a..a2941dac44550 100644 --- a/app/code/Magento/Robots/Test/Unit/Controller/RouterTest.php +++ b/app/code/Magento/Robots/Test/Unit/Controller/RouterTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Robots/etc/frontend/di.xml b/app/code/Magento/Robots/etc/frontend/di.xml index 8113c60032a5a..5670ee637beeb 100644 --- a/app/code/Magento/Robots/etc/frontend/di.xml +++ b/app/code/Magento/Robots/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Robots/etc/frontend/routes.xml b/app/code/Magento/Robots/etc/frontend/routes.xml index d564ef97d6942..a30cbe320f673 100644 --- a/app/code/Magento/Robots/etc/frontend/routes.xml +++ b/app/code/Magento/Robots/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Robots/etc/module.xml b/app/code/Magento/Robots/etc/module.xml index a8dc9007e5c6b..ab04dfb7486f7 100644 --- a/app/code/Magento/Robots/etc/module.xml +++ b/app/code/Magento/Robots/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Robots/registration.php b/app/code/Magento/Robots/registration.php index 8c82b61c6a4f5..0e062e1139461 100644 --- a/app/code/Magento/Robots/registration.php +++ b/app/code/Magento/Robots/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Robots/view/frontend/page_layout/robots.xml b/app/code/Magento/Robots/view/frontend/page_layout/robots.xml index f1e75352ebf0a..1184772e6817d 100644 --- a/app/code/Magento/Robots/view/frontend/page_layout/robots.xml +++ b/app/code/Magento/Robots/view/frontend/page_layout/robots.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Robots/view/frontend/templates/robots.phtml b/app/code/Magento/Robots/view/frontend/templates/robots.phtml index 5daa3ff018d00..4d5ef94cd565c 100644 --- a/app/code/Magento/Robots/view/frontend/templates/robots.phtml +++ b/app/code/Magento/Robots/view/frontend/templates/robots.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Rss/etc/adminhtml/di.xml b/app/code/Magento/Rss/etc/adminhtml/di.xml index 8a43668affea6..1b290bc066f45 100644 --- a/app/code/Magento/Rss/etc/adminhtml/di.xml +++ b/app/code/Magento/Rss/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Rss/etc/adminhtml/routes.xml b/app/code/Magento/Rss/etc/adminhtml/routes.xml index b76fd7221118a..6551f5c633fd9 100644 --- a/app/code/Magento/Rss/etc/adminhtml/routes.xml +++ b/app/code/Magento/Rss/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Rss/etc/adminhtml/system.xml b/app/code/Magento/Rss/etc/adminhtml/system.xml index d916bcd3e57ae..0ee0fffdfe3c0 100644 --- a/app/code/Magento/Rss/etc/adminhtml/system.xml +++ b/app/code/Magento/Rss/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Rss/etc/di.xml b/app/code/Magento/Rss/etc/di.xml index fbe92c28fdca5..3b00e1893efaf 100644 --- a/app/code/Magento/Rss/etc/di.xml +++ b/app/code/Magento/Rss/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Rss/etc/frontend/page_types.xml b/app/code/Magento/Rss/etc/frontend/page_types.xml index d4d755a3d556d..173f969cf1c95 100644 --- a/app/code/Magento/Rss/etc/frontend/page_types.xml +++ b/app/code/Magento/Rss/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Rss/etc/frontend/routes.xml b/app/code/Magento/Rss/etc/frontend/routes.xml index 8dd282271bed3..632d37d8a00de 100644 --- a/app/code/Magento/Rss/etc/frontend/routes.xml +++ b/app/code/Magento/Rss/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Rss/etc/module.xml b/app/code/Magento/Rss/etc/module.xml index 9aeb61e491a14..c0daf630f75e8 100644 --- a/app/code/Magento/Rss/etc/module.xml +++ b/app/code/Magento/Rss/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Rss/registration.php b/app/code/Magento/Rss/registration.php index 5d557825c24f6..e2206148a6d93 100644 --- a/app/code/Magento/Rss/registration.php +++ b/app/code/Magento/Rss/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml b/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml index eddf4a0581b40..184f26a0bbfb7 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Rss/view/frontend/templates/feeds.phtml b/app/code/Magento/Rss/view/frontend/templates/feeds.phtml index 4e7f0fc060fc4..a367e8f0955df 100644 --- a/app/code/Magento/Rss/view/frontend/templates/feeds.phtml +++ b/app/code/Magento/Rss/view/frontend/templates/feeds.phtml @@ -1,6 +1,6 @@ _backendData = $backendData; $this->_config = $config; @@ -108,6 +126,8 @@ public function __construct( $this->_productResource = $productResource; $this->_attrSetCollection = $attrSetCollection; $this->_localeFormat = $localeFormat; + $this->category = $category ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Catalog\Model\ResourceModel\Category::class); parent::__construct($context, $data); } @@ -520,7 +540,8 @@ public function validate(\Magento\Framework\Model\AbstractModel $model) $attrCode = $this->getAttribute(); if ('category_ids' == $attrCode) { - return $this->validateAttribute($model->getAvailableInCategories()); + $productId = (int)$model->getEntityId(); + return $this->validateAttribute($this->getCategoryIds($productId)); } elseif (!isset($this->_entityAttributeValues[$model->getId()])) { if (!$model->getResource()) { return false; @@ -721,4 +742,38 @@ protected function getEavAttributeTableAlias() return 'at_' . $attribute->getAttributeCode(); } + + /** + * Retrieve category id list where product is present. + * + * @param int $productId + * @return array + */ + private function getCategoryIds($productId) + { + if (!isset($this->categoryIdList[$productId])) { + $this->categoryIdList[$productId] = $this->_productResource->getConnection()->fetchCol( + $this->getCategorySelect($productId) + ); + } + + return $this->categoryIdList[$productId]; + } + + /** + * Returns DB select. + * + * @param int $productId + * @return Select + */ + private function getCategorySelect($productId) + { + return $this->_productResource->getConnection()->select()->from( + $this->category->getCategoryProductTable(), + ['category_id'] + )->where( + 'product_id = ?', + $productId + ); + } } diff --git a/app/code/Magento/Rule/Model/Condition/Sql/Builder.php b/app/code/Magento/Rule/Model/Condition/Sql/Builder.php index eabed8fee8ce1..2a6547e54fef2 100644 --- a/app/code/Magento/Rule/Model/Condition/Sql/Builder.php +++ b/app/code/Magento/Rule/Model/Condition/Sql/Builder.php @@ -1,6 +1,6 @@ _condition = $this->getMockForAbstractClass( @@ -58,14 +64,82 @@ protected function setUp() '_config' ); $this->_configProperty->setAccessible(true); + + $this->categoryProperty = new \ReflectionProperty( + \Magento\Rule\Model\Condition\Product\AbstractProduct::class, + 'category' + ); + $this->categoryProperty->setAccessible(true); + + $this->productResourceProperty = new \ReflectionProperty( + \Magento\Rule\Model\Condition\Product\AbstractProduct::class, + '_productResource' + ); + $this->productResourceProperty->setAccessible(true); } public function testValidateAttributeEqualCategoryId() { - $product = $this->getMock('Magento\Framework\Model\AbstractModel', ["getAttribute"], [], '', false); + $product = $this->getMockBuilder(\Magento\Framework\Model\AbstractModel::class) + ->disableOriginalConstructor() + ->setMethods(['getCategoryIds']) + ->getMock(); + $this->_condition->setAttribute('category_ids'); - $product->setAvailableInCategories(new \Magento\Framework\DataObject()); - $this->assertFalse($this->_condition->validate($product)); + $this->_condition->setValueParsed('1'); + $this->_condition->setOperator('{}'); + + $this->_configProperty->setValue( + $this->_condition, + $this->getMockBuilder(\Magento\Eav\Model\Config::class) + ->disableOriginalConstructor() + ->getMock() + ); + + $category = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Category::class) + ->disableOriginalConstructor() + ->getMock(); + $category->expects($this->once()) + ->method('getCategoryProductTable') + ->willReturnSelf(); + $this->categoryProperty->setValue( + $this->_condition, + $category + ); + + $dbSelect = $this->getMockBuilder(\Magento\Framework\DB\Select::class) + ->disableOriginalConstructor() + ->setMethods(['from', 'where']) + ->getMock(); + $dbSelect->expects($this->atLeastOnce()) + ->method('from') + ->willReturnSelf(); + $dbSelect->expects($this->atLeastOnce()) + ->method('where') + ->willReturnSelf(); + + $connection = $this->getMockBuilder(\Magento\Framework\DB\Adapter\AdapterInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $connection->expects($this->atLeastOnce()) + ->method('select') + ->willReturn($dbSelect); + $connection->expects($this->once()) + ->method('fetchCol') + ->willReturn([1, 2]); + + $resource = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product::class) + ->disableOriginalConstructor() + ->getMock(); + $resource->expects($this->atLeastOnce()) + ->method('getConnection') + ->willReturn($connection); + $this->productResourceProperty->setValue( + $this->_condition, + $resource + ); + + $this->assertTrue($this->_condition->validate($product)); } public function testValidateEmptyEntityAttributeValues() diff --git a/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php b/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php index eef05b805a9ff..651331183d9ee 100644 --- a/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php +++ b/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Rule/registration.php b/app/code/Magento/Rule/registration.php index d72d4fd9b6132..bcba2cc7f4609 100644 --- a/app/code/Magento/Rule/registration.php +++ b/app/code/Magento/Rule/registration.php @@ -1,6 +1,6 @@ getBaseTotalInvoicedCost() - $creditmemo->getBaseCost() ); - $creditmemo->setDoTransaction($online); + $creditmemo->setDoTransaction(!$creditmemo->getPaymentRefundDisallowed() && $online); $order->getPayment()->refund($creditmemo); $this->eventManager->dispatch('sales_order_creditmemo_refund', ['creditmemo' => $creditmemo]); diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php index 0636f7cf96995..ecd5670a319e7 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php @@ -1,6 +1,6 @@ $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; - $transport = new \Magento\Framework\DataObject($transport); + $transportObject = new DataObject($transport); + /** + * Event argument `transport` is @deprecated. Use `transportObject` instead. + */ $this->eventManager->dispatch( 'email_order_set_template_vars_before', - ['sender' => $this, 'transport' => $transport] + ['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject] ); - $this->templateContainer->setTemplateVars($transport->getData()); + $this->templateContainer->setTemplateVars($transportObject->getData()); parent::prepareTemplate($order); } diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php index bdbef9b8b1b11..664f8ec9fc7e5 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php @@ -1,6 +1,6 @@ transportBuilder->setScopeId($this->identityContainer->getStore()->getStoreId()); $this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId()); $this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions()); $this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars()); diff --git a/app/code/Magento/Sales/Model/Order/Grid/Massaction/ItemsUpdater.php b/app/code/Magento/Sales/Model/Order/Grid/Massaction/ItemsUpdater.php index 9785a02162ea1..2295832d7bf24 100644 --- a/app/code/Magento/Sales/Model/Order/Grid/Massaction/ItemsUpdater.php +++ b/app/code/Magento/Sales/Model/Order/Grid/Massaction/ItemsUpdater.php @@ -1,6 +1,6 @@ priceCurrency = $priceCurrency; $this->creditmemoFactory = $creditmemoFactory; @@ -149,6 +158,7 @@ public function __construct( $this->transactionBuilder = $transactionBuilder; $this->orderPaymentProcessor = $paymentProcessor; $this->orderRepository = $orderRepository; + $this->creditmemoManager = $creditmemoManager ?: ObjectManager::getInstance()->get(CreditmemoManager::class); parent::__construct( $context, $registry, @@ -169,7 +179,7 @@ public function __construct( */ protected function _construct() { - $this->_init('Magento\Sales\Model\ResourceModel\Order\Payment'); + $this->_init(\Magento\Sales\Model\ResourceModel\Order\Payment::class); } /** @@ -762,7 +772,8 @@ public function registerRefundNotification($amount) )->addComment( __('The credit memo has been created automatically.') ); - $creditmemo->save(); + + $this->creditmemoManager->refund($creditmemo, false); $this->_updateTotals( ['amount_refunded' => $creditmemo->getGrandTotal(), 'base_amount_refunded_online' => $amount] diff --git a/app/code/Magento/Sales/Model/Order/Payment/Info.php b/app/code/Magento/Sales/Model/Order/Payment/Info.php index 89f02cb874802..0d25f75fbd417 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Info.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Info.php @@ -1,6 +1,6 @@ _rootDirectory->getAbsolutePath('lib/internal/LinLibertineFont/LinLibertine_Re-4.4.1.ttf') + $this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/FreeSerif.ttf') ); $object->setFont($font, $size); return $font; @@ -867,7 +867,7 @@ protected function _setFontRegular($object, $size = 7) protected function _setFontBold($object, $size = 7) { $font = \Zend_Pdf_Font::fontWithPath( - $this->_rootDirectory->getAbsolutePath('lib/internal/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf') + $this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/FreeSerifBold.ttf') ); $object->setFont($font, $size); return $font; @@ -883,7 +883,7 @@ protected function _setFontBold($object, $size = 7) protected function _setFontItalic($object, $size = 7) { $font = \Zend_Pdf_Font::fontWithPath( - $this->_rootDirectory->getAbsolutePath('lib/internal/LinLibertineFont/LinLibertine_It-2.8.2.ttf') + $this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/FreeSerifItalic.ttf') ); $object->setFont($font, $size); return $font; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Config.php b/app/code/Magento/Sales/Model/Order/Pdf/Config.php index 603577aad61bd..6744233e13e86 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Config.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Config.php @@ -2,7 +2,7 @@ /** * Pdf config * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Model\Order\Pdf; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Config/Converter.php b/app/code/Magento/Sales/Model/Order/Pdf/Config/Converter.php index fd26d15ba69bf..b7ac688faae88 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Config/Converter.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Config/Converter.php @@ -2,7 +2,7 @@ /** * Converter of pdf configuration from \DOMDocument to array * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Model\Order\Pdf\Config; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Config/Reader.php b/app/code/Magento/Sales/Model/Order/Pdf/Config/Reader.php index 3ffe8d45535ae..9758c76f2d048 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Config/Reader.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Config/Reader.php @@ -2,7 +2,7 @@ /** * Loads catalog attributes configuration from multiple XML files by merging them together * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Model\Order\Pdf\Config; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Config/SchemaLocator.php b/app/code/Magento/Sales/Model/Order/Pdf/Config/SchemaLocator.php index 0f138a0714605..a65c83787518a 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Config/SchemaLocator.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Config/SchemaLocator.php @@ -2,7 +2,7 @@ /** * Attributes config schema locator * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Model\Order\Pdf\Config; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php index 71d64ed575d0d..6e2265315245d 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php @@ -1,6 +1,6 @@ _rootDirectory->getAbsolutePath('lib/internal/LinLibertineFont/LinLibertine_Re-4.4.1.ttf') + $this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/FreeSerif.ttf') ); $this->getPage()->setFont($font, $size); return $font; @@ -350,7 +350,7 @@ protected function _setFontRegular($size = 7) protected function _setFontBold($size = 7) { $font = \Zend_Pdf_Font::fontWithPath( - $this->_rootDirectory->getAbsolutePath('lib/internal/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf') + $this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/FreeSerifBold.ttf') ); $this->getPage()->setFont($font, $size); return $font; @@ -365,7 +365,7 @@ protected function _setFontBold($size = 7) protected function _setFontItalic($size = 7) { $font = \Zend_Pdf_Font::fontWithPath( - $this->_rootDirectory->getAbsolutePath('lib/internal/LinLibertineFont/LinLibertine_It-2.8.2.ttf') + $this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/FreeSerifItalic.ttf') ); $this->getPage()->setFont($font, $size); return $font; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php index a80f020696490..11908864236f6 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php @@ -1,6 +1,6 @@ aggregations = $aggregations; + return $this; } - /** * Retrieve all ids for collection * Backward compatibility with EAV collection diff --git a/app/code/Magento/Sales/Model/ResourceModel/GridInterface.php b/app/code/Magento/Sales/Model/ResourceModel/GridInterface.php index ef555cfc25a26..7946302561aa1 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/GridInterface.php +++ b/app/code/Magento/Sales/Model/ResourceModel/GridInterface.php @@ -1,6 +1,6 @@ orderRepository = $orderRepository; $this->historyRepository = $historyRepository; @@ -76,6 +85,8 @@ public function __construct( $this->notifier = $notifier; $this->eventManager = $eventManager; $this->orderCommentSender = $orderCommentSender; + $this->paymentFailures = $paymentFailures ? : \Magento\Framework\App\ObjectManager::getInstance() + ->get(PaymentFailuresInterface::class); } /** @@ -191,6 +202,9 @@ public function place(\Magento\Sales\Api\Data\OrderInterface $order) return $this->orderRepository->save($order); //commit } catch (\Exception $e) { + if ($e instanceof CommandException) { + $this->paymentFailures->handle($order->getQuoteId(), __($e->getMessage())); + } throw $e; //rollback; } diff --git a/app/code/Magento/Sales/Model/Service/PaymentFailuresService.php b/app/code/Magento/Sales/Model/Service/PaymentFailuresService.php new file mode 100644 index 0000000000000..7bddf47b43ded --- /dev/null +++ b/app/code/Magento/Sales/Model/Service/PaymentFailuresService.php @@ -0,0 +1,300 @@ + Configuration > Sales > Checkout > Payment Failed Emails + * configuration. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class PaymentFailuresService implements PaymentFailuresInterface +{ + /** + * Store config + * + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var StateInterface + */ + private $inlineTranslation; + + /** + * @var TransportBuilder + */ + private $transportBuilder; + + /** + * @var TimezoneInterface + */ + private $localeDate; + + /** + * @var CartRepositoryInterface + */ + private $cartRepository; + + /** + * PaymentFailures constructor. + * + * @param ScopeConfigInterface $scopeConfig + * @param StateInterface $inlineTranslation + * @param TransportBuilder $transportBuilder + * @param TimezoneInterface $localeDate + * @param CartRepositoryInterface $cartRepository + */ + public function __construct( + ScopeConfigInterface $scopeConfig, + StateInterface $inlineTranslation, + TransportBuilder $transportBuilder, + TimezoneInterface $localeDate, + CartRepositoryInterface $cartRepository + ) { + $this->scopeConfig = $scopeConfig; + $this->inlineTranslation = $inlineTranslation; + $this->transportBuilder = $transportBuilder; + $this->localeDate = $localeDate; + $this->cartRepository = $cartRepository; + } + + /** + * Sends an email about failed transaction. + * + * @param int $cartId + * @param string $message + * @param string $checkoutType + * @return PaymentFailuresInterface + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\MailException + */ + public function handle( + $cartId, + $message, + $checkoutType = 'onepage' + ) { + $this->inlineTranslation->suspend(); + $quote = $this->cartRepository->get($cartId); + + $template = $this->getConfigValue('checkout/payment_failed/template', $quote); + $receiver = $this->getConfigValue('checkout/payment_failed/receiver', $quote); + $sendTo = [ + [ + 'email' => $this->getConfigValue('trans_email/ident_' . $receiver . '/email', $quote), + 'name' => $this->getConfigValue('trans_email/ident_' . $receiver . '/name', $quote), + ], + ]; + + $copyMethod = $this->getConfigValue('checkout/payment_failed/copy_method', $quote); + $copyTo = $this->getConfigEmails($quote); + + $bcc = []; + if (!empty($copyTo)) { + switch ($copyMethod) { + case 'bcc': + $bcc = $copyTo; + break; + case 'copy': + foreach ($copyTo as $email) { + $sendTo[] = ['email' => $email, 'name' => null]; + } + break; + } + } + + foreach ($sendTo as $recipient) { + $transport = $this->transportBuilder + ->setTemplateIdentifier($template) + ->setTemplateOptions([ + 'area' => FrontNameResolver::AREA_CODE, + 'store' => Store::DEFAULT_STORE_ID + ]) + ->setTemplateVars($this->getTemplateVars($quote, $message, $checkoutType)) + ->setFrom($this->getSendFrom($quote)) + ->addTo($recipient['email'], $recipient['name']) + ->addBcc($bcc) + ->getTransport(); + + $transport->sendMessage(); + } + + $this->inlineTranslation->resume(); + + return $this; + } + + /** + * Returns mail template variables. + * + * @param Quote $quote + * @param string $message + * @param string $checkoutType + * @return array + */ + private function getTemplateVars($quote, $message, $checkoutType) + { + return [ + 'reason' => $message, + 'checkoutType' => $checkoutType, + 'dateAndTime' => $this->getLocaleDate(), + 'customer' => $this->getCustomerName($quote), + 'customerEmail' => $quote->getBillingAddress()->getEmail(), + 'billingAddress' => $quote->getBillingAddress(), + 'shippingAddress' => $quote->getShippingAddress(), + 'shippingMethod' => $this->getConfigValue( + 'carriers/' . $this->getShippingMethod($quote) . '/title', + $quote + ), + 'paymentMethod' => $this->getConfigValue( + 'payment/' . $this->getPaymentMethod($quote) . '/title', + $quote + ), + 'items' => implode('
    ', $this->getQuoteItems($quote)), + 'total' => $quote->getCurrency()->getStoreCurrencyCode() . ' ' . $quote->getGrandTotal(), + ]; + } + + /** + * Returns scope config value by config path. + * + * @param string $configPath + * @param Quote $quote + * @return mixed + */ + private function getConfigValue($configPath, Quote $quote) + { + return $this->scopeConfig->getValue( + $configPath, + ScopeInterface::SCOPE_STORE, + $quote->getStoreId() + ); + } + + /** + * Returns shipping method from quote. + * + * @param Quote $quote + * @return string + */ + private function getShippingMethod(Quote $quote) + { + $shippingMethod = ''; + if ($shippingInfo = $quote->getShippingAddress()->getShippingMethod()) { + $data = explode('_', $shippingInfo); + $shippingMethod = $data[0]; + } + + return $shippingMethod; + } + + /** + * Returns payment method title from quote. + * + * @param Quote $quote + * @return string + */ + private function getPaymentMethod(Quote $quote) + { + $paymentMethod = ''; + if ($paymentInfo = $quote->getPayment()) { + $paymentMethod = $paymentInfo->getMethod(); + } + + return $paymentMethod; + } + + /** + * Returns quote visible items. + * + * @param Quote $quote + * @return array + */ + private function getQuoteItems(Quote $quote) + { + $items = []; + foreach ($quote->getAllVisibleItems() as $item) { + /* @var $item \Magento\Quote\Model\Quote\Item */ + $itemData = $item->getProduct()->getName() . ' x ' . $item->getQty() . ' '; + $itemData .= $quote->getCurrency()->getStoreCurrencyCode() . ' ' . + $item->getProduct()->getFinalPrice($item->getQty()); + $items[] = $itemData; + } + + return $items; + } + + /** + * Gets email values by configuration path. + * + * @param Quote $quote + * @return array|false + */ + private function getConfigEmails(Quote $quote) + { + $configData = $this->getConfigValue('checkout/payment_failed/copy_to', $quote); + if (!empty($configData)) { + return explode(',', $configData); + } + + return false; + } + + /** + * Returns sender identity. + * + * @param Quote $quote + * @return string + */ + private function getSendFrom(Quote $quote) + { + return $this->getConfigValue('checkout/payment_failed/identity', $quote); + } + + /** + * Returns current locale date and time + * + * @return string + */ + private function getLocaleDate() + { + return $this->localeDate->formatDateTime( + new \DateTime(), + \IntlDateFormatter::MEDIUM, + \IntlDateFormatter::MEDIUM + ); + } + + /** + * Returns customer name. + * + * @param Quote $quote + * @return string + */ + private function getCustomerName(Quote $quote) + { + $customer = __('Guest'); + if (!$quote->getCustomerIsGuest()) { + $customer = $quote->getCustomer()->getFirstname() . ' ' . + $quote->getCustomer()->getLastname(); + } + + return $customer; + } +} diff --git a/app/code/Magento/Sales/Model/Service/ShipmentService.php b/app/code/Magento/Sales/Model/Service/ShipmentService.php index b787f845f74d3..851b96130ae0f 100644 --- a/app/code/Magento/Sales/Model/Service/ShipmentService.php +++ b/app/code/Magento/Sales/Model/Service/ShipmentService.php @@ -1,6 +1,6 @@ disableOriginalConstructor() ->setMethods(['create']) ->getMockForAbstractClass(); - $this->serviceOrderFactoryMock = $this->getMockBuilder('Magento\Sales\Model\Service\OrderFactory') - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - $this->eventManagerMock = $this->getMockBuilder('Magento\Framework\Event\Manager') + $this->eventManagerMock = $this->getMockBuilder(\Magento\Framework\Event\Manager::class) ->disableOriginalConstructor() ->setMethods([]) ->getMock(); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/EmailTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/EmailTest.php index 0fa25ee33d810..777fdc027e50c 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/EmailTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/EmailTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_duplicates.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_duplicates.xml index 5deb1ee72bfd0..a46ba6a8f833d 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_duplicates.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_duplicates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_root_node.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_root_node.xml index 8c35a2705bd5e..50cb5e3074905 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_root_node.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_root_node.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_scope.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_scope.xml index 0f1071b627fc0..7e04466f18d2f 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_scope.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_scope.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_without_attributes.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_without_attributes.xml index c8eae54ebdd0f..b94f5a6694c88 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_without_attributes.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_without_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_valid.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_valid.xml index 0f1071b627fc0..7e04466f18d2f 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_valid.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_valid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Sales/Test/Unit/Model/ConfigTest.php index 5a900bf1e96f8..f2abf3fd53698 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ConfigTest.php @@ -1,6 +1,6 @@ creditmemoMock = $this->getMockBuilder(\Magento\Sales\Api\Data\CreditmemoInterface::class) ->disableOriginalConstructor() - ->setMethods(['getBaseCost', 'setDoTransaction']) + ->setMethods(['getBaseCost', 'setDoTransaction', 'getPaymentRefundDisallowed']) ->getMockForAbstractClass(); $this->paymentMock = $this->getMockBuilder(\Magento\Framework\Pricing\PriceCurrencyInterface::class) diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php index 1c91cc87675c0..3a5396ae355d0 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php @@ -1,7 +1,7 @@ creditmemoFactoryMock = $this->getMockBuilder(CreditmemoFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->commentFactoryMock = - $this->getMockBuilder('Magento\Sales\Api\Data\CreditmemoCommentInterfaceFactory') - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); + $this->commentFactoryMock = $this->getMockBuilder(CreditmemoCommentInterfaceFactory::class) + ->disableOriginalConstructor() + ->getMock(); $this->hydratorPoolMock = $this->getMockBuilder(HydratorPool::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoNotifierTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoNotifierTest.php index 4be4015a7b0bb..3d85fbb4ad4a1 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoNotifierTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoNotifierTest.php @@ -1,6 +1,6 @@ templateContainerMock = $this->getMock( - '\Magento\Sales\Model\Order\Email\Container\Template', + \Magento\Sales\Model\Order\Email\Container\Template::class, ['getTemplateVars', 'getTemplateOptions', 'getTemplateId'], [], '', @@ -46,7 +54,7 @@ protected function setUp() ); $this->storeMock = $this->getMock( - '\Magento\Store\Model\Store', + \Magento\Store\Model\Store::class, ['getStoreId', '__wakeup'], [], '', @@ -54,11 +62,11 @@ protected function setUp() ); $this->identityContainerMock = $this->getMock( - '\Magento\Sales\Model\Order\Email\Container\ShipmentIdentity', + \Magento\Sales\Model\Order\Email\Container\ShipmentIdentity::class, [ 'getEmailIdentity', 'getCustomerEmail', 'getCustomerName', 'getTemplateOptions', 'getEmailCopyTo', - 'getCopyMethod' + 'getCopyMethod', 'getStore', ], [], '', @@ -66,7 +74,7 @@ protected function setUp() ); $this->transportBuilder = $this->getMock( - '\Magento\Framework\Mail\Template\TransportBuilder', + \Magento\Framework\Mail\Template\TransportBuilder::class, [ 'addTo', 'addBcc', 'getTransport', 'setTemplateIdentifier', 'setTemplateOptions', 'setTemplateVars', @@ -99,6 +107,9 @@ protected function setUp() $this->identityContainerMock->expects($this->once()) ->method('getEmailIdentity') ->will($this->returnValue($emailIdentity)); + $this->identityContainerMock->expects($this->once()) + ->method('getStore') + ->will($this->returnValue($this->storeMock)); $this->transportBuilder->expects($this->once()) ->method('setFrom') ->with($this->equalTo($emailIdentity)); @@ -119,7 +130,7 @@ public function testSend() $customerName = 'test_name'; $customerEmail = 'test_email'; $transportMock = $this->getMock( - '\Magento\Sales\Test\Unit\Model\Order\Email\Stub\TransportInterfaceMock', + \Magento\Sales\Test\Unit\Model\Order\Email\Stub\TransportInterfaceMock::class, [], [], '', @@ -152,7 +163,7 @@ public function testSend() public function testSendCopyTo() { $transportMock = $this->getMock( - '\Magento\Sales\Test\Unit\Model\Order\Email\Stub\TransportInterfaceMock', + \Magento\Sales\Test\Unit\Model\Order\Email\Stub\TransportInterfaceMock::class, [], [], '', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Stub/TransportInterfaceMock.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Stub/TransportInterfaceMock.php index 41119950b064e..592ed27913603 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Stub/TransportInterfaceMock.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Stub/TransportInterfaceMock.php @@ -1,6 +1,6 @@ total = new Shipping(); + } + + /** + * @dataProvider collectWithNoOrZeroPrevInvoiceDataProvider + * @param array $prevInvoicesData + * @param float $orderShipping + * @param float $expectedShipping + */ + public function testCollectWithNoOrZeroPrevInvoice(array $prevInvoicesData, $orderShipping, $expectedShipping) + { + $invoice = $this->createInvoiceStub($prevInvoicesData, $orderShipping); + $invoice->expects($this->exactly(2)) + ->method('setShippingAmount') + ->withConsecutive([0], [$expectedShipping]); + + $this->total->collect($invoice); + } + + /** + * @return array + */ + public static function collectWithNoOrZeroPrevInvoiceDataProvider() + { + return [ + 'no previous invoices' => [ + 'prevInvoicesData' => [[]], + 'orderShipping' => 10.00, + 'expectedShipping' => 10.00, + ], + 'zero shipping in previous invoices' => [ + 'prevInvoicesData' => [['shipping_amount' => '0.0000']], + 'orderShipping' => 10.00, + 'expectedShipping' => 10.00, + ], + ]; + } + + public function testCollectWithPreviousInvoice() + { + $orderShipping = 10.00; + $prevInvoicesData = [['shipping_amount' => '10.000']]; + $invoice = $this->createInvoiceStub($prevInvoicesData, $orderShipping); + $invoice->expects($this->once()) + ->method('setShippingAmount') + ->with(0); + + $this->total->collect($invoice); + } + + /** + * Create stub of an invoice + * + * @param array $prevInvoicesData + * @param float $orderShipping + * @return \Magento\Sales\Model\Order\Invoice|\PHPUnit_Framework_MockObject_MockObject + */ + private function createInvoiceStub(array $prevInvoicesData, $orderShipping) + { + $order = $this->getMockBuilder(\Magento\Sales\Model\Order::class) + ->disableOriginalConstructor() + ->getMock(); + $order->expects($this->any()) + ->method('getInvoiceCollection') + ->will($this->returnValue($this->getInvoiceCollection($prevInvoicesData))); + $order->expects($this->any()) + ->method('getShippingAmount') + ->willReturn($orderShipping); + /** @var $invoice \Magento\Sales\Model\Order\Invoice|\PHPUnit_Framework_MockObject_MockObject */ + $invoice = $this->getMockBuilder(\Magento\Sales\Model\Order\Invoice::class) + ->disableOriginalConstructor() + ->getMock(); + $invoice->expects($this->any()) + ->method('getOrder') + ->willReturn($order); + return $invoice; + } + /** * Retrieve new invoice collection from an array of invoices' data * * @param array $invoicesData * @return \Magento\Framework\Data\Collection */ - protected function _getInvoiceCollection(array $invoicesData) + private function getInvoiceCollection(array $invoicesData) { $className = 'Magento\Sales\Model\Order\Invoice'; $result = new \Magento\Framework\Data\Collection( @@ -33,12 +121,12 @@ protected function _getInvoiceCollection(array $invoicesData) false ), 'calculatorFactory' => $this->getMock( - 'Magento\Framework\Math\CalculatorFactory', - [], - [], - '', - false - ), + \Magento\Framework\Math\CalculatorFactory::class, + [], + [], + '', + false + ), 'invoiceItemCollectionFactory' => $this->getMock( 'Magento\Sales\Model\ResourceModel\Order\Invoice\Item\CollectionFactory', [], @@ -70,104 +158,4 @@ protected function _getInvoiceCollection(array $invoicesData) } return $result; } - - /** - * @dataProvider collectDataProvider - * @param array $prevInvoicesData - * @param float $orderShipping - * @param float $invoiceShipping - * @param float $expectedShipping - */ - public function testCollect(array $prevInvoicesData, $orderShipping, $invoiceShipping, $expectedShipping) - { - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $arguments = [ - 'productFactory' => $this->getMock('Magento\Catalog\Model\ProductFactory', [], [], '', false), - 'orderItemCollectionFactory' => $this->getMock( - 'Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory', - [], - [], - '', - false - ), - 'serviceOrderFactory' => $this->getMock( - 'Magento\Sales\Model\Service\OrderFactory', - [], - [], - '', - false - ), - 'currencyFactory' => $this->getMock( - 'Magento\Directory\Model\CurrencyFactory', - [], - [], - '', - false - ), - 'orderHistoryFactory' => $this->getMock( - 'Magento\Sales\Model\Order\Status\HistoryFactory', - [], - [], - '', - false - ), - 'orderTaxCollectionFactory' => $this->getMock( - 'Magento\Tax\Model\ResourceModel\Sales\Order\Tax\CollectionFactory', - [], - [], - '', - false - ), - ]; - $orderConstructorArgs = $objectManager->getConstructArguments('Magento\Sales\Model\Order', $arguments); - /** @var $order \Magento\Sales\Model\Order|PHPUnit_Framework_MockObject_MockObject */ - $order = $this->getMock( - 'Magento\Sales\Model\Order', - ['_init', 'getInvoiceCollection', '__wakeup'], - $orderConstructorArgs, - '', - false - ); - $order->setData('shipping_amount', $orderShipping); - $order->expects( - $this->any() - )->method( - 'getInvoiceCollection' - )->will( - $this->returnValue($this->_getInvoiceCollection($prevInvoicesData)) - ); - /** @var $invoice \Magento\Sales\Model\Order\Invoice|PHPUnit_Framework_MockObject_MockObject */ - $invoice = $this->getMock('Magento\Sales\Model\Order\Invoice', ['_init', '__wakeup'], [], '', false); - $invoice->setData('shipping_amount', $invoiceShipping); - $invoice->setOrder($order); - - $total = new \Magento\Sales\Model\Order\Invoice\Total\Shipping(); - $total->collect($invoice); - - $this->assertEquals($expectedShipping, $invoice->getShippingAmount()); - } - - public static function collectDataProvider() - { - return [ - 'no previous invoices' => [ - 'prevInvoicesData' => [[]], - 'orderShipping' => 10.00, - 'invoiceShipping' => 5.00, - 'expectedShipping' => 10.00, - ], - 'zero shipping in previous invoices' => [ - 'prevInvoicesData' => [['shipping_amount' => '0.0000']], - 'orderShipping' => 10.00, - 'invoiceShipping' => 5.00, - 'expectedShipping' => 10.00, - ], - 'non-zero shipping in previous invoices' => [ - 'prevInvoicesData' => [['shipping_amount' => '10.000']], - 'orderShipping' => 10.00, - 'invoiceShipping' => 5.00, - 'expectedShipping' => 0, - ] - ]; - } } diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/TaxTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/TaxTest.php index c8ade4f5e666d..1e3d8def339e1 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/TaxTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/TaxTest.php @@ -1,6 +1,6 @@ creditMemoMock = $this->getMock( - 'Magento\Sales\Model\Order\Creditmemo', - [ - 'setPaymentRefundDisallowed', - 'getItemsCollection', - 'getItems', - 'setAutomaticallyCreated', - 'register', - 'addComment', - 'save', - 'getGrandTotal', - 'getBaseGrandTotal', - 'getDoTransaction', - 'getInvoice' - ], - [], - '', - false - ); + + $this->creditMemoMock = $this->getMockBuilder(Creditmemo::class) + ->disableOriginalConstructor() + ->setMethods( + [ + 'setPaymentRefundDisallowed', + 'getItemsCollection', + 'getItems', + 'setAutomaticallyCreated', + 'register', + 'addComment', + 'save', + 'getGrandTotal', + 'getBaseGrandTotal', + 'getDoTransaction', + 'getInvoice', + 'getOrder', + 'getPaymentRefundDisallowed' + ] + ) + ->getMock(); + + $this->creditmemoManagerMock = $this->getMockBuilder(CreditmemoManagementInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); $this->payment = $this->initPayment(); $this->payment->setMethod('any'); @@ -1340,7 +1353,12 @@ public function testRegisterRefundNotification() $this->creditMemoMock->expects($this->once())->method('setPaymentRefundDisallowed')->willReturnSelf(); $this->creditMemoMock->expects($this->once())->method('setAutomaticallyCreated')->willReturnSelf(); $this->creditMemoMock->expects($this->once())->method('addComment')->willReturnSelf(); - $this->creditMemoMock->expects($this->once())->method('save')->willReturnSelf(); + + $this->creditmemoManagerMock->expects($this->once()) + ->method('refund') + ->with($this->creditMemoMock, false) + ->willReturn($this->creditMemoMock); + $this->orderMock->expects($this->once())->method('getBaseCurrency')->willReturn($this->currencyMock); $parentTransaction = $this->getMock( @@ -1553,7 +1571,8 @@ protected function initPayment() 'transactionManager' => $this->transactionManagerMock, 'transactionBuilder' => $this->transactionBuilderMock, 'paymentProcessor' => $this->paymentProcessor, - 'orderRepository' => $this->orderRepository + 'orderRepository' => $this->orderRepository, + 'creditmemoManager' => $this->creditmemoManagerMock ] ); } diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/AbstractTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/AbstractTest.php index a06db63a79f33..ddf4e95184433 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/AbstractTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/AbstractTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_one.xml b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_one.xml index a997e39a092ff..3ce56f48aa827 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_one.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_one.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_two.xml b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_two.xml index 8d132d09f8dd6..21bc5ac76b45b 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_two.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_two.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/ConfigTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/ConfigTest.php index 60c3e0a69c20e..a0ccd1c527ecd 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/ConfigTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/ConfigTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/etc/adminhtml/di.xml b/app/code/Magento/Sales/etc/adminhtml/di.xml index 5beb8de6d04c9..0d86c866cbf93 100644 --- a/app/code/Magento/Sales/etc/adminhtml/di.xml +++ b/app/code/Magento/Sales/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/adminhtml/events.xml b/app/code/Magento/Sales/etc/adminhtml/events.xml index 0249dce1e4d03..8f3a6d860b29e 100644 --- a/app/code/Magento/Sales/etc/adminhtml/events.xml +++ b/app/code/Magento/Sales/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/adminhtml/menu.xml b/app/code/Magento/Sales/etc/adminhtml/menu.xml index 5ad5e0887fb41..30be4f30d8c01 100644 --- a/app/code/Magento/Sales/etc/adminhtml/menu.xml +++ b/app/code/Magento/Sales/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/adminhtml/routes.xml b/app/code/Magento/Sales/etc/adminhtml/routes.xml index df9b84e61606d..fbdcf30a8e431 100644 --- a/app/code/Magento/Sales/etc/adminhtml/routes.xml +++ b/app/code/Magento/Sales/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/adminhtml/system.xml b/app/code/Magento/Sales/etc/adminhtml/system.xml index 7056c41ecb81a..9d6d11d56c81f 100644 --- a/app/code/Magento/Sales/etc/adminhtml/system.xml +++ b/app/code/Magento/Sales/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ @@ -106,15 +106,15 @@ We'll use the default error above if you leave this empty. - + - + Magento\Config\Model\Config\Source\Yesno Improves dashboard performance but provides non-realtime data. - + diff --git a/app/code/Magento/Sales/etc/catalog_attributes.xml b/app/code/Magento/Sales/etc/catalog_attributes.xml index 3fef995ae1b0a..e7e738ab0f6a2 100644 --- a/app/code/Magento/Sales/etc/catalog_attributes.xml +++ b/app/code/Magento/Sales/etc/catalog_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/config.xml b/app/code/Magento/Sales/etc/config.xml index 6bd5e5800c689..da2408416133d 100644 --- a/app/code/Magento/Sales/etc/config.xml +++ b/app/code/Magento/Sales/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/crontab.xml b/app/code/Magento/Sales/etc/crontab.xml index ec87dbc21f3df..d0d0e0ac3a391 100644 --- a/app/code/Magento/Sales/etc/crontab.xml +++ b/app/code/Magento/Sales/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/di.xml b/app/code/Magento/Sales/etc/di.xml index c5d727dd8abcb..8b0e5c5444503 100644 --- a/app/code/Magento/Sales/etc/di.xml +++ b/app/code/Magento/Sales/etc/di.xml @@ -1,7 +1,7 @@ @@ -65,6 +65,7 @@ + diff --git a/app/code/Magento/Sales/etc/email_templates.xml b/app/code/Magento/Sales/etc/email_templates.xml index 52127bf90f5ad..fc8107c85ef2c 100644 --- a/app/code/Magento/Sales/etc/email_templates.xml +++ b/app/code/Magento/Sales/etc/email_templates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/events.xml b/app/code/Magento/Sales/etc/events.xml index 164d7a23267f0..91829a9f36068 100644 --- a/app/code/Magento/Sales/etc/events.xml +++ b/app/code/Magento/Sales/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/extension_attributes.xml b/app/code/Magento/Sales/etc/extension_attributes.xml index 8c43f2665ebdb..7280a1a071548 100644 --- a/app/code/Magento/Sales/etc/extension_attributes.xml +++ b/app/code/Magento/Sales/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/fieldset.xml b/app/code/Magento/Sales/etc/fieldset.xml index 563ab2ab6032f..d680d7373bc35 100644 --- a/app/code/Magento/Sales/etc/fieldset.xml +++ b/app/code/Magento/Sales/etc/fieldset.xml @@ -1,7 +1,7 @@ @@ -486,6 +486,12 @@ + + + + + + diff --git a/app/code/Magento/Sales/etc/frontend/di.xml b/app/code/Magento/Sales/etc/frontend/di.xml index a01b6f759eb6a..7751a08e5763c 100644 --- a/app/code/Magento/Sales/etc/frontend/di.xml +++ b/app/code/Magento/Sales/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/frontend/events.xml b/app/code/Magento/Sales/etc/frontend/events.xml index e790d069bed46..f787e04a312c1 100644 --- a/app/code/Magento/Sales/etc/frontend/events.xml +++ b/app/code/Magento/Sales/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/frontend/page_types.xml b/app/code/Magento/Sales/etc/frontend/page_types.xml index 5bd418b013b3e..06a8bc9541b58 100644 --- a/app/code/Magento/Sales/etc/frontend/page_types.xml +++ b/app/code/Magento/Sales/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/frontend/routes.xml b/app/code/Magento/Sales/etc/frontend/routes.xml index 5e626205b4a50..f77708096e5d0 100644 --- a/app/code/Magento/Sales/etc/frontend/routes.xml +++ b/app/code/Magento/Sales/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/frontend/sections.xml b/app/code/Magento/Sales/etc/frontend/sections.xml index acb884723b4cb..92e9909eafead 100644 --- a/app/code/Magento/Sales/etc/frontend/sections.xml +++ b/app/code/Magento/Sales/etc/frontend/sections.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/module.xml b/app/code/Magento/Sales/etc/module.xml index 2b5d745964841..2fbf444f7852d 100644 --- a/app/code/Magento/Sales/etc/module.xml +++ b/app/code/Magento/Sales/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/pdf.xml b/app/code/Magento/Sales/etc/pdf.xml index 47042e6ebd418..2f0a1b4de777f 100644 --- a/app/code/Magento/Sales/etc/pdf.xml +++ b/app/code/Magento/Sales/etc/pdf.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/pdf.xsd b/app/code/Magento/Sales/etc/pdf.xsd index 57b532ad3a2ee..caaa3bf6ed412 100644 --- a/app/code/Magento/Sales/etc/pdf.xsd +++ b/app/code/Magento/Sales/etc/pdf.xsd @@ -3,7 +3,7 @@ /** * XSD for an XML, composed as result of merging all config files with PDF settings * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> diff --git a/app/code/Magento/Sales/etc/pdf_file.xsd b/app/code/Magento/Sales/etc/pdf_file.xsd index 29df3f46d2c39..ef8d686323d2c 100644 --- a/app/code/Magento/Sales/etc/pdf_file.xsd +++ b/app/code/Magento/Sales/etc/pdf_file.xsd @@ -3,7 +3,7 @@ /** * XSD for an individual file with PDF settings * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> diff --git a/app/code/Magento/Sales/etc/resources.xml b/app/code/Magento/Sales/etc/resources.xml index 9c7afa995c348..9695bca976a8f 100644 --- a/app/code/Magento/Sales/etc/resources.xml +++ b/app/code/Magento/Sales/etc/resources.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/sales.xml b/app/code/Magento/Sales/etc/sales.xml index 589e5d64861f7..203412a2cfd49 100644 --- a/app/code/Magento/Sales/etc/sales.xml +++ b/app/code/Magento/Sales/etc/sales.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/sales.xsd b/app/code/Magento/Sales/etc/sales.xsd index 6d62b3fb1ef0d..6facb719341ef 100644 --- a/app/code/Magento/Sales/etc/sales.xsd +++ b/app/code/Magento/Sales/etc/sales.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/webapi.xml b/app/code/Magento/Sales/etc/webapi.xml index 85c2182c1f511..cee245e348393 100644 --- a/app/code/Magento/Sales/etc/webapi.xml +++ b/app/code/Magento/Sales/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/webapi_rest/di.xml b/app/code/Magento/Sales/etc/webapi_rest/di.xml index 9d6766fadcc07..0cfd36e219169 100644 --- a/app/code/Magento/Sales/etc/webapi_rest/di.xml +++ b/app/code/Magento/Sales/etc/webapi_rest/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/webapi_rest/events.xml b/app/code/Magento/Sales/etc/webapi_rest/events.xml index e790d069bed46..f787e04a312c1 100644 --- a/app/code/Magento/Sales/etc/webapi_rest/events.xml +++ b/app/code/Magento/Sales/etc/webapi_rest/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/webapi_soap/di.xml b/app/code/Magento/Sales/etc/webapi_soap/di.xml index 9d6766fadcc07..0cfd36e219169 100644 --- a/app/code/Magento/Sales/etc/webapi_soap/di.xml +++ b/app/code/Magento/Sales/etc/webapi_soap/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/webapi_soap/events.xml b/app/code/Magento/Sales/etc/webapi_soap/events.xml index e790d069bed46..f787e04a312c1 100644 --- a/app/code/Magento/Sales/etc/webapi_soap/events.xml +++ b/app/code/Magento/Sales/etc/webapi_soap/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/etc/widget.xml b/app/code/Magento/Sales/etc/widget.xml index 73a651a1c4539..07e2dff7369c5 100644 --- a/app/code/Magento/Sales/etc/widget.xml +++ b/app/code/Magento/Sales/etc/widget.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/registration.php b/app/code/Magento/Sales/registration.php index 3dab7bf893ed5..9ff963f4b0e98 100644 --- a/app/code/Magento/Sales/registration.php +++ b/app/code/Magento/Sales/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml index f8004598ad930..edcdc2ae281dd 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml index f8004598ad930..edcdc2ae281dd 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml index 051bfadf72f76..462ad5a27109c 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml index dabfb299f3bd1..39ce85007e806 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_item_price.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_item_price.xml index ca4ffb0e720f4..85bc4bf50e139 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_item_price.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml index 187ed6b707155..7385cc205234d 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml index 187ed6b707155..7385cc205234d 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml index 7a1b43178d486..e4ad55fe8c9bb 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml index 0598a9f9be6d5..3677f9c292847 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_item_price.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_item_price.xml index 9f3e89df13f12..e29d4e2d7b3c3 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_item_price.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_addcomment.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_addcomment.xml index 3ea719f1d21de..feb561312535a 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_addcomment.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_addcomment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_address.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_address.xml index b499db59189df..50a24880fc23c 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_address.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_address.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_customer_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_customer_block.xml index 7a28dc1e2b823..5cd530defd493 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_customer_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_customer_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml index f2080128f5bea..d13474bc9e484 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_item_price.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_item_price.xml index 6c662939e1ae3..fa10dde66c04f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_item_price.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_address.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_address.xml index 28ace5252607a..17159c759aa13 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_address.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_address.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml index 2da51a9c68c80..e725244667836 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_comment.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_comment.xml index 118fc08e664df..98bdc674ea5e5 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_comment.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_comment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_customer_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_customer_grid.xml index 6672710be8d36..236abdbd488ee 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_customer_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_customer_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml index 79bff3ecfb55d..79ffdd008ba15 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_form_account.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_form_account.xml index 2a0c005ef6e17..a60635387eda7 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_form_account.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_form_account.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_giftmessage.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_giftmessage.xml index 135c315c63667..e519313f4100b 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_giftmessage.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_giftmessage.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_header.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_header.xml index 9e4568cb1e7ab..7aa461431c5aa 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_header.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_header.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml index 5250aa47dca8d..e97f70ca6c27c 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_json.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_json.xml index 09ba1234e7767..04787a9198c71 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_json.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_json.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_message.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_message.xml index 604bc8531e503..0e8e0bffcaf81 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_message.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_message.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_newsletter.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_newsletter.xml index c2afe642cf7c4..804a934520177 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_newsletter.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_newsletter.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_plain.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_plain.xml index 6c6a785f8963b..c0d5fa0fbc24f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_plain.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_plain.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search.xml index d175c7b5978e5..d9d7ab27c6856 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search_grid.xml index d004d626a8743..08849c7dbdfb1 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml index 3afc09e1af0cd..da6d89c707b1f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_method.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_method.xml index eef5cdbaf741b..7ff4ce08f7ba5 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_method.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_method.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml index bce15a03ee4ec..c8652dda94784 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_cart.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_cart.xml index 65ca72856c0bc..6f36eb0f55433 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_cart.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_cart.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_compared.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_compared.xml index b6a9abc2df8dd..845d041a9e9d0 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_compared.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_compared.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pcompared.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pcompared.xml index 7c53428ba9e4b..1a89ceec8096e 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pcompared.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pcompared.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pviewed.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pviewed.xml index d930927729bbc..0e38c6bd69d85 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pviewed.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pviewed.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_reorder.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_reorder.xml index a0cd430b0b5bd..56ca930bce7b0 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_reorder.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_reorder.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_viewed.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_viewed.xml index 7a113b2383963..f6e62c31ae54a 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_viewed.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_viewed.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_wishlist.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_wishlist.xml index 7c1050d4be458..cb4d30f71cadf 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_wishlist.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_wishlist.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_totals.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_totals.xml index f1ff1815664f3..d91f88ae0b911 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_totals.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_totals.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_addcomment.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_addcomment.xml index b98446dae0658..c8e6836831a88 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_addcomment.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_addcomment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml index 9400b29f7ff0d..3ee6753d743d2 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml index d108cacfd39b8..8febd9236f48f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index 23bc6a4124e6b..40b2200ca8bc4 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml index c4c16653b8282..6cce30e68596e 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml index 9a46191f05269..257c209e47ded 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_edit_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_edit_index.xml index e1d61e0c61471..db7a90fa7bce6 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_edit_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_edit_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportcsv.xml index fd80e3995d851..43a95443f3535 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportcsv.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportcsv.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportexcel.xml index fd80e3995d851..43a95443f3535 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportexcel.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportexcel.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid.xml index 1c67e0692bfbb..96e3d17f78ad2 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_index.xml index 2ff2fe88f8d5c..8263fd47e894b 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_addcomment.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_addcomment.xml index d4b08f2ea7f0d..edaca89cc2451 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_addcomment.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_addcomment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml index efba38d3ccb6e..52492c0f250e3 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml index 783b3e674babc..0af4a50679174 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml index 5fcd72d1c4cd0..b26fd43e6a924 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml index f9b115c8d3b73..3fcca24edf660 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml index da479bafef791..93649afbfdf62 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_item_price.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_item_price.xml index 68bc52fe2205e..17a8f7cdbbb4c 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_item_price.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml index de4ef7c222ef7..8d783975a404f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml index b58bd5970471f..37aa79a6c6472 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_assign.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_assign.xml index 7038803db29ae..64109e99b79e6 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_assign.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_assign.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_edit.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_edit.xml index 7ca0c87b41a4a..33a7e9fff6beb 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_edit.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml index f1744a3bceed5..e96932789e70e 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml index 40d8d19e1c1d2..b3b3b902932fc 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml index 4857eb26f6bfe..cfad13a8c35e7 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml index 42cd58e6b956d..c2f5532857202 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml index f4b2ce3fabeb4..1d4d46379874f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml index b3c090f2eaf5d..3948dfc0bdd00 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml index b3c090f2eaf5d..3948dfc0bdd00 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml index 8183382c1b6c6..d450fcf97b8ed 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml index 98aa355da793b..aa8672a68bc6c 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml index 3e66985f7d6c5..f65ea312e8e29 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml index dfa2566ae02ab..9f3b7f23ba20f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml index 7de682f5a70ef..75ce5f7653e46 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_view.xml index 868f1260f7d84..5a56e3033f942 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/requirejs-config.js b/app/code/Magento/Sales/view/adminhtml/requirejs-config.js index 6ecf955f48c96..d58cd07e5d281 100644 --- a/app/code/Magento/Sales/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/Sales/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Sales/view/adminhtml/templates/items/column/name.phtml b/app/code/Magento/Sales/view/adminhtml/templates/items/column/name.phtml index c3235d31318cc..6899a24747467 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/items/column/name.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/items/column/name.phtml @@ -1,6 +1,6 @@
    - +
    diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form.phtml index 4b8ea840dd2af..6b4757380bea9 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml index 86f7dd3f044a7..19ef6f668ef1d 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/totals/grand.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/totals/grand.phtml index 5823490671fab..0eb314ab24344 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/totals/grand.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/totals/grand.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/totals/paid.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/totals/paid.phtml index 0940773b7f0f8..b131f620f83b6 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/totals/paid.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/totals/paid.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/view/giftmessage.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/view/giftmessage.phtml index c4802c6697740..3927f00d17d6c 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/view/giftmessage.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/view/giftmessage.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml index f6dd49d97b355..fbb9d028c4f04 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml @@ -1,7 +1,7 @@ @@ -187,7 +187,6 @@ date Purchase Date desc - MMM dd, YYYY, H:mm:ss A diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_invoice_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_invoice_grid.xml index 73a861d798736..8cbd34189a863 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_invoice_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_invoice_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml index 7e94feeb36acc..b5357f65fc024 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml index f39eb09eaf815..e3c6e680da1f2 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml @@ -1,7 +1,7 @@ @@ -34,7 +34,15 @@ - + + + + + * + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml index 62f661db3e612..5663bca048995 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml @@ -1,7 +1,7 @@ @@ -34,7 +34,15 @@ - + + + + + * + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml index eebe4485995f5..006318b00221b 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml @@ -1,7 +1,7 @@ @@ -34,7 +34,15 @@ - + + + + + * + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/web/js/bootstrap/order-create-index.js b/app/code/Magento/Sales/view/adminhtml/web/js/bootstrap/order-create-index.js index aae4d599a89e0..2ee06d2cc7ff2 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/js/bootstrap/order-create-index.js +++ b/app/code/Magento/Sales/view/adminhtml/web/js/bootstrap/order-create-index.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Sales/view/adminhtml/web/js/bootstrap/order-post-action.js b/app/code/Magento/Sales/view/adminhtml/web/js/bootstrap/order-post-action.js index 6dc709bb4ee2f..922b31b4544b4 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/js/bootstrap/order-post-action.js +++ b/app/code/Magento/Sales/view/adminhtml/web/js/bootstrap/order-post-action.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/form.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/form.js index c4f66cc06cdc6..486d0ec6de73b 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/form.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/form.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/giftmessage.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/giftmessage.js index c2963f811dd7c..1639a1c8440cf 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/giftmessage.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/giftmessage.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /********************* GIFT OPTIONS POPUP ***********************/ diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index 673fba9792dfa..d4e9df13da227 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -1,6 +1,6 @@ // jscs:disable /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/edit/message.js b/app/code/Magento/Sales/view/adminhtml/web/order/edit/message.js index b82f7f22a2d54..e9f008baecb23 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/edit/message.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/edit/message.js @@ -1,7 +1,7 @@ /** * @category Mage * @package Magento_Sales - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/giftoptions_tooltip.js b/app/code/Magento/Sales/view/adminhtml/web/order/giftoptions_tooltip.js index f009b9d1fb5e4..13d200fcea0f5 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/giftoptions_tooltip.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/giftoptions_tooltip.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/view/post-wrapper.js b/app/code/Magento/Sales/view/adminhtml/web/order/view/post-wrapper.js index 132b76adfde3b..b9bc4ccd4ff11 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/view/post-wrapper.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/view/post-wrapper.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Sales/view/frontend/email/creditmemo_new.html b/app/code/Magento/Sales/view/frontend/email/creditmemo_new.html index 77a96a538aa30..ca89446a2f7c0 100644 --- a/app/code/Magento/Sales/view/frontend/email/creditmemo_new.html +++ b/app/code/Magento/Sales/view/frontend/email/creditmemo_new.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/creditmemo_new_guest.html b/app/code/Magento/Sales/view/frontend/email/creditmemo_new_guest.html index c94d58b53234c..afeed85adaae7 100644 --- a/app/code/Magento/Sales/view/frontend/email/creditmemo_new_guest.html +++ b/app/code/Magento/Sales/view/frontend/email/creditmemo_new_guest.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/creditmemo_update.html b/app/code/Magento/Sales/view/frontend/email/creditmemo_update.html index ab147750d1284..3a4aab19e9e7c 100644 --- a/app/code/Magento/Sales/view/frontend/email/creditmemo_update.html +++ b/app/code/Magento/Sales/view/frontend/email/creditmemo_update.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html b/app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html index ce6ebd761ce13..bc7c079d7f21b 100644 --- a/app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html +++ b/app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/invoice_new.html b/app/code/Magento/Sales/view/frontend/email/invoice_new.html index 7dad8fbda1f53..ca5f7ee632e22 100644 --- a/app/code/Magento/Sales/view/frontend/email/invoice_new.html +++ b/app/code/Magento/Sales/view/frontend/email/invoice_new.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/invoice_new_guest.html b/app/code/Magento/Sales/view/frontend/email/invoice_new_guest.html index c35249c1aff4b..c93df9f9e8efb 100644 --- a/app/code/Magento/Sales/view/frontend/email/invoice_new_guest.html +++ b/app/code/Magento/Sales/view/frontend/email/invoice_new_guest.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/invoice_update.html b/app/code/Magento/Sales/view/frontend/email/invoice_update.html index 6f3c897b0f104..cafdd65ff5208 100644 --- a/app/code/Magento/Sales/view/frontend/email/invoice_update.html +++ b/app/code/Magento/Sales/view/frontend/email/invoice_update.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html b/app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html index 093988329fbe3..fafb533301efb 100644 --- a/app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html +++ b/app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/order_new.html b/app/code/Magento/Sales/view/frontend/email/order_new.html index f6766086862d3..370bdb0f2f336 100644 --- a/app/code/Magento/Sales/view/frontend/email/order_new.html +++ b/app/code/Magento/Sales/view/frontend/email/order_new.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/order_new_guest.html b/app/code/Magento/Sales/view/frontend/email/order_new_guest.html index 9768f6af37399..cfd99e5b0936e 100644 --- a/app/code/Magento/Sales/view/frontend/email/order_new_guest.html +++ b/app/code/Magento/Sales/view/frontend/email/order_new_guest.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/order_update.html b/app/code/Magento/Sales/view/frontend/email/order_update.html index dac3af4b437ab..a709a9ed8a7f1 100644 --- a/app/code/Magento/Sales/view/frontend/email/order_update.html +++ b/app/code/Magento/Sales/view/frontend/email/order_update.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/order_update_guest.html b/app/code/Magento/Sales/view/frontend/email/order_update_guest.html index 4a038a87e12b5..5a39b01810c18 100644 --- a/app/code/Magento/Sales/view/frontend/email/order_update_guest.html +++ b/app/code/Magento/Sales/view/frontend/email/order_update_guest.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/shipment_new.html b/app/code/Magento/Sales/view/frontend/email/shipment_new.html index d326e4d9a88fa..8af49f322c682 100644 --- a/app/code/Magento/Sales/view/frontend/email/shipment_new.html +++ b/app/code/Magento/Sales/view/frontend/email/shipment_new.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/shipment_new_guest.html b/app/code/Magento/Sales/view/frontend/email/shipment_new_guest.html index ddb6b1065a859..df1677f56a500 100644 --- a/app/code/Magento/Sales/view/frontend/email/shipment_new_guest.html +++ b/app/code/Magento/Sales/view/frontend/email/shipment_new_guest.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/shipment_update.html b/app/code/Magento/Sales/view/frontend/email/shipment_update.html index 8ec993e32344c..6d9efc37004bc 100644 --- a/app/code/Magento/Sales/view/frontend/email/shipment_update.html +++ b/app/code/Magento/Sales/view/frontend/email/shipment_update.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/email/shipment_update_guest.html b/app/code/Magento/Sales/view/frontend/email/shipment_update_guest.html index 912fcf2077189..4896a00b7bc5a 100644 --- a/app/code/Magento/Sales/view/frontend/email/shipment_update_guest.html +++ b/app/code/Magento/Sales/view/frontend/email/shipment_update_guest.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml index a0daa9e2daff3..8e06f5eaeb8de 100644 --- a/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/customer_account.xml b/app/code/Magento/Sales/view/frontend/layout/customer_account.xml index 58ef5e28e5576..316c49b3ee0df 100644 --- a/app/code/Magento/Sales/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Sales/view/frontend/layout/customer_account.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml index ada874d0314cd..05ca9745f95da 100644 --- a/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/default.xml b/app/code/Magento/Sales/view/frontend/layout/default.xml index d3e767a2a26d7..959cefe2f92fc 100644 --- a/app/code/Magento/Sales/view/frontend/layout/default.xml +++ b/app/code/Magento/Sales/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_item_price.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_item_price.xml index 5197ce06947ea..862698d0d2ac6 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_item_price.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml index 55c7cd7ad15f0..7a864b5d88b5c 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_renderers.xml index 1db0975f216a7..63983d54555a0 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml index ea741a01a6e21..3dd3554c1b3ab 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_renderers.xml index 975c8acaa84b0..1ec5c9cc5022b 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml index 75adeaaca849b..f8ec2e875c941 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_renderers.xml index 66b17a5eb6350..f832ce41bd232 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml index 10e4de08baaea..03ba089d1147a 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml index 8859a6d978924..ffd5ebf4298fe 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml index 22d776c1f6134..afb1430b8bd9d 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml index edfb0a18333c2..b865bd415fb41 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml index 5728e03a12138..4f5950d044d0a 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml index df4ef415cfec1..64b194776ca27 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml index c481c81ded005..cd6f132560666 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml index 4f6cac3bf2f14..eda782f4042d1 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml index 64c137cf0d6bc..453a31a6f6ff1 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml index d03d109fd6176..6baeb31de1f94 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml index 1bcb0d235a77b..ef95c9b29d29c 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml index 0c7be2e80a2a5..c1b16319cb487 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml index 0d86d6f9c773d..0d58b292d4783 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo_renderers.xml index b3cac3a808780..8ba4c5751551b 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml index 52a5410a78897..fd771c7bb4deb 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml index d572268ce32e5..53d4d7069d127 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml index b903c41a21367..93f7f8788fac3 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml index f4f5f4b9bbb5b..028f54166e083 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice_renderers.xml index c7729cc170544..a2777b6ffd9df 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_item_price.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_item_price.xml index f27fc60b1a466..646946497dbc8 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_item_price.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_item_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_item_renderers.xml index 9fb01a4e63cd4..2dead7c00c708 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_item_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_item_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml index 0ce7a53485768..25043c2d70b41 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_creditmemo_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_creditmemo_renderers.xml index 5ce4d24ee5ed1..87d423eb9f0a3 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_creditmemo_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_creditmemo_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_invoice_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_invoice_renderers.xml index 6e902d6ce85d0..860dd8a7bbecd 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_invoice_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_invoice_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_renderers.xml index 4ecb2e99768e2..f3af7b32ca420 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_shipment_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_shipment_renderers.xml index 1658c8028b16b..3f76b447c7699 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_shipment_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_shipment_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml index 21cf3c8c29ab1..248f5e3eb949e 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml index 2a4ec65253754..d8f8572ead26c 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml index ead04c783ebd4..cc586cdfc67bc 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml index 1e4dcaf2bf6e3..6dd915cb2e469 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml index b292de7e3b012..484f9d0315e0b 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment_renderers.xml index 27bcff9ba8add..c799ab784dcfe 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml index c680cf48b91bc..a5af6a16342eb 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Sales/view/frontend/requirejs-config.js b/app/code/Magento/Sales/view/frontend/requirejs-config.js index cad9609518dc2..04778765f3c97 100644 --- a/app/code/Magento/Sales/view/frontend/requirejs-config.js +++ b/app/code/Magento/Sales/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Sales/view/frontend/templates/email/creditmemo/items.phtml b/app/code/Magento/Sales/view/frontend/templates/email/creditmemo/items.phtml index 753a16e10719f..072d529427e97 100644 --- a/app/code/Magento/Sales/view/frontend/templates/email/creditmemo/items.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/email/creditmemo/items.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/templates/order/creditmemo/items.phtml b/app/code/Magento/Sales/view/frontend/templates/order/creditmemo/items.phtml index 3e19f6025ac50..84e03886e2259 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/creditmemo/items.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/creditmemo/items.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/templates/order/invoice/items.phtml b/app/code/Magento/Sales/view/frontend/templates/order/invoice/items.phtml index a47c2f67f109e..36d62e161c1ab 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/invoice/items.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/invoice/items.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Sales/view/frontend/templates/order/print/creditmemo.phtml b/app/code/Magento/Sales/view/frontend/templates/order/print/creditmemo.phtml index 0a1785451331a..e9f9a917750e1 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/print/creditmemo.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/print/creditmemo.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesInventory/etc/extension_attributes.xml b/app/code/Magento/SalesInventory/etc/extension_attributes.xml index 481f13cfeae32..869b7ece0c517 100644 --- a/app/code/Magento/SalesInventory/etc/extension_attributes.xml +++ b/app/code/Magento/SalesInventory/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesInventory/etc/module.xml b/app/code/Magento/SalesInventory/etc/module.xml index 4aa89e151a35e..f40a587f66fed 100644 --- a/app/code/Magento/SalesInventory/etc/module.xml +++ b/app/code/Magento/SalesInventory/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesInventory/registration.php b/app/code/Magento/SalesInventory/registration.php index 92743627b5bc2..dba91dba9e0ba 100644 --- a/app/code/Magento/SalesInventory/registration.php +++ b/app/code/Magento/SalesInventory/registration.php @@ -1,6 +1,6 @@ _rendererFieldset = $rendererFieldset; $this->_ruleActions = $ruleActions; $this->_sourceYesno = $sourceYesno; parent::__construct($context, $registry, $formFactory, $data); - } - - /** - * The getter function to get the new RuleFactory dependency - * - * @return \Magento\SalesRule\Model\RuleFactory - * - * @deprecated - */ - private function getRuleFactory() - { - if ($this->ruleFactory === null) { - $this->ruleFactory = ObjectManager::getInstance()->get('Magento\SalesRule\Model\RuleFactory'); + if ($ruleFactory === null) { + $ruleFactory = ObjectManager::getInstance()->get(RuleFactory::class); } - return $this->ruleFactory; + $this->ruleFactory = $ruleFactory; } /** @@ -169,7 +165,7 @@ protected function addTabToForm($model, $fieldsetId = 'actions_fieldset', $formN { if (!$model) { $id = $this->getRequest()->getParam('id'); - $model = $this->getRuleFactory()->create(); + $model = $this->ruleFactory->create(); $model->load($id); } diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php index dbf237e405c28..661bb8d843dea 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php @@ -1,11 +1,12 @@ _rendererFieldset = $rendererFieldset; $this->_conditions = $conditions; parent::__construct($context, $registry, $formFactory, $data); - } - - /** - * The getter function to get the new RuleFactory dependency - * - * @return \Magento\SalesRule\Model\RuleFactory - * - * @deprecated - */ - private function getRuleFactory() - { - if ($this->ruleFactory === null) { - $this->ruleFactory = ObjectManager::getInstance()->get('Magento\SalesRule\Model\RuleFactory'); + if ($ruleFactory === null) { + $ruleFactory = ObjectManager::getInstance()->get(RuleFactory::class); } - return $this->ruleFactory; + $this->ruleFactory = $ruleFactory; } /** @@ -160,7 +153,7 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo { if (!$model) { $id = $this->getRequest()->getParam('id'); - $model = $this->getRuleFactory()->create(); + $model = $this->ruleFactory->create(); $model->load($id); } $conditionsFieldSetId = $model->getConditionsFieldSetId($formName); diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php index 847bfa082afcf..2d80084d35efe 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesRule/etc/adminhtml/di.xml b/app/code/Magento/SalesRule/etc/adminhtml/di.xml index 2ff711c3c66ba..bd0fb8ac1b14e 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/di.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/adminhtml/events.xml b/app/code/Magento/SalesRule/etc/adminhtml/events.xml index 6e60ea28a90a6..4d2b7a025224d 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/events.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/adminhtml/menu.xml b/app/code/Magento/SalesRule/etc/adminhtml/menu.xml index f212fbf97ba92..bdb6080822591 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/menu.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/adminhtml/routes.xml b/app/code/Magento/SalesRule/etc/adminhtml/routes.xml index a0fdf183fb749..1a163b2805c94 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/routes.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/adminhtml/system.xml b/app/code/Magento/SalesRule/etc/adminhtml/system.xml index b3f0c4d82d3d5..0e30d1484c637 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/system.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/config.xml b/app/code/Magento/SalesRule/etc/config.xml index d80a9033569a9..10d704f50e5c0 100644 --- a/app/code/Magento/SalesRule/etc/config.xml +++ b/app/code/Magento/SalesRule/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/crontab.xml b/app/code/Magento/SalesRule/etc/crontab.xml index b3914c6a7145a..a9186a717b507 100644 --- a/app/code/Magento/SalesRule/etc/crontab.xml +++ b/app/code/Magento/SalesRule/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/di.xml b/app/code/Magento/SalesRule/etc/di.xml index 23a00208c7e0c..8413f159b6dd5 100644 --- a/app/code/Magento/SalesRule/etc/di.xml +++ b/app/code/Magento/SalesRule/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/events.xml b/app/code/Magento/SalesRule/etc/events.xml index 2c34a9f82380a..43babc40a2ab5 100644 --- a/app/code/Magento/SalesRule/etc/events.xml +++ b/app/code/Magento/SalesRule/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/fieldset.xml b/app/code/Magento/SalesRule/etc/fieldset.xml index ce0478928a6ac..5873a2f1ad28b 100644 --- a/app/code/Magento/SalesRule/etc/fieldset.xml +++ b/app/code/Magento/SalesRule/etc/fieldset.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/frontend/di.xml b/app/code/Magento/SalesRule/etc/frontend/di.xml index 2ff711c3c66ba..bd0fb8ac1b14e 100644 --- a/app/code/Magento/SalesRule/etc/frontend/di.xml +++ b/app/code/Magento/SalesRule/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/module.xml b/app/code/Magento/SalesRule/etc/module.xml index 464cb1382346e..f41cdf6f57ee2 100644 --- a/app/code/Magento/SalesRule/etc/module.xml +++ b/app/code/Magento/SalesRule/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/sales.xml b/app/code/Magento/SalesRule/etc/sales.xml index ad85d8341566a..3ab197d40b0df 100644 --- a/app/code/Magento/SalesRule/etc/sales.xml +++ b/app/code/Magento/SalesRule/etc/sales.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/etc/webapi.xml b/app/code/Magento/SalesRule/etc/webapi.xml index d2ddda8473c37..995e252548715 100644 --- a/app/code/Magento/SalesRule/etc/webapi.xml +++ b/app/code/Magento/SalesRule/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/registration.php b/app/code/Magento/SalesRule/registration.php index 9b6025463b7a6..ade3971a36be1 100644 --- a/app/code/Magento/SalesRule/registration.php +++ b/app/code/Magento/SalesRule/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml index 182b535ec9b64..752beaa735550 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml index ee518d69466d7..4b670d5815554 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/view/adminhtml/templates/promo/salesrulejs.phtml b/app/code/Magento/SalesRule/view/adminhtml/templates/promo/salesrulejs.phtml index bd8f611f770c9..044778a110558 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/templates/promo/salesrulejs.phtml +++ b/app/code/Magento/SalesRule/view/adminhtml/templates/promo/salesrulejs.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesRule/view/adminhtml/templates/tab/coupons.phtml b/app/code/Magento/SalesRule/view/adminhtml/templates/tab/coupons.phtml index cfd4299fc2299..858aefcd9e675 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/templates/tab/coupons.phtml +++ b/app/code/Magento/SalesRule/view/adminhtml/templates/tab/coupons.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml index 9d937702e7b30..aeffb8b11be18 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-type.js b/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-type.js index 798e7a94ac9ac..2fc7fd6e7b04a 100644 --- a/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-type.js +++ b/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-type.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/SalesRule/view/base/web/js/form/element/manage-coupon-codes.js b/app/code/Magento/SalesRule/view/base/web/js/form/element/manage-coupon-codes.js index e2c70c75adfdd..389dcaaba1e6a 100644 --- a/app/code/Magento/SalesRule/view/base/web/js/form/element/manage-coupon-codes.js +++ b/app/code/Magento/SalesRule/view/base/web/js/form/element/manage-coupon-codes.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml index 5911249a227ec..022403579b237 100644 --- a/app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/SalesRule/view/frontend/layout/checkout_index_index.xml index 27f0669b4f020..e285530b25d9f 100644 --- a/app/code/Magento/SalesRule/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/SalesRule/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/action/cancel-coupon.js b/app/code/Magento/SalesRule/view/frontend/web/js/action/cancel-coupon.js index a6bef77fdca3a..d4ac56061a87c 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/action/cancel-coupon.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/action/cancel-coupon.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/action/set-coupon-code.js b/app/code/Magento/SalesRule/view/frontend/web/js/action/set-coupon-code.js index 2193dd7abbb89..d928a0685fc89 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/action/set-coupon-code.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/action/set-coupon-code.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/model/payment/discount-messages.js b/app/code/Magento/SalesRule/view/frontend/web/js/model/payment/discount-messages.js index b3c89892f7258..34e75a3ff8758 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/model/payment/discount-messages.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/model/payment/discount-messages.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define( diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/view/cart/totals/discount.js b/app/code/Magento/SalesRule/view/frontend/web/js/view/cart/totals/discount.js index ddab853217862..690ce24809547 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/view/cart/totals/discount.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/view/cart/totals/discount.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global define*/ diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount-messages.js b/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount-messages.js index 8fc2a4a17be94..2473e9375fc7e 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount-messages.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount-messages.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount.js b/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount.js index 1071a4aac343f..3ee0a71690095 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define( diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js b/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js index 37b90681e4741..7ab7c6ac89842 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global define*/ diff --git a/app/code/Magento/SalesRule/view/frontend/web/template/cart/totals/discount.html b/app/code/Magento/SalesRule/view/frontend/web/template/cart/totals/discount.html index 1711ebb7e6670..1fa9efe948cff 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/template/cart/totals/discount.html +++ b/app/code/Magento/SalesRule/view/frontend/web/template/cart/totals/discount.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesRule/view/frontend/web/template/payment/discount.html b/app/code/Magento/SalesRule/view/frontend/web/template/payment/discount.html index c4b13d9bf3940..7246460382fa7 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/template/payment/discount.html +++ b/app/code/Magento/SalesRule/view/frontend/web/template/payment/discount.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesRule/view/frontend/web/template/summary/discount.html b/app/code/Magento/SalesRule/view/frontend/web/template/summary/discount.html index 55f5ddb6e9ada..17a9559fa01f2 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/template/summary/discount.html +++ b/app/code/Magento/SalesRule/view/frontend/web/template/summary/discount.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesSequence/Model/Builder.php b/app/code/Magento/SalesSequence/Model/Builder.php index 50218d3f59803..3666b979908cb 100644 --- a/app/code/Magento/SalesSequence/Model/Builder.php +++ b/app/code/Magento/SalesSequence/Model/Builder.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SalesSequence/registration.php b/app/code/Magento/SalesSequence/registration.php index a8b63478a888e..e81329cce4e4b 100644 --- a/app/code/Magento/SalesSequence/registration.php +++ b/app/code/Magento/SalesSequence/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SampleData/etc/module.xml b/app/code/Magento/SampleData/etc/module.xml index 24be4417e689f..014fa6c2b727f 100644 --- a/app/code/Magento/SampleData/etc/module.xml +++ b/app/code/Magento/SampleData/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SampleData/registration.php b/app/code/Magento/SampleData/registration.php index a8629d7c238e3..f1e3677db05a4 100644 --- a/app/code/Magento/SampleData/registration.php +++ b/app/code/Magento/SampleData/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Search/etc/adminhtml/menu.xml b/app/code/Magento/Search/etc/adminhtml/menu.xml index 4e496b7685cb9..6ad836ff76682 100644 --- a/app/code/Magento/Search/etc/adminhtml/menu.xml +++ b/app/code/Magento/Search/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/etc/adminhtml/routes.xml b/app/code/Magento/Search/etc/adminhtml/routes.xml index 16a4c7dca6baa..c0cef0d8080c7 100644 --- a/app/code/Magento/Search/etc/adminhtml/routes.xml +++ b/app/code/Magento/Search/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/etc/adminhtml/system.xml b/app/code/Magento/Search/etc/adminhtml/system.xml index 3f525c0563b99..d3b7f64fbe0c4 100644 --- a/app/code/Magento/Search/etc/adminhtml/system.xml +++ b/app/code/Magento/Search/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/etc/di.xml b/app/code/Magento/Search/etc/di.xml index 3af41b2528576..01e46627833e1 100755 --- a/app/code/Magento/Search/etc/di.xml +++ b/app/code/Magento/Search/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/etc/frontend/page_types.xml b/app/code/Magento/Search/etc/frontend/page_types.xml index b0e0e3ececfde..803d49a6ed83b 100644 --- a/app/code/Magento/Search/etc/frontend/page_types.xml +++ b/app/code/Magento/Search/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/etc/frontend/routes.xml b/app/code/Magento/Search/etc/frontend/routes.xml index ee259563bf445..25d45968fe9dd 100644 --- a/app/code/Magento/Search/etc/frontend/routes.xml +++ b/app/code/Magento/Search/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/etc/module.xml b/app/code/Magento/Search/etc/module.xml index 2bc085da76033..12c5591109591 100644 --- a/app/code/Magento/Search/etc/module.xml +++ b/app/code/Magento/Search/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/etc/search_engine.xml b/app/code/Magento/Search/etc/search_engine.xml index 45a70279860e0..0a66f372fc997 100644 --- a/app/code/Magento/Search/etc/search_engine.xml +++ b/app/code/Magento/Search/etc/search_engine.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/etc/webapi.xml b/app/code/Magento/Search/etc/webapi.xml index 977c0e3ad1fb4..50f5f1d2856ff 100644 --- a/app/code/Magento/Search/etc/webapi.xml +++ b/app/code/Magento/Search/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/registration.php b/app/code/Magento/Search/registration.php index c206369df6f13..df884e1fadda6 100644 --- a/app/code/Magento/Search/registration.php +++ b/app/code/Magento/Search/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_edit.xml b/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_edit.xml index c1fdba16faad2..71ee47783c283 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_edit.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_index.xml b/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_index.xml index a55c6ed8b9571..c7675d4bd1ca4 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_index.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_new.xml b/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_new.xml index 60ee8f9130b79..28c61fb9ae0fb 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_new.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_synonyms_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_block.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_block.xml index b9034ca5f7680..594a3993d3adb 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_block.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_edit.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_edit.xml index c8d968312ec5b..99ff5eefcae57 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_edit.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchcsv.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchcsv.xml index 14eacc9cf61bc..cac672ec49c58 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchcsv.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchcsv.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchexcel.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchexcel.xml index 14eacc9cf61bc..cac672ec49c58 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchexcel.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchexcel.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_grid_block.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_grid_block.xml index 9eb23c51cd7aa..6bc9680aa3ba6 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_grid_block.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_index.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_index.xml index b22a3477e3f37..5806f3bda3f4a 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_index.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_report.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_report.xml index 2d02d39e30ca0..db8a5da64f12c 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_report.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_report.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_report_block.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_report_block.xml index 6627dc9c3123d..83f8d94897b67 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_report_block.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_report_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml b/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml index 32b860864c5e5..26f6f45d3d6bb 100644 --- a/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml +++ b/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_grid.xml b/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_grid.xml index d525ea8b9a462..c1ecc58aa66f2 100644 --- a/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_grid.xml +++ b/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/frontend/layout/default.xml b/app/code/Magento/Search/view/frontend/layout/default.xml index 53772f8814d41..0cb18adedd952 100644 --- a/app/code/Magento/Search/view/frontend/layout/default.xml +++ b/app/code/Magento/Search/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/frontend/layout/search_term_popular.xml b/app/code/Magento/Search/view/frontend/layout/search_term_popular.xml index 1ba7175ef7935..7f86e2eb50762 100644 --- a/app/code/Magento/Search/view/frontend/layout/search_term_popular.xml +++ b/app/code/Magento/Search/view/frontend/layout/search_term_popular.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Search/view/frontend/requirejs-config.js b/app/code/Magento/Search/view/frontend/requirejs-config.js index 17470f62b8851..c38cba4315eac 100644 --- a/app/code/Magento/Search/view/frontend/requirejs-config.js +++ b/app/code/Magento/Search/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Search/view/frontend/templates/form.mini.phtml b/app/code/Magento/Search/view/frontend/templates/form.mini.phtml index 8819cc3dbef11..a2590e6f8c505 100644 --- a/app/code/Magento/Search/view/frontend/templates/form.mini.phtml +++ b/app/code/Magento/Search/view/frontend/templates/form.mini.phtml @@ -1,6 +1,6 @@ getCurrentSession()->setData( - 'updated_at', - $this->authSession->getUpdatedAt() - ); - $this->getCurrentSession()->save(); + if ($this->lastProlongIsOldEnough()) { + $this->getCurrentSession()->setData( + 'updated_at', + date( + \Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT, + $this->authSession->getUpdatedAt() + ) + ); + $this->getCurrentSession()->save(); + } return $this; } @@ -279,4 +292,45 @@ protected function createAdminSessionInfoCollection() { return $this->adminSessionInfoCollectionFactory->create(); } + + /** + * Calculates diff between now and last session updated_at + * and decides whether new prolong must be triggered or not + * + * This is done to limit amount of session prolongs and updates to database + * within some period of time - X + * X - is calculated in getIntervalBetweenConsecutiveProlongs() + * + * @see getIntervalBetweenConsecutiveProlongs() + * @return bool + */ + private function lastProlongIsOldEnough() + { + $lastProlongTimestamp = strtotime($this->getCurrentSession()->getUpdatedAt()); + $nowTimestamp = $this->authSession->getUpdatedAt(); + + $diff = $nowTimestamp - $lastProlongTimestamp; + + return (float) $diff > $this->getIntervalBetweenConsecutiveProlongs(); + } + + /** + * Calculates lifetime for session prolong to be valid + * + * Calculation is based on admin session lifetime + * Calculated result is in seconds and is in the interval + * between 1 (including) and MAX_INTERVAL_BETWEEN_CONSECUTIVE_PROLONGS (including) + * + * @return float + */ + private function getIntervalBetweenConsecutiveProlongs() + { + return (float) max( + 1, + min( + 4 * log((float)$this->securityConfig->getAdminSessionLifetime()), + $this->maxIntervalBetweenConsecutiveProlongs + ) + ); + } } diff --git a/app/code/Magento/Security/Model/Config.php b/app/code/Magento/Security/Model/Config.php index d31495c7fad6b..2135b81eb82b5 100644 --- a/app/code/Magento/Security/Model/Config.php +++ b/app/code/Magento/Security/Model/Config.php @@ -1,6 +1,6 @@ scope->getCurrentScope() == \Magento\Framework\App\Area::AREA_ADMINHTML) { return self::XML_PATH_ADMIN_AREA; } - return self::XML_PATH_FRONTED_AREA; + return self::XML_PATH_FRONTEND_AREA; } /** diff --git a/app/code/Magento/Security/Model/Config/Source/ResetMethod.php b/app/code/Magento/Security/Model/Config/Source/ResetMethod.php index bc7001abf1e1e..b925262747fd0 100644 --- a/app/code/Magento/Security/Model/Config/Source/ResetMethod.php +++ b/app/code/Magento/Security/Model/Config/Source/ResetMethod.php @@ -1,6 +1,6 @@ request = $request; $this->securityManager = $securityManager; $this->passwordRequestEvent = $passwordRequestEvent; + $this->scope = $scope ?: ObjectManager::getInstance()->get(ScopeInterface::class); } /** @@ -63,10 +73,14 @@ public function beforeInitiatePasswordReset( $template, $websiteId = null ) { - $this->securityManager->performSecurityCheck( - $this->passwordRequestEvent, - $email - ); + if ($this->scope->getCurrentScope() == \Magento\Framework\App\Area::AREA_FRONTEND + || $this->passwordRequestEvent == PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST) { + $this->securityManager->performSecurityCheck( + $this->passwordRequestEvent, + $email + ); + } + return [$email, $template, $websiteId]; } } diff --git a/app/code/Magento/Security/Model/Plugin/Auth.php b/app/code/Magento/Security/Model/Plugin/Auth.php index 9c7d9452ec350..833b4e4c1b774 100644 --- a/app/code/Magento/Security/Model/Plugin/Auth.php +++ b/app/code/Magento/Security/Model/Plugin/Auth.php @@ -1,6 +1,6 @@ adminSessionInfoFactoryMock->expects($this->any()) ->method('create') @@ -254,13 +256,21 @@ public function testProcessProlong() ->method('load') ->willReturnSelf(); - $this->authSessionMock->expects($this->once()) + $this->currentSessionMock->expects($this->once()) + ->method('getUpdatedAt') + ->willReturn($lastUpdatedAt); + + $this->authSessionMock->expects($this->exactly(2)) ->method('getUpdatedAt') - ->willReturn($updatedAt); + ->willReturn(strtotime($newUpdatedAt)); + + $this->securityConfigMock->expects($this->once()) + ->method('getAdminSessionLifetime') + ->willReturn(100); $this->currentSessionMock->expects($this->once()) ->method('setData') - ->with('updated_at', $updatedAt) + ->with('updated_at', $newUpdatedAt) ->willReturnSelf(); $this->currentSessionMock->expects($this->once()) diff --git a/app/code/Magento/Security/Test/Unit/Model/Config/Source/ResetMethodTest.php b/app/code/Magento/Security/Test/Unit/Model/Config/Source/ResetMethodTest.php index b4240f14d3268..e1b94f4756b1f 100644 --- a/app/code/Magento/Security/Test/Unit/Model/Config/Source/ResetMethodTest.php +++ b/app/code/Magento/Security/Test/Unit/Model/Config/Source/ResetMethodTest.php @@ -1,7 +1,7 @@ objectManager = new ObjectManager($this); - $this->request = $this->getMock( - '\Magento\Framework\App\RequestInterface', - [], - [], - '', - false - ); + $this->request = $this->getMock(\Magento\Framework\App\RequestInterface::class); - $this->securityManager = $this->getMock( - '\Magento\Security\Model\SecurityManager', - ['performSecurityCheck'], - [], - '', - false - ); + $this->securityManager = $this->getMockBuilder( + \Magento\Security\Model\SecurityManager::class + )->setMethods( + ['performSecurityCheck'] + )->disableOriginalConstructor()->getMock(); - $this->accountManagement = $this->getMock( - '\Magento\Customer\Model\AccountManagement', - [], - [], - '', - false - ); + $this->accountManagement = $this->getMockBuilder( + AccountManagement::class + )->disableOriginalConstructor()->getMock(); - $this->model = $this->objectManager->getObject( - '\Magento\Security\Model\Plugin\AccountManagement', - [ - 'request' => $this->request, - 'securityManager' => $this->securityManager - ] - ); + $this->scope = $this->getMock(ScopeInterface::class); } /** - * @return void + * @param $area + * @param $passwordRequestEvent + * @param $expectedTimes + * @dataProvider beforeInitiatePasswordResetDataProvider */ - public function testBeforeInitiatePasswordReset() + public function testBeforeInitiatePasswordReset($area, $passwordRequestEvent, $expectedTimes) { $email = 'test@example.com'; - $template = \Magento\Customer\Model\AccountManagement::EMAIL_RESET; + $template = AccountManagement::EMAIL_RESET; - $this->securityManager->expects($this->once()) + $this->model = $this->objectManager->getObject( + \Magento\Security\Model\Plugin\AccountManagement::class, + [ + 'passwordRequestEvent' => $passwordRequestEvent, + 'request' => $this->request, + 'securityManager' => $this->securityManager, + 'scope' => $this->scope + ] + ); + + $this->scope->expects($this->once()) + ->method('getCurrentScope') + ->willReturn($area); + + $this->securityManager->expects($this->exactly($expectedTimes)) ->method('performSecurityCheck') - ->with(\Magento\Security\Model\PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST, $email) + ->with($passwordRequestEvent, $email) ->willReturnSelf(); $this->model->beforeInitiatePasswordReset( @@ -98,4 +105,18 @@ public function testBeforeInitiatePasswordReset() $template ); } + + /** + * @return array + */ + public function beforeInitiatePasswordResetDataProvider() + { + return [ + [Area::AREA_ADMINHTML, PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST, 0], + [Area::AREA_ADMINHTML, PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST, 1], + [Area::AREA_FRONTEND, PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST, 1], + // This should never happen, but let's cover it with tests + [Area::AREA_FRONTEND, PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST, 1], + ]; + } } diff --git a/app/code/Magento/Security/Test/Unit/Model/Plugin/AuthSessionTest.php b/app/code/Magento/Security/Test/Unit/Model/Plugin/AuthSessionTest.php index 3a3c31f120893..5e64f50c4a300 100644 --- a/app/code/Magento/Security/Test/Unit/Model/Plugin/AuthSessionTest.php +++ b/app/code/Magento/Security/Test/Unit/Model/Plugin/AuthSessionTest.php @@ -1,6 +1,6 @@ @@ -17,14 +17,14 @@ - Magento\Security\Model\PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST + Magento\Security\Model\PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST Magento\Security\Model\SecurityChecker\Frequency - Magento\Security\Model\SecurityChecker\Quantity + Magento\Security\Model\SecurityChecker\Quantity diff --git a/app/code/Magento/Security/etc/adminhtml/routes.xml b/app/code/Magento/Security/etc/adminhtml/routes.xml index f7eeec3f65b60..bcdc5f850f8ef 100644 --- a/app/code/Magento/Security/etc/adminhtml/routes.xml +++ b/app/code/Magento/Security/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Security/etc/adminhtml/system.xml b/app/code/Magento/Security/etc/adminhtml/system.xml index d3ad8439c86d8..71513361a694e 100644 --- a/app/code/Magento/Security/etc/adminhtml/system.xml +++ b/app/code/Magento/Security/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Security/etc/config.xml b/app/code/Magento/Security/etc/config.xml index 1d8e2ec09fc94..046969058f215 100644 --- a/app/code/Magento/Security/etc/config.xml +++ b/app/code/Magento/Security/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Security/etc/crontab.xml b/app/code/Magento/Security/etc/crontab.xml index ff6e89d4c3e75..a30a43730e6fa 100644 --- a/app/code/Magento/Security/etc/crontab.xml +++ b/app/code/Magento/Security/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Security/etc/di.xml b/app/code/Magento/Security/etc/di.xml index 06703cf66af38..4fe88f219cf74 100644 --- a/app/code/Magento/Security/etc/di.xml +++ b/app/code/Magento/Security/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Security/etc/module.xml b/app/code/Magento/Security/etc/module.xml index 93775df47e545..e1f0239be3fdd 100644 --- a/app/code/Magento/Security/etc/module.xml +++ b/app/code/Magento/Security/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Security/registration.php b/app/code/Magento/Security/registration.php index 2ddbb277f8d23..274743a06c3d3 100644 --- a/app/code/Magento/Security/registration.php +++ b/app/code/Magento/Security/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Security/view/adminhtml/layout/security_session_activity.xml b/app/code/Magento/Security/view/adminhtml/layout/security_session_activity.xml index 7f4b521ac3d17..631a7701bef61 100644 --- a/app/code/Magento/Security/view/adminhtml/layout/security_session_activity.xml +++ b/app/code/Magento/Security/view/adminhtml/layout/security_session_activity.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Security/view/adminhtml/page_layout/admin-popup.xml b/app/code/Magento/Security/view/adminhtml/page_layout/admin-popup.xml index bc0dca3010587..0f7483779209a 100644 --- a/app/code/Magento/Security/view/adminhtml/page_layout/admin-popup.xml +++ b/app/code/Magento/Security/view/adminhtml/page_layout/admin-popup.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Security/view/adminhtml/requirejs-config.js b/app/code/Magento/Security/view/adminhtml/requirejs-config.js index a44c1fb946637..6a97541491a88 100644 --- a/app/code/Magento/Security/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/Security/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*eslint no-unused-vars: 0*/ diff --git a/app/code/Magento/Security/view/adminhtml/templates/page/activity_link.phtml b/app/code/Magento/Security/view/adminhtml/templates/page/activity_link.phtml index 86099092a8b3d..28b6ae8c15b8e 100644 --- a/app/code/Magento/Security/view/adminhtml/templates/page/activity_link.phtml +++ b/app/code/Magento/Security/view/adminhtml/templates/page/activity_link.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SendFriend/etc/config.xml b/app/code/Magento/SendFriend/etc/config.xml index 12cf03c61172b..9fa005dcd2fd4 100644 --- a/app/code/Magento/SendFriend/etc/config.xml +++ b/app/code/Magento/SendFriend/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SendFriend/etc/email_templates.xml b/app/code/Magento/SendFriend/etc/email_templates.xml index 6c92782c56945..8a1c423c9f785 100644 --- a/app/code/Magento/SendFriend/etc/email_templates.xml +++ b/app/code/Magento/SendFriend/etc/email_templates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SendFriend/etc/frontend/di.xml b/app/code/Magento/SendFriend/etc/frontend/di.xml index eda115bf7d6b0..0b2b05165641d 100644 --- a/app/code/Magento/SendFriend/etc/frontend/di.xml +++ b/app/code/Magento/SendFriend/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SendFriend/etc/frontend/page_types.xml b/app/code/Magento/SendFriend/etc/frontend/page_types.xml index 686b4d59d8689..d92cc882fb21a 100644 --- a/app/code/Magento/SendFriend/etc/frontend/page_types.xml +++ b/app/code/Magento/SendFriend/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SendFriend/etc/frontend/routes.xml b/app/code/Magento/SendFriend/etc/frontend/routes.xml index 1f004aca6dcda..0befb6d25d7fd 100644 --- a/app/code/Magento/SendFriend/etc/frontend/routes.xml +++ b/app/code/Magento/SendFriend/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SendFriend/etc/module.xml b/app/code/Magento/SendFriend/etc/module.xml index cae02edc716be..fae2b90f710a3 100644 --- a/app/code/Magento/SendFriend/etc/module.xml +++ b/app/code/Magento/SendFriend/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SendFriend/registration.php b/app/code/Magento/SendFriend/registration.php index 3b80b087c7df0..005007faf220a 100644 --- a/app/code/Magento/SendFriend/registration.php +++ b/app/code/Magento/SendFriend/registration.php @@ -1,6 +1,6 @@ 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..9eb130915f923 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 @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml index 5b1d817f2713e..9382f35adfed5 100644 --- a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml +++ b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml @@ -1,6 +1,6 @@ _orderFactory->create()->load($this->getOrderId()); - if (!$order->getId() || $this->getProtectCode() != $order->getProtectCode()) { + if (!$order->getId() || $this->getProtectCode() !== $order->getProtectCode()) { return false; } @@ -132,7 +132,7 @@ protected function _initShipment() { /* @var $model Shipment */ $ship = $this->shipmentRepository->get($this->getShipId()); - if (!$ship->getEntityId() || $this->getProtectCode() != $ship->getProtectCode()) { + if (!$ship->getEntityId() || $this->getProtectCode() !== $ship->getProtectCode()) { return false; } @@ -197,7 +197,7 @@ public function getTrackingInfoByTrackId() { /** @var \Magento\Shipping\Model\Order\Track $track */ $track = $this->_trackFactory->create()->load($this->getTrackId()); - if ($track->getId() && $this->getProtectCode() == $track->getProtectCode()) { + if ($track->getId() && $this->getProtectCode() === $track->getProtectCode()) { $this->_trackingInfo = [[$track->getNumberDetail()]]; } return $this->_trackingInfo; diff --git a/app/code/Magento/Shipping/Model/Observer.php b/app/code/Magento/Shipping/Model/Observer.php index 4cbfd972ff118..1f3c85cbd22af 100644 --- a/app/code/Magento/Shipping/Model/Observer.php +++ b/app/code/Magento/Shipping/Model/Observer.php @@ -1,6 +1,6 @@ helper = $this->getMockBuilder(\Magento\Shipping\Helper\Data::class) + ->disableOriginalConstructor() + ->getMock(); + $this->orderFactory = $this->getMockBuilder(\Magento\Sales\Model\OrderFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->shipmentRepository = $this->getMockBuilder(\Magento\Sales\Api\ShipmentRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $this->trackFactory = $this->getMockBuilder(\Magento\Shipping\Model\Order\TrackFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->trackCollectionFactory = $this->getMockBuilder(CollectionFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $objectManagerHelper = new ObjectManager($this); + $this->info = $objectManagerHelper->getObject( + Info::class, + [ + 'shippingData' => $this->helper, + 'orderFactory' => $this->orderFactory, + 'shipmentRepository' => $this->shipmentRepository, + 'trackFactory' => $this->trackFactory, + 'trackCollectionFactory' => $this->trackCollectionFactory, + ] + ); + } + + public function testLoadByHashWithOrderId() + { + $hash = strtr(base64_encode('order_id:1:protected_code'), '+/=', '-_,'); + $decodedHash = [ + 'key' => 'order_id', + 'id' => 1, + 'hash' => 'protected_code', + ]; + $shipmentId = 1; + $shipmentIncrementId = 3; + $trackDetails = 'track_details'; + + $this->helper->expects($this->atLeastOnce()) + ->method('decodeTrackingHash') + ->with($hash) + ->willReturn($decodedHash); + $shipmentCollection = $this->getMockBuilder(\Magento\Sales\Model\ResourceModel\Order\Shipment\Collection::class) + ->disableOriginalConstructor() + ->setMethods(['getIterator']) + ->getMock(); + $order = $this->getMockBuilder(\Magento\Sales\Model\Order::class) + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getProtectCode', 'getShipmentsCollection']) + ->getMock(); + $order->expects($this->atLeastOnce())->method('load')->with($decodedHash['id'])->willReturnSelf(); + $order->expects($this->atLeastOnce())->method('getId')->willReturn($decodedHash['id']); + $order->expects($this->atLeastOnce())->method('getProtectCode')->willReturn($decodedHash['hash']); + $order->expects($this->atLeastOnce())->method('getShipmentsCollection')->willReturn($shipmentCollection); + + $shipment = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment::class) + ->disableOriginalConstructor() + ->setMethods(['getIncrementId', 'getId']) + ->getMock(); + $shipment->expects($this->atLeastOnce())->method('getIncrementId')->willReturn($shipmentIncrementId); + $shipment->expects($this->atLeastOnce())->method('getId')->willReturn($shipmentId); + + $shipmentCollection->expects($this->any())->method('getIterator')->willReturn(new \ArrayIterator([$shipment])); + $this->orderFactory->expects($this->atLeastOnce())->method('create')->willReturn($order); + $track = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment\Track::class) + ->disableOriginalConstructor() + ->setMethods(['setShipment', 'getNumberDetail']) + ->getMock(); + $track->expects($this->atLeastOnce())->method('setShipment')->with($shipment)->willReturnSelf(); + $track->expects($this->atLeastOnce())->method('getNumberDetail')->willReturn($trackDetails); + $trackCollection = $this->getMockBuilder(\Magento\Shipping\Model\ResourceModel\Order\Track\Collection::class) + ->disableOriginalConstructor() + ->setMethods(['getIterator', 'setShipmentFilter']) + ->getMock(); + $trackCollection->expects($this->atLeastOnce()) + ->method('setShipmentFilter') + ->with($shipmentId) + ->willReturnSelf(); + $trackCollection->expects($this->atLeastOnce()) + ->method('getIterator') + ->willReturn(new \ArrayIterator([$track])); + $this->trackCollectionFactory->expects($this->atLeastOnce())->method('create')->willReturn($trackCollection); + + $this->info->loadByHash($hash); + $this->assertEquals([$shipmentIncrementId => [$trackDetails]], $this->info->getTrackingInfo()); + } + + public function testLoadByHashWithOrderIdWrongCode() + { + $hash = strtr(base64_encode('order_id:1:0'), '+/=', '-_,'); + $decodedHash = [ + 'key' => 'order_id', + 'id' => 1, + 'hash' => '0', + ]; + + $this->helper->expects($this->atLeastOnce()) + ->method('decodeTrackingHash') + ->with($hash) + ->willReturn($decodedHash); + $order = $this->getMockBuilder(\Magento\Sales\Model\Order::class) + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getProtectCode', 'getShipmentsCollection']) + ->getMock(); + $order->expects($this->atLeastOnce())->method('load')->with($decodedHash['id'])->willReturnSelf(); + $order->expects($this->atLeastOnce())->method('getId')->willReturn($decodedHash['id']); + $order->expects($this->atLeastOnce())->method('getProtectCode')->willReturn('0e123123123'); + $this->orderFactory->expects($this->atLeastOnce())->method('create')->willReturn($order); + $this->info->loadByHash($hash); + $this->assertEmpty($this->info->getTrackingInfo()); + } + + public function testLoadByHashWithShipmentId() + { + $hash = strtr(base64_encode('ship_id:1:protected_code'), '+/=', '-_,'); + $decodedHash = [ + 'key' => 'ship_id', + 'id' => 1, + 'hash' => 'protected_code', + ]; + $shipmentIncrementId = 3; + $trackDetails = 'track_details'; + + $this->helper->expects($this->atLeastOnce()) + ->method('decodeTrackingHash') + ->with($hash) + ->willReturn($decodedHash); + $shipment = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment::class) + ->disableOriginalConstructor() + ->setMethods(['getEntityId', 'getProtectCode', 'getIncrementId', 'getId']) + ->getMock(); + $shipment->expects($this->atLeastOnce())->method('getIncrementId')->willReturn($shipmentIncrementId); + $shipment->expects($this->atLeastOnce())->method('getId')->willReturn($decodedHash['id']); + $shipment->expects($this->atLeastOnce())->method('getEntityId')->willReturn(3); + $shipment->expects($this->atLeastOnce())->method('getProtectCode')->willReturn($decodedHash['hash']); + $this->shipmentRepository->expects($this->atLeastOnce()) + ->method('get') + ->with($decodedHash['id']) + ->willReturn($shipment); + $track = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment\Track::class) + ->disableOriginalConstructor() + ->setMethods(['setShipment', 'getNumberDetail']) + ->getMock(); + $track->expects($this->atLeastOnce())->method('setShipment')->with($shipment)->willReturnSelf(); + $track->expects($this->atLeastOnce())->method('getNumberDetail')->willReturn($trackDetails); + $trackCollection = $this->getMockBuilder(\Magento\Shipping\Model\ResourceModel\Order\Track\Collection::class) + ->disableOriginalConstructor() + ->setMethods(['getIterator', 'setShipmentFilter']) + ->getMock(); + $trackCollection->expects($this->atLeastOnce()) + ->method('setShipmentFilter') + ->with($decodedHash['id']) + ->willReturnSelf(); + $trackCollection->expects($this->atLeastOnce()) + ->method('getIterator') + ->willReturn(new \ArrayIterator([$track])); + $this->trackCollectionFactory->expects($this->atLeastOnce())->method('create')->willReturn($trackCollection); + + $this->info->loadByHash($hash); + $this->assertEquals([$shipmentIncrementId => [$trackDetails]], $this->info->getTrackingInfo()); + } + + public function testLoadByHashWithShipmentIdWrongCode() + { + $hash = strtr(base64_encode('ship_id:1:0'), '+/=', '-_,'); + $decodedHash = [ + 'key' => 'ship_id', + 'id' => 1, + 'hash' => '0', + ]; + + $this->helper->expects($this->atLeastOnce()) + ->method('decodeTrackingHash') + ->with($hash) + ->willReturn($decodedHash); + $shipment = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment::class) + ->disableOriginalConstructor() + ->setMethods(['getEntityId', 'getProtectCode', 'getIncrementId', 'getId']) + ->getMock(); + $shipment->expects($this->atLeastOnce())->method('getEntityId')->willReturn(3); + $shipment->expects($this->atLeastOnce())->method('getProtectCode')->willReturn('0e123123123'); + $this->shipmentRepository->expects($this->atLeastOnce()) + ->method('get') + ->with($decodedHash['id']) + ->willReturn($shipment); + + $this->info->loadByHash($hash); + $this->assertEmpty($this->info->getTrackingInfo()); + } + + public function testLoadByHashWithTrackId() + { + $hash = base64_encode('hash'); + $decodedHash = [ + 'key' => 'track_id', + 'id' => 1, + 'hash' => 'protected_code', + ]; + $trackDetails = 'track_details'; + $this->helper->expects($this->atLeastOnce()) + ->method('decodeTrackingHash') + ->with($hash) + ->willReturn($decodedHash); + $track = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment\Track::class) + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getProtectCode', 'getNumberDetail']) + ->getMock(); + $track->expects($this->atLeastOnce())->method('load')->with($decodedHash['id'])->willReturnSelf(); + $track->expects($this->atLeastOnce())->method('getId')->willReturn($decodedHash['id']); + $track->expects($this->atLeastOnce())->method('getProtectCode')->willReturn($decodedHash['hash']); + $track->expects($this->atLeastOnce())->method('getNumberDetail')->willReturn($trackDetails); + $this->trackFactory->expects($this->atLeastOnce())->method('create')->willReturn($track); + + $this->info->loadByHash($hash); + $this->assertEquals([[$trackDetails]], $this->info->getTrackingInfo()); + } + + public function testLoadByHashWithWrongCode() + { + $hash = base64_encode('hash'); + $decodedHash = [ + 'key' => 'track_id', + 'id' => 1, + 'hash' => 'protected_code', + ]; + $this->helper->expects($this->atLeastOnce()) + ->method('decodeTrackingHash') + ->with($hash) + ->willReturn($decodedHash); + $track = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment\Track::class) + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getProtectCode', 'getNumberDetail']) + ->getMock(); + $track->expects($this->atLeastOnce())->method('load')->with($decodedHash['id'])->willReturnSelf(); + $track->expects($this->atLeastOnce())->method('getId')->willReturn($decodedHash['id']); + $track->expects($this->atLeastOnce())->method('getProtectCode')->willReturn('0e123123123'); + $this->trackFactory->expects($this->atLeastOnce())->method('create')->willReturn($track); + + $this->info->loadByHash($hash); + $this->assertEmpty($this->info->getTrackingInfo()); + } +} diff --git a/app/code/Magento/Shipping/Test/Unit/Model/Order/TrackTest.php b/app/code/Magento/Shipping/Test/Unit/Model/Order/TrackTest.php index 36301f5bc907f..e5e3295abf41b 100644 --- a/app/code/Magento/Shipping/Test/Unit/Model/Order/TrackTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Model/Order/TrackTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Shipping/etc/adminhtml/di.xml b/app/code/Magento/Shipping/etc/adminhtml/di.xml index 6e38c4b498b81..54d5d9664e66f 100644 --- a/app/code/Magento/Shipping/etc/adminhtml/di.xml +++ b/app/code/Magento/Shipping/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/etc/adminhtml/routes.xml b/app/code/Magento/Shipping/etc/adminhtml/routes.xml index 1c8d584672823..90c11b8f53050 100644 --- a/app/code/Magento/Shipping/etc/adminhtml/routes.xml +++ b/app/code/Magento/Shipping/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/etc/adminhtml/system.xml b/app/code/Magento/Shipping/etc/adminhtml/system.xml index ebd889d7139eb..b0d38bc0d61a1 100644 --- a/app/code/Magento/Shipping/etc/adminhtml/system.xml +++ b/app/code/Magento/Shipping/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/etc/config.xml b/app/code/Magento/Shipping/etc/config.xml index f519c6155ba06..4c2e018191b59 100644 --- a/app/code/Magento/Shipping/etc/config.xml +++ b/app/code/Magento/Shipping/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/etc/crontab.xml b/app/code/Magento/Shipping/etc/crontab.xml index 3d35951a25765..4c897f2bd2406 100644 --- a/app/code/Magento/Shipping/etc/crontab.xml +++ b/app/code/Magento/Shipping/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/etc/di.xml b/app/code/Magento/Shipping/etc/di.xml index 2e4cccd9edb68..9cde565e3a11f 100644 --- a/app/code/Magento/Shipping/etc/di.xml +++ b/app/code/Magento/Shipping/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/etc/frontend/page_types.xml b/app/code/Magento/Shipping/etc/frontend/page_types.xml index 1e6d8473dbd6e..301aa00917201 100644 --- a/app/code/Magento/Shipping/etc/frontend/page_types.xml +++ b/app/code/Magento/Shipping/etc/frontend/page_types.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/etc/frontend/routes.xml b/app/code/Magento/Shipping/etc/frontend/routes.xml index e126a455b78d1..6d24805d73f89 100644 --- a/app/code/Magento/Shipping/etc/frontend/routes.xml +++ b/app/code/Magento/Shipping/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/etc/module.xml b/app/code/Magento/Shipping/etc/module.xml index 127e33d06cb87..af78f43d77644 100644 --- a/app/code/Magento/Shipping/etc/module.xml +++ b/app/code/Magento/Shipping/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/registration.php b/app/code/Magento/Shipping/registration.php index 2a64b6d927964..690d8366678cf 100644 --- a/app/code/Magento/Shipping/registration.php +++ b/app/code/Magento/Shipping/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addtrack.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addtrack.xml index 3de8350a6ae4f..5bd012e3fffda 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addtrack.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addtrack.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml index 25e0739339647..b3987ee0ff89b 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_removetrack.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_removetrack.xml index 3de8350a6ae4f..5bd012e3fffda 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_removetrack.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_removetrack.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml index e36aa4fd5e7de..fe7dba972b658 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_invoice_new.xml index a6ba427c06b4f..94bd317ef73d7 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_invoice_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_view.xml index 3a99eaffbddd3..cfe3b0be63c59 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Shipping/view/adminhtml/templates/create/form.phtml b/app/code/Magento/Shipping/view/adminhtml/templates/create/form.phtml index f66ca158b3d02..2c7335c8e5001 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/create/form.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/create/form.phtml @@ -1,6 +1,6 @@ getShipment()->getOrder(); ?> -getShipment()->getOrder() ?> -getChildHtml('order_info') ?> +getChildHtml('order_info'); ?>
    - + escapeHtml(__('Payment & Shipping Method')); ?>
    - + escapeHtml(__('Payment Information')); ?>
    -
    getChildHtml('order_payment') ?>
    -
    getOrderCurrencyCode()) ?>
    +
    getChildHtml('order_payment'); ?>
    +
    + escapeHtml(__('The order was placed using %1.', $order->getOrderCurrencyCode())); ?> +
    - + escapeHtml(__('Shipping and Tracking Information')); ?>
    getShipment()->getTracksCollection()->count()): ?>

    - + + escapeHtml(__('Track this shipment')); ?>

    - escapeHtml($_order->getShippingDescription()) ?> + escapeHtml($order->getShippingDescription()) ?>
    - : + escapeHtml(__('Total Shipping Charges')); ?>: - helper('Magento\Tax\Helper\Data')->displayShippingPriceIncludingTax()): ?> - displayShippingPriceInclTax($_order); ?> + helper(\Magento\Tax\Helper\Data::class)->displayShippingPriceIncludingTax()): ?> + displayShippingPriceInclTax($order); ?> - displayPriceAttribute('shipping_amount', false, ' '); ?> + displayPriceAttribute('shipping_amount', false, ' '); ?> - displayShippingPriceInclTax($_order); ?> + displayShippingPriceInclTax($order); ?> - - helper('Magento\Tax\Helper\Data')->displayShippingBothPrices() && $_incl != $_excl): ?> - ( ) + + helper(\Magento\Tax\Helper\Data::class)->displayShippingBothPrices() && $incl != $excl): ?> + (escapeHtml(__('Incl. Tax')); ?> )
    - canCreateShippingLabel()): ?>

    - getCreateLabelButton()?> + canCreateShippingLabel()): ?> + getCreateLabelButton(); ?> + getShipment()->getShippingLabel()): ?> - getPrintLabelButton() ?> + getPrintLabelButton(); ?> getShipment()->getPackages()): ?> - getShowPackagesButton() ?> + getShowPackagesButton(); ?>

    - - getChildHtml('shipment_tracking') ?> + getChildHtml('shipment_tracking'); ?> - getChildHtml('shipment_packaging') ?> + getChildHtml('shipment_packaging'); ?> diff --git a/app/code/Magento/Swatches/view/frontend/templates/product/view/renderer.phtml b/app/code/Magento/Swatches/view/frontend/templates/product/view/renderer.phtml index 1a585b4cfec51..87354d94f6833 100644 --- a/app/code/Magento/Swatches/view/frontend/templates/product/view/renderer.phtml +++ b/app/code/Magento/Swatches/view/frontend/templates/product/view/renderer.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/SwatchesLayeredNavigation/registration.php b/app/code/Magento/SwatchesLayeredNavigation/registration.php index ea1540b617d26..e6350f6266314 100644 --- a/app/code/Magento/SwatchesLayeredNavigation/registration.php +++ b/app/code/Magento/SwatchesLayeredNavigation/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/Api/Data/AppliedTaxInterface.php b/app/code/Magento/Tax/Api/Data/AppliedTaxInterface.php index 1860097fec100..6b8fede5b4dc1 100644 --- a/app/code/Magento/Tax/Api/Data/AppliedTaxInterface.php +++ b/app/code/Magento/Tax/Api/Data/AppliedTaxInterface.php @@ -1,6 +1,6 @@ priceIncludesTax($store) || $this->getNeedUseShippingExcludeTax(); if ($priceIncludesTax) { switch ($this->getPriceDisplayType($store)) { @@ -844,7 +844,7 @@ public function needPriceConversion($store = null) case self::DISPLAY_TYPE_BOTH: return self::PRICE_CONVERSION_MINUS; case self::DISPLAY_TYPE_INCLUDING_TAX: - $res = true; + $res = false; break; default: break; diff --git a/app/code/Magento/Tax/Model/Config/Notification.php b/app/code/Magento/Tax/Model/Config/Notification.php index cc2c17a7276fa..046cbd9ed3ac8 100644 --- a/app/code/Magento/Tax/Model/Config/Notification.php +++ b/app/code/Magento/Tax/Model/Config/Notification.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/etc/adminhtml/di.xml b/app/code/Magento/Tax/etc/adminhtml/di.xml index 16cb3a15ae84e..5512c092823d5 100644 --- a/app/code/Magento/Tax/etc/adminhtml/di.xml +++ b/app/code/Magento/Tax/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/adminhtml/menu.xml b/app/code/Magento/Tax/etc/adminhtml/menu.xml index 624aef2e7fa05..918a468a603ff 100644 --- a/app/code/Magento/Tax/etc/adminhtml/menu.xml +++ b/app/code/Magento/Tax/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/adminhtml/routes.xml b/app/code/Magento/Tax/etc/adminhtml/routes.xml index 531019d5f333d..102589a8cebf3 100644 --- a/app/code/Magento/Tax/etc/adminhtml/routes.xml +++ b/app/code/Magento/Tax/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/adminhtml/system.xml b/app/code/Magento/Tax/etc/adminhtml/system.xml index bcc132b6a964b..c03a8aa44bf7b 100644 --- a/app/code/Magento/Tax/etc/adminhtml/system.xml +++ b/app/code/Magento/Tax/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/catalog_attributes.xml b/app/code/Magento/Tax/etc/catalog_attributes.xml index 9628274563d2b..45c50b1b74413 100644 --- a/app/code/Magento/Tax/etc/catalog_attributes.xml +++ b/app/code/Magento/Tax/etc/catalog_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/config.xml b/app/code/Magento/Tax/etc/config.xml index 2346b1e6b6d56..f5a1dd3478999 100644 --- a/app/code/Magento/Tax/etc/config.xml +++ b/app/code/Magento/Tax/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/crontab.xml b/app/code/Magento/Tax/etc/crontab.xml index 1060c426cb2e6..ea7aebc5c69df 100644 --- a/app/code/Magento/Tax/etc/crontab.xml +++ b/app/code/Magento/Tax/etc/crontab.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/di.xml b/app/code/Magento/Tax/etc/di.xml index 0435c871483d7..e1e857681d9af 100644 --- a/app/code/Magento/Tax/etc/di.xml +++ b/app/code/Magento/Tax/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/events.xml b/app/code/Magento/Tax/etc/events.xml index 6d4a4ff94ae61..567b255c0ae9b 100644 --- a/app/code/Magento/Tax/etc/events.xml +++ b/app/code/Magento/Tax/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/extension_attributes.xml b/app/code/Magento/Tax/etc/extension_attributes.xml index 61c5eefcd6268..e95dc1bd5cd08 100644 --- a/app/code/Magento/Tax/etc/extension_attributes.xml +++ b/app/code/Magento/Tax/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/fieldset.xml b/app/code/Magento/Tax/etc/fieldset.xml index 37ec0cd6c577a..38a8b7d54455f 100644 --- a/app/code/Magento/Tax/etc/fieldset.xml +++ b/app/code/Magento/Tax/etc/fieldset.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/frontend/di.xml b/app/code/Magento/Tax/etc/frontend/di.xml index a7b1c766c72f7..4db3f54b0edd9 100644 --- a/app/code/Magento/Tax/etc/frontend/di.xml +++ b/app/code/Magento/Tax/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/frontend/events.xml b/app/code/Magento/Tax/etc/frontend/events.xml index 206edaf93c7d2..24843851e05af 100644 --- a/app/code/Magento/Tax/etc/frontend/events.xml +++ b/app/code/Magento/Tax/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/module.xml b/app/code/Magento/Tax/etc/module.xml index b816eec92ce0f..f4e0bdf122dc2 100644 --- a/app/code/Magento/Tax/etc/module.xml +++ b/app/code/Magento/Tax/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/pdf.xml b/app/code/Magento/Tax/etc/pdf.xml index a06265d4782d9..a26fbb3bdf350 100644 --- a/app/code/Magento/Tax/etc/pdf.xml +++ b/app/code/Magento/Tax/etc/pdf.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/sales.xml b/app/code/Magento/Tax/etc/sales.xml index 3d437252cbd17..64d29ece898de 100644 --- a/app/code/Magento/Tax/etc/sales.xml +++ b/app/code/Magento/Tax/etc/sales.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/etc/webapi.xml b/app/code/Magento/Tax/etc/webapi.xml index a67bc2dcb4123..c6e519e56d163 100644 --- a/app/code/Magento/Tax/etc/webapi.xml +++ b/app/code/Magento/Tax/etc/webapi.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/registration.php b/app/code/Magento/Tax/registration.php index 7e5d1ea05d9cb..7512a227f1ab1 100644 --- a/app/code/Magento/Tax/registration.php +++ b/app/code/Magento/Tax/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/sales_invoice_item_price.xml b/app/code/Magento/Tax/view/adminhtml/layout/sales_invoice_item_price.xml index 3d7663f8536fa..c402776172448 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/sales_invoice_item_price.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/sales_invoice_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/sales_order_create_item_price.xml b/app/code/Magento/Tax/view/adminhtml/layout/sales_order_create_item_price.xml index 375b300e46892..039fb32861316 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/sales_order_create_item_price.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/sales_order_create_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/sales_order_item_price.xml b/app/code/Magento/Tax/view/adminhtml/layout/sales_order_item_price.xml index 9d2fce3b7652f..786b576da6b26 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/sales_order_item_price.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/sales_order_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_block.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_block.xml index d900a7c957054..463994262b7d3 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_block.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportcsv.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportcsv.xml index 89c857f569f4c..5bdcf3c5965dd 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportcsv.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportcsv.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportxml.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportxml.xml index 89c857f569f4c..5bdcf3c5965dd 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportxml.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportxml.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_index.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_index.xml index 270004a498ba1..050674d7427ef 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_index.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_block.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_block.xml index 4a58a9894f43e..e42c2bfeef3f9 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_block.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml index 0a9e6e3c59b3b..539b9781be8d7 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_index.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_index.xml index 83a60910ae318..d6afb1ab3dcc8 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_index.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml b/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml index 23bcbfbb4340e..32f692c32fccf 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml b/app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml index cba78caa5b2e6..75025db93607d 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/templates/toolbar/class/save.phtml b/app/code/Magento/Tax/view/adminhtml/templates/toolbar/class/save.phtml index 23068fd57de63..fbfde0f3cb86c 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/toolbar/class/save.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/toolbar/class/save.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/adminhtml/templates/toolbar/rule/save.phtml b/app/code/Magento/Tax/view/adminhtml/templates/toolbar/rule/save.phtml index baa5f257ea7ac..951f050f4ce75 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/toolbar/rule/save.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/toolbar/rule/save.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/base/templates/pricing/adjustment.phtml b/app/code/Magento/Tax/view/base/templates/pricing/adjustment.phtml index e3a765984d6ad..20e47f3c063a2 100644 --- a/app/code/Magento/Tax/view/base/templates/pricing/adjustment.phtml +++ b/app/code/Magento/Tax/view/base/templates/pricing/adjustment.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml index 93baddd73a9d3..a81c029b1cee3 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_index_index.xml index f8eeca47a1376..6d867fcb71f2e 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml index 5665eb0b5cd43..2dc29c083b3c4 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml b/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml index 0ef199db11b4d..50fae0fae5c7a 100644 --- a/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml +++ b/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/frontend/layout/sales_order_item_price.xml b/app/code/Magento/Tax/view/frontend/layout/sales_order_item_price.xml index acfb68b9c0de4..b30e60f0d625c 100644 --- a/app/code/Magento/Tax/view/frontend/layout/sales_order_item_price.xml +++ b/app/code/Magento/Tax/view/frontend/layout/sales_order_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Tax/view/frontend/templates/checkout/cart/item/price/sidebar.phtml b/app/code/Magento/Tax/view/frontend/templates/checkout/cart/item/price/sidebar.phtml index 9d1a1d40763da..a01867532b4e7 100644 --- a/app/code/Magento/Tax/view/frontend/templates/checkout/cart/item/price/sidebar.phtml +++ b/app/code/Magento/Tax/view/frontend/templates/checkout/cart/item/price/sidebar.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/cart/totals/shipping.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/cart/totals/shipping.html index afbe285629b24..9f8574a9438d1 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/cart/totals/shipping.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/cart/totals/shipping.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/cart/totals/tax.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/cart/totals/tax.html index 738a0125da02f..9c45e73db6fa4 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/cart/totals/tax.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/cart/totals/tax.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html index eb20767de779e..75058faebe919 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/shipping_method/price.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/shipping_method/price.html index 9b0077c3d4b11..bf546caa482df 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/shipping_method/price.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/shipping_method/price.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/grand-total.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/grand-total.html index 0dd86baae2ebf..5a324f92248d0 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/grand-total.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/grand-total.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/item/details/subtotal.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/item/details/subtotal.html index 60778bdba2117..052cd9ab01abc 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/item/details/subtotal.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/item/details/subtotal.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/shipping.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/shipping.html index ff4acc3ed5b49..007e7ded68210 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/shipping.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/shipping.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/subtotal.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/subtotal.html index 9da9955d45f90..f15830fdd1705 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/subtotal.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/subtotal.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/tax.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/tax.html index 68ccf75c6015d..0f2e3251bcfdb 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/tax.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/tax.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/Grid/Renderer/Country.php b/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/Grid/Renderer/Country.php index da9b250e91149..09e7c27fa9c3a 100644 --- a/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/Grid/Renderer/Country.php +++ b/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/Grid/Renderer/Country.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/TaxImportExport/etc/adminhtml/menu.xml b/app/code/Magento/TaxImportExport/etc/adminhtml/menu.xml index c6793683a4829..ddd12c7af0782 100644 --- a/app/code/Magento/TaxImportExport/etc/adminhtml/menu.xml +++ b/app/code/Magento/TaxImportExport/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/TaxImportExport/etc/adminhtml/routes.xml b/app/code/Magento/TaxImportExport/etc/adminhtml/routes.xml index 566345bc2e90d..1cab0b7338893 100644 --- a/app/code/Magento/TaxImportExport/etc/adminhtml/routes.xml +++ b/app/code/Magento/TaxImportExport/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/TaxImportExport/etc/module.xml b/app/code/Magento/TaxImportExport/etc/module.xml index 931ebe9845a71..192c817c29087 100644 --- a/app/code/Magento/TaxImportExport/etc/module.xml +++ b/app/code/Magento/TaxImportExport/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/TaxImportExport/registration.php b/app/code/Magento/TaxImportExport/registration.php index c187a78c0d7b4..be9bbe9ca11c8 100644 --- a/app/code/Magento/TaxImportExport/registration.php +++ b/app/code/Magento/TaxImportExport/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml b/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml index b8c36c9d4282c..050424a8d66bc 100644 --- a/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml +++ b/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml b/app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml index 12f48c00fda16..ec4a9352258ce 100644 --- a/app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml +++ b/app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/Test/Unit/Model/Layout/ConfigTest.php b/app/code/Magento/Theme/Test/Unit/Model/Layout/ConfigTest.php index 0a23277a15655..d045e349199a5 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Layout/ConfigTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Layout/ConfigTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme_invalid.xml b/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme_invalid.xml index b88b6d7763d56..44796560a44fd 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme_invalid.xml +++ b/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme_invalid.xml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/Test/Unit/Observer/ApplyThemeCustomizationObserverTest.php b/app/code/Magento/Theme/Test/Unit/Observer/ApplyThemeCustomizationObserverTest.php index 877cf7f19a921..18a2edc77449e 100644 --- a/app/code/Magento/Theme/Test/Unit/Observer/ApplyThemeCustomizationObserverTest.php +++ b/app/code/Magento/Theme/Test/Unit/Observer/ApplyThemeCustomizationObserverTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/etc/adminhtml/di.xml b/app/code/Magento/Theme/etc/adminhtml/di.xml index 7d87e73be0b55..8e672cbe1317e 100644 --- a/app/code/Magento/Theme/etc/adminhtml/di.xml +++ b/app/code/Magento/Theme/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/adminhtml/menu.xml b/app/code/Magento/Theme/etc/adminhtml/menu.xml index b93648178f48e..c37c28fd5a5b1 100644 --- a/app/code/Magento/Theme/etc/adminhtml/menu.xml +++ b/app/code/Magento/Theme/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/adminhtml/routes.xml b/app/code/Magento/Theme/etc/adminhtml/routes.xml index d53a36e808b66..f116adf77bbfe 100644 --- a/app/code/Magento/Theme/etc/adminhtml/routes.xml +++ b/app/code/Magento/Theme/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/config.xml b/app/code/Magento/Theme/etc/config.xml index a383af866ce61..19d60fd5b81d7 100644 --- a/app/code/Magento/Theme/etc/config.xml +++ b/app/code/Magento/Theme/etc/config.xml @@ -1,7 +1,7 @@ @@ -48,7 +48,7 @@ Disallow: /*SID= Default welcome msg!
    - Copyright © 2017 Magento, Inc. All rights reserved. + Copyright © 2013-present Magento, Inc. All rights reserved.
    diff --git a/app/code/Magento/Theme/etc/di.xml b/app/code/Magento/Theme/etc/di.xml index 6e36235040735..e7cc5b9469db3 100644 --- a/app/code/Magento/Theme/etc/di.xml +++ b/app/code/Magento/Theme/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/events.xml b/app/code/Magento/Theme/etc/events.xml index 574f14709ab25..47d73c5d3d0d9 100644 --- a/app/code/Magento/Theme/etc/events.xml +++ b/app/code/Magento/Theme/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/extension_attributes.xml b/app/code/Magento/Theme/etc/extension_attributes.xml index 302392f78fc08..c6e666cd8e75c 100644 --- a/app/code/Magento/Theme/etc/extension_attributes.xml +++ b/app/code/Magento/Theme/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/frontend/di.xml b/app/code/Magento/Theme/etc/frontend/di.xml index 3582aa9de3345..7db2783cd8dfa 100644 --- a/app/code/Magento/Theme/etc/frontend/di.xml +++ b/app/code/Magento/Theme/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/frontend/events.xml b/app/code/Magento/Theme/etc/frontend/events.xml index 97c3ecf930203..bab935e965f9a 100644 --- a/app/code/Magento/Theme/etc/frontend/events.xml +++ b/app/code/Magento/Theme/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/frontend/sections.xml b/app/code/Magento/Theme/etc/frontend/sections.xml index 34ced88c82de4..d0cf60d11f3f8 100644 --- a/app/code/Magento/Theme/etc/frontend/sections.xml +++ b/app/code/Magento/Theme/etc/frontend/sections.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/indexer.xml b/app/code/Magento/Theme/etc/indexer.xml index 002cca294181f..7ed25878e383c 100644 --- a/app/code/Magento/Theme/etc/indexer.xml +++ b/app/code/Magento/Theme/etc/indexer.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/module.xml b/app/code/Magento/Theme/etc/module.xml index ae4f6955c6168..47bad0386b1b5 100644 --- a/app/code/Magento/Theme/etc/module.xml +++ b/app/code/Magento/Theme/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/etc/mview.xml b/app/code/Magento/Theme/etc/mview.xml index 24bc771909c89..fb57aa90474cd 100644 --- a/app/code/Magento/Theme/etc/mview.xml +++ b/app/code/Magento/Theme/etc/mview.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/i18n/en_US.csv b/app/code/Magento/Theme/i18n/en_US.csv index 24b290c36fff1..bdb74f79ef096 100644 --- a/app/code/Magento/Theme/i18n/en_US.csv +++ b/app/code/Magento/Theme/i18n/en_US.csv @@ -135,7 +135,7 @@ Configuration,Configuration "This action will delete your custom instructions and reset robots.txt file to system's default settings.","This action will delete your custom instructions and reset robots.txt file to system's default settings." "Default Description","Default Description" "Default welcome msg!","Default welcome msg!" -"Copyright © 2017 Magento, Inc. All rights reserved.","Copyright © 2017 Magento, Inc. All rights reserved." +"Copyright © 2013-present Magento, Inc. All rights reserved.","Copyright © 2013-present Magento, Inc. All rights reserved." "Design Config Grid","Design Config Grid" "Rebuild design config grid index","Rebuild design config grid index" "Admin empty","Admin empty" diff --git a/app/code/Magento/Theme/registration.php b/app/code/Magento/Theme/registration.php index 58add46ee6909..fb41494f96395 100644 --- a/app/code/Magento/Theme/registration.php +++ b/app/code/Magento/Theme/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml index 5db690f54f186..99e4807281589 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_grid.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_grid.xml index b3e4744acd8d2..12a1b7b517040 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_grid.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_index.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_index.xml index 3e5166670ab36..7bbdc526a6143 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_index.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_contents.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_contents.xml index 9ec72de7f5361..6e0fba29d5148 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_contents.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_contents.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_index.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_index.xml index b022ad86eab5b..be0c0839855fd 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_index.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/layout/theme_design_config_edit.xml b/app/code/Magento/Theme/view/adminhtml/layout/theme_design_config_edit.xml index 648ccc0c7a482..1debfe93b2d51 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/theme_design_config_edit.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/theme_design_config_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/layout/theme_design_config_index.xml b/app/code/Magento/Theme/view/adminhtml/layout/theme_design_config_index.xml index 5a3b004bbfb7f..6496c24e4bfaa 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/theme_design_config_index.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/theme_design_config_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/layouts.xml b/app/code/Magento/Theme/view/adminhtml/layouts.xml index b8292d4b7db50..3e42e4c42d372 100644 --- a/app/code/Magento/Theme/view/adminhtml/layouts.xml +++ b/app/code/Magento/Theme/view/adminhtml/layouts.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-1column.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-1column.xml index 64def8572ff15..0c13f7c65b181 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-1column.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-1column.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml index b658e95a1cc4b..e2bb21ebe2899 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml index 1ae61806dea7c..70e9d68d00c0a 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-login.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-login.xml index 4beee7d41e5db..85c4b401e1716 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-login.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-login.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/requirejs-config.js b/app/code/Magento/Theme/view/adminhtml/requirejs-config.js index a38a4991aa647..8c51d5a1505d6 100644 --- a/app/code/Magento/Theme/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/Theme/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Theme/view/adminhtml/templates/browser/content.phtml b/app/code/Magento/Theme/view/adminhtml/templates/browser/content.phtml index 492655f3b6fa1..820cd016c2a28 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/browser/content.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/browser/content.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/templates/browser/content/files.phtml b/app/code/Magento/Theme/view/adminhtml/templates/browser/content/files.phtml index bae1e883150b9..8f594e6c7e2d6 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/browser/content/files.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/browser/content/files.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml b/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml index 8655e5b3a507f..d6b8274a4d2fc 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/templates/title.phtml b/app/code/Magento/Theme/view/adminhtml/templates/title.phtml index 6e49ac4ec17ef..3ace728b3eca3 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/title.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/title.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/ui_component/design_config_listing.xml b/app/code/Magento/Theme/view/adminhtml/ui_component/design_config_listing.xml index 54db67209305b..747a4581aa604 100644 --- a/app/code/Magento/Theme/view/adminhtml/ui_component/design_config_listing.xml +++ b/app/code/Magento/Theme/view/adminhtml/ui_component/design_config_listing.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/adminhtml/web/css/theme.css b/app/code/Magento/Theme/view/adminhtml/web/css/theme.css index 508fdacf72659..54331e269f9e6 100644 --- a/app/code/Magento/Theme/view/adminhtml/web/css/theme.css +++ b/app/code/Magento/Theme/view/adminhtml/web/css/theme.css @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Theme/view/adminhtml/web/js/bootstrap.js b/app/code/Magento/Theme/view/adminhtml/web/js/bootstrap.js index 6c5ed9eaf54bf..598f93032885a 100644 --- a/app/code/Magento/Theme/view/adminhtml/web/js/bootstrap.js +++ b/app/code/Magento/Theme/view/adminhtml/web/js/bootstrap.js @@ -1,6 +1,6 @@ /** * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ require([ diff --git a/app/code/Magento/Theme/view/adminhtml/web/js/custom-js-list.js b/app/code/Magento/Theme/view/adminhtml/web/js/custom-js-list.js index cf15cadcc01f6..2d127444956c3 100644 --- a/app/code/Magento/Theme/view/adminhtml/web/js/custom-js-list.js +++ b/app/code/Magento/Theme/view/adminhtml/web/js/custom-js-list.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Theme/view/adminhtml/web/js/form.js b/app/code/Magento/Theme/view/adminhtml/web/js/form.js index 131ea2868aa24..3deee013e024a 100644 --- a/app/code/Magento/Theme/view/adminhtml/web/js/form.js +++ b/app/code/Magento/Theme/view/adminhtml/web/js/form.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define(["prototype"], function(){ diff --git a/app/code/Magento/Theme/view/adminhtml/web/js/sortable.js b/app/code/Magento/Theme/view/adminhtml/web/js/sortable.js index 830020e9a5908..74bffbb2722a4 100644 --- a/app/code/Magento/Theme/view/adminhtml/web/js/sortable.js +++ b/app/code/Magento/Theme/view/adminhtml/web/js/sortable.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Theme/view/adminhtml/web/prototype/magento.css b/app/code/Magento/Theme/view/adminhtml/web/prototype/magento.css index e989db7091986..07c4ee8200af5 100644 --- a/app/code/Magento/Theme/view/adminhtml/web/prototype/magento.css +++ b/app/code/Magento/Theme/view/adminhtml/web/prototype/magento.css @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Theme/view/base/layouts.xml b/app/code/Magento/Theme/view/base/layouts.xml index c1489a2e66c47..429eb8482825d 100644 --- a/app/code/Magento/Theme/view/base/layouts.xml +++ b/app/code/Magento/Theme/view/base/layouts.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/base/page_layout/empty.xml b/app/code/Magento/Theme/view/base/page_layout/empty.xml index 395e629d04ad3..93f97bd2f4056 100644 --- a/app/code/Magento/Theme/view/base/page_layout/empty.xml +++ b/app/code/Magento/Theme/view/base/page_layout/empty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/base/requirejs-config.js b/app/code/Magento/Theme/view/base/requirejs-config.js index a9a077bf901d3..eced970c4a3b5 100644 --- a/app/code/Magento/Theme/view/base/requirejs-config.js +++ b/app/code/Magento/Theme/view/base/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Theme/view/base/templates/root.phtml b/app/code/Magento/Theme/view/base/templates/root.phtml index ff5e67235e2fe..a999b4fc084a2 100644 --- a/app/code/Magento/Theme/view/base/templates/root.phtml +++ b/app/code/Magento/Theme/view/base/templates/root.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml b/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml index aa4b464549dc3..38ab9c29402e9 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml b/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml index 4093e646d48b6..ce2df77efd92b 100644 --- a/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml +++ b/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/frontend/layout/print.xml b/app/code/Magento/Theme/view/frontend/layout/print.xml index 37d599f301c93..49b35f7b362ee 100644 --- a/app/code/Magento/Theme/view/frontend/layout/print.xml +++ b/app/code/Magento/Theme/view/frontend/layout/print.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/frontend/layouts.xml b/app/code/Magento/Theme/view/frontend/layouts.xml index 1b1a9c1956c51..27e28c61659a5 100644 --- a/app/code/Magento/Theme/view/frontend/layouts.xml +++ b/app/code/Magento/Theme/view/frontend/layouts.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/frontend/page_layout/1column.xml b/app/code/Magento/Theme/view/frontend/page_layout/1column.xml index 0ce264465ca61..4b29bffde0064 100644 --- a/app/code/Magento/Theme/view/frontend/page_layout/1column.xml +++ b/app/code/Magento/Theme/view/frontend/page_layout/1column.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/frontend/page_layout/2columns-left.xml b/app/code/Magento/Theme/view/frontend/page_layout/2columns-left.xml index 74fdf1dd176ed..27849074f85a5 100644 --- a/app/code/Magento/Theme/view/frontend/page_layout/2columns-left.xml +++ b/app/code/Magento/Theme/view/frontend/page_layout/2columns-left.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/frontend/page_layout/2columns-right.xml b/app/code/Magento/Theme/view/frontend/page_layout/2columns-right.xml index 62cda64a18d2c..69a18998ae049 100644 --- a/app/code/Magento/Theme/view/frontend/page_layout/2columns-right.xml +++ b/app/code/Magento/Theme/view/frontend/page_layout/2columns-right.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/frontend/page_layout/3columns.xml b/app/code/Magento/Theme/view/frontend/page_layout/3columns.xml index 62cda64a18d2c..69a18998ae049 100644 --- a/app/code/Magento/Theme/view/frontend/page_layout/3columns.xml +++ b/app/code/Magento/Theme/view/frontend/page_layout/3columns.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Theme/view/frontend/requirejs-config.js b/app/code/Magento/Theme/view/frontend/requirejs-config.js index 4bd09ebd0ad2c..454092630d6f0 100644 --- a/app/code/Magento/Theme/view/frontend/requirejs-config.js +++ b/app/code/Magento/Theme/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Theme/view/frontend/templates/callouts/left_col.phtml b/app/code/Magento/Theme/view/frontend/templates/callouts/left_col.phtml index 5740c91b5b0c5..b542a7488bd4b 100644 --- a/app/code/Magento/Theme/view/frontend/templates/callouts/left_col.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/callouts/left_col.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/html/block.phtml b/app/code/Magento/Theme/view/frontend/templates/html/block.phtml index a9bffb4bbe269..ce5cedb570f7d 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/block.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/block.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/html/collapsible.phtml b/app/code/Magento/Theme/view/frontend/templates/html/collapsible.phtml index 32933e3a32747..f2a043d06450f 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/collapsible.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/collapsible.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/html/footer.phtml b/app/code/Magento/Theme/view/frontend/templates/html/footer.phtml index d9de080002604..331c46f622b03 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/footer.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/footer.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/html/notices.phtml b/app/code/Magento/Theme/view/frontend/templates/html/notices.phtml index 457da22298014..fd5fba5a13609 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/notices.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/notices.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/html/sections.phtml b/app/code/Magento/Theme/view/frontend/templates/html/sections.phtml index 34deb16aa2b9b..a8b82527ee69f 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/sections.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/sections.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/js/components.phtml b/app/code/Magento/Theme/view/frontend/templates/js/components.phtml index bdcb2e9bf7747..e71938935b8f3 100644 --- a/app/code/Magento/Theme/view/frontend/templates/js/components.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/js/components.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml b/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml index 14c511252e0e0..f17ddf8ee7a09 100644 --- a/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/link.phtml b/app/code/Magento/Theme/view/frontend/templates/link.phtml index c75589a8815ed..a64483993d4f4 100644 --- a/app/code/Magento/Theme/view/frontend/templates/link.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/link.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/page/js/require_js.phtml b/app/code/Magento/Theme/view/frontend/templates/page/js/require_js.phtml index d3bf6a342924d..657e47edd801c 100644 --- a/app/code/Magento/Theme/view/frontend/templates/page/js/require_js.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/page/js/require_js.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Theme/view/frontend/templates/template.phtml b/app/code/Magento/Theme/view/frontend/templates/template.phtml index b836a0d1b8fa2..85c6a4e54826e 100644 --- a/app/code/Magento/Theme/view/frontend/templates/template.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/template.phtml @@ -1,6 +1,6 @@ config->getPatterns() as $pattern) { - $result = preg_match_all($pattern, $content, $matches); + $concatenatedContent = preg_replace('~(["\'])\s*?\+\s*?\1~', '', $content); + $result = preg_match_all($pattern, $concatenatedContent, $matches); if ($result) { if (isset($matches[2])) { foreach ($matches[2] as $match) { - $phrases[] = str_replace('\\\'', '\'', $match); + $phrases[] = str_replace(["\'", '\"'], ["'", '"'], $match); } } } diff --git a/app/code/Magento/Translation/Model/Js/DataProviderInterface.php b/app/code/Magento/Translation/Model/Js/DataProviderInterface.php index 15359d140fd16..630804e5d76af 100644 --- a/app/code/Magento/Translation/Model/Js/DataProviderInterface.php +++ b/app/code/Magento/Translation/Model/Js/DataProviderInterface.php @@ -1,6 +1,6 @@ resourceMock = $this->getMockBuilder('Magento\Translation\Model\ResourceModel\StringUtilsFactory') + $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->translateInlineMock = + $this->getMockForAbstractClass(\Magento\Framework\Translate\InlineInterface::class); + $this->appCacheMock = $this->getMockForAbstractClass(\Magento\Framework\App\Cache\TypeListInterface::class); + $this->storeManagerMock = $this->getMockForAbstractClass(\Magento\Store\Model\StoreManagerInterface::class); + $this->storeMock = $this->getMockForAbstractClass(\Magento\Store\Api\Data\StoreInterface::class); + $this->storeManagerMock->expects($this->any()) + ->method('getStore') + ->willReturn($this->storeMock); + $this->resourceFactoryMock = $this->getMockBuilder( + \Magento\Translation\Model\ResourceModel\StringUtilsFactory::class + ) ->disableOriginalConstructor() - ->setMethods([]) ->getMock(); $this->storeManagerMock = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') diff --git a/app/code/Magento/Translation/Test/Unit/Model/Js/Config/Source/StrategyTest.php b/app/code/Magento/Translation/Test/Unit/Model/Js/Config/Source/StrategyTest.php index e38dc09d2a089..e0cc1eb65839c 100644 --- a/app/code/Magento/Translation/Test/Unit/Model/Js/Config/Source/StrategyTest.php +++ b/app/code/Magento/Translation/Test/Unit/Model/Js/Config/Source/StrategyTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Translation/etc/adminhtml/routes.xml b/app/code/Magento/Translation/etc/adminhtml/routes.xml index 96cbaa2d184b9..cb9da9914aca4 100644 --- a/app/code/Magento/Translation/etc/adminhtml/routes.xml +++ b/app/code/Magento/Translation/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Translation/etc/adminhtml/system.xml b/app/code/Magento/Translation/etc/adminhtml/system.xml index 7ce6719d92e01..8c3cdc5c39916 100644 --- a/app/code/Magento/Translation/etc/adminhtml/system.xml +++ b/app/code/Magento/Translation/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Translation/etc/cache.xml b/app/code/Magento/Translation/etc/cache.xml index 8e3f03dd503c5..14255a71bc30d 100644 --- a/app/code/Magento/Translation/etc/cache.xml +++ b/app/code/Magento/Translation/etc/cache.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Translation/etc/config.xml b/app/code/Magento/Translation/etc/config.xml index 3c7fdbcead9cc..340b6b5857fdd 100644 --- a/app/code/Magento/Translation/etc/config.xml +++ b/app/code/Magento/Translation/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Translation/etc/di.xml b/app/code/Magento/Translation/etc/di.xml index 05e4bc6d1bdb5..c75324029116b 100644 --- a/app/code/Magento/Translation/etc/di.xml +++ b/app/code/Magento/Translation/etc/di.xml @@ -1,7 +1,7 @@ @@ -59,8 +59,8 @@ - ~\$\.mage\.__\((?s)[^'"]*?(['"])(.+?)\1(?s).*?\)~ - ~\$t\((?s)[^'"]*?(["'])(.+?)\1(?s).*?\)~ + + diff --git a/app/code/Magento/Translation/etc/frontend/routes.xml b/app/code/Magento/Translation/etc/frontend/routes.xml index 44eb6b5b7d68d..366ba1f002c83 100644 --- a/app/code/Magento/Translation/etc/frontend/routes.xml +++ b/app/code/Magento/Translation/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Translation/etc/module.xml b/app/code/Magento/Translation/etc/module.xml index 7abeb5bbdd49e..f45ddeb28a8ec 100644 --- a/app/code/Magento/Translation/etc/module.xml +++ b/app/code/Magento/Translation/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Translation/registration.php b/app/code/Magento/Translation/registration.php index d4118679a31be..454562eee7d3f 100644 --- a/app/code/Magento/Translation/registration.php +++ b/app/code/Magento/Translation/registration.php @@ -1,6 +1,6 @@ getContext(); $config = $this->getData('config'); if (isset($config['options'])) { $options = []; foreach ($config['options'] as $option) { - $option['url'] = $this->urlBuilder->getUrl($option['url']); + $additionalParams = $this->getAdditionalParams($config, $context); + $option['url'] = $this->urlBuilder->getUrl($option['url'], $additionalParams); $options[] = $option; } $config['options'] = $options; @@ -66,4 +68,25 @@ public function prepare() } parent::prepare(); } + + /** + * Get export button additional parameters + * + * @param array $config + * @param ContextInterface $context + * @return array + */ + private function getAdditionalParams($config, $context) + { + $additionalParams = []; + if (isset($config['additionalParams'])) { + foreach ($config['additionalParams'] as $paramName => $paramValue) { + if ('*' == $paramValue) { + $paramValue = $context->getRequestParam($paramName); + } + $additionalParams[$paramName] = $paramValue; + } + } + return $additionalParams; + } } diff --git a/app/code/Magento/Ui/Component/Filters.php b/app/code/Magento/Ui/Component/Filters.php index ee67c35ba3e39..39f204c19d86c 100644 --- a/app/code/Magento/Ui/Component/Filters.php +++ b/app/code/Magento/Ui/Component/Filters.php @@ -1,6 +1,6 @@ converter = $converter; $this->fileFactory = $fileFactory; + $this->filter = $filter + ?: ObjectManager::getInstance()->get(Filter::class); + $this->logger = $logger + ?: ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -48,6 +69,34 @@ public function __construct( */ public function execute() { - return $this->fileFactory->create('export.csv', $this->converter->getCsvFile(), 'var'); + return $this->fileFactory->create( + 'export.csv', + $this->converter->getCsvFile(), + 'var' + ); + } + + /** + * Checking if the user has access to requested component. + * + * @inheritDoc + */ + protected function _isAllowed() + { + if ($this->_request->getParam('namespace')) { + try { + $component = $this->filter->getComponent(); + $aclResource = $component->getData('acl'); + if ($aclResource) { + return $this->_authorization->isAllowed($aclResource); + } + } catch (\Exception $exception) { + $this->logger->critical($exception); + + return false; + } + } + + return true; } } diff --git a/app/code/Magento/Ui/Controller/Adminhtml/Export/GridToXml.php b/app/code/Magento/Ui/Controller/Adminhtml/Export/GridToXml.php index 521e726894f56..da2609db91273 100644 --- a/app/code/Magento/Ui/Controller/Adminhtml/Export/GridToXml.php +++ b/app/code/Magento/Ui/Controller/Adminhtml/Export/GridToXml.php @@ -1,14 +1,17 @@ converter = $converter; $this->fileFactory = $fileFactory; + $this->filter = $filter + ?: ObjectManager::getInstance()->get(Filter::class); + $this->logger = $logger + ?: ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -48,6 +69,34 @@ public function __construct( */ public function execute() { - return $this->fileFactory->create('export.xml', $this->converter->getXmlFile(), 'var'); + return $this->fileFactory->create( + 'export.xml', + $this->converter->getXmlFile(), + 'var' + ); + } + + /** + * Checking if the user has access to requested component. + * + * @inheritDoc + */ + protected function _isAllowed() + { + if ($this->_request->getParam('namespace')) { + try { + $component = $this->filter->getComponent(); + $aclResource = $component->getData('acl'); + if ($aclResource) { + return $this->_authorization->isAllowed($aclResource); + } + } catch (\Exception $exception) { + $this->logger->critical($exception); + + return false; + } + } + + return true; } } diff --git a/app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php b/app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php index 9d45cab45b5b1..60615b3bc4bc3 100644 --- a/app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php +++ b/app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php @@ -1,6 +1,6 @@ getData('acl'); if ($aclResource && !$this->_authorization->isAllowed($aclResource)) { - $this->_redirect('admin/noroute'); + if (!$this->_request->isAjax()) { + $this->_redirect('admin/noroute'); + } + return; } $this->prepareComponent($component); + + if ($component->getContext()->getAcceptType() === 'json') { + $this->_response->setHeader('Content-Type', 'application/json'); + } + $this->_response->appendBody((string) $component->render()); } diff --git a/app/code/Magento/Ui/Controller/Adminhtml/Index/Render/Handle.php b/app/code/Magento/Ui/Controller/Adminhtml/Index/Render/Handle.php index defa8f8756045..cc028a455456d 100644 --- a/app/code/Magento/Ui/Controller/Adminhtml/Index/Render/Handle.php +++ b/app/code/Magento/Ui/Controller/Adminhtml/Index/Render/Handle.php @@ -1,6 +1,6 @@ wrapContent(json_encode($this->structure->generate($this->component))); + $layoutConfiguration = $this->wrapContent( + json_encode($this->structure->generate($this->component), JSON_HEX_TAG) + ); $this->template->append($layoutConfiguration); } diff --git a/app/code/Magento/Ui/Test/Unit/Component/AbstractComponentTest.php b/app/code/Magento/Ui/Test/Unit/Component/AbstractComponentTest.php index d1738bb9d6598..8862a28c94f77 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/AbstractComponentTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/AbstractComponentTest.php @@ -1,6 +1,6 @@ requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') + $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) ->disableOriginalConstructor() ->getMock(); - $this->responseMock = $this->getMockBuilder('Magento\Framework\App\Response\Http') + $this->responseMock = $this->getMockBuilder(\Magento\Framework\App\Response\Http::class) ->disableOriginalConstructor() ->getMock(); - $this->contextMock = $this->getMockBuilder('Magento\Backend\App\Action\Context') + $this->contextMock = $this->getMockBuilder(\Magento\Backend\App\Action\Context::class) ->disableOriginalConstructor() ->getMock(); $this->uiFactoryMock = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponentFactory::class) @@ -110,38 +114,23 @@ public function testExecuteAjaxRequest() $name = 'test-name'; $renderedData = 'data'; - $this->requestMock->expects($this->any()) - ->method('getParam') - ->with('namespace') - ->willReturn($name); - $this->requestMock->expects($this->any()) - ->method('getParams') - ->willReturn([]); - $this->responseMock->expects($this->once()) - ->method('appendBody') - ->with($renderedData); + $this->prepareComponent($name, $renderedData); - /** - * @var \Magento\Framework\View\Element\UiComponentInterface|\PHPUnit_Framework_MockObject_MockObject $viewMock - */ - $viewMock = $this->getMockForAbstractClass( - 'Magento\Framework\View\Element\UiComponentInterface', - [], - '', - false, - true, - true, - ['render'] - ); - $viewMock->expects($this->once()) - ->method('render') - ->willReturn($renderedData); - $viewMock->expects($this->once()) - ->method('getChildComponents') - ->willReturn([]); - $this->uiFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($viewMock); + $this->responseMock->expects($this->never())->method('setHeader'); + + $this->render->executeAjaxRequest(); + } + + public function testExecuteAjaxJsonRequest() + { + $name = 'test-name'; + $renderedData = '{"data": "test"}'; + + $this->prepareComponent($name, $renderedData, 'json'); + + $this->responseMock->expects($this->once()) + ->method('setHeader') + ->with('Content-Type', 'application/json'); $this->render->executeAjaxRequest(); } @@ -160,9 +149,15 @@ public function testExecuteAjaxRequestWithoutPermissions($acl, $isAllowed) ->method('getParam') ->with('namespace') ->willReturn($name); - $this->requestMock->expects($this->any()) - ->method('getParams') - ->willReturn([]); + + if ($isAllowed === false) { + $this->requestMock->expects($this->once()) + ->method('isAjax') + ->willReturn(true); + } + + $this->responseMock->expects($this->never()) + ->method('setRedirect'); $this->responseMock->expects($this->any()) ->method('appendBody') ->with($renderedData); @@ -180,6 +175,12 @@ public function testExecuteAjaxRequestWithoutPermissions($acl, $isAllowed) true, ['render'] ); + + $contextMock = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\ContextInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $contextMock->expects($this->any())->method('getAcceptType')->willReturn('html'); + $componentMock->expects($this->any()) ->method('render') ->willReturn($renderedData); @@ -190,6 +191,9 @@ public function testExecuteAjaxRequestWithoutPermissions($acl, $isAllowed) ->method('getData') ->with('acl') ->willReturn($acl); + $componentMock->expects($this->any()) + ->method('getContext') + ->willReturn($contextMock); $this->uiFactoryMock->expects($this->once()) ->method('create') ->willReturn($componentMock); @@ -208,4 +212,53 @@ public function executeAjaxRequestWithoutPermissionsDataProvider() ['', null], ]; } + + /** + * Prepares component mock. + * + * @param string $namespace + * @param string $renderedData + * @param string $acceptType + * @return \Magento\Framework\View\Element\UiComponentInterface|MockObject + */ + private function prepareComponent($namespace, $renderedData, $acceptType = 'html') + { + $this->requestMock->expects($this->any()) + ->method('getParam') + ->with('namespace') + ->willReturn($namespace); + $this->responseMock->expects($this->once()) + ->method('appendBody') + ->with($renderedData); + + /** @var \Magento\Framework\View\Element\UiComponentInterface|MockObject $componentMock */ + $componentMock = $this->getMockForAbstractClass( + \Magento\Framework\View\Element\UiComponentInterface::class, + [], + '', + false, + true, + true, + ['render'] + ); + $contextMock = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\ContextInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $contextMock->expects($this->once())->method('getAcceptType')->willReturn($acceptType); + + $componentMock->expects($this->once()) + ->method('render') + ->willReturn($renderedData); + $componentMock->expects($this->once()) + ->method('getChildComponents') + ->willReturn([]); + $componentMock->expects($this->once()) + ->method('getContext') + ->willReturn($contextMock); + $this->uiFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($componentMock); + + return $componentMock; + } } diff --git a/app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php b/app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php index dc661bfa1b602..2e9d861a44316 100644 --- a/app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php +++ b/app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/etc/adminhtml/routes.xml b/app/code/Magento/Ui/etc/adminhtml/routes.xml index 9b5a5d97f06d7..0e735c8aa64d5 100644 --- a/app/code/Magento/Ui/etc/adminhtml/routes.xml +++ b/app/code/Magento/Ui/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/etc/adminhtml/system.xml b/app/code/Magento/Ui/etc/adminhtml/system.xml index 796304ff790fc..74e2e076b93c8 100644 --- a/app/code/Magento/Ui/etc/adminhtml/system.xml +++ b/app/code/Magento/Ui/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/etc/config.xml b/app/code/Magento/Ui/etc/config.xml index 042d40eb5dcb5..061347848c2f3 100644 --- a/app/code/Magento/Ui/etc/config.xml +++ b/app/code/Magento/Ui/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/etc/data_source.xsd b/app/code/Magento/Ui/etc/data_source.xsd index 9d098f9998572..997a590c9b9fc 100644 --- a/app/code/Magento/Ui/etc/data_source.xsd +++ b/app/code/Magento/Ui/etc/data_source.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/etc/di.xml b/app/code/Magento/Ui/etc/di.xml index 39a2935c67df1..3b9803b72e26d 100644 --- a/app/code/Magento/Ui/etc/di.xml +++ b/app/code/Magento/Ui/etc/di.xml @@ -1,7 +1,7 @@ @@ -197,6 +197,7 @@ + Magento\Framework\Data\Argument\Interpreter\Constant configurableObjectArgumentInterpreterProxy configurableObjectArgumentInterpreterProxy arrayArgumentInterpreterProxy diff --git a/app/code/Magento/Ui/etc/module.xml b/app/code/Magento/Ui/etc/module.xml index f9e1c5f041fbb..20bd9de1567ee 100644 --- a/app/code/Magento/Ui/etc/module.xml +++ b/app/code/Magento/Ui/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/etc/ui_components.xsd b/app/code/Magento/Ui/etc/ui_components.xsd index aa84445ba1fb4..4edb1c1e0b9b0 100644 --- a/app/code/Magento/Ui/etc/ui_components.xsd +++ b/app/code/Magento/Ui/etc/ui_components.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/etc/ui_configuration.xsd b/app/code/Magento/Ui/etc/ui_configuration.xsd index adbe7e7cc8fd4..8fe8ce16ca44d 100644 --- a/app/code/Magento/Ui/etc/ui_configuration.xsd +++ b/app/code/Magento/Ui/etc/ui_configuration.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/etc/ui_definition.xsd b/app/code/Magento/Ui/etc/ui_definition.xsd index f50bb6dfbe788..0c4f59209c095 100644 --- a/app/code/Magento/Ui/etc/ui_definition.xsd +++ b/app/code/Magento/Ui/etc/ui_definition.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/etc/ui_template.xsd b/app/code/Magento/Ui/etc/ui_template.xsd index e8e088ffa9115..b3a3d8aff7250 100644 --- a/app/code/Magento/Ui/etc/ui_template.xsd +++ b/app/code/Magento/Ui/etc/ui_template.xsd @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/i18n/en_US.csv b/app/code/Magento/Ui/i18n/en_US.csv index f7f5b845ef8b6..109bebf1c836a 100644 --- a/app/code/Magento/Ui/i18n/en_US.csv +++ b/app/code/Magento/Ui/i18n/en_US.csv @@ -109,3 +109,25 @@ Ok,Ok Action,Action CSV,CSV "Excel XML","Excel XML" +"Please select one of the options above.","Please select one of the options above." +"Please select a file.","Please select a file." +"Please select one of the options.","Please select one of the options." +"Please enter a value less than or equal to %s.","Please enter a value less than or equal to %s." +"Please enter a value greater than or equal to %s.","Please enter a value greater than or equal to %s." +"Card type does not match credit card number.","Card type does not match credit card number." +"Credit card number does not match credit card type.","Credit card number does not match credit card type." +"Incorrect credit card expiration date.","Incorrect credit card expiration date." +"Please enter less or equal than %1 symbols.","Please enter less or equal than %1 symbols." +"Please enter more or equal than %1 symbols.","Please enter more or equal than %1 symbols." +"Please enter a valid value from list","Please enter a valid value from list" +"Please enter valid SKU key.","Please enter valid SKU key." +"Please enter a valid number.","Please enter a valid number." +"Admin is a required field in the each row.","Admin is a required field in the each row." +"Please fix this field.","Please fix this field." +"Please enter a valid date (ISO).","Please enter a valid date (ISO)." +"Please enter only digits.","Please enter only digits." +"Please enter the same value again.","Please enter the same value again." +"Please enter no more than {0} characters.","Please enter no more than {0} characters." +"Please enter at least {0} characters.","Please enter at least {0} characters." +"Please enter a value between {0} and {1} characters long.","Please enter a value between {0} and {1} characters long." +"Please enter a value between {0} and {1}.","Please enter a value between {0} and {1}." diff --git a/app/code/Magento/Ui/registration.php b/app/code/Magento/Ui/registration.php index e7976c82547b0..1904ac6c89fc3 100644 --- a/app/code/Magento/Ui/registration.php +++ b/app/code/Magento/Ui/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/requirejs-config.js b/app/code/Magento/Ui/view/base/requirejs-config.js index d0170d06c7697..8b7ceaf1e7f4c 100644 --- a/app/code/Magento/Ui/view/base/requirejs-config.js +++ b/app/code/Magento/Ui/view/base/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/templates/container/content/default.phtml b/app/code/Magento/Ui/view/base/templates/container/content/default.phtml index 1e805048885be..75f04eae82159 100644 --- a/app/code/Magento/Ui/view/base/templates/container/content/default.phtml +++ b/app/code/Magento/Ui/view/base/templates/container/content/default.phtml @@ -1,5 +1,5 @@ diff --git a/app/code/Magento/Ui/view/base/templates/control/button/default.phtml b/app/code/Magento/Ui/view/base/templates/control/button/default.phtml index 5fb56e2a35ffe..f420d55db7d58 100644 --- a/app/code/Magento/Ui/view/base/templates/control/button/default.phtml +++ b/app/code/Magento/Ui/view/base/templates/control/button/default.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/templates/layout/tabs/default.phtml b/app/code/Magento/Ui/view/base/templates/layout/tabs/default.phtml index ca5a5a769da09..f02aff60d9ff6 100644 --- a/app/code/Magento/Ui/view/base/templates/layout/tabs/default.phtml +++ b/app/code/Magento/Ui/view/base/templates/layout/tabs/default.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/ui_component/templates/container/default.xhtml b/app/code/Magento/Ui/view/base/ui_component/templates/container/default.xhtml index a3088c81e1af5..dd4a2038a53c4 100644 --- a/app/code/Magento/Ui/view/base/ui_component/templates/container/default.xhtml +++ b/app/code/Magento/Ui/view/base/ui_component/templates/container/default.xhtml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/view/base/ui_component/templates/export/button.xhtml b/app/code/Magento/Ui/view/base/ui_component/templates/export/button.xhtml index 5045d6dbad8eb..6dc91cf6b3d5b 100644 --- a/app/code/Magento/Ui/view/base/ui_component/templates/export/button.xhtml +++ b/app/code/Magento/Ui/view/base/ui_component/templates/export/button.xhtml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/view/base/ui_component/templates/form/collapsible.xhtml b/app/code/Magento/Ui/view/base/ui_component/templates/form/collapsible.xhtml index 82cb73533286c..baab52111aebe 100644 --- a/app/code/Magento/Ui/view/base/ui_component/templates/form/collapsible.xhtml +++ b/app/code/Magento/Ui/view/base/ui_component/templates/form/collapsible.xhtml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/view/base/ui_component/templates/form/default.xhtml b/app/code/Magento/Ui/view/base/ui_component/templates/form/default.xhtml index 1029a55892da9..5e0d699ed3edc 100644 --- a/app/code/Magento/Ui/view/base/ui_component/templates/form/default.xhtml +++ b/app/code/Magento/Ui/view/base/ui_component/templates/form/default.xhtml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/view/base/ui_component/templates/listing/default.xhtml b/app/code/Magento/Ui/view/base/ui_component/templates/listing/default.xhtml index 6b3feb43e27d7..88a8e42e2966b 100644 --- a/app/code/Magento/Ui/view/base/ui_component/templates/listing/default.xhtml +++ b/app/code/Magento/Ui/view/base/ui_component/templates/listing/default.xhtml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ui/view/base/web/js/block-loader.js b/app/code/Magento/Ui/view/base/web/js/block-loader.js index 419cbff22d214..f78f90ab893a0 100644 --- a/app/code/Magento/Ui/view/base/web/js/block-loader.js +++ b/app/code/Magento/Ui/view/base/web/js/block-loader.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/core/app.js b/app/code/Magento/Ui/view/base/web/js/core/app.js index d6b612dcde21b..10972111eb557 100644 --- a/app/code/Magento/Ui/view/base/web/js/core/app.js +++ b/app/code/Magento/Ui/view/base/web/js/core/app.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js b/app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js index 6f9bf5cc52859..f16166ec1f1c2 100644 --- a/app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js +++ b/app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/core/renderer/types.js b/app/code/Magento/Ui/view/base/web/js/core/renderer/types.js index 2335a0bc4805e..f7fc3b5d556dc 100644 --- a/app/code/Magento/Ui/view/base/web/js/core/renderer/types.js +++ b/app/code/Magento/Ui/view/base/web/js/core/renderer/types.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js index fefd4ba0fcf80..483ff17bf6a72 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows-grid.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows-grid.js index c0bd0156f5a0e..4cbb971073d79 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows-grid.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows-grid.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -104,9 +104,8 @@ define([ * @param {String|Number} recordId */ deleteRecord: function (index, recordId) { - this._super(); - this.updateInsertData(recordId); + this._super(); }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js index f8af2229fc871..a23a960030b46 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/record.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/record.js index 8ea9bd1e58d52..d3231de5cd549 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/record.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/record.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/adapter.js b/app/code/Magento/Ui/view/base/web/js/form/adapter.js index 0e3c4ce60f4f4..aa90521a2dbea 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/adapter.js +++ b/app/code/Magento/Ui/view/base/web/js/form/adapter.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/button-adapter.js b/app/code/Magento/Ui/view/base/web/js/form/button-adapter.js index 4d602ec9c4c69..0dfda3b9cd07d 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/button-adapter.js +++ b/app/code/Magento/Ui/view/base/web/js/form/button-adapter.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/client.js b/app/code/Magento/Ui/view/base/web/js/form/client.js index 2e12d60afb718..2872d959df107 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/client.js +++ b/app/code/Magento/Ui/view/base/web/js/form/client.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/area.js b/app/code/Magento/Ui/view/base/web/js/form/components/area.js index b0547d30f3057..4a778cc16d55e 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/area.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/area.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/button.js b/app/code/Magento/Ui/view/base/web/js/form/components/button.js index 81f93466bb8ab..1acd20abe2efd 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/button.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/button.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/collection.js b/app/code/Magento/Ui/view/base/web/js/form/components/collection.js index 7fe3bb9b74599..f1ee2ab036d2f 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/collection.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/collection.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js b/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js index 7557c8801f486..1ae998482d9df 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js b/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js index 5d0309d77883f..f7b86b4e7925d 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ @@ -109,14 +109,14 @@ define([ * @returns {Group} Chainable. */ _setClasses: function () { - var addtional = this.additionalClasses, + var additional = this.additionalClasses, classes; - if (_.isString(addtional)) { - addtional = this.additionalClasses.split(' '); + if (_.isString(additional)) { + additional = this.additionalClasses.split(' '); classes = this.additionalClasses = {}; - addtional.forEach(function (name) { + additional.forEach(function (name) { classes[name] = true; }, this); } diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/group.js b/app/code/Magento/Ui/view/base/web/js/form/components/group.js index 0ec4b88f8fc16..d9187a8f3c4e3 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/group.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/group.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ @@ -54,14 +54,14 @@ define([ * @returns {Group} Chainable. */ _setClasses: function () { - var addtional = this.additionalClasses, + var additional = this.additionalClasses, classes; - if (_.isString(addtional)) { - addtional = this.additionalClasses.split(' '); + if (_.isString(additional)) { + additional = this.additionalClasses.split(' '); classes = this.additionalClasses = {}; - addtional.forEach(function (name) { + additional.forEach(function (name) { classes[name] = true; }, this); } diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/html.js b/app/code/Magento/Ui/view/base/web/js/form/components/html.js index 5bb96f8c78892..67954b23ee821 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/html.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/html.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ @@ -16,7 +16,10 @@ define([ loading: false, visible: true, template: 'ui/content/content', - additionalClasses: {} + additionalClasses: {}, + ignoreTmpls: { + content: true + } }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/insert-form.js b/app/code/Magento/Ui/view/base/web/js/form/components/insert-form.js index c6c0e3de4e47c..b9533bca694f0 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/insert-form.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/insert-form.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/insert-listing.js b/app/code/Magento/Ui/view/base/web/js/form/components/insert-listing.js index afca916df367f..00928d3d999fe 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/insert-listing.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/insert-listing.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/insert.js b/app/code/Magento/Ui/view/base/web/js/form/components/insert.js index 6569266902b9b..3bc02321ededd 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/insert.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/insert.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/tab.js b/app/code/Magento/Ui/view/base/web/js/form/components/tab.js index 0cd56d1b093e5..317875bb45c98 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/tab.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/tab.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js b/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js index 83be734666034..fd05af453ddab 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js index 91234d0b20315..a7f2fdbd7d090 100755 --- a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -205,7 +205,7 @@ define([ }, /** - * Sets 'value' as 'hidden' propertie's value, triggers 'toggle' event, + * Sets 'value' as 'hidden' property's value, triggers 'toggle' event, * sets instance's hidden identifier in params storage based on * 'value'. * diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js b/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js index 813624b0928cb..6320ef5610d21 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/checkbox-set.js b/app/code/Magento/Ui/view/base/web/js/form/element/checkbox-set.js index 18f5722abe81b..3229e867ba292 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/checkbox-set.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/checkbox-set.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/country.js b/app/code/Magento/Ui/view/base/web/js/form/element/country.js index 4b857cc1ab18d..29c2a346e482f 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/country.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/country.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/date.js b/app/code/Magento/Ui/view/base/web/js/form/element/date.js index 99a7fd4ad72d6..916f9b2f214af 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/date.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/date.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js b/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js index 9e9fa5baec80e..c9a5dd5a1e702 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ @@ -304,7 +304,7 @@ define([ if (allowed.passed) { target.on('fileuploadsend', function (event, postData) { - postData.data.set('param_name', this.paramName); + postData.data.append('param_name', this.paramName); $(event.currentTarget).off('fileuploadsend'); }.bind(data)); diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/media.js b/app/code/Magento/Ui/view/base/web/js/form/element/media.js index 30b77626209f1..be156dc36b0c7 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/media.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/media.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js index c37c67c39d092..63a6ff7a6052b 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -49,7 +49,7 @@ define([ * @param {Array} data - current component value */ setPrepareToSendData: function (data) { - if (!data.length) { + if (_.isUndefined(data) || !data.length) { data = ''; } diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js index 66776725923e8..3d7cc4e954529 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/region.js b/app/code/Magento/Ui/view/base/web/js/form/element/region.js index faac496251ac4..2961fcce59bb4 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/region.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/region.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/select.js b/app/code/Magento/Ui/view/base/web/js/form/element/select.js index 0c266b9d2fc61..761685f6e8cd5 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/select.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-toggle-notice.js b/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-toggle-notice.js index bcad5c55080cb..a8fdb7178e49d 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-toggle-notice.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-toggle-notice.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-use-config.js b/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-use-config.js index b32d74ebeacb6..79beb2764ada7 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-use-config.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-use-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox.js b/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox.js index 5d4f6b48776d3..e67187f0f4f4a 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/text.js b/app/code/Magento/Ui/view/base/web/js/form/element/text.js index 779ed6b2fac83..3073813a8d82c 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/text.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/text.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js b/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js index be4157c67d5d2..a1c51fba21fa3 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/ui-select.js b/app/code/Magento/Ui/view/base/web/js/form/element/ui-select.js index f73f884263969..a10bd548694a4 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/ui-select.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/ui-select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/website.js b/app/code/Magento/Ui/view/base/web/js/form/element/website.js index a5b08dadcf2e1..9582bc939a690 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/website.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/website.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js b/app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js index 1697d78a7f48c..470e3d60eb770 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/form/form.js b/app/code/Magento/Ui/view/base/web/js/form/form.js index 1ef9e64393c37..0114e0e7cb921 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/form.js +++ b/app/code/Magento/Ui/view/base/web/js/form/form.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ @@ -38,7 +38,8 @@ define([ * @returns {Object} */ function collectData(items) { - var result = {}; + var result = {}, + name; items = Array.prototype.slice.call(items); @@ -54,6 +55,11 @@ define([ } break; + case 'select-multiple': + name = item.name.substring(0, item.name.length - 2); //remove [] from the name ending + result[name] = _.pluck(item.selectedOptions, 'value'); + break; + default: result[item.name] = item.value; } diff --git a/app/code/Magento/Ui/view/base/web/js/form/provider.js b/app/code/Magento/Ui/view/base/web/js/form/provider.js index 3e53979de381d..3c40c75105e75 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/provider.js +++ b/app/code/Magento/Ui/view/base/web/js/form/provider.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ @@ -17,6 +17,9 @@ define([ save: '${ $.submit_url }', beforeSave: '${ $.validate_url }' } + }, + ignoreTmpls: { + data: true } }, diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js index cd3a6bf9be78d..62afa33799ae7 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js index 03f0c2a69ead5..618fcdc54f047 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js index bee080483864c..21fe3c3ec6540 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js index 8436ff81da1f5..bc97448824bb2 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/onoff.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/onoff.js index 9f25cd47f8975..95f88915e1eb1 100755 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/onoff.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/onoff.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js index a52996f8db742..0d5e28d7c95ec 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js index e109b2cfdd6da..b9964cec57fb5 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js b/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js index 89e71b47f16dd..40246381e2705 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/storage.js b/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/storage.js index 31cb26a97aa2c..3415694cc2f55 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/storage.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/storage.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/controls/button/split.js b/app/code/Magento/Ui/view/base/web/js/grid/controls/button/split.js new file mode 100644 index 0000000000000..d37e80213f650 --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/js/grid/controls/button/split.js @@ -0,0 +1,17 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery' +], function ($) { + 'use strict'; + + return function (data, element) { + + $(element).on('click.splitDefault', '.action-default', function () { + $(this).siblings('.dropdown-menu').find('.item-default').trigger('click'); + }); + }; +}); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js b/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js index 6bb7a082e6e06..ae50eb0488deb 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/data-storage.js b/app/code/Magento/Ui/view/base/web/js/grid/data-storage.js index 642c9b6072745..bc1d909fe8414 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/data-storage.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/data-storage.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/dnd.js b/app/code/Magento/Ui/view/base/web/js/grid/dnd.js index 314348619e140..12e5c8da823c2 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/dnd.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/dnd.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/bulk.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/bulk.js index 59b4978555b89..c4baedae97c66 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/bulk.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/bulk.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/client.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/client.js index e38a8f1e9a169..a1fdd187965c8 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/client.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/client.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/editor-view.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/editor-view.js index c6d03010bbec0..7514db38348f8 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/editor-view.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/editor-view.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js index 0b201608b8e9c..41b549f3e2e41 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/record.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/record.js index 1b33355981341..16e394ffbb357 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/record.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/record.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/export.js b/app/code/Magento/Ui/view/base/web/js/grid/export.js index 6aae5b4ef9b01..1ad30dab5b0a2 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/export.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/export.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/chips.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/chips.js index 2a94e14d32da5..694169bff8df7 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/chips.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/chips.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js index 1fd73390cd228..f41ea5615d299 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js index cb801192610de..55275384133c6 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/listing.js b/app/code/Magento/Ui/view/base/web/js/grid/listing.js index d1e00374e064e..fc383a1bac88f 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/listing.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/listing.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js index cd7e749914b0d..911b3cf7f34c5 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js index 8a01ff014d3aa..6d9bf19f22110 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging/sizes.js b/app/code/Magento/Ui/view/base/web/js/grid/paging/sizes.js index 4998c89cc7271..bbf5efe70ecdb 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging/sizes.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging/sizes.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/provider.js b/app/code/Magento/Ui/view/base/web/js/grid/provider.js index 8b5997f840884..520f78e169fbb 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/provider.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/provider.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -27,6 +27,9 @@ define([ listens: { params: 'onParamsChange', requestConfig: 'updateRequestConfig' + }, + ignoreTmpls: { + data: true } }, diff --git a/app/code/Magento/Ui/view/base/web/js/grid/resize.js b/app/code/Magento/Ui/view/base/web/js/grid/resize.js index fe04d482d406e..f8154a92b004c 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/resize.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/resize.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/search/search.js b/app/code/Magento/Ui/view/base/web/js/grid/search/search.js index 01b2cdb713f43..24c1dfcb545e8 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/search/search.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/search/search.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/sticky/sticky.js b/app/code/Magento/Ui/view/base/web/js/grid/sticky/sticky.js index 90f695da17980..318d2db98437f 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/sticky/sticky.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/sticky/sticky.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/toolbar.js b/app/code/Magento/Ui/view/base/web/js/grid/toolbar.js index 036be579edcbb..ef0f2483b891a 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/toolbar.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/toolbar.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/tree-massactions.js b/app/code/Magento/Ui/view/base/web/js/grid/tree-massactions.js index 57e3a43245e56..0e590f8215a3c 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/tree-massactions.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/tree-massactions.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/collapsible.js b/app/code/Magento/Ui/view/base/web/js/lib/collapsible.js index 9c18c97dbc4cb..1afe59e316bef 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/collapsible.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/collapsible.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/class.js b/app/code/Magento/Ui/view/base/web/js/lib/core/class.js index 8cf4a6497254f..5bfa87e650271 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/class.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/class.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ @@ -27,12 +27,12 @@ define([ * Creates constructor function which allows * initialization without usage of a 'new' operator. * - * @param {Object} protoProps - Prototypal propeties of a new consturctor. - * @param {Function} consturctor - * @returns {Function} Created consturctor. + * @param {Object} protoProps - Prototypal properties of a new constructor. + * @param {Function} constructor + * @returns {Function} Created constructor. */ - function createConstructor(protoProps, consturctor) { - var UiClass = consturctor; + function createConstructor(protoProps, constructor) { + var UiClass = constructor; if (!UiClass) { @@ -61,7 +61,7 @@ define([ Class = createConstructor({ /** - * Entry point to the initialization of consturctors' instance. + * Entry point to the initialization of constructors' instance. * * @param {Object} [options={}] * @returns {Class} Chainable. diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/collection.js b/app/code/Magento/Ui/view/base/web/js/lib/core/collection.js index abfb0c2545799..f3b1199e683f3 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/collection.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/collection.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/element/element.js b/app/code/Magento/Ui/view/base/web/js/lib/core/element/element.js index a4b9d478567c3..54998df1cb72f 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/element/element.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/element/element.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/element/links.js b/app/code/Magento/Ui/view/base/web/js/lib/core/element/links.js index 918a881cc6206..edabbc2b84c96 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/element/links.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/element/links.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/events.js b/app/code/Magento/Ui/view/base/web/js/lib/core/events.js index ac540ecf9250b..097cf1552439a 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/events.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/events.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/storage/local.js b/app/code/Magento/Ui/view/base/web/js/lib/core/storage/local.js index 41dba4c928c6c..38afa2d71e3e1 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/storage/local.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/storage/local.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/key-codes.js b/app/code/Magento/Ui/view/base/web/js/lib/key-codes.js index e04c68118186b..d48092a1bb8fc 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/key-codes.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/key-codes.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/after-render.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/after-render.js index 9f44678e53df5..45c470b9e86b0 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/after-render.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/after-render.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/autoselect.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/autoselect.js index 350c478ddee0d..86641b89fadff 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/autoselect.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/autoselect.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/bind-html.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/bind-html.js index f6d6a54554800..fc2ae0bcc0708 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/bind-html.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/bind-html.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/bootstrap.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/bootstrap.js index 236dda8d68df1..b29d10a143117 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/bootstrap.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/bootstrap.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define(function (require) { diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/collapsible.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/collapsible.js index 20afa10f00686..057d626e08a40 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/collapsible.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/collapsible.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js index 1ef44a4031d6b..4d5b56413dcdd 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** Creates datepicker binding and registers in to ko.bindingHandlers object */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/fadeVisible.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/fadeVisible.js index 819ae4694f3e8..487d64f2a0eb5 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/fadeVisible.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/fadeVisible.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/i18n.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/i18n.js index 2d76217280c27..eb26f76d3a7ca 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/i18n.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/i18n.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/keyboard.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/keyboard.js index 990d8c1a9a076..e049ce2e6408f 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/keyboard.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/keyboard.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/mage-init.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/mage-init.js index f4dd857829cec..9124ffabb0373 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/mage-init.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/mage-init.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js index daad48d4618b7..951d73e29b826 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/outer_click.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/outer_click.js index cf2d2c8bcc932..cc9dc5e0a2202 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/outer_click.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/outer_click.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** Creates outerClick binding and registers in to ko.bindingHandlers object */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/range.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/range.js index f60882ad81f54..708bf56e07a5d 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/range.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/range.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/resizable.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/resizable.js index cbafdec12066b..130a351fac574 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/resizable.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/resizable.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js index 2a96198f8d157..088f0447f8ef0 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** Creates scope binding and registers in to ko.bindingHandlers object */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/simple-checked.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/simple-checked.js index 3ac920170c03f..faddfb609924e 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/simple-checked.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/simple-checked.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/staticChecked.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/staticChecked.js index 51785d14013cd..44a3d1f6a06b3 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/staticChecked.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/staticChecked.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/tooltip.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/tooltip.js index 8505520b310f4..0cf23bf247c09 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/tooltip.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/tooltip.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bootstrap.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bootstrap.js index 8ead6884dc570..5eafa981d579a 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bootstrap.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bootstrap.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** Loads all available knockout bindings, sets custom template engine, initializes knockout on page */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js index 2601486a8a649..5ecb1930dcaed 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/observable_array.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/observable_array.js index a768de38b2048..3f08dd35be1cc 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/observable_array.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/observable_array.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/engine.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/engine.js index 11cfe300cfbfc..93bdb1765c585 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/engine.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/engine.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/loader.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/loader.js index 5d5961f320442..9d77868817787 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/loader.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/loader.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/observable_source.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/observable_source.js index f126a1abf6478..98ffd83b56466 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/observable_source.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/observable_source.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/renderer.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/renderer.js index f1c51be0087ba..5c6e859006384 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/renderer.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/template/renderer.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js b/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js index 98261af055666..e04478a99afc5 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/spinner.js b/app/code/Magento/Ui/view/base/web/js/lib/spinner.js index e98e7a51226b5..7a955f95b2946 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/spinner.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/spinner.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/step-wizard.js b/app/code/Magento/Ui/view/base/web/js/lib/step-wizard.js index f110af57de1f3..35cd65d9fbabe 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/step-wizard.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/step-wizard.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // jscs:disable jsDoc diff --git a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js index 38cf168ad88b6..8104d4883dce6 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/validation/utils.js b/app/code/Magento/Ui/view/base/web/js/lib/validation/utils.js index 4ed81c10e0348..ba5c0d93ca277 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/validation/utils.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/validation/utils.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define(function () { diff --git a/app/code/Magento/Ui/view/base/web/js/lib/validation/validator.js b/app/code/Magento/Ui/view/base/web/js/lib/validation/validator.js index 936da2e54fc36..61e4706c4787c 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/validation/validator.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/validation/validator.js @@ -1,5 +1,5 @@ /* - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/async.js b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/async.js index 5d52acf0e4d38..37c6bdd7f40fe 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/async.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/async.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js index 3c6db4827a5ad..f6afdf7846388 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/dom-observer.js b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/dom-observer.js index b2fb171b5e178..4590af4f2d635 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/dom-observer.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/dom-observer.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js index 8b3a39b8ab847..2156def5048d5 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/modal/alert.js b/app/code/Magento/Ui/view/base/web/js/modal/alert.js index 241410bfa3abc..ef85f2c5132f8 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/alert.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/alert.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/modal/confirm.js b/app/code/Magento/Ui/view/base/web/js/modal/confirm.js index 2bde2afd6faff..a11865e644e1e 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/confirm.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/confirm.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modal-component.js b/app/code/Magento/Ui/view/base/web/js/modal/modal-component.js index 2dd75ae554d4a..d079b07cfded2 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/modal-component.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/modal-component.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modal.js b/app/code/Magento/Ui/view/base/web/js/modal/modal.js index 3c24f3db7ce9d..cb8831d6c7ad1 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/modal.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/modal.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modalToggle.js b/app/code/Magento/Ui/view/base/web/js/modal/modalToggle.js index 8a717557536e3..7990de1aa609e 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/modalToggle.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/modalToggle.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/base/web/js/modal/prompt.js b/app/code/Magento/Ui/view/base/web/js/modal/prompt.js index 9c4fcd6219694..316554e38b132 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/prompt.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/prompt.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/timeline/timeline-view.js b/app/code/Magento/Ui/view/base/web/js/timeline/timeline-view.js index 478ce528ae9cc..f3f1fa961c957 100644 --- a/app/code/Magento/Ui/view/base/web/js/timeline/timeline-view.js +++ b/app/code/Magento/Ui/view/base/web/js/timeline/timeline-view.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/js/timeline/timeline.js b/app/code/Magento/Ui/view/base/web/js/timeline/timeline.js index e86064a8606f8..7a1d50b8b937b 100644 --- a/app/code/Magento/Ui/view/base/web/js/timeline/timeline.js +++ b/app/code/Magento/Ui/view/base/web/js/timeline/timeline.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Ui/view/base/web/templates/area.html b/app/code/Magento/Ui/view/base/web/templates/area.html index 9d32e2a795104..1b100f26a9c5f 100644 --- a/app/code/Magento/Ui/view/base/web/templates/area.html +++ b/app/code/Magento/Ui/view/base/web/templates/area.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/block-loader.html b/app/code/Magento/Ui/view/base/web/templates/block-loader.html index 0f879e469371e..3d8b730a9e8c5 100644 --- a/app/code/Magento/Ui/view/base/web/templates/block-loader.html +++ b/app/code/Magento/Ui/view/base/web/templates/block-loader.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/collection.html b/app/code/Magento/Ui/view/base/web/templates/collection.html index 1c515e5d311b7..fec48a2b06061 100644 --- a/app/code/Magento/Ui/view/base/web/templates/collection.html +++ b/app/code/Magento/Ui/view/base/web/templates/collection.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/content/content.html b/app/code/Magento/Ui/view/base/web/templates/content/content.html index 3fee830c6bf40..8cf47120865dc 100644 --- a/app/code/Magento/Ui/view/base/web/templates/content/content.html +++ b/app/code/Magento/Ui/view/base/web/templates/content/content.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/action-delete.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/action-delete.html index 209f6354f52de..f3125e7e9debe 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/action-delete.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/action-delete.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/dnd.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/dnd.html index 3068964174784..17295be060c84 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/dnd.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/dnd.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/text.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/text.html index a8bc63109a688..fcd4e3b74442b 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/text.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/text.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/thumbnail.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/thumbnail.html index 5b74e4230fe42..1bff60064b983 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/thumbnail.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/thumbnail.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/collapsible.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/collapsible.html index 6882d43b5c700..cc25075117a5a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/collapsible.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/collapsible.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/default.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/default.html index 6bb7da7cbaaf4..2d312bfb5f010 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/default.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/default.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html index 712d9d0de2fad..0c0d6ad378ce6 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/collection.html b/app/code/Magento/Ui/view/base/web/templates/form/collection.html index 72a0189ddb26e..5006c3eb68693 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/collection.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/collection.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/button/container.html b/app/code/Magento/Ui/view/base/web/templates/form/components/button/container.html index 4043db33abd09..14ce257ae400a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/button/container.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/button/container.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/button/simple.html b/app/code/Magento/Ui/view/base/web/templates/form/components/button/simple.html index 4d9f86697f449..a7d61aa80b1a4 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/button/simple.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/button/simple.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/collection.html b/app/code/Magento/Ui/view/base/web/templates/form/components/collection.html index 75b5832027767..e153beab8748b 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/collection.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/collection.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/collection/preview.html b/app/code/Magento/Ui/view/base/web/templates/form/components/collection/preview.html index 9ace6f80c569a..2c0ce802b4bc0 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/collection/preview.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/collection/preview.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/complex.html b/app/code/Magento/Ui/view/base/web/templates/form/components/complex.html index 13bfc88d98238..cb7f9882e2f05 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/complex.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/complex.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/single/checkbox.html b/app/code/Magento/Ui/view/base/web/templates/form/components/single/checkbox.html index 9085e9f6368bd..5b2f27ce0c54e 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/single/checkbox.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/single/checkbox.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/single/field.html b/app/code/Magento/Ui/view/base/web/templates/form/components/single/field.html index eb00b278acfaf..9018efc28aa21 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/single/field.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/single/field.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/single/radio.html b/app/code/Magento/Ui/view/base/web/templates/form/components/single/radio.html index 95f604ad0397b..b962d3a733c71 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/single/radio.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/single/radio.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/single/switcher.html b/app/code/Magento/Ui/view/base/web/templates/form/components/single/switcher.html index aac8bc8dbf9aa..ea6af0db5a2b8 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/components/single/switcher.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/components/single/switcher.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/button.html b/app/code/Magento/Ui/view/base/web/templates/form/element/button.html index 432816f37a2ee..62154ca8e9bb3 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/button.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/button.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox-set.html b/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox-set.html index 2a44c516850ad..79478d2417110 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox-set.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox-set.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html b/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html index 31bbaa2a82891..0bf2a2c8be48d 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/date.html b/app/code/Magento/Ui/view/base/web/templates/form/element/date.html index e278455e12d2a..aca560a07a26f 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/date.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/date.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/email.html b/app/code/Magento/Ui/view/base/web/templates/form/element/email.html index 00306b78ad620..f3eca6a9d028f 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/email.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/email.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/fallback-reset.html b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/fallback-reset.html index 4bad21fc81a1a..df30574cdc4d5 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/fallback-reset.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/fallback-reset.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html index 911c1e20b0065..e3c3ab5b5df5c 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/tooltip.html b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/tooltip.html index b5d68b9b5e34b..3d41fc41fe239 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/tooltip.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/tooltip.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/hidden.html b/app/code/Magento/Ui/view/base/web/templates/form/element/hidden.html index dd0d5fbd10150..5c6dc3ca4c72e 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/hidden.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/hidden.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/input.html b/app/code/Magento/Ui/view/base/web/templates/form/element/input.html index b923b7e7b4475..9e4b37b66297e 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/input.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/input.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/media.html b/app/code/Magento/Ui/view/base/web/templates/form/element/media.html index b42e955fed5ec..ec9a5b157bcce 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/media.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/media.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html b/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html index 6661dcfa42cb7..cd7a407ce691c 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/preview.html b/app/code/Magento/Ui/view/base/web/templates/form/element/preview.html index c1f3609d7295e..e1eedf45eeeb7 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/preview.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/preview.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/price.html b/app/code/Magento/Ui/view/base/web/templates/form/element/price.html index ae2155912cc25..379267a3876f4 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/price.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/price.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/radio.html b/app/code/Magento/Ui/view/base/web/templates/form/element/radio.html index d7aea465eade2..e32c473a882b2 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/radio.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/radio.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/select.html b/app/code/Magento/Ui/view/base/web/templates/form/element/select.html index f7515b92c46e2..933328d229fe9 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/select.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/select.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/split-button.html b/app/code/Magento/Ui/view/base/web/templates/form/element/split-button.html index ea8873fa395ce..c1a5b9e89809c 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/split-button.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/split-button.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/switcher.html b/app/code/Magento/Ui/view/base/web/templates/form/element/switcher.html index f09865d0e53c2..0f43b0a030944 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/switcher.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/switcher.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html b/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html index e07e4056af2dd..23a8987ee2be1 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/preview.html b/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/preview.html index d9285957257b1..503c88092498e 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/preview.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/preview.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html b/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html index 95ac7134f209a..37120a66eceea 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/wysiwyg.html b/app/code/Magento/Ui/view/base/web/templates/form/element/wysiwyg.html index 04408cb845d43..05a2db4848271 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/wysiwyg.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/wysiwyg.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/field.html b/app/code/Magento/Ui/view/base/web/templates/form/field.html index 1d3b1cfc8895c..9036a0be1dbd0 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/field.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/field.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/fieldset.html b/app/code/Magento/Ui/view/base/web/templates/form/fieldset.html index a97eb85b225dc..2859cd24234a1 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/fieldset.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/fieldset.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/form/insert.html b/app/code/Magento/Ui/view/base/web/templates/form/insert.html index bf97bf8fbf01a..e19b2784e6bc6 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/insert.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/insert.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/actions.html b/app/code/Magento/Ui/view/base/web/templates/grid/actions.html index e9944a63bbbfe..ca301d603b1b5 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/actions.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/actions.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html index c7b0c49af3dcd..ccaec7b3a2192 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/html.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/html.html index 032b67d3b2fca..cdd0e4b35d398 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/html.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/html.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html index 7cc068fe723ec..a176150e024da 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/onoff.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/onoff.html index f927f578f0d1e..8244599ff87ba 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/onoff.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/onoff.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/text.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/text.html index 725e6409feb8b..036e5a9821f13 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/text.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/text.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/thumbnail.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/thumbnail.html index 16447ab9f64d3..705becce75a0a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/thumbnail.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/thumbnail.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/thumbnail/preview.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/thumbnail/preview.html index bc62199abeab9..b14a423dd8273 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/thumbnail/preview.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/thumbnail/preview.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html b/app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html index 5e10572651352..18dd49bd56ee3 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/columns/onoff.html b/app/code/Magento/Ui/view/base/web/templates/grid/columns/onoff.html index a5db2f959ca85..b8ee9fb8694c8 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/columns/onoff.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/columns/onoff.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/columns/text.html b/app/code/Magento/Ui/view/base/web/templates/grid/columns/text.html index 1b29c95f1e5c1..5afc83f485af1 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/columns/text.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/columns/text.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html index e338f76686b7b..3ef64fd4b5371 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html index a424d8040735b..b52669e2cd28d 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.html b/app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.html index 627848b0d58f3..f47e1509b4c38 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/controls/columns.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/editing/bulk.html b/app/code/Magento/Ui/view/base/web/templates/grid/editing/bulk.html index 32c078d5eaa82..a11e56a68dab2 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/editing/bulk.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/editing/bulk.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/editing/field.html b/app/code/Magento/Ui/view/base/web/templates/grid/editing/field.html index 3cd1953d53539..80eea8ef0e61c 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/editing/field.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/editing/field.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/editing/header-buttons.html b/app/code/Magento/Ui/view/base/web/templates/grid/editing/header-buttons.html index b79e45eaf6f81..94fa74fba0e96 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/editing/header-buttons.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/editing/header-buttons.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/editing/row-buttons.html b/app/code/Magento/Ui/view/base/web/templates/grid/editing/row-buttons.html index 6545e85222e68..639653cef64f7 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/editing/row-buttons.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/editing/row-buttons.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/editing/row.html b/app/code/Magento/Ui/view/base/web/templates/grid/editing/row.html index 10ec4665c992e..4b3109e522f0b 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/editing/row.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/editing/row.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/exportButton.html b/app/code/Magento/Ui/view/base/web/templates/grid/exportButton.html index f8ff827add0b8..0f2057740146b 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/exportButton.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/exportButton.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/chips.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/chips.html index be9acf065682b..1ed09c421eb38 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/chips.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/chips.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/group.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/group.html index 1375c1b1bd73a..ba425928304ec 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/group.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/group.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select-optgroup.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select-optgroup.html index 4171953cd26fc..56244422a6b43 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select-optgroup.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select-optgroup.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html index e3751a80ce6a3..4038f65738041 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/field.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/field.html index cfd818772bae9..46cadbae5d5ce 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/field.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/field.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/filters.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/filters.html index 7922d115e0223..2af1a430a6e00 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/filters.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/filters.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/listing.html b/app/code/Magento/Ui/view/base/web/templates/grid/listing.html index 3f1c9a47b9702..c4aa896154388 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/listing.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/listing.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/paging-total.html b/app/code/Magento/Ui/view/base/web/templates/grid/paging-total.html index 7bf15bd06004f..234bf3cc687d3 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/paging-total.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/paging-total.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/paging/paging-detailed-total.html b/app/code/Magento/Ui/view/base/web/templates/grid/paging/paging-detailed-total.html index 28c71dbe9d876..e3cb1a853b55b 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/paging/paging-detailed-total.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/paging/paging-detailed-total.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/paging/paging.html b/app/code/Magento/Ui/view/base/web/templates/grid/paging/paging.html index 21cdc81c4742d..9c993eb155d1f 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/paging/paging.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/paging/paging.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/paging/sizes.html b/app/code/Magento/Ui/view/base/web/templates/grid/paging/sizes.html index 42f48f558658f..be78e3644e602 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/paging/sizes.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/paging/sizes.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/search/search.html b/app/code/Magento/Ui/view/base/web/templates/grid/search/search.html index b89bb42c3b626..39d996e05c3a6 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/search/search.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/search/search.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/sticky/filters.html b/app/code/Magento/Ui/view/base/web/templates/grid/sticky/filters.html index 1d71a700c1663..dce3dda07485b 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/sticky/filters.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/sticky/filters.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/sticky/listing.html b/app/code/Magento/Ui/view/base/web/templates/grid/sticky/listing.html index ef81b9274bd88..56531ffba5c5f 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/sticky/listing.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/sticky/listing.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/sticky/sticky.html b/app/code/Magento/Ui/view/base/web/templates/grid/sticky/sticky.html index 71b5199a8392c..0bd5ea06dbf86 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/sticky/sticky.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/sticky/sticky.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/submenu.html b/app/code/Magento/Ui/view/base/web/templates/grid/submenu.html index dd8a11d28b3d4..c5d87a4b16c4e 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/submenu.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/submenu.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/toolbar.html b/app/code/Magento/Ui/view/base/web/templates/grid/toolbar.html index f9bfc4b59775a..29b71a1d7cf34 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/toolbar.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/toolbar.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/tree-massactions.html b/app/code/Magento/Ui/view/base/web/templates/grid/tree-massactions.html index 78d52a26cbeaa..1aeb48b7c7698 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/tree-massactions.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/tree-massactions.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/view-switcher.html b/app/code/Magento/Ui/view/base/web/templates/grid/view-switcher.html index 5151541f54a8c..707637308605a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/view-switcher.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/view-switcher.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/group/group.html b/app/code/Magento/Ui/view/base/web/templates/group/group.html index dbe5f95090ff6..40aa8dd4f54f5 100644 --- a/app/code/Magento/Ui/view/base/web/templates/group/group.html +++ b/app/code/Magento/Ui/view/base/web/templates/group/group.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/modal/modal-component.html b/app/code/Magento/Ui/view/base/web/templates/modal/modal-component.html index 7380c17ebf289..73647b8356c01 100644 --- a/app/code/Magento/Ui/view/base/web/templates/modal/modal-component.html +++ b/app/code/Magento/Ui/view/base/web/templates/modal/modal-component.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/modal/modal-custom.html b/app/code/Magento/Ui/view/base/web/templates/modal/modal-custom.html index ae1f1ac3e1395..e364ab7804d7c 100644 --- a/app/code/Magento/Ui/view/base/web/templates/modal/modal-custom.html +++ b/app/code/Magento/Ui/view/base/web/templates/modal/modal-custom.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/modal/modal-popup.html b/app/code/Magento/Ui/view/base/web/templates/modal/modal-popup.html index 0be2cb14909e6..0b54acce99cc1 100644 --- a/app/code/Magento/Ui/view/base/web/templates/modal/modal-popup.html +++ b/app/code/Magento/Ui/view/base/web/templates/modal/modal-popup.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/modal/modal-slide.html b/app/code/Magento/Ui/view/base/web/templates/modal/modal-slide.html index 4f5784ede4569..beba3c136a960 100644 --- a/app/code/Magento/Ui/view/base/web/templates/modal/modal-slide.html +++ b/app/code/Magento/Ui/view/base/web/templates/modal/modal-slide.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/tab.html b/app/code/Magento/Ui/view/base/web/templates/tab.html index 0db57170a3174..b59a1d2c1918a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/tab.html +++ b/app/code/Magento/Ui/view/base/web/templates/tab.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/timeline/record.html b/app/code/Magento/Ui/view/base/web/templates/timeline/record.html index e150c183fb52e..cfd07689faf0c 100644 --- a/app/code/Magento/Ui/view/base/web/templates/timeline/record.html +++ b/app/code/Magento/Ui/view/base/web/templates/timeline/record.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/timeline/timeline.html b/app/code/Magento/Ui/view/base/web/templates/timeline/timeline.html index c8b0aa37896f0..1b90fba8411c9 100644 --- a/app/code/Magento/Ui/view/base/web/templates/timeline/timeline.html +++ b/app/code/Magento/Ui/view/base/web/templates/timeline/timeline.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/base/web/templates/tooltip/tooltip.html b/app/code/Magento/Ui/view/base/web/templates/tooltip/tooltip.html index 0f4f964dc1bdf..85bddfc3c9ee9 100644 --- a/app/code/Magento/Ui/view/base/web/templates/tooltip/tooltip.html +++ b/app/code/Magento/Ui/view/base/web/templates/tooltip/tooltip.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/js/model/messageList.js b/app/code/Magento/Ui/view/frontend/web/js/model/messageList.js index 099ce7a0e1d19..7ed70c17820ca 100644 --- a/app/code/Magento/Ui/view/frontend/web/js/model/messageList.js +++ b/app/code/Magento/Ui/view/frontend/web/js/model/messageList.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define( diff --git a/app/code/Magento/Ui/view/frontend/web/js/model/messages.js b/app/code/Magento/Ui/view/frontend/web/js/model/messages.js index 8f65f6ce416a6..7df6491578aec 100644 --- a/app/code/Magento/Ui/view/frontend/web/js/model/messages.js +++ b/app/code/Magento/Ui/view/frontend/web/js/model/messages.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/frontend/web/js/view/messages.js b/app/code/Magento/Ui/view/frontend/web/js/view/messages.js index c6b751b635ac2..997b5c23ae3ef 100644 --- a/app/code/Magento/Ui/view/frontend/web/js/view/messages.js +++ b/app/code/Magento/Ui/view/frontend/web/js/view/messages.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Ui/view/frontend/web/template/messages.html b/app/code/Magento/Ui/view/frontend/web/template/messages.html index c2fb97e3e67de..38c6a6857b17f 100644 --- a/app/code/Magento/Ui/view/frontend/web/template/messages.html +++ b/app/code/Magento/Ui/view/frontend/web/template/messages.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/element/checkbox.html b/app/code/Magento/Ui/view/frontend/web/templates/form/element/checkbox.html index ee95777607775..365aa4d256e03 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/element/checkbox.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/element/checkbox.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/element/date.html b/app/code/Magento/Ui/view/frontend/web/templates/form/element/date.html index f140cfc8c7571..a9d4c468e1416 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/element/date.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/element/date.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/element/email.html b/app/code/Magento/Ui/view/frontend/web/templates/form/element/email.html index 4788b47267a58..0949dcb6888d5 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/element/email.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/element/email.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/element/helper/tooltip.html b/app/code/Magento/Ui/view/frontend/web/templates/form/element/helper/tooltip.html index 4f3dc8842b062..734cef541e15d 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/element/helper/tooltip.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/element/helper/tooltip.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/element/input.html b/app/code/Magento/Ui/view/frontend/web/templates/form/element/input.html index 5806448cfbad6..253c7087259ed 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/element/input.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/element/input.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/element/password.html b/app/code/Magento/Ui/view/frontend/web/templates/form/element/password.html index 563e1dba41b17..5f1ccce76f8e1 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/element/password.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/element/password.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/element/select.html b/app/code/Magento/Ui/view/frontend/web/templates/form/element/select.html index c6d6e4d286b7a..c48808af35a10 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/element/select.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/element/select.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/field.html b/app/code/Magento/Ui/view/frontend/web/templates/form/field.html index 40dc58cbb5673..2be5b9bd2c185 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/field.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/field.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ui/view/frontend/web/templates/group/group.html b/app/code/Magento/Ui/view/frontend/web/templates/group/group.html index 9dd5e5ae81649..292306adb98cc 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/group/group.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/group/group.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ups/Block/Backend/System/CarrierConfig.php b/app/code/Magento/Ups/Block/Backend/System/CarrierConfig.php index f314a661cfe0d..4f6d5a74ca651 100644 --- a/app/code/Magento/Ups/Block/Backend/System/CarrierConfig.php +++ b/app/code/Magento/Ups/Block/Backend/System/CarrierConfig.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ups/etc/config.xml b/app/code/Magento/Ups/etc/config.xml index 1f5deecc130d6..7dd47b6bf673b 100644 --- a/app/code/Magento/Ups/etc/config.xml +++ b/app/code/Magento/Ups/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ups/etc/di.xml b/app/code/Magento/Ups/etc/di.xml index 3e07640c4a0b8..cb57ab6c7cd9b 100644 --- a/app/code/Magento/Ups/etc/di.xml +++ b/app/code/Magento/Ups/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ups/etc/module.xml b/app/code/Magento/Ups/etc/module.xml index 3de439c11d3a4..b0500b9aa4f90 100644 --- a/app/code/Magento/Ups/etc/module.xml +++ b/app/code/Magento/Ups/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ups/registration.php b/app/code/Magento/Ups/registration.php index 655813d652eef..c8350005cb1c1 100644 --- a/app/code/Magento/Ups/registration.php +++ b/app/code/Magento/Ups/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ups/view/adminhtml/templates/system/shipping/carrier_config.phtml b/app/code/Magento/Ups/view/adminhtml/templates/system/shipping/carrier_config.phtml index 7651750180f31..b8041d3be417f 100644 --- a/app/code/Magento/Ups/view/adminhtml/templates/system/shipping/carrier_config.phtml +++ b/app/code/Magento/Ups/view/adminhtml/templates/system/shipping/carrier_config.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Ups/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Ups/view/frontend/layout/checkout_index_index.xml index 99ac83dec0653..62ad2f75d4a97 100644 --- a/app/code/Magento/Ups/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Ups/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Ups/view/frontend/web/js/model/shipping-rates-validation-rules.js b/app/code/Magento/Ups/view/frontend/web/js/model/shipping-rates-validation-rules.js index 047ede941b4a7..266dd473f4c24 100644 --- a/app/code/Magento/Ups/view/frontend/web/js/model/shipping-rates-validation-rules.js +++ b/app/code/Magento/Ups/view/frontend/web/js/model/shipping-rates-validation-rules.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global define*/ diff --git a/app/code/Magento/Ups/view/frontend/web/js/model/shipping-rates-validator.js b/app/code/Magento/Ups/view/frontend/web/js/model/shipping-rates-validator.js index 3b746c8967feb..56ad202599339 100644 --- a/app/code/Magento/Ups/view/frontend/web/js/model/shipping-rates-validator.js +++ b/app/code/Magento/Ups/view/frontend/web/js/model/shipping-rates-validator.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global define*/ diff --git a/app/code/Magento/Ups/view/frontend/web/js/view/shipping-rates-validation.js b/app/code/Magento/Ups/view/frontend/web/js/view/shipping-rates-validation.js index 17d7d70221eac..6c9511ff67099 100644 --- a/app/code/Magento/Ups/view/frontend/web/js/view/shipping-rates-validation.js +++ b/app/code/Magento/Ups/view/frontend/web/js/view/shipping-rates-validation.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*browser:true*/ diff --git a/app/code/Magento/UrlRewrite/Block/Catalog/Category/Edit.php b/app/code/Magento/UrlRewrite/Block/Catalog/Category/Edit.php index f484089c0634f..e3f794dba8e06 100644 --- a/app/code/Magento/UrlRewrite/Block/Catalog/Category/Edit.php +++ b/app/code/Magento/UrlRewrite/Block/Catalog/Category/Edit.php @@ -1,6 +1,6 @@ _getProduct()->getId()) { - $this->_addProductLinkBlock($this->_getProduct()); + $this->_addProductLinkBlock(); } if ($this->_getCategory()->getId()) { diff --git a/app/code/Magento/UrlRewrite/Block/Catalog/Product/Grid.php b/app/code/Magento/UrlRewrite/Block/Catalog/Product/Grid.php index 3114c3f1f0def..cac5752ac3bda 100644 --- a/app/code/Magento/UrlRewrite/Block/Catalog/Product/Grid.php +++ b/app/code/Magento/UrlRewrite/Block/Catalog/Product/Grid.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/UrlRewrite/etc/adminhtml/menu.xml b/app/code/Magento/UrlRewrite/etc/adminhtml/menu.xml index 6fe623fbf868a..615e17dbb7af8 100644 --- a/app/code/Magento/UrlRewrite/etc/adminhtml/menu.xml +++ b/app/code/Magento/UrlRewrite/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/UrlRewrite/etc/adminhtml/routes.xml b/app/code/Magento/UrlRewrite/etc/adminhtml/routes.xml index 0c4c85852f7c5..9b705928fc66f 100644 --- a/app/code/Magento/UrlRewrite/etc/adminhtml/routes.xml +++ b/app/code/Magento/UrlRewrite/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/UrlRewrite/etc/config.xml b/app/code/Magento/UrlRewrite/etc/config.xml index dc6bcf7690559..c81bf286ba88c 100644 --- a/app/code/Magento/UrlRewrite/etc/config.xml +++ b/app/code/Magento/UrlRewrite/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/UrlRewrite/etc/di.xml b/app/code/Magento/UrlRewrite/etc/di.xml index d0d9325fac6f5..dfeb5d026d508 100644 --- a/app/code/Magento/UrlRewrite/etc/di.xml +++ b/app/code/Magento/UrlRewrite/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/UrlRewrite/etc/frontend/di.xml b/app/code/Magento/UrlRewrite/etc/frontend/di.xml index 6b879c3f72afc..d46bb1c5d14a2 100644 --- a/app/code/Magento/UrlRewrite/etc/frontend/di.xml +++ b/app/code/Magento/UrlRewrite/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/UrlRewrite/etc/module.xml b/app/code/Magento/UrlRewrite/etc/module.xml index 284c67950ac53..2d2463b61b30e 100644 --- a/app/code/Magento/UrlRewrite/etc/module.xml +++ b/app/code/Magento/UrlRewrite/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/UrlRewrite/registration.php b/app/code/Magento/UrlRewrite/registration.php index f8e717dc2e0ff..7a37111ef15bb 100644 --- a/app/code/Magento/UrlRewrite/registration.php +++ b/app/code/Magento/UrlRewrite/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/UrlRewrite/view/adminhtml/templates/categories.phtml b/app/code/Magento/UrlRewrite/view/adminhtml/templates/categories.phtml index fda675df2deac..52aaa10c8482d 100644 --- a/app/code/Magento/UrlRewrite/view/adminhtml/templates/categories.phtml +++ b/app/code/Magento/UrlRewrite/view/adminhtml/templates/categories.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/User/etc/adminhtml/di.xml b/app/code/Magento/User/etc/adminhtml/di.xml index 95d73b68e797c..58c34552f8c54 100755 --- a/app/code/Magento/User/etc/adminhtml/di.xml +++ b/app/code/Magento/User/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/adminhtml/events.xml b/app/code/Magento/User/etc/adminhtml/events.xml index 6c1c33843001e..0568f1d749a15 100755 --- a/app/code/Magento/User/etc/adminhtml/events.xml +++ b/app/code/Magento/User/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/adminhtml/menu.xml b/app/code/Magento/User/etc/adminhtml/menu.xml index 5ccb08f0443e1..c1bfe93f1d26e 100644 --- a/app/code/Magento/User/etc/adminhtml/menu.xml +++ b/app/code/Magento/User/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/adminhtml/routes.xml b/app/code/Magento/User/etc/adminhtml/routes.xml index b864562249363..29b1968713ee2 100644 --- a/app/code/Magento/User/etc/adminhtml/routes.xml +++ b/app/code/Magento/User/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/adminhtml/system.xml b/app/code/Magento/User/etc/adminhtml/system.xml index 0abcb3e1c37b9..6c57b268968c3 100644 --- a/app/code/Magento/User/etc/adminhtml/system.xml +++ b/app/code/Magento/User/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/config.xml b/app/code/Magento/User/etc/config.xml index f57bb8c1a329d..f6a3924b5a27d 100644 --- a/app/code/Magento/User/etc/config.xml +++ b/app/code/Magento/User/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/di.xml b/app/code/Magento/User/etc/di.xml index c4383e5561ae8..e235f0fd6fa0f 100644 --- a/app/code/Magento/User/etc/di.xml +++ b/app/code/Magento/User/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/email_templates.xml b/app/code/Magento/User/etc/email_templates.xml index c21f955dc424e..b998f304c249b 100644 --- a/app/code/Magento/User/etc/email_templates.xml +++ b/app/code/Magento/User/etc/email_templates.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/module.xml b/app/code/Magento/User/etc/module.xml index 1b766e35afbcc..ca92dd552a372 100644 --- a/app/code/Magento/User/etc/module.xml +++ b/app/code/Magento/User/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/etc/webapi_rest/di.xml b/app/code/Magento/User/etc/webapi_rest/di.xml index b8f1a692ff1b3..7c6cccb454df7 100644 --- a/app/code/Magento/User/etc/webapi_rest/di.xml +++ b/app/code/Magento/User/etc/webapi_rest/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/registration.php b/app/code/Magento/User/registration.php index 79c72e95e8527..8089a69fb659a 100644 --- a/app/code/Magento/User/registration.php +++ b/app/code/Magento/User/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/User/view/adminhtml/email/user_notification.html b/app/code/Magento/User/view/adminhtml/email/user_notification.html index 043f51a104f42..3b6ffb2ce14b1 100644 --- a/app/code/Magento/User/view/adminhtml/email/user_notification.html +++ b/app/code/Magento/User/view/adminhtml/email/user_notification.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml index ce94fb5aefa63..a08275f951d29 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_login.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_login.xml index f63f32a41be33..538013109c0f3 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_login.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_login.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_resetpassword.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_resetpassword.xml index 8ac4b22aa6bdf..a1a2fbfc091d8 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_resetpassword.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_resetpassword.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_block.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_block.xml index b9d350ef4d61b..326e7d3734916 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_block.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_grid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_grid.xml index 0de6ff640be6a..3478b72214d8f 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_grid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_grid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_index.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_index.xml index 8d51c3e2e014f..94518aeef49f8 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_index.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml index 315b38f7c65e2..d765f89f2b19f 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml index 9bd4d914b80b1..b182dc7a4afbf 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_index.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_index.xml index 7ee73649ef317..6934fbdd2a040 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_index.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrole.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrole.xml index b788617786c1c..2e0418f9b0efc 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrole.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrole.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrolegrid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrolegrid.xml index 686cad695300a..2c71d6c6d1718 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrolegrid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrolegrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_grid_block.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_grid_block.xml index e9d8b1bcc32e5..a33d96868026a 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_grid_block.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_index.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_index.xml index 5f2d1a4042c02..78ed1d8ca5ced 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_index.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_rolegrid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_rolegrid.xml index f035a223bea19..44611f3153ff4 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_rolegrid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_rolegrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolegrid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolegrid.xml index 067482fd80750..4e72ffbfdcda5 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolegrid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolegrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolesgrid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolesgrid.xml index 31a2087113964..d56866d468419 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolesgrid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolesgrid.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/User/view/adminhtml/requirejs-config.js b/app/code/Magento/User/view/adminhtml/requirejs-config.js index 6da7677277502..68878edb5f49a 100644 --- a/app/code/Magento/User/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/User/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/User/view/adminhtml/templates/admin/forgotpassword.phtml b/app/code/Magento/User/view/adminhtml/templates/admin/forgotpassword.phtml index b3b64ff91f6e2..efb70200bca0b 100644 --- a/app/code/Magento/User/view/adminhtml/templates/admin/forgotpassword.phtml +++ b/app/code/Magento/User/view/adminhtml/templates/admin/forgotpassword.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/User/view/adminhtml/templates/role/users.phtml b/app/code/Magento/User/view/adminhtml/templates/role/users.phtml index 06311f74aec55..85291ddd65f3e 100644 --- a/app/code/Magento/User/view/adminhtml/templates/role/users.phtml +++ b/app/code/Magento/User/view/adminhtml/templates/role/users.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/User/view/adminhtml/templates/role/users_grid_js.phtml b/app/code/Magento/User/view/adminhtml/templates/role/users_grid_js.phtml index 5014748ce5762..ca8747ef8501b 100644 --- a/app/code/Magento/User/view/adminhtml/templates/role/users_grid_js.phtml +++ b/app/code/Magento/User/view/adminhtml/templates/role/users_grid_js.phtml @@ -1,6 +1,6 @@ _result; } + /** + * @inheritdoc + * Starting from 23.02.2018 USPS doesn't allow to create free shipping labels via their API. + */ + public function isShippingLabelsAvailable() + { + return false; + } + /** * Get quotes * @@ -416,9 +425,13 @@ protected function _getXmlQuotes() if (!$service) { $service = $r->getService(); } - if ($r->getContainer() == 'FLAT RATE BOX' || $r->getContainer() == 'FLAT RATE ENVELOPE') { + + if (strpos($r->getContainer(), 'FLAT RATE ENVELOPE') !== false || + strpos($r->getContainer(), 'FLAT RATE BOX') !== false + ) { $service = 'Priority'; } + $package->addChild('Service', $service); // no matter Letter, Flat or Parcel, use Parcel @@ -783,8 +796,15 @@ public function getCode($type, $code = '') 'first_class_mail_type' => ['LETTER' => __('Letter'), 'FLAT' => __('Flat'), 'PARCEL' => __('Parcel')], 'container' => [ 'VARIABLE' => __('Variable'), - 'FLAT RATE BOX' => __('Flat-Rate Box'), + 'SM FLAT RATE BOX' => __('Small Flat-Rate Box'), + 'MD FLAT RATE BOX' => __('Medium Flat-Rate Box'), + 'LG FLAT RATE BOX' => __('Large Flat-Rate Box'), 'FLAT RATE ENVELOPE' => __('Flat-Rate Envelope'), + 'SM FLAT RATE ENVELOPE' => __('Small Flat-Rate Envelope'), + 'WINDOW FLAT RATE ENVELOPE' => __('Window Flat-Rate Envelope'), + 'GIFT CARD FLAT RATE ENVELOPE' => __('Gift Card Flat-Rate Envelope'), + 'LEGAL FLAT RATE ENVELOPE' => __('Legal Flat-Rate Envelope'), + 'PADDED FLAT RATE ENVELOPE' => __('Padded Flat-Rate Envelope'), 'RECTANGULAR' => __('Rectangular'), 'NONRECTANGULAR' => __('Non-rectangular'), ], @@ -794,152 +814,141 @@ public function getCode($type, $code = '') 'filters' => [ 'within_us' => [ 'method' => [ - 'Priority Mail Express Flat Rate Envelope', - 'Priority Mail Express Flat Rate Envelope Hold For Pickup', - 'Priority Mail Flat Rate Envelope', - 'Priority Mail Large Flat Rate Box', - 'Priority Mail Medium Flat Rate Box', - 'Priority Mail Small Flat Rate Box', - 'Priority Mail Express Hold For Pickup', - 'Priority Mail Express', - 'Priority Mail', - 'Priority Mail Hold For Pickup', - 'Priority Mail Large Flat Rate Box Hold For Pickup', - 'Priority Mail Medium Flat Rate Box Hold For Pickup', - 'Priority Mail Small Flat Rate Box Hold For Pickup', - 'Priority Mail Flat Rate Envelope Hold For Pickup', - 'Priority Mail Small Flat Rate Envelope', - 'Priority Mail Small Flat Rate Envelope Hold For Pickup', - 'First-Class Package Service Hold For Pickup', - 'Retail Ground', - 'Media Mail', - 'First-Class Mail Large Envelope', - 'Priority Mail Express Sunday/Holiday Delivery', - 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope', - 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes', + '13', '27', '16', '22', '17', '28', '2', '3', '1', '33', '34', '35', + '36', '37', '42', '43', '53', '4', '6', '15', '23', '25', '57', ], ], 'from_us' => [ 'method' => [ - 'Priority Mail Express International Flat Rate Envelope', - 'Priority Mail International Flat Rate Envelope', - 'Priority Mail International Large Flat Rate Box', - 'Priority Mail International Medium Flat Rate Box', - 'Priority Mail International Small Flat Rate Box', - 'Priority Mail International Small Flat Rate Envelope', - 'Priority Mail Express International Flat Rate Boxes', - 'Global Express Guaranteed (GXG)', - 'USPS GXG Envelopes', - 'Priority Mail Express International', - 'Priority Mail International', - 'First-Class Mail International Letter', - 'First-Class Mail International Large Envelope', - 'First-Class Package International Service', + 'INT_10', 'INT_8', 'INT_11', 'INT_9', 'INT_16', 'INT_20', 'INT_4', + 'INT_12', 'INT_1', 'INT_2', 'INT_13', 'INT_14', 'INT_15', ], ], ], ], [ - 'containers' => ['FLAT RATE BOX'], + 'containers' => ['SM FLAT RATE BOX'], 'filters' => [ 'within_us' => [ - 'method' => [ - 'Priority Mail Large Flat Rate Box', - 'Priority Mail Medium Flat Rate Box', - 'Priority Mail Small Flat Rate Box', - 'Priority Mail International Large Flat Rate Box', - 'Priority Mail International Medium Flat Rate Box', - 'Priority Mail International Small Flat Rate Box', - 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes', - ], + 'method' => ['28', '57'], ], 'from_us' => [ - 'method' => [ - 'Priority Mail International Large Flat Rate Box', - 'Priority Mail International Medium Flat Rate Box', - 'Priority Mail International Small Flat Rate Box', - 'Priority Mail International DVD Flat Rate priced box', - 'Priority Mail International Large Video Flat Rate priced box', - ], + 'method' => ['INT_16', 'INT_24'], + ], + ], + ], + [ + 'containers' => ['MD FLAT RATE BOX'], + 'filters' => [ + 'within_us' => [ + 'method' => ['17', '57'], + ], + 'from_us' => [ + 'method' => ['INT_9', 'INT_24'], ], - ] + ], + ], + [ + 'containers' => ['LG FLAT RATE BOX'], + 'filters' => [ + 'within_us' => [ + 'method' => ['22', '57'], + ], + 'from_us' => [ + 'method' => ['INT_11', 'INT_24', 'INT_25'], + ], + ], + ], + [ + 'containers' => ['SM FLAT RATE ENVELOPE'], + 'filters' => [ + 'within_us' => [ + 'method' => ['42', '43'], + ], + 'from_us' => [ + 'method' => ['INT_20'], + ], + ], + ], + [ + 'containers' => ['WINDOW FLAT RATE ENVELOPE'], + 'filters' => [ + 'within_us' => [ + 'method' => ['40', '41'], + ], + 'from_us' => [ + 'method' => ['INT_19'], + ], + ], + ], + [ + 'containers' => ['GIFT CARD FLAT RATE ENVELOPE'], + 'filters' => [ + 'within_us' => [ + 'method' => ['38', '39'], + ], + 'from_us' => [ + 'method' => ['INT_18'], + ], + ], + ], + [ + 'containers' => ['PADDED FLAT RATE ENVELOPE'], + 'filters' => [ + 'within_us' => [ + 'method' => ['62', '63', '64', '46', '29'], + ], + 'from_us' => [ + 'method' => ['INT_27', 'INT_23'], + ], + ], + ], + [ + 'containers' => ['LEGAL FLAT RATE ENVELOPE'], + 'filters' => [ + 'within_us' => [ + 'method' => ['44', '45', '30', '31', '32'], + ], + 'from_us' => [ + 'method' => ['INT_17', 'INT_22'], + ], + ], ], [ 'containers' => ['FLAT RATE ENVELOPE'], 'filters' => [ 'within_us' => [ - 'method' => [ - 'Priority Mail Flat Rate Envelope', - 'Priority Mail Express Flat Rate Envelope', - 'Priority Mail Express Flat Rate Envelope Hold For Pickup', - 'Priority Mail Flat Rate Envelope', - 'First-Class Mail Large Envelope', - 'Priority Mail Flat Rate Envelope Hold For Pickup', - 'Priority Mail Small Flat Rate Envelope', - 'Priority Mail Small Flat Rate Envelope Hold For Pickup', - 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope', - 'Priority Mail Express Padded Flat Rate Envelope', - ], + 'method' => ['16', '13', '27', '16', '15', '37', '42', '43', '25', '62'], ], 'from_us' => [ 'method' => [ - 'Priority Mail Express International Flat Rate Envelope', - 'Priority Mail International Flat Rate Envelope', - 'First-Class Mail International Large Envelope', - 'Priority Mail International Small Flat Rate Envelope', - 'Priority Mail Express International Legal Flat Rate Envelope', - 'Priority Mail International Gift Card Flat Rate Envelope', - 'Priority Mail International Window Flat Rate Envelope', - 'Priority Mail International Legal Flat Rate Envelope', - 'Priority Mail Express International Padded Flat Rate Envelope', + 'INT_10', 'INT_8', 'INT_14', 'INT_20', 'INT_17', + 'INT_18', 'INT_19', 'INT_22', 'INT_27', ], ], - ] + ], ], [ 'containers' => ['RECTANGULAR'], 'filters' => [ 'within_us' => [ - 'method' => [ - 'Priority Mail Express', - 'Priority Mail', - 'Retail Ground', - 'Media Mail', - 'Library Mail', - 'First-Class Package Service', - ], + 'method' => ['3', '1', '4', '6', '7', '61'], ], 'from_us' => [ - 'method' => [ - 'USPS GXG Envelopes', - 'Priority Mail Express International', - 'Priority Mail International', - 'First-Class Package International Service', - ], + 'method' => ['INT_12', 'INT_1', 'INT_2', 'INT_15'], ], - ] + ], ], [ 'containers' => ['NONRECTANGULAR'], 'filters' => [ 'within_us' => [ - 'method' => [ - 'Priority Mail Express', - 'Priority Mail', - 'Retail Ground', - 'Media Mail', - 'Library Mail', - ], + 'method' => ['3', '1', '4', '6', '7'], ], 'from_us' => [ - 'method' => [ - 'Global Express Guaranteed (GXG)', - 'Priority Mail Express International', - 'Priority Mail International', - 'First-Class Package International Service', - ], + 'method' => ['INT_4', 'INT_1', 'INT_2', 'INT_15'], ], - ] + ], ], ], 'size' => ['REGULAR' => __('Regular'), 'LARGE' => __('Large')], @@ -1414,6 +1423,8 @@ protected function _filterServiceName($name) * * @param \Magento\Framework\DataObject $request * @return string + * @deprecated This method should not be used anymore. + * @see \Magento\Usps\Model\Carrier::_doShipmentRequest method doc block. */ protected function _formUsExpressShipmentRequest(\Magento\Framework\DataObject $request) { @@ -1589,6 +1600,8 @@ protected function _convertPoundOunces($weightInPounds) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @deprecated Should not be used anymore. + * @see \Magento\Usps\Model\Carrier::_doShipmentRequest doc block. */ protected function _formIntlShipmentRequest(\Magento\Framework\DataObject $request) { @@ -1842,6 +1855,8 @@ protected function _formIntlShipmentRequest(\Magento\Framework\DataObject $reque * @param \Magento\Framework\DataObject $request * @return \Magento\Framework\DataObject * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @deprecated This method must not be used anymore. Starting from 23.02.2018 USPS elimates API usage for + * free shipping labels generating. */ protected function _doShipmentRequest(\Magento\Framework\DataObject $request) { diff --git a/app/code/Magento/Usps/Model/Source/Container.php b/app/code/Magento/Usps/Model/Source/Container.php index 8205738fd95ce..9f931db1cf98d 100644 --- a/app/code/Magento/Usps/Model/Source/Container.php +++ b/app/code/Magento/Usps/Model/Source/Container.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Usps/Test/Unit/Model/_files/success_usps_response_return_shipment.xml b/app/code/Magento/Usps/Test/Unit/Model/_files/success_usps_response_return_shipment.xml index b32520a299123..0e012f8ee5dfb 100644 --- a/app/code/Magento/Usps/Test/Unit/Model/_files/success_usps_response_return_shipment.xml +++ b/app/code/Magento/Usps/Test/Unit/Model/_files/success_usps_response_return_shipment.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index c7226f5dfb3be..09fa8ed8b7445 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -15,7 +15,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.4", + "version": "100.1.6", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Usps/etc/adminhtml/di.xml b/app/code/Magento/Usps/etc/adminhtml/di.xml index f0f3e17cabac2..9398784a6258f 100644 --- a/app/code/Magento/Usps/etc/adminhtml/di.xml +++ b/app/code/Magento/Usps/etc/adminhtml/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Usps/etc/adminhtml/system.xml b/app/code/Magento/Usps/etc/adminhtml/system.xml index 7e3c3d99521d2..0bdaf49297f05 100644 --- a/app/code/Magento/Usps/etc/adminhtml/system.xml +++ b/app/code/Magento/Usps/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Usps/etc/config.xml b/app/code/Magento/Usps/etc/config.xml index a5c623d6a8802..68c1b31fcd515 100644 --- a/app/code/Magento/Usps/etc/config.xml +++ b/app/code/Magento/Usps/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Usps/etc/di.xml b/app/code/Magento/Usps/etc/di.xml index d0706c7099f87..d3a5eed1cee1d 100644 --- a/app/code/Magento/Usps/etc/di.xml +++ b/app/code/Magento/Usps/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Usps/etc/module.xml b/app/code/Magento/Usps/etc/module.xml index 4ded84247d05a..8a1ec284c6333 100644 --- a/app/code/Magento/Usps/etc/module.xml +++ b/app/code/Magento/Usps/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Usps/registration.php b/app/code/Magento/Usps/registration.php index b1f57ca697f3a..4a7420612510a 100644 --- a/app/code/Magento/Usps/registration.php +++ b/app/code/Magento/Usps/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Usps/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Usps/view/frontend/layout/checkout_index_index.xml index 4af078f89a0ef..e15acf6c2baaa 100644 --- a/app/code/Magento/Usps/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Usps/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Usps/view/frontend/web/js/model/shipping-rates-validation-rules.js b/app/code/Magento/Usps/view/frontend/web/js/model/shipping-rates-validation-rules.js index e8c6be9420e32..0c29e2817a8ac 100644 --- a/app/code/Magento/Usps/view/frontend/web/js/model/shipping-rates-validation-rules.js +++ b/app/code/Magento/Usps/view/frontend/web/js/model/shipping-rates-validation-rules.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global define*/ diff --git a/app/code/Magento/Usps/view/frontend/web/js/model/shipping-rates-validator.js b/app/code/Magento/Usps/view/frontend/web/js/model/shipping-rates-validator.js index ea20e2bd774ac..33e86239a0084 100644 --- a/app/code/Magento/Usps/view/frontend/web/js/model/shipping-rates-validator.js +++ b/app/code/Magento/Usps/view/frontend/web/js/model/shipping-rates-validator.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*global define*/ diff --git a/app/code/Magento/Usps/view/frontend/web/js/view/shipping-rates-validation.js b/app/code/Magento/Usps/view/frontend/web/js/view/shipping-rates-validation.js index b5fa7f73ec032..838c540cea698 100644 --- a/app/code/Magento/Usps/view/frontend/web/js/view/shipping-rates-validation.js +++ b/app/code/Magento/Usps/view/frontend/web/js/view/shipping-rates-validation.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /*browser:true*/ diff --git a/app/code/Magento/Variable/Block/System/Variable.php b/app/code/Magento/Variable/Block/System/Variable.php index 3148037faee45..715337d1177ee 100644 --- a/app/code/Magento/Variable/Block/System/Variable.php +++ b/app/code/Magento/Variable/Block/System/Variable.php @@ -1,6 +1,6 @@ _init('Magento\Variable\Model\ResourceModel\Variable'); + $this->_init(\Magento\Variable\Model\ResourceModel\Variable::class); } /** @@ -154,7 +154,7 @@ public function getVariablesOptionArray($withGroup = false) foreach ($collection->toOptionArray() as $variable) { $variables[] = [ 'value' => '{{customVar code=' . $variable['value'] . '}}', - 'label' => __('%1', $variable['label']), + 'label' => __('%1', $this->_escaper->escapeHtml($variable['label'])), ]; } if ($withGroup && $variables) { diff --git a/app/code/Magento/Variable/Model/Variable/Config.php b/app/code/Magento/Variable/Model/Variable/Config.php index ebae87e167f78..f819a02b4aadd 100644 --- a/app/code/Magento/Variable/Model/Variable/Config.php +++ b/app/code/Magento/Variable/Model/Variable/Config.php @@ -1,6 +1,6 @@ objectManager = new ObjectManager($this); - $this->escaperMock = $this->getMockBuilder('Magento\Framework\Escaper') + $this->escaperMock = $this->getMockBuilder(\Magento\Framework\Escaper::class) ->disableOriginalConstructor() ->getMock(); - $this->resourceMock = $this->getMockBuilder('Magento\Variable\Model\ResourceModel\Variable') + $this->resourceMock = $this->getMockBuilder(\Magento\Variable\Model\ResourceModel\Variable::class) ->disableOriginalConstructor() ->getMock(); $this->model = $this->objectManager->getObject( - 'Magento\Variable\Model\Variable', + \Magento\Variable\Model\Variable::class, [ 'escaper' => $this->escaperMock, - 'resource' => $this->resourceMock + 'resource' => $this->resourceMock, ] ); $this->validationFailedPhrase = __('Validation has failed.'); @@ -99,63 +99,6 @@ public function testValidate($variableArray, $objectId, $expectedResult) $this->assertEquals($expectedResult, $this->model->validate($variableArray)); } - public function testGetVariablesOptionArrayNoGroup() - { - $origOptions = [ - ['value' => 'VAL', 'label' => 'LBL',] - ]; - - $transformedOptions = [ - ['value' => '{{customVar code=VAL}}', 'label' => __('%1', 'LBL')] - ]; - - $collectionMock = $this->getMockBuilder('\Magento\Variable\Model\ResourceModel\Variable\Collection') - ->disableOriginalConstructor() - ->getMock(); - $collectionMock->expects($this->any()) - ->method('toOptionArray') - ->willReturn($origOptions); - $mockVariable = $this->getMock( - 'Magento\Variable\Model\Variable', - ['getCollection'], - $this->objectManager->getConstructArguments('Magento\Variable\Model\Variable') - ); - $mockVariable->expects($this->any()) - ->method('getCollection') - ->willReturn($collectionMock); - $this->assertEquals($transformedOptions, $mockVariable->getVariablesOptionArray()); - } - - public function testGetVariablesOptionArrayWithGroup() - { - $origOptions = [ - ['value' => 'VAL', 'label' => 'LBL',] - ]; - - $transformedOptions = [ - 'label' => __('Custom Variables'), - 'value' => [ - ['value' => '{{customVar code=VAL}}', 'label' => __('%1', 'LBL')] - ] - ]; - - $collectionMock = $this->getMockBuilder('\Magento\Variable\Model\ResourceModel\Variable\Collection') - ->disableOriginalConstructor() - ->getMock(); - $collectionMock->expects($this->any()) - ->method('toOptionArray') - ->willReturn($origOptions); - $mockVariable = $this->getMock( - 'Magento\Variable\Model\Variable', - ['getCollection'], - $this->objectManager->getConstructArguments('Magento\Variable\Model\Variable') - ); - $mockVariable->expects($this->any()) - ->method('getCollection') - ->willReturn($collectionMock); - $this->assertEquals($transformedOptions, $mockVariable->getVariablesOptionArray(true)); - } - public function validateDataProvider() { $variable = [ diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json index 63a4be3777299..fa5318c980c71 100644 --- a/app/code/Magento/Variable/composer.json +++ b/app/code/Magento/Variable/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.2", + "version": "100.1.4", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Variable/etc/acl.xml b/app/code/Magento/Variable/etc/acl.xml index a9d4f0d35950e..c0c188061a738 100644 --- a/app/code/Magento/Variable/etc/acl.xml +++ b/app/code/Magento/Variable/etc/acl.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Variable/etc/adminhtml/menu.xml b/app/code/Magento/Variable/etc/adminhtml/menu.xml index 5b2853e1425e4..41d5b24731c08 100644 --- a/app/code/Magento/Variable/etc/adminhtml/menu.xml +++ b/app/code/Magento/Variable/etc/adminhtml/menu.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Variable/etc/adminhtml/routes.xml b/app/code/Magento/Variable/etc/adminhtml/routes.xml index a1725fcbf0268..5a84cd27ddf2a 100644 --- a/app/code/Magento/Variable/etc/adminhtml/routes.xml +++ b/app/code/Magento/Variable/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Variable/etc/module.xml b/app/code/Magento/Variable/etc/module.xml index b1411cd7fb026..d85388d46fcbd 100644 --- a/app/code/Magento/Variable/etc/module.xml +++ b/app/code/Magento/Variable/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Variable/registration.php b/app/code/Magento/Variable/registration.php index 9b0f8aded417c..2de7222aca308 100644 --- a/app/code/Magento/Variable/registration.php +++ b/app/code/Magento/Variable/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml index e52681752957d..a66871163b262 100644 --- a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml +++ b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_index.xml b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_index.xml index 8f470135128a9..1e57fce547cb5 100644 --- a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_index.xml +++ b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Variable/view/adminhtml/templates/system/variable/js.phtml b/app/code/Magento/Variable/view/adminhtml/templates/system/variable/js.phtml index d257314f8eb7a..a569b8e71a055 100644 --- a/app/code/Magento/Variable/view/adminhtml/templates/system/variable/js.phtml +++ b/app/code/Magento/Variable/view/adminhtml/templates/system/variable/js.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Variable/view/adminhtml/web/variables.js b/app/code/Magento/Variable/view/adminhtml/web/variables.js index afa83b7246df1..0881673d642f1 100644 --- a/app/code/Magento/Variable/view/adminhtml/web/variables.js +++ b/app/code/Magento/Variable/view/adminhtml/web/variables.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Vault/Api/Data/PaymentTokenInterface.php b/app/code/Magento/Vault/Api/Data/PaymentTokenInterface.php index 208e44460f59d..c478e02de5899 100644 --- a/app/code/Magento/Vault/Api/Data/PaymentTokenInterface.php +++ b/app/code/Magento/Vault/Api/Data/PaymentTokenInterface.php @@ -1,6 +1,6 @@ false, 'dafault' => true], + ['nullable' => false, 'default' => true], 'Is active flag' )->addColumn( 'is_visible', Table::TYPE_BOOLEAN, null, - ['nullable' => false, 'dafault' => true], + ['nullable' => false, 'default' => true], 'Is visible flag' )->addIndex( $setup->getIdxName( diff --git a/app/code/Magento/Vault/Setup/UpgradeData.php b/app/code/Magento/Vault/Setup/UpgradeData.php index 95c27f000d46c..8cd22228913a9 100644 --- a/app/code/Magento/Vault/Setup/UpgradeData.php +++ b/app/code/Magento/Vault/Setup/UpgradeData.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Vault/etc/config.xml b/app/code/Magento/Vault/etc/config.xml index d7ca5c886d1cc..9d569fe9455d5 100644 --- a/app/code/Magento/Vault/etc/config.xml +++ b/app/code/Magento/Vault/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/etc/di.xml b/app/code/Magento/Vault/etc/di.xml index 55a8913a826f5..f233fc1f4baaa 100644 --- a/app/code/Magento/Vault/etc/di.xml +++ b/app/code/Magento/Vault/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/etc/events.xml b/app/code/Magento/Vault/etc/events.xml index dcdaa876902ad..df0c45bb8d748 100644 --- a/app/code/Magento/Vault/etc/events.xml +++ b/app/code/Magento/Vault/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/etc/extension_attributes.xml b/app/code/Magento/Vault/etc/extension_attributes.xml index abfb20767f9bb..7188b017a0123 100644 --- a/app/code/Magento/Vault/etc/extension_attributes.xml +++ b/app/code/Magento/Vault/etc/extension_attributes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/etc/frontend/di.xml b/app/code/Magento/Vault/etc/frontend/di.xml index 598a30aa1c73b..cb7ab4735d470 100644 --- a/app/code/Magento/Vault/etc/frontend/di.xml +++ b/app/code/Magento/Vault/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/etc/frontend/routes.xml b/app/code/Magento/Vault/etc/frontend/routes.xml index ffa8e55afa700..b1b68df885fd8 100644 --- a/app/code/Magento/Vault/etc/frontend/routes.xml +++ b/app/code/Magento/Vault/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/etc/module.xml b/app/code/Magento/Vault/etc/module.xml index 2e709dd6cfe11..1a7d1fe7d09fd 100644 --- a/app/code/Magento/Vault/etc/module.xml +++ b/app/code/Magento/Vault/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/registration.php b/app/code/Magento/Vault/registration.php index 7132ef2bde9ca..0db6578485190 100644 --- a/app/code/Magento/Vault/registration.php +++ b/app/code/Magento/Vault/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Vault/view/frontend/layout/customer_account.xml b/app/code/Magento/Vault/view/frontend/layout/customer_account.xml index d2658f4a3a1e2..e3af8a1bec0d1 100644 --- a/app/code/Magento/Vault/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Vault/view/frontend/layout/customer_account.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/view/frontend/layout/vault_cards_listaction.xml b/app/code/Magento/Vault/view/frontend/layout/vault_cards_listaction.xml index a41125414a424..677f074263906 100644 --- a/app/code/Magento/Vault/view/frontend/layout/vault_cards_listaction.xml +++ b/app/code/Magento/Vault/view/frontend/layout/vault_cards_listaction.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Vault/view/frontend/templates/cards_list.phtml b/app/code/Magento/Vault/view/frontend/templates/cards_list.phtml index 1982f85bd2243..80de44a11b0bb 100644 --- a/app/code/Magento/Vault/view/frontend/templates/cards_list.phtml +++ b/app/code/Magento/Vault/view/frontend/templates/cards_list.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Version/Controller/Index/Index.php b/app/code/Magento/Version/Controller/Index/Index.php index 6fd45e15d913c..6e2c094e448c4 100644 --- a/app/code/Magento/Version/Controller/Index/Index.php +++ b/app/code/Magento/Version/Controller/Index/Index.php @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Version/etc/module.xml b/app/code/Magento/Version/etc/module.xml index 8637a5d892368..8108aaa038aee 100644 --- a/app/code/Magento/Version/etc/module.xml +++ b/app/code/Magento/Version/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Version/registration.php b/app/code/Magento/Version/registration.php index ff790bc4808aa..c622008b1dccd 100644 --- a/app/code/Magento/Version/registration.php +++ b/app/code/Magento/Version/registration.php @@ -1,6 +1,6 @@ swaggerGenerator->generate( $requestedServices, $this->_request->getScheme(), - $this->_request->getHttpHost(), + $this->_request->getHttpHost(false), $this->_request->getRequestUri() ); $this->_response->setBody($responseBody)->setHeader('Content-Type', 'application/json'); diff --git a/app/code/Magento/Webapi/Controller/Rest/InputParamsResolver.php b/app/code/Magento/Webapi/Controller/Rest/InputParamsResolver.php index 49700c496e667..07d1b4e07fe9d 100644 --- a/app/code/Magento/Webapi/Controller/Rest/InputParamsResolver.php +++ b/app/code/Magento/Webapi/Controller/Rest/InputParamsResolver.php @@ -1,6 +1,6 @@ _soapCode = $exception->getOriginator(); + $this->_soapFaultCode = $exception->getOriginator(); $this->_parameters = $exception->getDetails(); $this->_wrappedErrors = $exception->getErrors(); $this->stackTrace = $exception->getStackTrace() ?: $exception->getTraceAsString(); @@ -194,7 +196,7 @@ public function getDetails() */ public function getSoapCode() { - return $this->_soapCode; + return $this->_soapFaultCode; } /** diff --git a/app/code/Magento/Webapi/Model/Soap/Server.php b/app/code/Magento/Webapi/Model/Soap/Server.php index a5858fa29729a..aa7a4041ae415 100644 --- a/app/code/Magento/Webapi/Model/Soap/Server.php +++ b/app/code/Magento/Webapi/Model/Soap/Server.php @@ -2,7 +2,7 @@ /** * Magento-specific SOAP server. * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Webapi\Model\Soap; diff --git a/app/code/Magento/Webapi/Model/Soap/ServerFactory.php b/app/code/Magento/Webapi/Model/Soap/ServerFactory.php index 89e415902945e..cfde5c6004590 100644 --- a/app/code/Magento/Webapi/Model/Soap/ServerFactory.php +++ b/app/code/Magento/Webapi/Model/Soap/ServerFactory.php @@ -2,7 +2,7 @@ /** * Factory to create new SoapServer objects. * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Webapi\Model\Soap; diff --git a/app/code/Magento/Webapi/Model/Soap/Wsdl.php b/app/code/Magento/Webapi/Model/Soap/Wsdl.php index a71ffe04266aa..2d0b310995215 100644 --- a/app/code/Magento/Webapi/Model/Soap/Wsdl.php +++ b/app/code/Magento/Webapi/Model/Soap/Wsdl.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Webapi/Test/Unit/Model/DataObjectProcessorTest.php b/app/code/Magento/Webapi/Test/Unit/Model/DataObjectProcessorTest.php index 258ca9d02b848..54cc4a6b64bf1 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/DataObjectProcessorTest.php +++ b/app/code/Magento/Webapi/Test/Unit/Model/DataObjectProcessorTest.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Webapi/Test/Unit/Model/_files/acl.xsd b/app/code/Magento/Webapi/Test/Unit/Model/_files/acl.xsd index 367be30cd8ab6..6531872eb4af4 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/_files/acl.xsd +++ b/app/code/Magento/Webapi/Test/Unit/Model/_files/acl.xsd @@ -3,7 +3,7 @@ /** * Structure description for acl.xml ACL resource files. * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> diff --git a/app/code/Magento/Webapi/Test/Unit/_files/soap_fault/soap_fault_expected_xmls.php b/app/code/Magento/Webapi/Test/Unit/_files/soap_fault/soap_fault_expected_xmls.php index adbf030f9e3fb..dfc08779a2ade 100644 --- a/app/code/Magento/Webapi/Test/Unit/_files/soap_fault/soap_fault_expected_xmls.php +++ b/app/code/Magento/Webapi/Test/Unit/_files/soap_fault/soap_fault_expected_xmls.php @@ -2,7 +2,7 @@ /** * The list of all expected soap fault XMLs. * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ return [ diff --git a/app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php b/app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php index 8c934ee6c97b4..0a89b3277f685 100644 --- a/app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php +++ b/app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Webapi/etc/cache.xml b/app/code/Magento/Webapi/etc/cache.xml index 31f995e9433bc..3b90d3dbe3971 100644 --- a/app/code/Magento/Webapi/etc/cache.xml +++ b/app/code/Magento/Webapi/etc/cache.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Webapi/etc/di.xml b/app/code/Magento/Webapi/etc/di.xml index fc8d4a31f2f04..9bb35a756a3cb 100644 --- a/app/code/Magento/Webapi/etc/di.xml +++ b/app/code/Magento/Webapi/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Webapi/etc/frontend/routes.xml b/app/code/Magento/Webapi/etc/frontend/routes.xml index c4d4d29d80bf4..45cc8ddaca0b6 100644 --- a/app/code/Magento/Webapi/etc/frontend/routes.xml +++ b/app/code/Magento/Webapi/etc/frontend/routes.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Webapi/etc/module.xml b/app/code/Magento/Webapi/etc/module.xml index 05fe801020c78..cda30887d0a22 100644 --- a/app/code/Magento/Webapi/etc/module.xml +++ b/app/code/Magento/Webapi/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Webapi/etc/webapi.xsd b/app/code/Magento/Webapi/etc/webapi.xsd index da56d6468b73a..7a237cba2cfd2 100644 --- a/app/code/Magento/Webapi/etc/webapi.xsd +++ b/app/code/Magento/Webapi/etc/webapi.xsd @@ -3,7 +3,7 @@ /** * Structure description for webapi.xml configuration files. * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> diff --git a/app/code/Magento/Webapi/etc/webapi_rest/di.xml b/app/code/Magento/Webapi/etc/webapi_rest/di.xml index e8cf2b0632fdb..fa8252aca9095 100644 --- a/app/code/Magento/Webapi/etc/webapi_rest/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_rest/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Webapi/etc/webapi_soap/di.xml b/app/code/Magento/Webapi/etc/webapi_soap/di.xml index 565277d9b78d8..1308021779053 100644 --- a/app/code/Magento/Webapi/etc/webapi_soap/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_soap/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Webapi/registration.php b/app/code/Magento/Webapi/registration.php index 17a879648daea..013fce851d760 100644 --- a/app/code/Magento/Webapi/registration.php +++ b/app/code/Magento/Webapi/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml index 91a978b647ba1..a0f3596bbdae8 100644 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml @@ -3,7 +3,7 @@ /** * Tab for integration activation permissions popup. * - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> diff --git a/app/code/Magento/WebapiSecurity/Model/Plugin/AnonymousResourceSecurity.php b/app/code/Magento/WebapiSecurity/Model/Plugin/AnonymousResourceSecurity.php index b0268518b636b..35ac21c8370cb 100644 --- a/app/code/Magento/WebapiSecurity/Model/Plugin/AnonymousResourceSecurity.php +++ b/app/code/Magento/WebapiSecurity/Model/Plugin/AnonymousResourceSecurity.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/WebapiSecurity/etc/config.xml b/app/code/Magento/WebapiSecurity/etc/config.xml index d80ac4a164d16..f0bd6976fa08e 100644 --- a/app/code/Magento/WebapiSecurity/etc/config.xml +++ b/app/code/Magento/WebapiSecurity/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/WebapiSecurity/etc/di.xml b/app/code/Magento/WebapiSecurity/etc/di.xml index 22c06dfdf71d8..ae05c8d12c180 100644 --- a/app/code/Magento/WebapiSecurity/etc/di.xml +++ b/app/code/Magento/WebapiSecurity/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/WebapiSecurity/etc/module.xml b/app/code/Magento/WebapiSecurity/etc/module.xml index 0d016c29dd755..5fed15fb373b8 100644 --- a/app/code/Magento/WebapiSecurity/etc/module.xml +++ b/app/code/Magento/WebapiSecurity/etc/module.xml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/WebapiSecurity/registration.php b/app/code/Magento/WebapiSecurity/registration.php index 1d671f658cbf8..0c639f145c66b 100644 --- a/app/code/Magento/WebapiSecurity/registration.php +++ b/app/code/Magento/WebapiSecurity/registration.php @@ -1,6 +1,6 @@ websites = $websites; } - if ($storeId = $this->locator->getStore()->getId()) { /** @var WebsiteInterface $website */ $website = $this->storeManager->getStore($storeId)->getWebsite(); - $websites[$website->getId()] = [ + $websites[] = [ 'value' => $website->getId(), 'label' => $this->formatLabel( $website->getName(), @@ -84,7 +83,7 @@ public function getWebsites(ProductInterface $product, EavAttribute $eavAttribut if (!in_array($website->getId(), $product->getWebsiteIds())) { continue; } - $websites[$website->getId()] = [ + $websites[] = [ 'value' => $website->getId(), 'label' => $this->formatLabel( $website->getName(), diff --git a/app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Weee.php b/app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Weee.php index d5558c8875723..468899ed8101d 100644 --- a/app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Weee.php +++ b/app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Weee.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Weee/etc/adminhtml/events.xml b/app/code/Magento/Weee/etc/adminhtml/events.xml index 00ec05e9f4e4a..cd91e84640c19 100644 --- a/app/code/Magento/Weee/etc/adminhtml/events.xml +++ b/app/code/Magento/Weee/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/adminhtml/system.xml b/app/code/Magento/Weee/etc/adminhtml/system.xml index cc97f910e7ccd..ae02b27d10c72 100644 --- a/app/code/Magento/Weee/etc/adminhtml/system.xml +++ b/app/code/Magento/Weee/etc/adminhtml/system.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/config.xml b/app/code/Magento/Weee/etc/config.xml index f6d9676c6ee99..be0ae7a83b940 100644 --- a/app/code/Magento/Weee/etc/config.xml +++ b/app/code/Magento/Weee/etc/config.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/di.xml b/app/code/Magento/Weee/etc/di.xml index 084a5eefc7f73..9f208a3ee8d8b 100644 --- a/app/code/Magento/Weee/etc/di.xml +++ b/app/code/Magento/Weee/etc/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/events.xml b/app/code/Magento/Weee/etc/events.xml index 46ac52f516dfd..9db00ed431f4e 100644 --- a/app/code/Magento/Weee/etc/events.xml +++ b/app/code/Magento/Weee/etc/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/fieldset.xml b/app/code/Magento/Weee/etc/fieldset.xml index 30d4fcd44bb27..35274db557cc2 100644 --- a/app/code/Magento/Weee/etc/fieldset.xml +++ b/app/code/Magento/Weee/etc/fieldset.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/frontend/di.xml b/app/code/Magento/Weee/etc/frontend/di.xml index f31c718b91ee6..1ce09205b6e77 100644 --- a/app/code/Magento/Weee/etc/frontend/di.xml +++ b/app/code/Magento/Weee/etc/frontend/di.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/frontend/events.xml b/app/code/Magento/Weee/etc/frontend/events.xml index de485427d7c43..56eb52773c2a5 100644 --- a/app/code/Magento/Weee/etc/frontend/events.xml +++ b/app/code/Magento/Weee/etc/frontend/events.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/module.xml b/app/code/Magento/Weee/etc/module.xml index 8c59e20d3803e..01fa4fa5fd69e 100644 --- a/app/code/Magento/Weee/etc/module.xml +++ b/app/code/Magento/Weee/etc/module.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/pdf.xml b/app/code/Magento/Weee/etc/pdf.xml index 9d34b8b0628c5..45623b4f44a2f 100644 --- a/app/code/Magento/Weee/etc/pdf.xml +++ b/app/code/Magento/Weee/etc/pdf.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/etc/sales.xml b/app/code/Magento/Weee/etc/sales.xml index c2c484184b804..d4ea6b3ed9b27 100644 --- a/app/code/Magento/Weee/etc/sales.xml +++ b/app/code/Magento/Weee/etc/sales.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/registration.php b/app/code/Magento/Weee/registration.php index 8fa46f234ff31..f87e263384c78 100644 --- a/app/code/Magento/Weee/registration.php +++ b/app/code/Magento/Weee/registration.php @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_creditmemo_item_price.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_creditmemo_item_price.xml index 8db6ad29a9d72..87a0f8be985f2 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_creditmemo_item_price.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_creditmemo_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_invoice_item_price.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_invoice_item_price.xml index bd78d50eb2375..383bf3d6a42be 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_invoice_item_price.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_invoice_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_create_item_price.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_create_item_price.xml index 62c6e2f11a7b7..0039f32e8af3c 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_create_item_price.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_create_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_new.xml index b80a6ab9627aa..94a77534d94e8 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index b80a6ab9627aa..94a77534d94e8 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_view.xml index b80a6ab9627aa..94a77534d94e8 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_new.xml index 17ae336776d5c..d14bba1395385 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_new.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_updateqty.xml index 17ae336776d5c..d14bba1395385 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_view.xml index 17ae336776d5c..d14bba1395385 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_item_price.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_item_price.xml index 38279d31b0500..fe4559345b249 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_item_price.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_view.xml index 1c2f825d85dd5..f31acedf94447 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/requirejs-config.js b/app/code/Magento/Weee/view/adminhtml/requirejs-config.js index 1d5a3a6d02502..59afa8db2e0d2 100644 --- a/app/code/Magento/Weee/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/Weee/view/adminhtml/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Weee/view/adminhtml/templates/items/price/row.phtml b/app/code/Magento/Weee/view/adminhtml/templates/items/price/row.phtml index 533af55c40525..0bdc7b5edd900 100644 --- a/app/code/Magento/Weee/view/adminhtml/templates/items/price/row.phtml +++ b/app/code/Magento/Weee/view/adminhtml/templates/items/price/row.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Weee/view/adminhtml/web/js/fpt-attribute.js b/app/code/Magento/Weee/view/adminhtml/web/js/fpt-attribute.js index 7b00a5e891612..9934a3c28ee61 100644 --- a/app/code/Magento/Weee/view/adminhtml/web/js/fpt-attribute.js +++ b/app/code/Magento/Weee/view/adminhtml/web/js/fpt-attribute.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ diff --git a/app/code/Magento/Weee/view/adminhtml/web/js/fpt-group.js b/app/code/Magento/Weee/view/adminhtml/web/js/fpt-group.js index dbff56ac61fab..b034ae376f596 100644 --- a/app/code/Magento/Weee/view/adminhtml/web/js/fpt-group.js +++ b/app/code/Magento/Weee/view/adminhtml/web/js/fpt-group.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Weee/view/adminhtml/web/js/regions-tax-select.js b/app/code/Magento/Weee/view/adminhtml/web/js/regions-tax-select.js index 189a8ac2be3ec..88a19aa7bb71b 100644 --- a/app/code/Magento/Weee/view/adminhtml/web/js/regions-tax-select.js +++ b/app/code/Magento/Weee/view/adminhtml/web/js/regions-tax-select.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Weee/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Weee/view/base/layout/catalog_product_prices.xml index bae712d0a6aef..4383877a4fe93 100644 --- a/app/code/Magento/Weee/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Weee/view/base/layout/catalog_product_prices.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/base/templates/pricing/adjustment.phtml b/app/code/Magento/Weee/view/base/templates/pricing/adjustment.phtml index 21dfc2602ae86..f31c0192aac71 100644 --- a/app/code/Magento/Weee/view/base/templates/pricing/adjustment.phtml +++ b/app/code/Magento/Weee/view/base/templates/pricing/adjustment.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Weee/view/frontend/layout/checkout_index_index.xml index 7538f5780b941..3de3d596d344e 100644 --- a/app/code/Magento/Weee/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Weee/view/frontend/layout/checkout_index_index.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml index bd87ee64a6f86..bd59c37ae4e0a 100644 --- a/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml +++ b/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/default.xml b/app/code/Magento/Weee/view/frontend/layout/default.xml index e01b48cc71b11..6b97ebabce5b7 100644 --- a/app/code/Magento/Weee/view/frontend/layout/default.xml +++ b/app/code/Magento/Weee/view/frontend/layout/default.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_email_item_price.xml b/app/code/Magento/Weee/view/frontend/layout/sales_email_item_price.xml index a9aa5d63beb73..451e59262a970 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_email_item_price.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_email_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_creditmemo_items.xml b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_creditmemo_items.xml index b80a6ab9627aa..94a77534d94e8 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_creditmemo_items.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_creditmemo_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_invoice_items.xml b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_invoice_items.xml index 17ae336776d5c..d14bba1395385 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_invoice_items.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_invoice_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_items.xml b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_items.xml index 1c2f825d85dd5..f31acedf94447 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_items.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_items.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_creditmemo.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_creditmemo.xml index b80a6ab9627aa..94a77534d94e8 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_creditmemo.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_creditmemo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_invoice.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_invoice.xml index 17ae336776d5c..d14bba1395385 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_invoice.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_invoice.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_print.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_print.xml index 1c2f825d85dd5..f31acedf94447 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_print.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_print.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_printcreditmemo.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_printcreditmemo.xml index b80a6ab9627aa..94a77534d94e8 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_printcreditmemo.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_printcreditmemo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_printinvoice.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_printinvoice.xml index 17ae336776d5c..d14bba1395385 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_printinvoice.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_printinvoice.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_view.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_view.xml index 1c2f825d85dd5..f31acedf94447 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_view.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_creditmemo.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_creditmemo.xml index b80a6ab9627aa..94a77534d94e8 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_creditmemo.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_creditmemo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_invoice.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_invoice.xml index 17ae336776d5c..d14bba1395385 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_invoice.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_invoice.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_item_price.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_item_price.xml index 90473aa072d01..bc78d73b1aad9 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_item_price.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_item_price.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_print.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_print.xml index 1c2f825d85dd5..f31acedf94447 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_print.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_print.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_printcreditmemo.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_printcreditmemo.xml index b80a6ab9627aa..94a77534d94e8 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_printcreditmemo.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_printcreditmemo.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_printinvoice.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_printinvoice.xml index 17ae336776d5c..d14bba1395385 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_printinvoice.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_printinvoice.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_view.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_view.xml index 1c2f825d85dd5..f31acedf94447 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_view.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_view.xml @@ -1,7 +1,7 @@ diff --git a/app/code/Magento/Weee/view/frontend/requirejs-config.js b/app/code/Magento/Weee/view/frontend/requirejs-config.js index 7719e9068413f..61c4a9aa83838 100644 --- a/app/code/Magento/Weee/view/frontend/requirejs-config.js +++ b/app/code/Magento/Weee/view/frontend/requirejs-config.js @@ -1,5 +1,5 @@ /** - * Copyright © 2013-2017 Magento, Inc. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ diff --git a/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml b/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml index ab05ed0e2f409..79140880aceaa 100644 --- a/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml +++ b/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Weee/view/frontend/web/template/checkout/summary/item/price/row_incl_tax.html b/app/code/Magento/Weee/view/frontend/web/template/checkout/summary/item/price/row_incl_tax.html index c835683c956a2..594aeeae01b76 100644 --- a/app/code/Magento/Weee/view/frontend/web/template/checkout/summary/item/price/row_incl_tax.html +++ b/app/code/Magento/Weee/view/frontend/web/template/checkout/summary/item/price/row_incl_tax.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Weee/view/frontend/web/template/checkout/summary/weee.html b/app/code/Magento/Weee/view/frontend/web/template/checkout/summary/weee.html index 5106257704c1a..4a4bf5e3ad689 100644 --- a/app/code/Magento/Weee/view/frontend/web/template/checkout/summary/weee.html +++ b/app/code/Magento/Weee/view/frontend/web/template/checkout/summary/weee.html @@ -1,6 +1,6 @@ diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget.php b/app/code/Magento/Widget/Block/Adminhtml/Widget.php index 01cbe16ea6ff9..dbeef76e2eb1b 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget.php @@ -1,6 +1,6 @@ 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/Model/Config/Data.php b/app/code/Magento/Widget/Model/Config/Data.php index d560a5ca42438..bf057c66d7c7a 100644 --- a/app/code/Magento/Widget/Model/Config/Data.php +++ b/app/code/Magento/Widget/Model/Config/Data.php @@ -1,6 +1,6 @@ themeCollectionFactory = $themeCollectionFactory; + } + + /** + * Return array of options as value-label pairs + * + * @return array Format: array('' => '', ...) + */ + public function toOptionArray() + { + // Load only visible themes that are used in frontend area + return $this->themeCollectionFactory->create()->loadRegisteredThemes()->toOptionHash(); + } +} diff --git a/app/code/Magento/Widget/Model/ResourceModel/Widget/Instance/Options/Types.php b/app/code/Magento/Widget/Model/ResourceModel/Widget/Instance/Options/Types.php index 8dca86947bcf3..718ca979be9a0 100644 --- a/app/code/Magento/Widget/Model/ResourceModel/Widget/Instance/Options/Types.php +++ b/app/code/Magento/Widget/Model/ResourceModel/Widget/Instance/Options/Types.php @@ -1,6 +1,6 @@ themeCollectionMock = $this->getMock(ThemeCollection::class, [], [], '', false); + $this->themeCollectionFactoryMock = $this->getMock(ThemeCollectionFactory::class, ['create'], [], '', false); + $this->model = new Themes( + $this->themeCollectionFactoryMock + ); + } + + public function testToOptionArray() + { + $expectedResult = [ + 1 => 'Theme Label', + ]; + $this->themeCollectionFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->themeCollectionMock); + + $this->themeCollectionMock->expects($this->once())->method('loadRegisteredThemes')->willReturnSelf(); + $this->themeCollectionMock->expects($this->once())->method('toOptionHash')->willReturn($expectedResult); + + $this->assertEquals($expectedResult, $this->model->toOptionArray()); + } +} diff --git a/app/code/Magento/Widget/Test/Unit/Model/Template/FilterEmulateTest.php b/app/code/Magento/Widget/Test/Unit/Model/Template/FilterEmulateTest.php index c8be340fe5194..1880e68865d9e 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/Template/FilterEmulateTest.php +++ b/app/code/Magento/Widget/Test/Unit/Model/Template/FilterEmulateTest.php @@ -1,6 +1,6 @@ @@ -11,6 +11,7 @@ Orders and Returns Search Form + @@ -54,6 +55,7 @@ +
    Action