diff --git a/CHANGELOG.md b/CHANGELOG.md index 2984a09d5135829526e47019483548907161de44..21c3e686cc208bb9e2913c0415d8e638519c9421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ +0.1.0-alpha92 +============= + * Implemented API services: + * Shopping Cart Payment + * Shopping Cart Shipping + * Shopping Cart Coupon + * Shopping Cart License Agreements + * Indexer for Fulltext Search + * RSS Module become removable + * Framework Improvements: + * Ability to drop/regenerate access for native mobile apps + * Ability to support extensible service data objects + * No Code Duplication in Root Templates (MAGETWO-26278) + * Fixed bugs: + * Persistance session application. Loggin out the customer + * Placing the order with two terms and conditions + * Saving of custom option by service catalogProductCustomOptionsWriteServiceV1 + * Placing the order on frontend if enter in the street address line 1 and 2 255 symbols + * Using @357.farm domain emails in registration form + * Validation for country_id/region_id and percentage_rate during Tax Rate creation + * Declaration of getSortOrders in Magento\Framework\Service\V1\Data\SearchCriteria + * Order cancellation for online payment methods + * Order online processing for Authorize.net Direct Post + * Backend grids while search + * Adding of downlodable sample block on product page + * Variations on duplicated configurable product + * Added functional tests: + * Product Review Report + * Share Wishlist + 0.1.0-alpha91 ============= * Added the following functional tests: diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index e460f773cda4d4ac8d6f59878aa83dd257947988..43db83e7a6c80476dc5b926643c62ea6fdeea173 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml index 15c9289ba82bc0214562f039777f8da3ce517156..b0a94fd8014bf590bc2f860fb56e3ab7ed369e8f 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.notification.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.notification.container.grid" as="grid"> <arguments> @@ -89,4 +89,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 05db85996d352b9f42bda6be74df237e7a4b75f4..ed74b6e8b1667524ca11f3398f62a6d193ba49fd 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="adminhtml_notification_block"/> <referenceContainer name="content"> <block class="Magento\AdminNotification\Block\Inbox" name="adminhtml.notification.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml index 859fe367e732fbdc1fba4ce208b8a67701c9a9d7..09d661912c1b2e29f3986dc2fb9ef2ff2c767186 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="notifications"> <block class="Magento\AdminNotification\Block\System\Messages" name="system_messages" as="system_messages" before="-" template="Magento_AdminNotification::system/messages.phtml"/> <block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup" name="unread_system_messages" as="unread_system_messages" after="system_messages" template="Magento_AdminNotification::system/messages/popup.phtml"/> @@ -39,4 +39,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index 97243800f890e57ff1ca9b603186530a52f69317..7d69a31075309780d367ede6cb682797518cb62d 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -3,12 +3,12 @@ "description": "Authorization module provides access to Magento ACL functionality.", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json index cdb900f8b94c94667ad134167ddbcf4f9322e5c0..3afe9a4cc5a53205be0e48cd30d65dd91481114b 100644 --- a/app/code/Magento/Authorizenet/composer.json +++ b/app/code/Magento/Authorizenet/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-centinel": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-centinel": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/CatalogSearch/etc/indexers.xml b/app/code/Magento/Authorizenet/etc/webapi_rest/di.xml similarity index 82% rename from app/code/Magento/CatalogSearch/etc/indexers.xml rename to app/code/Magento/Authorizenet/etc/webapi_rest/di.xml index 5b1230f2b4d4cf1df65bf769f9e98a782d90b251..02c2e3fa2ed70ecb0b74d6f561b1e67bd5b331f6 100644 --- a/app/code/Magento/CatalogSearch/etc/indexers.xml +++ b/app/code/Magento/Authorizenet/etc/webapi_rest/di.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Index/etc/indexers.xsd"> - <indexer name="catalogsearch_fulltext" instance="Magento\CatalogSearch\Model\Indexer\Fulltext" /> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + <preference for="Magento\Authorizenet\Helper\HelperInterface" type="Magento\Authorizenet\Helper\Data" /> </config> + + diff --git a/app/code/Magento/Authorizenet/etc/webapi_soap/di.xml b/app/code/Magento/Authorizenet/etc/webapi_soap/di.xml new file mode 100644 index 0000000000000000000000000000000000000000..02c2e3fa2ed70ecb0b74d6f561b1e67bd5b331f6 --- /dev/null +++ b/app/code/Magento/Authorizenet/etc/webapi_soap/di.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + <preference for="Magento\Authorizenet\Helper\HelperInterface" type="Magento\Authorizenet\Helper\Data" /> +</config> + + diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml index 97c9683a1340120c72231f6b322662a38f4749c5..6e724bee492f558ebe4b508fa092f30adfd3545f 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" template="directpost/iframe.phtml"/> </container> </layout> diff --git a/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml b/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml index ee8ae162479da22ae7c912bb223b0b2e0562368c..190a9da2dac9b46e8383403eb0877b08a4a22a08 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml +++ b/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml @@ -156,4 +156,5 @@ directPostModel = new directPost( <?php if (!$this->isAjaxRequest()): ?> }); <?php endif; ?> +}); </script> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml index cb99e1d9cfd4f81556390c362811f8d27e8d2318..63714b8f56d08106a4ccdb6090c8f635837d52b3 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" output="1" template="directpost/iframe.phtml"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" template="directpost/iframe.phtml"/> + </container> </layout> 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 cb99e1d9cfd4f81556390c362811f8d27e8d2318..63714b8f56d08106a4ccdb6090c8f635837d52b3 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 @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" output="1" template="directpost/iframe.phtml"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" template="directpost/iframe.phtml"/> + </container> </layout> 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 cb99e1d9cfd4f81556390c362811f8d27e8d2318..63714b8f56d08106a4ccdb6090c8f635837d52b3 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 @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" output="1" template="directpost/iframe.phtml"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" template="directpost/iframe.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml index e47395aa82be7eb40ddfb1fb0b0da811ad2b83f8..1a98d72b324b42af80e6eba7460492a6bc1ce33c 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="authorizenet_page_head_components" template="Magento_Authorizenet::js/components.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_review.xml index 525d447d1aa11ad2640a919c41f83aed510216e3..fc8c82c892292baa676dab43115b882a45d6bc6b 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_review.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="checkout.onepage.review.info.items.after"> <block class="Magento\Authorizenet\Block\Directpost\Form" name="payment.form.directpost" template="directpost/form.phtml"> <action method="setMethodInfo"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Backend/Block/Page.php b/app/code/Magento/Backend/Block/Page.php index 612174c00fc9bfcb416e146315d918f3fd9f4917..2dbd390a0652fd9b8e67e8700345e0477deeacd0 100644 --- a/app/code/Magento/Backend/Block/Page.php +++ b/app/code/Magento/Backend/Block/Page.php @@ -31,11 +31,6 @@ namespace Magento\Backend\Block; class Page extends \Magento\Backend\Block\Template { - /** - * @var string - */ - protected $_template = 'admin/page.phtml'; - /** * @var \Magento\Framework\Locale\ResolverInterface */ diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Extended.php index 3cde51f10b86a6317bf821e788aff2de080c7c28..97d9ecbe19f24ba5e4000de7bdbd3861ca2de850 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Extended.php @@ -464,16 +464,14 @@ class Extended extends \Magento\Backend\Block\Widget\Grid implements \Magento\Ba protected function _prepareCollection() { if ($this->getCollection()) { + if ($this->getCollection()->isLoaded()) { + $this->getCollection()->clear(); + } + parent::_prepareCollection(); if (!$this->_isExport) { - $filter = $this->getParam($this->getVarNameFilter(), null); - if (is_string($filter)) { - $this->getCollection()->removeAllItems(); - $this->getCollection()->loadWithFilter(); - } else { - $this->getCollection()->load(); - } + $this->getCollection()->load(); $this->_afterLoadCollection(); } } diff --git a/app/code/Magento/Backend/Model/View.php b/app/code/Magento/Backend/Model/View.php index b9c9f1bb9350289a62a4e65a9d56c217777f7cec..4151a520c2e764bcb8f0894b162a9ea526ecf65f 100644 --- a/app/code/Magento/Backend/Model/View.php +++ b/app/code/Magento/Backend/Model/View.php @@ -36,7 +36,7 @@ class View extends \Magento\Framework\App\View * @param \Magento\Framework\App\ResponseInterface $response * @param \Magento\Framework\Config\ScopeInterface $configScope * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Framework\Translate\InlineInterface $translateInline + * @param \Magento\Framework\View\Result\PageFactory $pageFactory * @param \Magento\Framework\App\ActionFlag $actionFlag * @param Layout\Filter\Acl $aclFilter */ @@ -46,12 +46,12 @@ class View extends \Magento\Framework\App\View \Magento\Framework\App\ResponseInterface $response, \Magento\Framework\Config\ScopeInterface $configScope, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Translate\InlineInterface $translateInline, + \Magento\Framework\View\Result\PageFactory $pageFactory, \Magento\Framework\App\ActionFlag $actionFlag, Layout\Filter\Acl $aclFilter ) { $this->_aclFilter = $aclFilter; - parent::__construct($layout, $request, $response, $configScope, $eventManager, $translateInline, $actionFlag); + parent::__construct($layout, $request, $response, $configScope, $eventManager, $pageFactory, $actionFlag); } /** diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index 263e29d914d1c1feff16a3ab4bc576422c7d2497..d09b2f14a6f6ac5405e63a839b145876ae42338d 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -3,32 +3,32 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-cron": "0.1.0-alpha91", - "magento/module-sendfriend": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-weee": "0.1.0-alpha91", - "magento/module-reports": "0.1.0-alpha91", - "magento/module-catalog-search": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-user": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-backup": "0.1.0-alpha91", - "magento/module-email": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-url-rewrite": "0.1.0-alpha91", - "magento/module-translation": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-cron": "0.1.0-alpha92", + "magento/module-sendfriend": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-weee": "0.1.0-alpha92", + "magento/module-reports": "0.1.0-alpha92", + "magento/module-catalog-search": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-user": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-backup": "0.1.0-alpha92", + "magento/module-email": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-url-rewrite": "0.1.0-alpha92", + "magento/module-translation": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 583352c68f6f9339f727fcd30849a7eaecadaeb4..8defcd2f56840ad2d2e66e16381aebf7ec52c5ca 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<page layout="empty" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceContainer name="main.content"> <block class="Magento\Backend\Block\Template" name="content" template="admin/login.phtml"> <block class="Magento\Backend\Block\Page\Copyright" name="copyright" as="copyright"/> <container name="form.additional.info" label="Form Additional Info"/> @@ -32,5 +32,5 @@ <block class="Magento\Backend\Block\Template" name="adminhtml_auth_login_buttons" template="admin/login_buttons.phtml"/> </container> </block> - </container> -</layout> + </referenceContainer> +</page> 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 1d0cfb1f91c1ccc53b19f5ba4d2e69e4e0260829..537c143f438363ae40346290fa372f437213f5da 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.cache.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.cache.grid" as="grid"> <arguments> @@ -108,4 +108,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 33c594aa9617260ac27fee9158313ce3a6879f4b..02b8c03fb467c96dc29324975d2a81b3096985ed 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="adminhtml_cache_block"/> <referenceContainer name="content"> <block class="Magento\Backend\Block\Cache" name="adminhtml.cache.container"/> <block class="Magento\Backend\Block\Cache\Additional" name="cache.additional" template="Magento_Backend::system/cache/additional.phtml"/> </referenceContainer> -</layout> +</page> 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 875775f34c29628f58590ca1f720e6f59419b74d..de25530d94763f4ed1ddd1acdfa8d990a62c8de0 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Backend\Block\Dashboard\Tab\Customers\Most" name="adminhtml.dashboard.tab.customers.most"/> </container> </layout> 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 6692c077cc84367f8779e8fed58ef65fb9a36e5a..114f524e116c5cb74aeffe6279a190af3b24b513 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Backend\Block\Dashboard\Tab\Customers\Newest" name="adminhtml.dashboard.tab.customers.newest"/> </container> </layout> 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 960ac53c977fc3382ad33f12d180d255cba7de32..2640fc5e3aaf83d92814101c0d55d8c2cddf0a16 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="store_switcher" @@ -38,4 +38,4 @@ <referenceContainer name="content"> <block class="Magento\Backend\Block\Dashboard" name="dashboard" /> </referenceContainer> -</layout> +</page> 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 7a8218cc04db636ba16a3fd333dfcb8cfbd055f9..04574b1b938bd85f6c472a790fcc61cc0bdeb3b2 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Backend\Block\Dashboard\Tab\Products\Viewed" name="adminhtml.dashboard.tab.products.viewed"/> </container> </layout> 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 aac7c7d614c27d0eae0d51685ed4ebef96ec5aa4..8d967323d270d2155b73337415a7a881f79789e2 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Backend\Block\Denied" name="content.denied" template="admin/access_denied.phtml"/> </referenceContainer> -</layout> +</page> 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 5a7ddf6c47e4bdc47f4616833314b0a932922656..9bcf654cc5c633f5f23d722392119521843d6228 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Text" name="content.noRoute"> <action method="setText"> @@ -31,4 +31,4 @@ </action> </block> </referenceContainer> -</layout> +</page> 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 b771e79d41d5cf1f12d4c72471f18028719c60a8..e4b281c77b6f189c9852ba9c7985eb1501cf51de 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Backend\Block\System\Account\Edit" name="adminhtml.system.account.edit"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml index f7ba57915ed5e47e6ea6d04cdbfb4f116e1dbe2e..d405b9690c239d2efa589e339d7949d32627a0c2 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"/> <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" template="Magento_Backend::system/config/js.phtml"/> @@ -48,4 +48,4 @@ <referenceContainer name="content"> <block name="system.config.edit" class="Magento\Backend\Block\System\Config\Edit"/> </referenceContainer> -</layout> +</page> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts_partial.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml similarity index 78% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts_partial.xml rename to app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml index aefcdf2410f0745547116e319323358fc130f439..0e1a15998cdaf25c70c17e3b0086792caa42f919 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts_partial.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml @@ -23,12 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<page_layouts> - <layouts default="no_id"> - <layout> - <label translate="true">Empty</label> - <template>empty.phtml</template> - <layout_handle>page_empty</layout_handle> - </layout> - </layouts> -</page_layouts> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" /> 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 383a42537ea4b9607a43d9f52559c2c231bd3e90..4b55f869b6301d0a47981096cd96476dce9273f0 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_design_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.system.design.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.system.design.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 4f4e104aec87a61640483b562b5bd605ad678b5b..bc15183536e38e17f7410b7cced17b08f0c62297 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.system.design.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.design.grid" as="grid"> <arguments> @@ -83,4 +83,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 fd9544fded765dea7500f4c08da421a4b7393ceb..830dc8b83d2277c013f92390b6df5ed1b69970b9 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_design_grid_block"/> <referenceContainer name="content"> <block class="Magento\Backend\Block\System\Design" name="adminhtml.system.design.container"/> </referenceContainer> -</layout> +</page> 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 b005f130920b13b97458cbebe83811b673f7dff1..5a0018c2b24ed0d2d12c2e09e1dda200eca5bebf 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.system.store.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.store.grid" as="grid"> <arguments> @@ -65,4 +65,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 036bf1d5c323c77b08c40e09e1c653726f905501..555925518a819b20533d8dfaf6f6fe740349e357 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_store_grid_block"/> <referenceContainer name="content"> <block class="Magento\Backend\Block\System\Store\Store" name="adminhtml.system.store.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_edit.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_edit.xml index 9313f41dc301d8fa358617bc456ac8a5588562a2..6428e638f37d07b6890e110a78814943b60f6e49 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_edit.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_edit.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="store_switcher" /> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml index cfc3999a2da1d27bf5a40bea61615cb1200e5ae5..00e1418066e76e7fc9f1c3ea8ab5f9152bd94ed9 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.system.variable.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.variable.grid" as="grid"> <arguments> @@ -64,4 +64,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_index.xml index ed5d634c4f9bcf6f21ce11b2184d47a5d0799d92..7aea6145d8243989932a82f5e66f4f40c2cd6194 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_index.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="adminhtml_system_variable_grid_block"/> <referenceContainer name="content"> <block class="Magento\Backend\Block\System\Variable" name="adminhtml.system.variable.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_urlrewrite_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_urlrewrite_index.xml index b262bef8777ee509f778af8a285006ac8610f23f..c6557a289d3f00ca755354c5b512e082ee18c2e6 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_urlrewrite_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_urlrewrite_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Backend\Block\Urlrewrite" name="adminhtml.block.urlrewrite.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.urlrewrite.grid" as="grid"> @@ -133,4 +133,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml index b569628baa3612ca69b174baefba438499f260ae..cbe4ae2e7bba1be142628ea265b0c10e9151d302 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml @@ -23,196 +23,213 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Backend\Block\Page" name="root" output="1" template="admin/page.phtml"> - <block class="Magento\Backend\Block\Page\Head" name="head" as="head" template="page/head.phtml"> - <action method="setTitle"> - <argument translate="true" name="title" xsi:type="string">Magento Admin</argument> - </action> - <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-prototype-js"> - <arguments> - <argument name="file" xsi:type="string">prototype/prototype.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-window-js"> - <arguments> - <argument name="file" xsi:type="string">prototype/window.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-builder-js"> - <arguments> - <argument name="file" xsi:type="string">scriptaculous/builder.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-effects-js"> - <arguments> - <argument name="file" xsi:type="string">scriptaculous/effects.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="lib-ccard-js"> - <arguments> - <argument name="file" xsi:type="string">lib/ccard.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-validation-js"> - <arguments> - <argument name="file" xsi:type="string">prototype/validation.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="varien-js-js"> - <arguments> - <argument name="file" xsi:type="string">varien/js.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-varienloader-js"> - <arguments> - <argument name="file" xsi:type="string">mage/adminhtml/varienLoader.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> - <arguments> - <argument name="file" xsi:type="string">mage/adminhtml/tools.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="lib-ds-sleight-js"> - <arguments> - <argument name="file" xsi:type="string">lib/ds-sleight.js</argument> - <argument name="properties" xsi:type="array"> - <item name="attributes" xsi:type="string">defer</item> - <item name="ie_condition" xsi:type="string">lt IE 7</item> - </argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Css" name="magento-calendar-css"> - <arguments> - <argument name="file" xsi:type="string">mage/calendar.css</argument> - <argument name="properties" xsi:type="array"> - <item name="attributes" xsi:type="string"/> - </argument> - </arguments> - </block> - - <block class="Magento\Theme\Block\Html\Head\Script" name="requirejs"> - <arguments> - <argument name="file" xsi:type="string">requirejs/require.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="app-config" after="jquery"> - <arguments> - <argument name="file" xsi:type="string">app-config.js</argument> - </arguments> - </block> - <!-- /** - TODO: remove jQuery. jQuery could be loaded through RequireJS. But only in case ALL MODULES ARE AMD MODULES. - Detail: http://requirejs.org/docs/jquery.html#noconflictmap - */ --> - <block class="Magento\Theme\Block\Html\Head\Script" name="jquery" after="requirejs"> - <arguments> - <argument name="file" xsi:type="string">jquery/jquery-1.8.2.js</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-no-conflict" after="jquery"> - <arguments> - <argument name="file" xsi:type="string">mage/jquery-no-conflict.js</argument> - </arguments> - </block> +<page layout="admin-1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceContainer name="global.notices"> + <block class="Magento\Backend\Block\Page\Notices" name="global_notices" as="global_notices" template="page/notices.phtml"/> + </referenceContainer> - <block class="Magento\Theme\Block\Html\Head\Script" name="extjs-ext-tree-js"> - <arguments> - <argument name="file" xsi:type="string">extjs/ext-tree.js</argument> - <argument name="properties" xsi:type="array"> - <item name="attributes" xsi:type="string"/> - <item name="ie_condition" xsi:type="string"/> - <item name="flag_name" xsi:type="string">can_load_ext_js</item> - </argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="extjs-ext-tree-checkbox-js"> - <arguments> - <argument name="file" xsi:type="string">extjs/ext-tree-checkbox.js</argument> - <argument name="properties" xsi:type="array"> - <item name="attributes" xsi:type="string"/> - <item name="ie_condition" xsi:type="string"/> - <item name="flag_name" xsi:type="string">can_load_ext_js</item> - </argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Css" name="extjs-resources-css-ext-all-css"> - <arguments> - <argument name="file" xsi:type="string">extjs/resources/css/ext-all.css</argument> - <argument name="properties" xsi:type="array"> - <item name="attributes" xsi:type="string"/> - <item name="ie_condition" xsi:type="string"/> - <item name="flag_name" xsi:type="string">can_load_ext_js</item> - </argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Css" name="extjs-resources-css-ytheme-magento-css"> - <arguments> - <argument name="file" xsi:type="string">extjs/resources/css/ytheme-magento.css</argument> - <argument name="properties" xsi:type="array"> - <item name="attributes" xsi:type="string"/> - <item name="ie_condition" xsi:type="string"/> - <item name="flag_name" xsi:type="string">can_load_ext_js</item> - </argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-promo-rules-js"> - <arguments> - <argument name="file" xsi:type="string">Magento_Rule::rules.js</argument> - <argument name="properties" xsi:type="array"> - <item name="attributes" xsi:type="string"/> - <item name="ie_condition" xsi:type="string"/> - <item name="flag_name" xsi:type="string">can_load_rules_js</item> - </argument> - </arguments> - </block> - <block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Backend::page/js/components.phtml"/> - <block class="Magento\Framework\View\Element\Html\Calendar" name="head.calendar" as="calendar" template="Magento_Backend::page/js/calendar.phtml"/> + <referenceContainer name="header"> + <block class="Magento\Backend\Block\Page\Header" name="logo" before="-"> + <arguments> + <argument name="show_part" xsi:type="string">logo</argument> + <argument name="edition" translate="true" xsi:type="string">Community Edition</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\GlobalSearch" as="search" after="logo" acl="Magento_Adminhtml::global_search"/> + <block class="Magento\Backend\Block\Page\Header" name="user" after="-"> + <arguments> + <argument name="show_part" xsi:type="string">user</argument> + </arguments> </block> + </referenceContainer> + + <referenceContainer name="page.menu"> <block class="Magento\Backend\Block\Menu" name="menu" as="menu" template="Magento_Backend::menu.phtml"/> - <block class="Magento\Backend\Block\Page\Notices" name="global_notices" as="global_notices" template="page/notices.phtml"/> - <container name="header" htmlTag="header" htmlClass="page-header"> - <block class="Magento\Backend\Block\Page\Header" name="logo" before="-"> - <arguments> - <argument name="show_part" xsi:type="string">logo</argument> - <argument name="edition" translate="true" xsi:type="string">Community Edition</argument> - </arguments> - </block> - <block class="Magento\Backend\Block\GlobalSearch" as="search" after="logo" acl="Magento_Adminhtml::global_search"/> - <block class="Magento\Backend\Block\Page\Header" name="user" after="-"> - <arguments> - <argument name="show_part" xsi:type="string">user</argument> - </arguments> - </block> - </container> - <container name="notifications" as="notifications" label="Notifications"/> + </referenceContainer> + + <referenceContainer name="page.breadcrumbs"> <block class="Magento\Backend\Block\Widget\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> - <!--<update handle="formkey"/> this won't work, see the try/catch and a jammed exception in \Magento\Framework\View\Layout::createBlock() --> + </referenceContainer> + + <referenceContainer name="page.formkey"> <block class="Magento\Backend\Block\Admin\Formkey" name="formkey" as="formkey" template="Magento_Backend::admin/formkey.phtml"/> - <!-- deprecated since 1.7.0.0 see \Magento\Theme\Block\Js\Translate --> + </referenceContainer> + + <referenceContainer name="page.js.translate"> <block class="Magento\Framework\View\Element\Template" name="js_translate" as="js_translate" template="Magento_Backend::page/js/translate.phtml"/> - <container name="main-top" label="main-top" as="main-top"> - <block class="Magento\Theme\Block\Html\Title" name="page-title" template="title.phtml"/> - </container> - <container name="page.main.actions" as="page_main_actions" htmlTag="div" htmlClass="page-main-actions"> - <block class="Magento\Framework\View\Element\Template" name="page.actions.toolbar" template="Magento_Backend::pageactions.phtml" after="-"/> - </container> - <container name="left" as="left" label="Left Column"/> - <container name="content" as="content" label="Content"/> + </referenceContainer> + + <referenceContainer name="main.top"> + <block class="Magento\Theme\Block\Html\Title" name="page-title" template="title.phtml"/> + </referenceContainer> + + <referenceContainer name="page.messages"> <block class="Magento\Framework\View\Element\Messages" name="messages" as="messages"/> - <container name="js" as="js" label="JavaScript"/> - <container name="footer" htmlTag="footer" htmlClass="page-footer"> - <block class="Magento\Backend\Block\Page\Locale" name="locale.switcher" template="Magento_Backend::page/locale.phtml"/> - <container name="legal" htmlTag="div" htmlClass="footer-legal"> - <block class="Magento\Backend\Block\Page\Copyright" name="copyright" as="copyright"/> - <block class="Magento\Backend\Block\Page\Footer" name="version" as="version"> - <arguments> - <argument name="bugreport_url" xsi:type="string">http://www.magentocommerce.com/bug-tracking</argument> - </arguments> - </block> - </container> + </referenceContainer> + + <referenceContainer name="page.main.actions"> + <block class="Magento\Framework\View\Element\Template" name="page.actions.toolbar" template="Magento_Backend::pageactions.phtml" after="-"/> + </referenceContainer> + + <referenceContainer name="footer"> + <block class="Magento\Backend\Block\Page\Locale" name="locale.switcher" template="Magento_Backend::page/locale.phtml"/> + <container name="legal" htmlTag="div" htmlClass="footer-legal"> + <block class="Magento\Backend\Block\Page\Copyright" name="copyright" as="copyright"/> + <block class="Magento\Backend\Block\Page\Footer" name="version" as="version"> + <arguments> + <argument name="bugreport_url" xsi:type="string">http://www.magentocommerce.com/bug-tracking</argument> + </arguments> + </block> </container> - <container name="before_body_end" as="before_body_end" label="Before Body End"/> + </referenceContainer> + + <referenceContainer name="backend.page"> + <block class="Magento\Framework\View\Element\Template" name="page.loader" template="Magento_Backend::admin/loader.phtml" after="-"/> + </referenceContainer> + + <block class="Magento\Backend\Block\Page\Head" name="head" as="head" template="page/head.phtml"> + <action method="setTitle"> + <argument translate="true" name="title" xsi:type="string">Magento Admin</argument> + </action> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-prototype-js"> + <arguments> + <argument name="file" xsi:type="string">prototype/prototype.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-window-js"> + <arguments> + <argument name="file" xsi:type="string">prototype/window.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-builder-js"> + <arguments> + <argument name="file" xsi:type="string">scriptaculous/builder.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-effects-js"> + <arguments> + <argument name="file" xsi:type="string">scriptaculous/effects.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="lib-ccard-js"> + <arguments> + <argument name="file" xsi:type="string">lib/ccard.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-validation-js"> + <arguments> + <argument name="file" xsi:type="string">prototype/validation.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="varien-js-js"> + <arguments> + <argument name="file" xsi:type="string">varien/js.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-varienloader-js"> + <arguments> + <argument name="file" xsi:type="string">mage/adminhtml/varienLoader.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> + <arguments> + <argument name="file" xsi:type="string">mage/adminhtml/tools.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="lib-ds-sleight-js"> + <arguments> + <argument name="file" xsi:type="string">lib/ds-sleight.js</argument> + <argument name="properties" xsi:type="array"> + <item name="attributes" xsi:type="string">defer</item> + <item name="ie_condition" xsi:type="string">lt IE 7</item> + </argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-calendar-css"> + <arguments> + <argument name="file" xsi:type="string">mage/calendar.css</argument> + <argument name="properties" xsi:type="array"> + <item name="attributes" xsi:type="string"/> + </argument> + </arguments> + </block> + + <block class="Magento\Theme\Block\Html\Head\Script" name="requirejs"> + <arguments> + <argument name="file" xsi:type="string">requirejs/require.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="app-config" after="jquery"> + <arguments> + <argument name="file" xsi:type="string">app-config.js</argument> + </arguments> + </block> + <!-- /** + TODO: remove jQuery. jQuery could be loaded through RequireJS. But only in case ALL MODULES ARE AMD MODULES. + Detail: http://requirejs.org/docs/jquery.html#noconflictmap + */ --> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery" after="requirejs"> + <arguments> + <argument name="file" xsi:type="string">jquery/jquery-1.8.2.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-no-conflict" after="jquery"> + <arguments> + <argument name="file" xsi:type="string">mage/jquery-no-conflict.js</argument> + </arguments> + </block> + + <block class="Magento\Theme\Block\Html\Head\Script" name="extjs-ext-tree-js"> + <arguments> + <argument name="file" xsi:type="string">extjs/ext-tree.js</argument> + <argument name="properties" xsi:type="array"> + <item name="attributes" xsi:type="string"/> + <item name="ie_condition" xsi:type="string"/> + <item name="flag_name" xsi:type="string">can_load_ext_js</item> + </argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="extjs-ext-tree-checkbox-js"> + <arguments> + <argument name="file" xsi:type="string">extjs/ext-tree-checkbox.js</argument> + <argument name="properties" xsi:type="array"> + <item name="attributes" xsi:type="string"/> + <item name="ie_condition" xsi:type="string"/> + <item name="flag_name" xsi:type="string">can_load_ext_js</item> + </argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Css" name="extjs-resources-css-ext-all-css"> + <arguments> + <argument name="file" xsi:type="string">extjs/resources/css/ext-all.css</argument> + <argument name="properties" xsi:type="array"> + <item name="attributes" xsi:type="string"/> + <item name="ie_condition" xsi:type="string"/> + <item name="flag_name" xsi:type="string">can_load_ext_js</item> + </argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Css" name="extjs-resources-css-ytheme-magento-css"> + <arguments> + <argument name="file" xsi:type="string">extjs/resources/css/ytheme-magento.css</argument> + <argument name="properties" xsi:type="array"> + <item name="attributes" xsi:type="string"/> + <item name="ie_condition" xsi:type="string"/> + <item name="flag_name" xsi:type="string">can_load_ext_js</item> + </argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-promo-rules-js"> + <arguments> + <argument name="file" xsi:type="string">Magento_Rule::rules.js</argument> + <argument name="properties" xsi:type="array"> + <item name="attributes" xsi:type="string"/> + <item name="ie_condition" xsi:type="string"/> + <item name="flag_name" xsi:type="string">can_load_rules_js</item> + </argument> + </arguments> + </block> + <block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Backend::page/js/components.phtml"/> + <block class="Magento\Framework\View\Element\Html\Calendar" name="head.calendar" as="calendar" template="Magento_Backend::page/js/calendar.phtml"/> </block> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/editor.xml b/app/code/Magento/Backend/view/adminhtml/layout/editor.xml index 6789e6d13b04637dbf78e55d0ddfb214f5df7d6d..f5552723b99ce8f36517969849bbf70e963949dd 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/editor.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/editor.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setCanLoadExtJs"> <argument name="flag" xsi:type="string">1</argument> @@ -44,4 +44,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/empty.xml b/app/code/Magento/Backend/view/adminhtml/layout/empty.xml index c90693dd03d300fcc4466ecbf7dffe50d35ae2a6..7ab3943632ae3d0eec25f80145c657cd4f979e9d 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/empty.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/empty.xml @@ -23,5 +23,5 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml b/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml index f8af802bd20f249b018316bd17a74d539e587d91..d0d766de79ab4b682339d16f290834d24beace34 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Backend\Block\Admin\Formkey" name="formkey" as="formkey" template="Magento_Backend::admin/formkey.phtml"/> -</layout> +</page> 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 ec371c481604cf5de397dec5c8f3b75876eb53ad..77126c89c45226af2dd997ea5239455a91a0880b 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="popup"/> - <referenceBlock name="root"> + <referenceBlock name="backend.page"> <action method="setTemplate"> <argument name="template" xsi:type="string">admin/overlay_popup.phtml</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/popup.xml b/app/code/Magento/Backend/view/adminhtml/layout/popup.xml index 04c62f0d76f1913a8815de812df6e0ceb97a0461..d3766960c3e32eb914bc3e1e0e0cf63b1ca38167 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/popup.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/popup.xml @@ -23,13 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="default"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <remove name="header"/> <remove name="menu"/> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">admin/popup.phtml</argument> - </action> - </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Sales/view/frontend/templates/order/order_rss.phtml b/app/code/Magento/Backend/view/adminhtml/templates/admin/loader.phtml similarity index 84% rename from app/code/Magento/Sales/view/frontend/templates/order/order_rss.phtml rename to app/code/Magento/Backend/view/adminhtml/templates/admin/loader.phtml index 705fb178493c633f6e216cb5255cd89965e2641e..e657e66ff1f1aa206d17d71ff3b62fa2f9f41d17 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/order_rss.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/admin/loader.phtml @@ -22,5 +22,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<?php /** @var $this \Magento\Sales\Block\Order\Info */ ?> -<?php echo $this->getStatusHistoryRssUrl($this->getOrder()) ?> +<div class="loading-old" id="loading-mask" style="display:none;"> + <div class="loader" id="loading_mask_loader"><p><?php echo __('Please wait...') ?></p></div> +</div> 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 bdde118326bc4a3d3b288233eee54a16db057cfc..280bae9956b763bab06f891713a51b6fa9c2e7e2 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml @@ -22,44 +22,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<!doctype html> -<html lang="en"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title><?php echo __('Log into Magento Admin Page') ?></title> - - <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico') ?>" type="image/x-icon" /> - <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico') ?>" type="image/x-icon" /> - - <script type="text/javascript"> - var require = { - "baseUrl": "<?php echo $this->getViewFileUrl('/') ?>", - "paths": { - "jquery/ui": "jquery/jquery-ui-1.9.2", - "mage/components": "mage/backend/components" - } - }; - </script> - - <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/reset.css') ?>" media="all" /> - <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/base.css') ?>" media="all" /> - <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/elements.css') ?>" media="all" /> - <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/form.css') ?>" media="all" /> - <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('css/admin.css') ?>" media="all" /> - <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('css/pages.css') ?>" media="all" /> - <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/utils.css') ?>" media="all" /> - - <script src="<?php echo $this->getViewFileUrl('prototype/prototype.js') ?>"></script> - <script src="<?php echo $this->getViewFileUrl('scriptaculous/effects.js') ?>"></script> - <script src="<?php echo $this->getViewFileUrl('mage/captcha.js') ?>"></script> - <script src="<?php echo $this->getViewFileUrl('modernizr/modernizr.js') ?>"></script> - - <script src="<?php echo $this->getViewFileUrl('requirejs/require.js') ?>"></script> - <script src="<?php echo $this->getViewFileUrl('jquery/jquery-1.8.2.js') ?>"></script> - <script src="<?php echo $this->getViewFileUrl('mage/jquery-no-conflict.js') ?>"></script> - <script src="<?php echo $this->getViewFileUrl('app-config.js') ?>"></script> -</head> -<body id="page-login" class="page-login" onload="document.forms['login-form'].username.focus();"> +<div id="page-login" class="page-login"> <div class="wrapper"> <div class="wrapper-inner"> <div class="form-login form-inline"> @@ -101,6 +64,9 @@ ], function(jQuery){ jQuery('#login-form').form().validation(); }); + jQuery(window).load(function(){ + jQuery('#username').focus(); + }); </script> </div> </div> @@ -110,5 +76,4 @@ <div class="footer-copyright"><?php echo $this->getChildHtml('copyright');?></div> </div> </footer> -</body> -</html> +</div> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/admin/page.phtml b/app/code/Magento/Backend/view/adminhtml/templates/admin/page.phtml deleted file mode 100644 index 088e700b4b22f6765166a44f262bdc51a69f7930..0000000000000000000000000000000000000000 --- a/app/code/Magento/Backend/view/adminhtml/templates/admin/page.phtml +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php /** @var $this \Magento\Backend\Block\Page */ ?> -<!doctype html> -<html lang="<?php echo $this->getLang() ?>" class="no-js"> - -<head> - <?php echo $this->getChildHtml('head') ?> -</head> - -<body id="html-body"<?php echo $this->getBodyClass() ? ' class="' . $this->getBodyClass() . '"' : ''; ?> data-container="body" data-mage-init='{"loaderAjax":{},"loader":{}}'> - <div class="page-wrapper"> - <?php echo $this->getChildHtml('notification_window'); ?> - <?php echo $this->getChildHtml('global_notices') ?> - <div class="page-header-wrapper"> - <?php echo $this->getChildHtml('header') ?> - </div> - <?php echo $this->getChildHtml('menu') ?> - <?php echo $this->getChildHtml('notifications'); ?> - - <section class="page-content" id="anchor-content"> - <?php echo $this->getChildHtml('main-top'); ?> - <div id="messages" data-container-for="messages" class="messages"> - <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> - </div> - <?php echo $this->getChildHtml('page_main_actions'); ?> - <?php if($this->getChildHtml('left')): ?> - <div id="page:main-container" class="<?php echo $this->getContainerCssClass() ?> col-2-left-layout"> - <div class="main-col" id="content"> - <?php echo $this->getChildHtml('content') ?> - </div> - - <div class="side-col" id="page:left"> - <?php echo $this->getChildHtml('left') ?> - </div> - </div> - <?php else: ?> - <div id="page:main-container" class="col-1-layout"> - <?php echo $this->getChildHtml('content') ?> - </div> - <?php endif; ?> - </section> - - <?php echo $this->getChildHtml('js') ?> - <div class="page-footer-wrapper"> - <?php echo $this->getChildHtml('footer') ?> - </div> - </div> - <?php echo $this->getChildHtml('before_body_end') ?> - <!-- TODO: remove this popup after refactoring of "varienLoader.js" file --> - <div class="loading-old" id="loading-mask" style="display:none;"> - <div class="loader" id="loading_mask_loader"><p><?php echo __('Please wait...') ?></p></div> - </div> -</body> -</html> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/dashboard/grid.phtml b/app/code/Magento/Backend/view/adminhtml/templates/dashboard/grid.phtml index c0edc02fad233304d94388fb53847f8b3c7894b2..04d8846fecc44fb3571d87f9d18e7ba381d08831 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/dashboard/grid.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/dashboard/grid.phtml @@ -64,8 +64,6 @@ $numColumns = sizeof($this->getColumns()); </div> <?php if($this->canDisplayContainer()): ?> <script type="text/javascript"> -var <?php echo $this->getJsObjectName() ?>; - var deps = ['mage/adminhtml/grid']; <?php if (strpos($this->getRowClickCallback(), 'order.')!==false): ?> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml index af41c55da34c171e75fda1d775ba1125c44c4dda..4735ef7ac956f0cf216fbd739c24d7275a6046e4 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml @@ -228,6 +228,7 @@ require([ } }; + $$('.shared').each(function(element){ Event.observe(element, 'change', adminSystemConfig.onchangeSharedElement); @@ -361,7 +362,9 @@ require([ jQuery(window).hashchange(handleHash); handleHash(); - }); + }); + + jQuery('body').trigger('adminConfigDefined'); }); </script> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml b/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml index 7292c65216f4ba4384731fb20ab1f602ed18ef96..09c70ed4b899cd1cdb3b83efc3297f9153ad8090 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml @@ -245,8 +245,6 @@ $numColumns = sizeof($this->getColumns()); <?php if ($this->canDisplayContainer()): ?> </div> <script type="text/javascript"> - var <?php echo $this->getJsObjectName() ?>; - var deps = ['mage/adminhtml/grid']; <?php if (strpos($this->getRowClickCallback(), 'order.')!==false): ?> diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index e37e10dc9887bb4dde944f55739398fd9b271718..36a9cad902e4565c305fd08694a5e7437a25d19e 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-cron": "0.1.0-alpha91", - "magento/module-index": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-cron": "0.1.0-alpha92", + "magento/module-index": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml index fa30ef1c8cd79a4fefbd5550b7de8dad9a0798ec..b46a22cd5f056256177711e8ba821ce2b53c4417 100644 --- a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml +++ b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.system.backup.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.backup.grid" as="grid"> <arguments> @@ -115,4 +115,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 0e8b13baf7c04351ad92e4274f0b100e5cf9d3b9..25c7fc8be28235affbd0b8b8f4c8f513754c4cd8 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="backup_index_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.system.backup.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.system.backup.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 0d4edc2d58ef4e7709a3250d77b3b6fc461f6908..7da938812362d54fc0305598bf4bfdb1340e68fd 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="backup_index_block"/> <referenceContainer name="content"> <block class="Magento\Backup\Block\Adminhtml\Backup" name="adminhtml.system.backup.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Bundle/Model/Selection.php b/app/code/Magento/Bundle/Model/Selection.php index bda5dcb8bb2eec916357cb66c9844e310bb2e12b..fbcae5a4af8842377da45f0113fd5c5496a6788f 100644 --- a/app/code/Magento/Bundle/Model/Selection.php +++ b/app/code/Magento/Bundle/Model/Selection.php @@ -90,7 +90,7 @@ class Selection extends \Magento\Framework\Model\AbstractModel * * @return $this */ - protected function _beforeSave() + protected function _afterSave() { if (!$this->_catalogData->isPriceGlobal() && $this->getWebsiteId()) { $this->getResource()->saveSelectionPrice($this); @@ -100,6 +100,6 @@ class Selection extends \Magento\Framework\Model\AbstractModel $this->unsSelectionPriceType(); } } - parent::_beforeSave(); + parent::_afterSave(); } } diff --git a/app/code/Magento/Bundle/Service/V1/Product/Link/Data/ProductLinkBuilder.php b/app/code/Magento/Bundle/Service/V1/Product/Link/Data/ProductLinkBuilder.php index 64c5d665f408f04e2f9025b71b8920c0d7412270..d646232c2da5373f37a055f26735da68fca4095f 100644 --- a/app/code/Magento/Bundle/Service/V1/Product/Link/Data/ProductLinkBuilder.php +++ b/app/code/Magento/Bundle/Service/V1/Product/Link/Data/ProductLinkBuilder.php @@ -41,15 +41,17 @@ class ProductLinkBuilder extends \Magento\Framework\Service\Data\Eav\AbstractObj /** * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder + * @param \Magento\Framework\Service\Config\MetadataConfig $metadataService * @param array $customAttributesCodes */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, AttributeValueBuilder $valueBuilder, + \Magento\Framework\Service\Config\MetadataConfig $metadataService, array $customAttributesCodes = array() ) { $this->customAttributes = $customAttributesCodes; - parent::__construct($objectFactory, $valueBuilder); + parent::__construct($objectFactory, $valueBuilder, $metadataService); } /** diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index 1bc4d0b8abc363b946bb9b87127aa3c2fc34159c..0427ebbc87b2cdad600f153df0a88e4512f9b3b2 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-catalog-rule": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-weee": "0.1.0-alpha91", - "magento/module-gift-message": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", - "magento/module-webapi": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-catalog-rule": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-weee": "0.1.0-alpha92", + "magento/module-gift-message": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", + "magento/module-webapi": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml index 8edca6e1a24cd2482bb5b1eb60333d9ab01229b8..b37651e7132f0ae4e0571d0b52250efd3e7e486a 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/shipment/create/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 84863e26726f7dea0aea3e36af0c48fd9c3d206d..639a2d5e733f48f1e2b5b1ac71a727b3a489d451 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="shipment_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/shipment/view/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 79ed499396bf411e7d4784cb5a2a4967cff8e31b..811f019a72653a0fabf65957c6d8ed04188b9003 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="magento-bundle-css-bundle-product-css"> <arguments> @@ -37,4 +37,4 @@ <argument name="block" xsi:type="string">Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle</argument> </action> </referenceBlock> -</layout> +</page> 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 e99ff5322c775277a21716bbed9878225e840b27..a05ec046b49dc1ba7c2138370dbea8d5e3ec7fc7 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="js"> <block class="Magento\Framework\View\Element\Template" template="Magento_Bundle::product/stock/disabler.phtml"/> </referenceContainer> -</layout> +</page> 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 88415abfe66fa2ecfc37ebfa1ee5b115f0184104..ae413bc432b61d2291d63959b3e7d5a276ca94ec 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product.composite.fieldset"> <block class="Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Bundle" before="product.composite.fieldset.options" name="product.composite.fieldset.bundle" template="product/composite/fieldset/options/bundle.phtml"> <block class="Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Select" name="product.info.bundle.options.select" as="select"/> @@ -32,4 +32,4 @@ <block class="Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Checkbox" name="product.info.bundle.options.checkbox" as="checkbox"/> </block> </referenceBlock> -</layout> +</page> 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 f8cdc778949fd7c1a664ac98523d50abf209ed21..701ce80dfce889346738945c64981efa8215dad1 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer.wishlist.edit.tab"> <arguments> <argument name="product_configuration_helpers" xsi:type="array"> @@ -31,4 +31,4 @@ </argument> </arguments> </referenceBlock> -</layout> +</page> 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 08fa5a75be0556a1abd50ac8cbdd092b758c5fb6..f8512ca004c82d8fc86692adad5cff83b4272302 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/creditmemo/create/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 08fa5a75be0556a1abd50ac8cbdd092b758c5fb6..f8512ca004c82d8fc86692adad5cff83b4272302 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/creditmemo/create/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 f97ff3c4493b63ecd365623a3a2b9047fdefff30..47df9ee96c4e0a17c74626254056545b57db8185 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/creditmemo/view/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 5ea2214651833ee215363a833b8872dc905d9c2b..1b5d422202255f4056e04668a72cba61cf3051cc 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/invoice/create/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 5ea2214651833ee215363a833b8872dc905d9c2b..1b5d422202255f4056e04668a72cba61cf3051cc 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/invoice/create/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 46f55dd174a872ade67f5db47c69d7b32a08a6b8..26f4a9374247facc4ac1871e40506fcbe3f2244d 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/invoice/view/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 627ea4a6c5424796cd3320acbd8a2d22f9297e1e..b2debfb918a2c64dcaa559fb59a62623efdc7129 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\View\Items\Renderer" as="bundle" template="sales/order/view/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml index 31ae5a831dd69fb84c942dfe427e481bd21e04a3..e20732a294b65860af927fafb9641628a33f6168 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml @@ -134,7 +134,6 @@ require([ "jquery", "js/theme", "Magento_Bundle/js/bundle-product", - "prototype", "mage/adminhtml/form" ], function(jQuery){ 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 394956881f61ea92df27f3032099873f9b454b15..eda52ea31e819164873f9dd06a9b154039ed22d4 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="bundle" xsi:type="array"> @@ -42,4 +42,4 @@ </argument> </arguments> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml index 0f96fd61c0de4dcf0cab9dac4dd6b68b8783afcb..34e8c9fe1ebf8441493107bfc7dfbec1ace49aec 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="body.class"> <action method="addBodyClass"> <argument name="value" xsi:type="string">type-bundle</argument> </action> @@ -77,4 +77,4 @@ <container name="product.info.bundle.extra" after="product.info.bundle" as="product_type_data_extra" label="Product Extra Info"/> <block class="Magento\Catalog\Block\Product\View" name="customize.button" as="customize_button" template="Magento_Bundle::catalog/product/view/customize.phtml"/> </referenceContainer> -</layout> +</page> 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 de213eab989f0610fe866097016224c02b198f0c..0c8007031f3c3701ceb9b1c3d90f238af7053350 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product.info.upsell"> <action method="setItemLimit"> <argument name="type" xsi:type="string">bundle</argument> <argument name="limit" xsi:type="string">4</argument> </action> </referenceBlock> -</layout> +</page> 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 d1c5bffba06a610b9a61bbdabe069549c893f895..14109148d3dc739b27fec48e22c866369877f481 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_view_type_bundle"/> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="bundle_cart_configure_head_components" template="Magento_Checkout::js/components.phtml"/> @@ -33,4 +33,4 @@ <argument name="template" xsi:type="string">Magento_Checkout::cart/item/configure/updatecart.phtml</argument> </action> </referenceBlock> -</layout> +</page> 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 15dd78c1ae518a867b440e651b31f80124859c98..f2f506daaa88fa3d4fea099e2e4459614083289a 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\Bundle\Block\Checkout\Cart\Item\Renderer" as="bundle" template="Magento_Checkout::cart/item/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml index ccf4f52e222e9a6f795d3ee23d0eb546ca4f8a74..097874f0ab2c60684f60305bd195c24345d4f5a7 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.sidebar.item.renderers"> <block class="Magento\Bundle\Block\Checkout\Cart\Item\Renderer" as="bundle" template="Magento_Checkout::cart/sidebar/default.phtml"/> </referenceBlock> -</layout> +</page> 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 12316260412269cca711866ad307534eed24ec8b..06ff0971f806cbd433cdf7f80c835cff0b4ed309 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\Bundle\Block\Checkout\Cart\Item\Renderer" as="bundle" template="Magento_Checkout::onepage/review/item.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Bundle/view/frontend/layout/default.xml b/app/code/Magento/Bundle/view/frontend/layout/default.xml index b7ad9b861ed00fc1ef75b15cdf706b64b022a6f8..063e968f615058000728cf203ae41dcc5410647a 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/default.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/default.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="bundle_checkout_page_head_components" template="Magento_Bundle::js/components.phtml"/> </referenceBlock> -</layout> +</page> 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 7c26f54ed627e4015726ad9342daf765e28da6e2..a40be037f3e26c0e942cce4fb11c27a3ef1171fe 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.email.order.creditmemo.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="email/order/items/creditmemo/default.phtml"/> </referenceBlock> -</layout> +</page> 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 3b1e59a24fbc41c47f2e25788abcbb1de6341180..2e7c8d4a8c19c8bd955b8ff8623e2585197715db 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.email.order.invoice.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="email/order/items/invoice/default.phtml"/> </referenceBlock> -</layout> +</page> 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 ce4ca90b1d23adb2344341e96853c84bbedd209b..cd716a4c640e90e9c93b8e0d785088a3d14e7682 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.email.order.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="email/order/items/order/default.phtml"/> </referenceBlock> -</layout> +</page> 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 70b71cdf592f20298493d5d7bab51437e90bbad1..96423a7afbedb8990c93caa4ee40932377ea950e 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.email.order.shipment.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="email/order/items/shipment/default.phtml"/> </referenceBlock> -</layout> +</page> 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 edfd7b457a6ff89c8d7843dd5264f8057841e803..02f9b8e7022fd479f3481c2b55c8cf14fe4b3286 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.creditmemo.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/creditmemo/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 8950f98067d30415b03a1d47fd35e47b31388ebb..90ce68bc66b90e749a1417f311d7b5aacc322173 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/invoice/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 99c68873877794b0d9a8820f0f09f0bd61acadb7..702b8594e61a2d182cd9086bf7b94f2d0cc5d900 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.items.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 90e235cf1742f24041555f360096fd49746fced0..708f56526c1ff4a47043a28472c8669e221e45b2 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.creditmemo.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/creditmemo/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 e718cbfc41d65103e564c287930cc1252eeb6349..a22768f62c6301c1772e520a548911745cb13307 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.invoice.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/invoice/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 c9619be53eba401ea1735ec6ff823af978f12f82..8b7adc46df977f9245916ec30695546919d1fbb9 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 4f54517ab34288b0940a1e10ea6a1c4ff5373925..a76f22c396ecf6f343ed0e35297d74ee41706afc 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.shipment.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/shipment/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> 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 38952e24de719c46362cf2c083d671303cb8eb2b..96f810354adefd705825b94201bda00c7f334fbb 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.shipment.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/shipment/items/renderer.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 0a57db0f697e955cfd56cb2faf5454234368d116..53f5e302ccd9c73448d4b2be358192d68a915e40 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml b/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml index 0a6eceb5519cf210cdb9549fd5bad7a9e29183d7..b27b0583c47bde32df9ef24eb9a30d1a54b5dd6c 100644 --- a/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml +++ b/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha"> <action method="setFormId"> @@ -37,4 +37,4 @@ </action> </block> </referenceContainer> -</layout> +</page> 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 056c79ca6ebedcc0e7bb7ed1d0bac0bf63c14540..7a03772a5095e4684d5abbd09edbd176ce8444dd 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha"> <action method="setFormId"> @@ -37,4 +37,4 @@ </action> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml index ea6a0533cf8ec48df968c54977bd0cddab246a43..8effff1b9a9536edbd2f6dc04e1df64a23ab0978 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.login.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> <action method="setFormId"> @@ -65,4 +65,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="captcha_page_head_components" template="Magento_Captcha::js/components.phtml"/> </referenceBlock> -</layout> +</page> 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 affbbb616da3d851a77f8030a60ed8458ed3d436..1d4de8a5c2998f814a9f75a59651479c086a5988 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> <action method="setFormId"> @@ -40,4 +40,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="captcha_page_head_components" template="Magento_Captcha::js/components.phtml"/> </referenceBlock> -</layout> +</page> 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 67cc574af8ca50ad37cd9b79a59d511d42d1014d..3ad54c8ae345ff5cc82d1ff20d1184024b73401c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> <action method="setFormId"> @@ -40,4 +40,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="captcha_page_head_components" template="Magento_Captcha::js/components.phtml"/> </referenceBlock> -</layout> +</page> 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 5ce7ad5e5541adf7accb0ce42b5321f7cdadc684..25c56b77d4c112c68d44a48cfbe133c99aedfa46 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> <action method="setFormId"> @@ -40,4 +40,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="captcha_page_head_components" template="Magento_Captcha::js/components.phtml"/> </referenceBlock> -</layout> +</page> 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 f458c779d69ed904dc261228c0a061bb700b7fec..094ed7f082a9d491e73768adec5707d628a9a7eb 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> <action method="setFormId"> @@ -40,4 +40,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="captcha_page_head_components" template="Magento_Captcha::js/components.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index b8d09e0cbcc0bc8e43212109b8457e53084af0a4..850ae06b7098658c9aa4bc2e8e0f8e4ad2ac06c8 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -109,11 +109,6 @@ abstract class AbstractProduct extends \Magento\Framework\View\Element\Template */ protected $_compareProduct; - /** - * @var \Magento\Theme\Helper\Layout - */ - protected $_layoutHelper; - /** * @var \Magento\Catalog\Helper\Image */ @@ -138,7 +133,6 @@ abstract class AbstractProduct extends \Magento\Framework\View\Element\Template array $data = array() ) { $this->_imageHelper = $context->getImageHelper(); - $this->_layoutHelper = $context->getLayoutHelper(); $this->_compareProduct = $context->getCompareProduct(); $this->_wishlistHelper = $context->getWishlistHelper(); $this->_cartHelper = $context->getCartHelper(); @@ -355,7 +349,6 @@ abstract class AbstractProduct extends \Magento\Framework\View\Element\Template $this->setData('column_count', $this->_defaultColumnCount); } } - return (int) $this->_getData('column_count'); } @@ -405,11 +398,12 @@ abstract class AbstractProduct extends \Magento\Framework\View\Element\Template /** * Retrieve current page layout * - * @return \Magento\Framework\Object + * @return string */ public function getPageLayout() { - return $this->_layoutHelper->getCurrentPageLayout(); + // TODO: Implement of getting current page layout + return ''; } /** diff --git a/app/code/Magento/Catalog/Block/Product/Compare/Sidebar.php b/app/code/Magento/Catalog/Block/Product/Compare/Sidebar.php index 81ee137e60eba155e0131a9954678f737375de23..ee9c11c96b889f663d9c7a70b5ad9a3dc804eee4 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/Sidebar.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/Sidebar.php @@ -26,9 +26,7 @@ namespace Magento\Catalog\Block\Product\Compare; use Magento\Catalog\Model\Product\Compare\Item as CompareItem; /** - * Catalog Comapare Products Sidebar Block - * - * @author Magento Core Team <core@magentocommerce.com> + * Catalog Compare Products Sidebar Block */ class Sidebar extends \Magento\Catalog\Block\Product\Compare\AbstractCompare implements \Magento\Framework\View\Block\IdentityInterface diff --git a/app/code/Magento/Catalog/Block/Product/Context.php b/app/code/Magento/Catalog/Block/Product/Context.php index df1b21decebbd7e161612e317c68f75700cdb184..2a3708fea28ff39c8bd59dd2d12a552606ae9d59 100644 --- a/app/code/Magento/Catalog/Block/Product/Context.php +++ b/app/code/Magento/Catalog/Block/Product/Context.php @@ -33,11 +33,6 @@ class Context extends \Magento\Framework\View\Element\Template\Context */ protected $imageHelper; - /** - * @var \Magento\Theme\Helper\Layout - */ - protected $layoutHelper; - /** * @var \Magento\Catalog\Helper\Product\Compare */ @@ -120,7 +115,6 @@ class Context extends \Magento\Framework\View\Element\Template\Context * @param \Magento\Checkout\Helper\Cart $cartHelper * @param \Magento\Wishlist\Helper\Data $wishlistHelper * @param \Magento\Catalog\Helper\Product\Compare $compareProduct - * @param \Magento\Theme\Helper\Layout $layoutHelper * @param \Magento\Catalog\Helper\Image $imageHelper * @param ReviewRendererInterface $reviewRenderer * @param \Magento\CatalogInventory\Service\V1\StockItemService $stockItemService @@ -159,13 +153,11 @@ class Context extends \Magento\Framework\View\Element\Template\Context \Magento\Checkout\Helper\Cart $cartHelper, \Magento\Wishlist\Helper\Data $wishlistHelper, \Magento\Catalog\Helper\Product\Compare $compareProduct, - \Magento\Theme\Helper\Layout $layoutHelper, \Magento\Catalog\Helper\Image $imageHelper, ReviewRendererInterface $reviewRenderer, \Magento\CatalogInventory\Service\V1\StockItemService $stockItemService ) { $this->imageHelper = $imageHelper; - $this->layoutHelper = $layoutHelper; $this->compareProduct = $compareProduct; $this->wishlistHelper = $wishlistHelper; $this->cartHelper = $cartHelper; @@ -251,14 +243,6 @@ class Context extends \Magento\Framework\View\Element\Template\Context return $this->imageHelper; } - /** - * @return \Magento\Theme\Helper\Layout - */ - public function getLayoutHelper() - { - return $this->layoutHelper; - } - /** * @return \Magento\Framework\Math\Random */ diff --git a/app/code/Magento/Catalog/Block/Product/NewProduct.php b/app/code/Magento/Catalog/Block/Product/NewProduct.php index aabbafe65911d5c047fedd23e1bdafb1d35d0599..8cebb1346225eb371ffffc85526b13c223f9feaf 100644 --- a/app/code/Magento/Catalog/Block/Product/NewProduct.php +++ b/app/code/Magento/Catalog/Block/Product/NewProduct.php @@ -94,23 +94,11 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct implemen protected function _construct() { parent::_construct(); - - $this->addColumnCountLayoutDepend( - 'empty', - 6 - )->addColumnCountLayoutDepend( - 'one_column', - 5 - )->addColumnCountLayoutDepend( - 'two_columns_left', - 4 - )->addColumnCountLayoutDepend( - 'two_columns_right', - 4 - )->addColumnCountLayoutDepend( - 'three_columns', - 3 - ); + $this->addColumnCountLayoutDepend('empty', 6) + ->addColumnCountLayoutDepend('1column', 5) + ->addColumnCountLayoutDepend('2columns-left', 4) + ->addColumnCountLayoutDepend('2columns-right', 4) + ->addColumnCountLayoutDepend('3columns', 3); $this->addData( array('cache_lifetime' => 86400, 'cache_tags' => array(\Magento\Catalog\Model\Product::CACHE_TAG)) diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php index 116a8a79ffc8e35e61fca21b1c00e5fa7831fa3e..ad1b41d58487996e2210852376fff84eb34305da 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php @@ -92,8 +92,9 @@ class Attribute extends \Magento\Backend\App\Action } else { $this->_view->loadLayout(array('popup', 'catalog_product_attribute_edit_popup')); } - - $this->_view->getLayout()->getBlock('root')->addBodyClass('attribute-popup'); + /** @var \Magento\Framework\View\Page\Config $pageConfig */ + $pageConfig = $this->_objectManager->get('Magento\Framework\View\Page\Config'); + $pageConfig->addBodyClass('attribute-popup'); } else { $this->_view->loadLayout(); $this->_addBreadcrumb( diff --git a/app/code/Magento/Catalog/Controller/Category/View.php b/app/code/Magento/Catalog/Controller/Category/View.php index 6a2fda5a8b17e7d0eb1d5fd22c8c2ef1bff735a5..e60825d2df87fef4e1326b65a3f6dcd7905f79e5 100644 --- a/app/code/Magento/Catalog/Controller/Category/View.php +++ b/app/code/Magento/Catalog/Controller/Category/View.php @@ -134,6 +134,7 @@ class View extends \Magento\Framework\App\Action\Action $category = $this->_initCategory(); if ($category) { $settings = $this->_catalogDesign->getDesignSettings($category); + $pageConfig = $this->_view->getPage()->getConfig(); // apply custom design if ($settings->getCustomDesign()) { @@ -142,8 +143,12 @@ class View extends \Magento\Framework\App\Action\Action $this->_catalogSession->setLastViewedCategoryId($category->getId()); + // apply custom layout (page) template once the blocks are generated + if ($settings->getPageLayout()) { + $pageConfig->setPageLayout($settings->getPageLayout()); + } + $this->_view->getPage()->initLayout(); $update = $this->_view->getLayout()->getUpdate(); - $update->addHandle('default'); if ($category->getIsAnchor()) { $type = $category->hasChildren() ? 'layered' : 'layered_without_children'; } else { @@ -157,10 +162,6 @@ class View extends \Magento\Framework\App\Action\Action } $this->_view->addPageLayoutHandles(array('type' => $type, 'id' => $category->getId())); - // apply custom layout (page) template once the blocks are generated - if ($settings->getPageLayout()) { - $this->_objectManager->get('Magento\Theme\Helper\Layout')->applyHandle($settings->getPageLayout()); - } $this->_view->loadLayoutUpdates(); // apply custom layout update once layout is loaded @@ -174,14 +175,9 @@ class View extends \Magento\Framework\App\Action\Action $this->_view->generateLayoutXml(); $this->_view->generateLayoutBlocks(); - $root = $this->_view->getLayout()->getBlock('root'); - if ($root) { - $root->addBodyClass( - 'categorypath-' . $category->getUrlPath() - )->addBodyClass( - 'category-' . $category->getUrlKey() - ); - } + $pageConfig->addBodyClass('page-products') + ->addBodyClass('categorypath-' . $category->getUrlPath()) + ->addBodyClass('category-' . $category->getUrlKey()); $this->_view->getLayout()->initMessages(); $this->_view->renderLayout(); diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index 51c5a493ffa777c2333a269c48f2b83cd222629c..6c6bf3612967d8eeaecea850f9126c902d797c0e 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -637,7 +637,7 @@ class Image extends AbstractHelper { $size = explode('x', strtolower($string)); if (sizeof($size) == 2) { - return array('width' => $size[0] > 0 ? $size[0] : null, 'heigth' => $size[1] > 0 ? $size[1] : null); + return array('width' => $size[0] > 0 ? $size[0] : null, 'height' => $size[1] > 0 ? $size[1] : null); } return false; } diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php index a78164a075642c2f3f26e9d2aa3cfff098b75f38..db0a65704c096025874a885355798f5544630d2b 100644 --- a/app/code/Magento/Catalog/Helper/Product/View.php +++ b/app/code/Magento/Catalog/Helper/Product/View.php @@ -22,13 +22,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Catalog\Helper\Product; + /** * Catalog category helper - * - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Catalog\Helper\Product; - class View extends \Magento\Framework\App\Helper\AbstractHelper { // List of exceptions throwable during prepareAndRender() method @@ -57,13 +55,6 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper */ protected $_catalogProduct = null; - /** - * Catalog product - * - * @var \Magento\Theme\Helper\Layout - */ - protected $_pageLayout = null; - /** * Catalog design * @@ -93,7 +84,6 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\Catalog\Model\Design $catalogDesign * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Theme\Helper\Layout $pageLayout * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Framework\App\ViewInterface $view * @param \Magento\Framework\Message\ManagerInterface $messageManager @@ -104,7 +94,6 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper \Magento\Catalog\Model\Session $catalogSession, \Magento\Catalog\Model\Design $catalogDesign, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Theme\Helper\Layout $pageLayout, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\App\ViewInterface $view, \Magento\Framework\Message\ManagerInterface $messageManager, @@ -113,7 +102,6 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper $this->_catalogSession = $catalogSession; $this->_catalogDesign = $catalogDesign; $this->_catalogProduct = $catalogProduct; - $this->_pageLayout = $pageLayout; $this->_coreRegistry = $coreRegistry; $this->_view = $view; $this->messageGroups = $messageGroups; @@ -133,13 +121,20 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper public function initProductLayout($product, $controller, $params = null) { $settings = $this->_catalogDesign->getDesignSettings($product); + $pageConfig = $this->_view->getPage()->getConfig(); if ($settings->getCustomDesign()) { $this->_catalogDesign->applyCustomDesign($settings->getCustomDesign()); } + // Apply custom page layout + if ($settings->getPageLayout()) { + $pageConfig->setPageLayout($settings->getPageLayout()); + } + + // Load default page handles and page configurations + $this->_view->getPage()->initLayout(); $update = $this->_view->getLayout()->getUpdate(); - $update->addHandle('default'); if ($params && $params->getBeforeHandles()) { foreach ($params->getBeforeHandles() as $handle) { @@ -162,7 +157,6 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper ); } } - $this->_view->loadLayoutUpdates(); // Apply custom layout update once layout is loaded $layoutUpdates = $settings->getLayoutUpdates(); @@ -177,26 +171,16 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper $this->_view->generateLayoutXml(); $this->_view->generateLayoutBlocks(); - // Apply custom layout (page) template once the blocks are generated - if ($settings->getPageLayout()) { - $this->_pageLayout->applyTemplate($settings->getPageLayout()); - } - $currentCategory = $this->_coreRegistry->registry('current_category'); - $root = $this->_view->getLayout()->getBlock('root'); - if ($root) { - $controllerClass = $this->_request->getFullActionName(); - if ($controllerClass != 'catalog-product-view') { - $root->addBodyClass('catalog-product-view'); - } - $root->addBodyClass('product-' . $product->getUrlKey()); - if ($currentCategory instanceof \Magento\Catalog\Model\Category) { - $root->addBodyClass( - 'categorypath-' . $currentCategory->getUrlPath() - )->addBodyClass( - 'category-' . $currentCategory->getUrlKey() - ); - } + + $controllerClass = $this->_request->getFullActionName(); + if ($controllerClass != 'catalog-product-view') { + $pageConfig->addBodyClass('catalog-product-view'); + } + $pageConfig->addBodyClass('product-' . $product->getUrlKey()); + if ($currentCategory instanceof \Magento\Catalog\Model\Category) { + $pageConfig->addBodyClass('categorypath-' . $currentCategory->getUrlPath()) + ->addBodyClass('category-' . $currentCategory->getUrlKey()); } return $this; diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php b/app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php index 9c3933e97745c621a4cea89ae8042ea8d26152e4..9d5be92aef6fa8a6b7d60ef585758e7da0ef62d9 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php @@ -31,20 +31,16 @@ namespace Magento\Catalog\Model\Category\Attribute\Source; class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** - * Page source layout - * - * @var \Magento\Theme\Model\Layout\Source\Layout + * @var \Magento\Core\Model\PageLayout\Config\Builder */ - protected $_pageSourceLayout; + protected $pageLayoutBuilder; /** - * Construct - * - * @param \Magento\Theme\Model\Layout\Source\Layout $pageSourceLayout + * @param \Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder */ - public function __construct(\Magento\Theme\Model\Layout\Source\Layout $pageSourceLayout) + public function __construct(\Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder) { - $this->_pageSourceLayout = $pageSourceLayout; + $this->pageLayoutBuilder = $pageLayoutBuilder; } /** @@ -53,7 +49,7 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource public function getAllOptions() { if (!$this->_options) { - $this->_options = $this->_pageSourceLayout->toOptionArray(); + $this->_options = $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray(); array_unshift($this->_options, array('value' => '', 'label' => __('No layout updates'))); } return $this->_options; diff --git a/app/code/Magento/Catalog/Model/Observer/Reindex.php b/app/code/Magento/Catalog/Model/Observer/Reindex.php deleted file mode 100644 index a58cbb9f3fb5016bc3163cb41d980dc1cc6b1aba..0000000000000000000000000000000000000000 --- a/app/code/Magento/Catalog/Model/Observer/Reindex.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Catalog\Model\Observer; - -/** - * Catalog Observer Reindex - * - * @author Magento Core Team <core@magentocommerce.com> - */ -class Reindex -{ - /** - * Object manager - * - * @var \Magento\Framework\ObjectManager - */ - protected $_objectManager; - - /** - * Constructor - * - * @param \Magento\Framework\ObjectManager $objectManager - */ - public function __construct(\Magento\Framework\ObjectManager $objectManager) - { - $this->_objectManager = $objectManager; - } - - /** - * Reindex fulltext - * - * @param \Magento\Framework\Event\Observer $observer - * @return $this - */ - public function fulltextReindex(\Magento\Framework\Event\Observer $observer) - { - /** @var $category \Magento\Catalog\Model\Category */ - $category = $observer->getDataObject(); - if ($category && count($category->getAffectedProductIds()) > 0) { - /** @var $resource \Magento\CatalogSearch\Model\Resource\Fulltext */ - $resource = $this->_objectManager->get('Magento\CatalogSearch\Model\Resource\Fulltext'); - $resource->rebuildIndex(null, $category->getAffectedProductIds()); - } - return $this; - } -} diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php index 032dce61c7fdfc0d1c9e4aaef77e74e0da5ba541..1c9cb7a73d910b1ea68831c7fb0443ee2e6cde4c 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php @@ -31,20 +31,16 @@ namespace Magento\Catalog\Model\Product\Attribute\Source; class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** - * Page source layout - * - * @var \Magento\Theme\Model\Layout\Source\Layout + * @var \Magento\Core\Model\PageLayout\Config\Builder */ - protected $_pageSourceLayout; + protected $pageLayoutBuilder; /** - * Construct - * - * @param \Magento\Theme\Model\Layout\Source\Layout $pageSourceLayout + * @param \Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder */ - public function __construct(\Magento\Theme\Model\Layout\Source\Layout $pageSourceLayout) + public function __construct(\Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder) { - $this->_pageSourceLayout = $pageSourceLayout; + $this->pageLayoutBuilder = $pageLayoutBuilder; } /** @@ -53,7 +49,7 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource public function getAllOptions() { if (!$this->_options) { - $this->_options = $this->_pageSourceLayout->toOptionArray(); + $this->_options = $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray(); array_unshift($this->_options, array('value' => '', 'label' => __('No layout updates'))); } return $this->_options; diff --git a/app/code/Magento/Catalog/Model/Product/Image.php b/app/code/Magento/Catalog/Model/Product/Image.php index cc8b28d2865d7d5100457443cc1849145a36b13f..d2372eec3f71d7c78cc4abaa0a34caa2d50559ff 100644 --- a/app/code/Magento/Catalog/Model/Product/Image.php +++ b/app/code/Magento/Catalog/Model/Product/Image.php @@ -122,7 +122,7 @@ class Image extends \Magento\Framework\Model\AbstractModel /** * @var int */ - protected $_watermarkHeigth; + protected $_watermarkHeight; /** * @var int @@ -212,7 +212,7 @@ class Image extends \Magento\Framework\Model\AbstractModel $this->_coreFileStorageDatabase = $coreFileStorageDatabase; parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); - $this->_mediaDirectory->create($this->_catalogProductMediaConfig->getBaseMediaPath()); + $result = $this->_mediaDirectory->create($this->_catalogProductMediaConfig->getBaseMediaPath()); $this->_imageFactory = $imageFactory; $this->_assetRepo = $assetRepo; $this->_viewFileSystem = $viewFileSystem; @@ -621,10 +621,10 @@ class Image extends \Magento\Framework\Model\AbstractModel * * @param string $file * @param string $position - * @param string $size + * @param array $size ['width' => int, 'height' => int] * @param int $width - * @param int $heigth - * @param int $imageOpacity + * @param int $height + * @param int $opacity * @return $this */ public function setWatermark( @@ -632,8 +632,8 @@ class Image extends \Magento\Framework\Model\AbstractModel $position = null, $size = null, $width = null, - $heigth = null, - $imageOpacity = null + $height = null, + $opacity = null ) { if ($this->_isBaseFilePlaceholder) { return $this; @@ -654,11 +654,11 @@ class Image extends \Magento\Framework\Model\AbstractModel if ($width) { $this->setWatermarkWidth($width); } - if ($heigth) { - $this->setWatermarkHeight($heigth); + if ($height) { + $this->setWatermarkHeight($height); } - if ($imageOpacity) { - $this->setImageOpacity($imageOpacity); + if ($opacity) { + $this->setWatermarkImageOpacity($opacity); } $filePath = $this->_getWatermarkFilePath(); @@ -843,7 +843,7 @@ class Image extends \Magento\Framework\Model\AbstractModel public function setWatermarkSize($size) { if (is_array($size)) { - $this->setWatermarkWidth($size['width'])->setWatermarkHeight($size['heigth']); + $this->setWatermarkWidth($size['width'])->setWatermarkHeight($size['height']); } return $this; } @@ -878,7 +878,7 @@ class Image extends \Magento\Framework\Model\AbstractModel */ public function setWatermarkHeight($height) { - $this->_watermarkHeigth = $height; + $this->_watermarkHeight = $height; return $this; } @@ -889,7 +889,7 @@ class Image extends \Magento\Framework\Model\AbstractModel */ public function getWatermarkHeight() { - return $this->_watermarkHeigth; + return $this->_watermarkHeight; } /** diff --git a/app/code/Magento/Catalog/Service/V1/Category/MetadataService.php b/app/code/Magento/Catalog/Service/V1/Category/MetadataService.php index aa098a384e47db6af4b3ff65502fbccda918b6a3..87a18ed9e704bf34a481977da8318dacf28a88f5 100644 --- a/app/code/Magento/Catalog/Service/V1/Category/MetadataService.php +++ b/app/code/Magento/Catalog/Service/V1/Category/MetadataService.php @@ -24,13 +24,14 @@ namespace Magento\Catalog\Service\V1\Category; use Magento\Catalog\Service\V1\Data\Eav\AttributeMetadata; +use Magento\Framework\Service\Config\MetadataConfig; /** * Class AttributeMetadataService */ class MetadataService implements MetadataServiceInterface { - /** @var \Magento\Catalog\Service\V1\MetadataService */ + /** @var \Magento\Catalog\Service\V1\MetadataServiceInterface */ protected $metadataService; /** @@ -44,33 +45,42 @@ class MetadataService implements MetadataServiceInterface private $filterBuilder; /** - * @param \Magento\Catalog\Service\V1\MetadataService $metadataService + * @var MetadataConfig + */ + private $metadataConfig; + + /** + * Initialize dependencies. + * + * @param \Magento\Catalog\Service\V1\MetadataServiceInterface $metadataService * @param \Magento\Framework\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder * @param \Magento\Framework\Service\V1\Data\FilterBuilder $filterBuilder + * @param MetadataConfig $metadataConfig */ public function __construct( - \Magento\Catalog\Service\V1\MetadataService $metadataService, + \Magento\Catalog\Service\V1\MetadataServiceInterface $metadataService, \Magento\Framework\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder, - \Magento\Framework\Service\V1\Data\FilterBuilder $filterBuilder + \Magento\Framework\Service\V1\Data\FilterBuilder $filterBuilder, + MetadataConfig $metadataConfig ) { $this->metadataService = $metadataService; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->filterBuilder = $filterBuilder; + $this->metadataConfig = $metadataConfig; } /** - * Retrieve custom EAV attribute metadata of category - * - * @param int $attributeSetId - * @return AttributeMetadata[] + * {@inheritdoc} */ - public function getCustomAttributesMetadata($attributeSetId = MetadataServiceInterface::DEFAULT_ATTRIBUTE_SET_ID) + public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_OBJECT_CLASS_NAME) { $customAttributes = []; - foreach ($this->getCategoryAttributesMetadata($attributeSetId) as $attributeMetadata) { + foreach ($this->getCategoryAttributesMetadata( + MetadataServiceInterface::DEFAULT_ATTRIBUTE_SET_ID + ) as $attributeMetadata) { $customAttributes[] = $attributeMetadata; } - return $customAttributes; + return array_merge($customAttributes, $this->metadataConfig->getCustomAttributesMetadata($dataObjectClassName)); } /** diff --git a/app/code/Magento/Catalog/Service/V1/Category/MetadataServiceInterface.php b/app/code/Magento/Catalog/Service/V1/Category/MetadataServiceInterface.php index 32a00ff0982260fbed53826f42aac58affed5e68..2e277ebd7b3a063de99a96bdbd63540c4f35aeab 100644 --- a/app/code/Magento/Catalog/Service/V1/Category/MetadataServiceInterface.php +++ b/app/code/Magento/Catalog/Service/V1/Category/MetadataServiceInterface.php @@ -28,7 +28,7 @@ use Magento\Catalog\Service\V1\Data\Eav\AttributeMetadata; /** * Class Category MetadataServiceInterface */ -interface MetadataServiceInterface +interface MetadataServiceInterface extends \Magento\Framework\Service\Data\Eav\MetadataServiceInterface { /**#@+ * Predefined constants @@ -36,21 +36,20 @@ interface MetadataServiceInterface const ENTITY_TYPE = 'catalog_category'; const DEFAULT_ATTRIBUTE_SET_ID = 3; + + const DATA_OBJECT_CLASS_NAME = 'Magento\Catalog\Service\V1\Data\Category'; /**#@-*/ /** - * Retrieve custom EAV attribute metadata of category + * Retrieve EAV attribute metadata of category * * @param int $attributeSetId * @return AttributeMetadata[] */ - public function getCustomAttributesMetadata($attributeSetId = self::DEFAULT_ATTRIBUTE_SET_ID); + public function getCategoryAttributesMetadata($attributeSetId = self::DEFAULT_ATTRIBUTE_SET_ID); /** - * Retrieve EAV attribute metadata of category - * - * @param int $attributeSetId - * @return AttributeMetadata[] + * {@inheritdoc} */ - public function getCategoryAttributesMetadata($attributeSetId = self::DEFAULT_ATTRIBUTE_SET_ID); + public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_OBJECT_CLASS_NAME); } diff --git a/app/code/Magento/Catalog/Service/V1/Data/CategoryBuilder.php b/app/code/Magento/Catalog/Service/V1/Data/CategoryBuilder.php index 9d002c3a10109754cbe2151e7b4fb913084403c3..392999218e1551d90ac39388c603bfb3a0cd1b26 100644 --- a/app/code/Magento/Catalog/Service/V1/Data/CategoryBuilder.php +++ b/app/code/Magento/Catalog/Service/V1/Data/CategoryBuilder.php @@ -25,43 +25,20 @@ namespace Magento\Catalog\Service\V1\Data; use Magento\Framework\Service\Data\Eav\AbstractObjectBuilder; use Magento\Framework\Service\Data\Eav\AttributeValueBuilder; -use Magento\Catalog\Service\V1\Category\MetadataServiceInterface; class CategoryBuilder extends AbstractObjectBuilder { /** - * @var MetadataServiceInterface - */ - protected $metadataService; - - /** - * Initialize dependencies - * * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder - * @param MetadataServiceInterface $metadataService + * @param \Magento\Catalog\Service\V1\Category\MetadataServiceInterface $metadataService */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, AttributeValueBuilder $valueBuilder, - MetadataServiceInterface $metadataService + \Magento\Catalog\Service\V1\Category\MetadataServiceInterface $metadataService ) { - parent::__construct($objectFactory, $valueBuilder); - $this->metadataService = $metadataService; - } - - /** - * Template method used to configure the attribute codes for the category attributes - * - * @return string[] - */ - public function getCustomAttributesCodes() - { - $attributeCodes = array(); - foreach ($this->metadataService->getCustomAttributesMetadata() as $attribute) { - $attributeCodes[] = $attribute->getAttributeCode(); - } - return $attributeCodes; + parent::__construct($objectFactory, $valueBuilder, $metadataService); } /** diff --git a/app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadata.php b/app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadata.php index 4ae46cb294a5cc387bc7982bd24c7da5b191006b..b976790286818566fe08ab4f1e6f60ded87e3c35 100644 --- a/app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadata.php +++ b/app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadata.php @@ -24,11 +24,12 @@ namespace Magento\Catalog\Service\V1\Data\Eav; use \Magento\Framework\Service\Data\Eav\AbstractObject; +use Magento\Framework\Service\Data\Eav\MetadataObjectInterface; /** * Class AttributeMetadata */ -class AttributeMetadata extends AbstractObject +class AttributeMetadata extends AbstractObject implements MetadataObjectInterface { /**#@+ * Constants used as keys into $_data diff --git a/app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadataBuilder.php b/app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadataBuilder.php index 559362e58d101ead9d0b411dba96fa2bce2f6861..c369b3b9fca1df2517c1ae8c15362fbbe6160314 100644 --- a/app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadataBuilder.php +++ b/app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadataBuilder.php @@ -23,12 +23,13 @@ */ namespace Magento\Catalog\Service\V1\Data\Eav; -use Magento\Framework\Service\Data\Eav\AbstractObjectBuilder; +use Magento\Framework\Service\Data\AbstractObjectBuilder; +use Magento\Framework\Service\Data\AttributeMetadataBuilderInterface; /** * Class AttributeMetadataBuilder */ -class AttributeMetadataBuilder extends AbstractObjectBuilder +class AttributeMetadataBuilder extends AbstractObjectBuilder implements AttributeMetadataBuilderInterface { /** * Option builder @@ -53,19 +54,17 @@ class AttributeMetadataBuilder extends AbstractObjectBuilder * Initializes builder. * * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory - * @param \Magento\Framework\Service\Data\Eav\AttributeValueBuilder $valueBuilder * @param OptionBuilder $optionBuilder * @param ValidationRuleBuilder $validationRuleBuilder * @param Product\Attribute\FrontendLabelBuilder $frontendLabelBuilder */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, - \Magento\Framework\Service\Data\Eav\AttributeValueBuilder $valueBuilder, OptionBuilder $optionBuilder, ValidationRuleBuilder $validationRuleBuilder, Product\Attribute\FrontendLabelBuilder $frontendLabelBuilder ) { - parent::__construct($objectFactory, $valueBuilder); + parent::__construct($objectFactory); $this->optionBuilder = $optionBuilder; $this->validationRuleBuilder = $validationRuleBuilder; $this->frontendLabelBuilder = $frontendLabelBuilder; @@ -131,7 +130,7 @@ class AttributeMetadataBuilder extends AbstractObjectBuilder /** * Set options - * + * * @param \Magento\Catalog\Service\V1\Data\Eav\Option[] $options * @return $this */ diff --git a/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/AttributeMetadata.php b/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/AttributeMetadata.php index 2f4b3ac823ee2d0e02fc3dbcfea10f3efd7899b1..055c6efc5a9b4980f8cb093ac931c7702dd42bd1 100644 --- a/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/AttributeMetadata.php +++ b/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/AttributeMetadata.php @@ -24,8 +24,9 @@ namespace Magento\Catalog\Service\V1\Data\Eav\Category; use \Magento\Framework\Service\Data\Eav\AbstractObject; +use Magento\Framework\Service\Data\Eav\MetadataObjectInterface; -class AttributeMetadata extends AbstractObject +class AttributeMetadata extends AbstractObject implements MetadataObjectInterface { const ATTRIBUTE_ID = 'attribute_id'; diff --git a/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/AttributeMetadataBuilder.php b/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/AttributeMetadataBuilder.php index 8b5fa303f8340ead07f72bdf4a15af03c84b4914..d6824b2cdb2395a1630aea0ed6e6d32d777c2b80 100644 --- a/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/AttributeMetadataBuilder.php +++ b/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/AttributeMetadataBuilder.php @@ -24,8 +24,9 @@ namespace Magento\Catalog\Service\V1\Data\Eav\Category; use Magento\Framework\Service\Data\AbstractObjectBuilder; +use Magento\Framework\Service\Data\AttributeMetadataBuilderInterface; -class AttributeMetadataBuilder extends AbstractObjectBuilder +class AttributeMetadataBuilder extends AbstractObjectBuilder implements AttributeMetadataBuilderInterface { /** * Set attribute id diff --git a/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/Info/MetadataBuilder.php b/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/Info/MetadataBuilder.php index 485e5feeb8f75441d1b1040f3a92e797395ec16e..e75105a294b51e6cbba4465787d3d6a127f59202 100644 --- a/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/Info/MetadataBuilder.php +++ b/app/code/Magento/Catalog/Service/V1/Data/Eav/Category/Info/MetadataBuilder.php @@ -21,44 +21,30 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Catalog\Service\V1\Data\Eav\Category\Info; -use Magento\Catalog\Service\V1\Category\MetadataServiceInterface; use Magento\Framework\Service\Data\Eav\AbstractObjectBuilder; use Magento\Framework\Service\Data\Eav\AttributeValueBuilder; -use Magento\Framework\Service\Data\ObjectFactory; /** * Class MetadataBuilder + * * @codeCoverageIgnore */ class MetadataBuilder extends AbstractObjectBuilder { /** - * @param ObjectFactory $objectFactory + * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder - * @param MetadataServiceInterface $metadataService + * @param \Magento\Catalog\Service\V1\Category\MetadataServiceInterface $metadataService */ public function __construct( - ObjectFactory $objectFactory, + \Magento\Framework\Service\Data\ObjectFactory $objectFactory, AttributeValueBuilder $valueBuilder, - MetadataServiceInterface $metadataService + \Magento\Catalog\Service\V1\Category\MetadataServiceInterface $metadataService ) { - parent::__construct($objectFactory, $valueBuilder); - $this->metadataService = $metadataService; - } - - /** - * @return string[] - */ - public function getCustomAttributesCodes() - { - $attributeCodes = array(); - foreach ($this->metadataService->getCustomAttributesMetadata() as $attribute) { - /** @var \Magento\Catalog\Service\V1\Data\Eav\Category\AttributeMetadata @attribute */ - $attributeCodes[] = $attribute->getAttributeCode(); - } - return $attributeCodes; + parent::__construct($objectFactory, $valueBuilder, $metadataService); } /** diff --git a/app/code/Magento/Catalog/Service/V1/Data/ProductBuilder.php b/app/code/Magento/Catalog/Service/V1/Data/ProductBuilder.php index a455f89851bc6736835c0c2bf06c3192597273a1..a4a024726d0d756f787b521aa69ed4cc006b928d 100644 --- a/app/code/Magento/Catalog/Service/V1/Data/ProductBuilder.php +++ b/app/code/Magento/Catalog/Service/V1/Data/ProductBuilder.php @@ -21,46 +21,24 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Catalog\Service\V1\Data; -use Magento\Catalog\Service\V1\Product\MetadataServiceInterface; use Magento\Framework\Service\Data\Eav\AttributeValueBuilder; class ProductBuilder extends \Magento\Framework\Service\Data\Eav\AbstractObjectBuilder { /** - * @var MetadataServiceInterface - */ - protected $metadataService; - - /** - * Initialize dependencies. - * * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder - * @param MetadataServiceInterface $metadataService + * @param \Magento\Catalog\Service\V1\Product\MetadataServiceInterface $metadataService */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, AttributeValueBuilder $valueBuilder, - MetadataServiceInterface $metadataService + \Magento\Catalog\Service\V1\Product\MetadataServiceInterface $metadataService ) { - parent::__construct($objectFactory, $valueBuilder); - $this->metadataService = $metadataService; - } - - /** - * Template method used to configure the attribute codes for the product attributes - * - * @return string[] - */ - public function getCustomAttributesCodes() - { - $attributeCodes = array(); - foreach ($this->metadataService->getCustomAttributesMetadata() as $attribute) { - $attributeCodes[] = $attribute->getAttributeCode(); - } - return $attributeCodes; + parent::__construct($objectFactory, $valueBuilder, $metadataService); } /** diff --git a/app/code/Magento/Catalog/Service/V1/MetadataService.php b/app/code/Magento/Catalog/Service/V1/MetadataService.php index e8ba90ca2938aac21e5b230fedf1dde35103f282..e98cace4823fe514cac1c01eef7f7d4d0a338942 100644 --- a/app/code/Magento/Catalog/Service/V1/MetadataService.php +++ b/app/code/Magento/Catalog/Service/V1/MetadataService.php @@ -30,6 +30,7 @@ use Magento\Catalog\Service\V1\Data\Eav\AttributeMetadata; use Magento\Catalog\Service\V1\Data\Eav\Product\Attribute\FrontendLabel; use Magento\Framework\Service\V1\Data\Search\FilterGroup; use Magento\Framework\Service\V1\Data\SearchCriteria; +use Magento\Framework\Service\V1\Data\SortOrder; /** * Class MetadataService @@ -156,10 +157,11 @@ class MetadataService implements MetadataServiceInterface foreach ($searchCriteria->getFilterGroups() as $group) { $this->addFilterGroupToCollection($group, $attributeCollection); } - foreach ((array)$searchCriteria->getSortOrders() as $field => $direction) { + /** @var SortOrder $sortOrder */ + foreach ((array)$searchCriteria->getSortOrders() as $sortOrder) { $attributeCollection->addOrder( - $this->translateField($field), - $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC' + $this->translateField($sortOrder->getField()), + ($sortOrder->getDirection() == SearchCriteria::SORT_ASC) ? 'ASC' : 'DESC' ); } $totalCount = $attributeCollection->getSize(); diff --git a/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/Data/Option/MetadataBuilder.php b/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/Data/Option/MetadataBuilder.php index 620857ccc3967670f56b129faaae0b46125a1734..c696ab11613819c12470a2041e819d77a83852f1 100644 --- a/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/Data/Option/MetadataBuilder.php +++ b/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/Data/Option/MetadataBuilder.php @@ -44,14 +44,16 @@ class MetadataBuilder extends \Magento\Framework\Service\Data\Eav\AbstractObject /** * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder + * @param \Magento\Framework\Service\Config\MetadataConfig $metadataService * @param array $customAttributeCodes */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, AttributeValueBuilder $valueBuilder, + \Magento\Framework\Service\Config\MetadataConfig $metadataService, array $customAttributeCodes = array() ) { - parent::__construct($objectFactory, $valueBuilder); + parent::__construct($objectFactory, $valueBuilder, $metadataService); $this->customAttributeCodes = array_merge($this->customAttributeCodes, $customAttributeCodes); } diff --git a/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/WriteService.php b/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/WriteService.php index 55d299596182ae08dd5709494975cea0e31a838f..8d62b277dd0e67dc2d2d1c8de561de622406e5f4 100644 --- a/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/WriteService.php +++ b/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/WriteService.php @@ -28,6 +28,7 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Catalog\Service\V1\Product\CustomOptions\Data\OptionBuilder; use Magento\Catalog\Service\V1\Product\CustomOptions\Data\Option\Metadata; +use Magento\Framework\Exception\InputException; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -86,6 +87,9 @@ class WriteService implements WriteServiceInterface public function add($productSku, \Magento\Catalog\Service\V1\Product\CustomOptions\Data\Option $option) { $product = $this->productRepository->get($productSku); + if ($option->getOptionId()) { + throw new InputException('Unable to save option. Please, check input data.'); + } $optionData = $this->optionConverter->convert($option); $product->setCanSaveCustomOptions(true); diff --git a/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/WriteServiceInterface.php b/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/WriteServiceInterface.php index 72ab9d5ee2429e9a36338786f033c0989b8b6ef1..000cb68e728b455029022f8798dfc01a4ef2d0c4 100644 --- a/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/WriteServiceInterface.php +++ b/app/code/Magento/Catalog/Service/V1/Product/CustomOptions/WriteServiceInterface.php @@ -42,6 +42,8 @@ interface WriteServiceInterface * @param string $productSku * @param \Magento\Catalog\Service\V1\Product\CustomOptions\Data\Option $option * @return \Magento\Catalog\Service\V1\Product\CustomOptions\Data\Option + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\CouldNotSaveException */ public function add($productSku, \Magento\Catalog\Service\V1\Product\CustomOptions\Data\Option $option); diff --git a/app/code/Magento/Catalog/Service/V1/Product/Link/Data/ProductLinkBuilder.php b/app/code/Magento/Catalog/Service/V1/Product/Link/Data/ProductLinkBuilder.php index 2355b2838ac53bed6ec5b1586339d027e73a9bb9..0e6fb868f39d790daa655e84d2cfbfb3bf3210cd 100644 --- a/app/code/Magento/Catalog/Service/V1/Product/Link/Data/ProductLinkBuilder.php +++ b/app/code/Magento/Catalog/Service/V1/Product/Link/Data/ProductLinkBuilder.php @@ -41,15 +41,17 @@ class ProductLinkBuilder extends \Magento\Framework\Service\Data\Eav\AbstractObj /** * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder + * @param \Magento\Framework\Service\Config\MetadataConfig $metadataService * @param array $customAttributesCodes */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, AttributeValueBuilder $valueBuilder, + \Magento\Framework\Service\Config\MetadataConfig $metadataService, array $customAttributesCodes = array() ) { $this->customAttributes = $customAttributesCodes; - parent::__construct($objectFactory, $valueBuilder); + parent::__construct($objectFactory, $valueBuilder, $metadataService); } /** diff --git a/app/code/Magento/Catalog/Service/V1/Product/MetadataService.php b/app/code/Magento/Catalog/Service/V1/Product/MetadataService.php index 9dac9bbcfdfece5f81fcd3428ae259e04278ca76..9df4a08a1b0067c05a34d4d950e37b8dfed1bc85 100644 --- a/app/code/Magento/Catalog/Service/V1/Product/MetadataService.php +++ b/app/code/Magento/Catalog/Service/V1/Product/MetadataService.php @@ -24,13 +24,14 @@ namespace Magento\Catalog\Service\V1\Product; use Magento\Catalog\Service\V1\Data\Eav\AttributeMetadata; +use Magento\Framework\Service\Config\MetadataConfig; /** * Class AttributeMetadataService */ class MetadataService implements MetadataServiceInterface { - /** @var \Magento\Catalog\Service\V1\MetadataService */ + /** @var \Magento\Catalog\Service\V1\MetadataService */ protected $metadataService; /** @@ -44,33 +45,40 @@ class MetadataService implements MetadataServiceInterface private $filterBuilder; /** - * @param \Magento\Catalog\Service\V1\MetadataService $metadataService + * @var MetadataConfig + */ + private $metadataConfig; + + /** + * Initialize dependencies. + * + * @param \Magento\Catalog\Service\V1\MetadataServiceInterface $metadataService * @param \Magento\Framework\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder * @param \Magento\Framework\Service\V1\Data\FilterBuilder $filterBuilder + * @param MetadataConfig $metadataConfig */ public function __construct( - \Magento\Catalog\Service\V1\MetadataService $metadataService, + \Magento\Catalog\Service\V1\MetadataServiceInterface $metadataService, \Magento\Framework\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder, - \Magento\Framework\Service\V1\Data\FilterBuilder $filterBuilder + \Magento\Framework\Service\V1\Data\FilterBuilder $filterBuilder, + MetadataConfig $metadataConfig ) { $this->metadataService = $metadataService; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->filterBuilder = $filterBuilder; + $this->metadataConfig = $metadataConfig; } /** - * Retrieve custom EAV attribute metadata of product - * - * @param int $attributeSetId - * @return AttributeMetadata[] + * {@inheritdoc} */ - public function getCustomAttributesMetadata($attributeSetId = self::DEFAULT_ATTRIBUTE_SET_ID) + public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_OBJECT_CLASS_NAME) { $customAttributes = []; - foreach ($this->getProductAttributesMetadata($attributeSetId) as $attributeMetadata) { + foreach ($this->getProductAttributesMetadata(self::DEFAULT_ATTRIBUTE_SET_ID) as $attributeMetadata) { $customAttributes[] = $attributeMetadata; } - return $customAttributes; + return array_merge($customAttributes, $this->metadataConfig->getCustomAttributesMetadata($dataObjectClassName)); } /** diff --git a/app/code/Magento/Catalog/Service/V1/Product/MetadataServiceInterface.php b/app/code/Magento/Catalog/Service/V1/Product/MetadataServiceInterface.php index f0974ca9d312bb03772a64f878ab6d97f68e964b..6f529f07ebc6d212e5cac88c50d075ff2793718a 100644 --- a/app/code/Magento/Catalog/Service/V1/Product/MetadataServiceInterface.php +++ b/app/code/Magento/Catalog/Service/V1/Product/MetadataServiceInterface.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Service\V1\Product; /** * Class Product MetadataServiceInterface */ -interface MetadataServiceInterface +interface MetadataServiceInterface extends \Magento\Framework\Service\Data\Eav\MetadataServiceInterface { /**#@+ * Predefined constants @@ -34,21 +34,20 @@ interface MetadataServiceInterface const ENTITY_TYPE = 'catalog_product'; const DEFAULT_ATTRIBUTE_SET_ID = 4; + + const DATA_OBJECT_CLASS_NAME = 'Magento\Catalog\Service\V1\Data\Product'; /**#@-*/ /** - * Retrieve custom EAV attribute metadata of product + * Retrieve EAV attribute metadata of product * * @param int $attributeSetId * @return \Magento\Catalog\Service\V1\Data\Eav\AttributeMetadata[] */ - public function getCustomAttributesMetadata($attributeSetId = self::DEFAULT_ATTRIBUTE_SET_ID); + public function getProductAttributesMetadata($attributeSetId = self::DEFAULT_ATTRIBUTE_SET_ID); /** - * Retrieve EAV attribute metadata of product - * - * @param int $attributeSetId - * @return \Magento\Catalog\Service\V1\Data\Eav\AttributeMetadata[] + * {@inheritdoc} */ - public function getProductAttributesMetadata($attributeSetId = self::DEFAULT_ATTRIBUTE_SET_ID); + public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_OBJECT_CLASS_NAME); } diff --git a/app/code/Magento/Catalog/Service/V1/ProductService.php b/app/code/Magento/Catalog/Service/V1/ProductService.php index b8efcb94790cda26c8bc97a03cb31c623efa8871..9bb1d4d6d29234936ec9eccc488e49009a9fd1b9 100644 --- a/app/code/Magento/Catalog/Service/V1/ProductService.php +++ b/app/code/Magento/Catalog/Service/V1/ProductService.php @@ -30,6 +30,7 @@ use Magento\Catalog\Service\V1\Data\Product as ProductData; use Magento\Framework\Service\V1\Data\Search\FilterGroup; use Magento\Catalog\Model\Resource\Product\Collection; use Magento\Catalog\Service\V1\Product\MetadataServiceInterface as ProductMetadataServiceInterface; +use Magento\Framework\Service\V1\Data\SortOrder; /** * Class ProductService @@ -209,9 +210,10 @@ class ProductService implements ProductServiceInterface foreach ($searchCriteria->getFilterGroups() as $group) { $this->addFilterGroupToCollection($group, $collection); } - foreach ((array)$searchCriteria->getSortOrders() as $field => $direction) { - $field = $this->translateField($field); - $collection->addOrder($field, $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); + /** @var SortOrder $sortOrder*/ + foreach ((array)$searchCriteria->getSortOrders() as $sortOrder) { + $field = $this->translateField($sortOrder->getField()); + $collection->addOrder($field, ($sortOrder->getDirection() == SearchCriteria::SORT_ASC) ? 'ASC' : 'DESC'); } $collection->setCurPage($searchCriteria->getCurrentPage()); $collection->setPageSize($searchCriteria->getPageSize()); diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 7ab74d258bd02bbbc80d16e130fc6acc7ac07c81..c07830f16b78a36250e5f6375f30c39023da899c 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -3,33 +3,33 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-index": "0.1.0-alpha91", - "magento/module-indexer": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-log": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-widget": "0.1.0-alpha91", - "magento/module-wishlist": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-bundle": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-catalog-rule": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-catalog-search": "0.1.0-alpha91", - "magento/module-product-alert": "0.1.0-alpha91", - "magento/module-url-rewrite": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-index": "0.1.0-alpha92", + "magento/module-indexer": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-log": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-widget": "0.1.0-alpha92", + "magento/module-wishlist": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-bundle": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-catalog-rule": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-catalog-search": "0.1.0-alpha92", + "magento/module-product-alert": "0.1.0-alpha92", + "magento/module-url-rewrite": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index feb24c8bfa8b28c403839f159aa96841f7dab540..6cea44bd685884b6e3a8a0801ef1f0ea2ff9cc85 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -459,9 +459,25 @@ </argument> </arguments> </type> + <virtualType name="Magento\Catalog\Service\Config\ProductMetadataConfig" type="Magento\Framework\Service\Config\MetadataConfig"> + <arguments> + <argument name="attributeMetadataBuilder" xsi:type="object">Magento\Catalog\Service\V1\Data\Eav\AttributeMetadataBuilder</argument> + </arguments> + </virtualType> <type name="Magento\Catalog\Service\V1\Product\MetadataService"> <arguments> <argument name="metadataService" xsi:type="object">Magento\Catalog\Service\V1\MetadataService\Proxy</argument> + <argument name="metadataConfig" xsi:type="object">Magento\Catalog\Service\Config\ProductMetadataConfig</argument> + </arguments> + </type> + <virtualType name="Magento\Catalog\Service\Config\CategoryMetadataConfig" type="Magento\Framework\Service\Config\MetadataConfig"> + <arguments> + <argument name="attributeMetadataBuilder" xsi:type="object">Magento\Catalog\Service\V1\Data\Eav\AttributeMetadataBuilder</argument> + </arguments> + </virtualType> + <type name="Magento\Catalog\Service\V1\Category\MetadataService"> + <arguments> + <argument name="metadataConfig" xsi:type="object">Magento\Catalog\Service\Config\CategoryMetadataConfig</argument> </arguments> </type> <type name="Magento\Catalog\Service\V1\ProductService"> diff --git a/app/code/Magento/Catalog/etc/events.xml b/app/code/Magento/Catalog/etc/events.xml index 435dd539fb907bd1fd734703c59d50970e9edb3d..d3f897712ec2bc036c74771f77bcc92ab6ec2617 100644 --- a/app/code/Magento/Catalog/etc/events.xml +++ b/app/code/Magento/Catalog/etc/events.xml @@ -24,9 +24,6 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> - <event name="catalog_category_save_commit_after"> - <observer name="fulltext_reindex" instance="Magento\Catalog\Model\Observer\Reindex" method="fulltextReindex" /> - </event> <event name="page_block_html_topmenu_gethtml_before"> <observer name="catalog_add_topmenu_items" instance="Magento\Catalog\Model\Observer" method="addCatalogToTopmenuItems" /> </event> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml index 4894b300a60536618d9f2440fae3601e924f12e7..336ecaa0846a819efe9a96f7049c97ee8678524c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml @@ -23,23 +23,25 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset" name="product.composite.fieldset" output="1"> - <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Options" template="catalog/product/composite/fieldset/options.phtml"> - <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/default.phtml"/> - <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/text.phtml"/> - <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/file.phtml"/> - <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/select.phtml"/> - <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/date.phtml"/> - <block class="Magento\Framework\View\Element\Template" name="product.composite.fieldset.options.js" as="options_js" template="Magento_Catalog::catalog/product/composite/fieldset/options/js.phtml"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset" name="product.composite.fieldset"> + <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Options" template="catalog/product/composite/fieldset/options.phtml"> + <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/default.phtml"/> + <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/text.phtml"/> + <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/file.phtml"/> + <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/select.phtml"/> + <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/date.phtml"/> + <block class="Magento\Framework\View\Element\Template" name="product.composite.fieldset.options.js" as="options_js" template="Magento_Catalog::catalog/product/composite/fieldset/options/js.phtml"/> + </block> + <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Qty" name="product.composite.fieldset.qty" template="catalog/product/composite/fieldset/qty.phtml"/> </block> - <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Qty" name="product.composite.fieldset.qty" template="catalog/product/composite/fieldset/qty.phtml"/> - </block> - <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> - <arguments> - <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> - <argument name="use_link_for_as_low_as" xsi:type="boolean">true</argument> - <!-- set "override" configuration settings here --> - </arguments> - </block> + <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <argument name="use_link_for_as_low_as" xsi:type="boolean">true</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> + </container> </layout> 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 8696cb9923eda1ec0711303633330573fe582047..993b36f4c610f3568b7e4ae0a857aca7397aa15d 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 @@ -23,13 +23,15 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Error" name="product.composite.error" output="1"/> - <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> - <arguments> - <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> - <argument name="use_link_for_as_low_as" xsi:type="boolean">true</argument> - <!-- set "override" configuration settings here --> - </arguments> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Error" name="product.composite.error"/> + <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <argument name="use_link_for_as_low_as" xsi:type="boolean">true</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> + </container> </layout> 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 ebc33502e83ead32c84669bad2208d8383051399..a9f03e3a291b1be75416b0cbfa121daa5d7a4611 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 @@ -23,13 +23,15 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Update\Result" name="product.composite.update.result" output="1"/> - <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> - <arguments> - <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> - <argument name="use_link_for_as_low_as" xsi:type="boolean">true</argument> - <!-- set "override" configuration settings here --> - </arguments> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Update\Result" name="product.composite.update.result"/> + <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <argument name="use_link_for_as_low_as" xsi:type="boolean">true</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> + </container> </layout> 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 5680c7b90b28e8401602168f6b430eff2677f7ab..973318d8c404b6f91e3ebd02d12218ee2eac82c0 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="editor"/> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> @@ -61,4 +61,4 @@ <block class="Magento\Framework\View\Element\Js\Components" name="catalog_category_page_head_components" template="Magento_Catalog::js/components.phtml"/> </referenceBlock> -</layout> +</page> 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 a1477be7434fa30681c9480e46e1d0fb848b74ad..3d5fa50cf4d3cd4e13e44cac40f935d2342a88f6 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="store_switcher" template="Magento_Backend::store/switcher.phtml"/> </referenceContainer> @@ -49,4 +49,4 @@ <referenceContainer name="content"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute" name="attribute" template="catalog/product/edit/action/attribute.phtml"/> </referenceContainer> -</layout> +</page> 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 b0ff554491f1613685dbe6b500507609890ecbc7..bf2926e9aa3c2885ef9fa97418f120937155e003 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 @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Alerts\Price" name="admin.product.edit.tab.alerts.price" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Alerts\Price" name="admin.product.edit.tab.alerts.price"/> + </container> </layout> 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 07e1b487341dbbc68e7ff3a9f0cb89c5e4272ed8..edcde3aafa8f4f1aa41ad74792117dd40c399512 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 @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Alerts\Stock" name="admin.product.edit.tab.alerts.stock" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Alerts\Stock" name="admin.product.edit.tab.alerts.stock"/> + </container> </layout> 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 d3b9851155b6b7bcf705f676800ff82c9d74b85b..0c8b7de3a8ef7e0339f4910e5c80162eb85d7a65 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="left"> <block class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tabs" name="attribute_edit_tabs"> <container label="Main" name="main"> @@ -41,4 +41,4 @@ <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" name="attribute_edit_js" template="Magento_Catalog::catalog/product/attribute/js.phtml"/> </referenceContainer> -</layout> +</page> 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 019620cdaba21961621c3e4f6ea3f09308a94cfd..996ceb26c22b1570677d5658fdc19ec07d54d2b9 100644 --- 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <remove name="left"/> <referenceBlock name="attribute_edit_content"> <arguments> @@ -37,4 +37,4 @@ <block class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front" as="front-options"/> </container> </referenceBlock> -</layout> +</page> 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 4e3bfe12171839abd1b7cf7b7475a5449ea6b64f..095815566e6af0a9c54fe7c58c11c7cc9fd1cd9b 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Crosssell" name="catalog.product.edit.tab.crosssell"/> <block class="Magento\Backend\Block\Widget\Grid\Serializer" name="crosssell_grid_serializer"> <arguments> 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 95b7ecd3b25a3e211ef6abbd15f3e55317f75496..5037b7c6b8f882df6f4e6d10dfcdca4f33b2b4cd 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Crosssell" name="catalog.product.edit.tab.crosssell"/> </container> </layout> 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 00b04e9cdee29661dd4553e629c4a4e5d09cc706..1ebbdeec6b5287a2109e69b92576e14d43e8f652 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Options\Ajax" name="catalog.product.import.custom.options"/> </container> </layout> 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 c9a5dd5bd98fa5f18d0b9658d907971969c4c533..f1a3ea42d6c3eddf749c820feea706c1ce806457 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_new"/> <referenceBlock name="page-title"> <action method="setTitleClass"> @@ -37,4 +37,4 @@ </action> </block> </referenceContainer> -</layout> +</page> 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 833cc87e13bc5d145d1bfffa7ae556ee78739ce7..e354a47ec9a3186b16b588e650cb767103c52e6c 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> - <container name="root" label="Root" output="1"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Grid" name="admin.product.grid"/> </container> </layout> 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 21ccfc803b1607ee6260ed125da230d7a2ba4d39..081ab5359bc4ddc8562a00e7c548220bf18524ed 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="menu"> <action method="setActive"> <argument name="itemId" xsi:type="string">Magento_Catalog::catalog_products</argument> @@ -44,4 +44,4 @@ <referenceContainer name="content"> <block class="Magento\Catalog\Block\Adminhtml\Product" name="products_list"/> </referenceContainer> -</layout> +</page> 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 60aefbaa14ca21fa3cdd7716b863992269a8b047..fffeacc4ff85b2a954a708c0e161a285304aac94 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="editor"/> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> @@ -77,4 +77,4 @@ <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Js" name="catalog_product_js" template="catalog/product/js.phtml"/> <block class="Magento\Framework\View\Element\Template" template="Magento_Catalog::catalog/wysiwyg/js.phtml"/> </referenceContainer> -</layout> +</page> 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 9fcc68df42c3879d8c5e0d8a6a73cf89fc571258..8869a742e03e0998d7664602f5e20fb5881e4fb1 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options" name="admin.product.options"/> </container> </layout> 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 cfac8e41a1864e7b75b15a84b40cf77b6a6d0a21..6ef9015b6b0ed8f71520faa7f6e25e23b518be7b 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Popup\Grid" name="catalog.product.import.custom.options"/> </container> </layout> 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 42043b4e530fb2665bc2a6e2f70598ca9628c789..5b5e3d97348444b90c1d84ce9eab7dc45385cfbb 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Related" name="catalog.product.edit.tab.related"/> <block class="Magento\Backend\Block\Widget\Grid\Serializer" name="related_grid_serializer"> <arguments> 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 6c8ca9e79ceff950c9b4dca6b73f4149c54f5c3a..e07f2105d7daf8e63afda798a178ee84a7c96dd2 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Related" name="catalog.product.edit.tab.related"/> </container> </layout> 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 5a7839af9ea6c7df5ae4132aa2cf4760bc6ffd12..fc0c0092061b3efdfce84ec2c08e1475bdfc5f2b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.catalog.product.set.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.catalog.product.set.grid" as="grid"> <arguments> @@ -54,4 +54,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 975254e379e35c073c3025308d42ec76d5826219..fbef56fcd1530ab9ec4cc9341b79301eeced16a2 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main" name="adminhtml.catalog.product.set.edit" template="catalog/product/attribute/set/main.phtml"/> </referenceContainer> -</layout> +</page> 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 1a13a2f97ec201de5891de6a5f8f5fe7c0cd0180..9c7a35b42eb06c569160a5c09113057e457cba30 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="catalog_product_set_block"/> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Toolbar\Main" name="adminhtml.catalog.product.set.container"/> </referenceContainer> -</layout> +</page> 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 4aa7d753e109bfdefe415da931aea6720cde36d9..691c4d952caf916b834f39e957f33d52869af839 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Upsell" name="catalog.product.edit.tab.upsell"/> <block class="Magento\Backend\Block\Widget\Grid\Serializer" name="upsell_grid_serializer"> <arguments> 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 be3d7e7e2ca7d6b27fe50d860ad9871b2175e798..8909fa754867352bb1893d296f8b99c79b39fabb 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Upsell" name="catalog.product.edit.tab.upsell"/> </container> </layout> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/group.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/group.phtml index 46935579446e3c4ded48c5de9eb14e96ae1a7cc2..ce7ec53fc525f1f139ab0207476e3e059d405f55 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/group.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/group.phtml @@ -59,7 +59,10 @@ $_showWebsite= $this->isMultiWebsites(); </table> <script type="text/javascript"> -require(["prototype"], function(){ +require([ + "prototype", + "mage/adminhtml/form" +], function(){ //<![CDATA[ var groupPriceRowTemplate = '<tr>' diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/tier.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/tier.phtml index b1976570fd598b217e9864cd64b2934cdab5ba7b..3a88e27b534c28189cbcc4afdf9272f1731a0349 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/tier.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/tier.phtml @@ -62,7 +62,10 @@ $element = $this->getElement(); </table> <script type="text/javascript"> -require(["prototype"], function(){ +require([ + "prototype", + "mage/adminhtml/form" +], function(){ //<![CDATA[ var tierPriceRowTemplate = '<tr>' 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 8dda37e87c9ed984f18a621a534b133225f072b8..41c1d2e349659a82785c2397f4c8b513fa9685b6 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Framework\Pricing\Render\RendererPool" name="render.product.prices"> <arguments> <argument name="default" xsi:type="array"> @@ -61,4 +61,4 @@ </argument> </arguments> </block> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/base/layout/default.xml b/app/code/Magento/Catalog/view/base/layout/default.xml index 7b8420a104c3d3e84f315d7a2fced67de6037eed..93aab43d68b7deb95b1b06228c6560b1d2bb3d07 100644 --- a/app/code/Magento/Catalog/view/base/layout/default.xml +++ b/app/code/Magento/Catalog/view/base/layout/default.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> <arguments> <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> @@ -32,4 +32,4 @@ <!-- set "override" configuration settings here --> </arguments> </block> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/base/layout/empty.xml b/app/code/Magento/Catalog/view/base/layout/empty.xml index 7b8420a104c3d3e84f315d7a2fced67de6037eed..93aab43d68b7deb95b1b06228c6560b1d2bb3d07 100644 --- a/app/code/Magento/Catalog/view/base/layout/empty.xml +++ b/app/code/Magento/Catalog/view/base/layout/empty.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> <arguments> <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> @@ -32,4 +32,4 @@ <!-- set "override" configuration settings here --> </arguments> </block> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/MAP_popup.xml b/app/code/Magento/Catalog/view/frontend/layout/MAP_popup.xml index a6b3877969852058b9bba385cbc4fd52f37ab29c..1ad87ee2d446cbf1817a298abb399cf3ce25e10a 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/MAP_popup.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/MAP_popup.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" template="Magento_Catalog::msrp/popup.phtml" name="product.tooltip"> <block class="Magento\Catalog\Block\ShortcutButtons\InCatalog\PositionAfter" name="map.shortcut.buttons"/> </block> </referenceContainer> -</layout> +</page> 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 b6106d659355d018f48ba6de1ff2d78efe4586b5..08cf14d41fb656f1bc903f8aca1523ea2ca2f8d1 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 @@ -23,13 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_two_columns_left"/> - <referenceBlock name="root"> - <action method="addBodyClass"> - <argument name="class" xsi:type="string">page-products</argument> - </action> - </referenceBlock> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Category\View" name="category.image" template="Magento_Catalog::category/image.phtml"/> <block class="Magento\Catalog\Block\Category\View" name="category.description" template="Magento_Catalog::category/description.phtml"/> @@ -101,4 +95,4 @@ </block> </referenceContainer> <update handle="MAP_popup"/> -</layout> +</page> 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 a684f073d472d11f00b54fe3fcb23c13a075d2f2..d92ed041572b7f54f1ad4323b851d1cab2be26d8 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="sidebar.main"> <block class="Magento\Catalog\Block\Navigation" name="catalog.leftnav" before="-" template="navigation/left.phtml"/> </referenceContainer> -</layout> +</page> 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 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 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 @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> 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 ba4c3e8e04a69e36034749d25f7ed4cf22be1b4a..cfec489907935568f9ecb12d387c09a12cb6dfa0 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 @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="page.main.title"> <action method="setPageTitle"> <argument translate="true" name="page_title" xsi:type="string">Compare Products</argument> @@ -34,4 +33,4 @@ <block class="Magento\Catalog\Block\Product\Compare\ListCompare" name="catalog.compare.list" template="product/compare/list.phtml"/> </referenceContainer> <update handle="MAP_popup"/> -</layout> +</page> 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 3793f1ff20fe2638c01c68c6a6485c475b27958d..f54cdea6631858578edadde8e48e4a7d9c86ce90 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">popup.phtml</argument> @@ -32,4 +32,4 @@ <referenceContainer name="content"> <block class="Magento\Catalog\Block\Product\Gallery" name="catalog_product_gallery" template="product/gallery.phtml"/> </referenceContainer> -</layout> +</page> 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 e107801766dc16e7e162afc57faf0492bbaa517f..5db60cf1e40ff1359d040362496293c9fe8d9089 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 @@ -23,11 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="checkout_page_head_components" template="Magento_Catalog::js/components.phtml"/> </referenceBlock> - <update handle="page_one_column"/> <referenceBlock name="page.main.title"> <arguments> <argument name="css_class" xsi:type="string">product</argument> @@ -164,4 +163,4 @@ </referenceBlock> <update handle="MAP_popup"/> <update handle="MAP_price_msrp_item"/> -</layout> +</page> 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 b049a8aac8fdcf6d6a689ba771dad3877547a7be..d7f40ea5387e4f71da1473d724dff7504e033347 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="product.info.type"> <block class="Magento\Catalog\Block\Product\View\Type\Simple" name="product.info.simple" as="product_type_data" template="product/view/type/default.phtml"/> <container name="product.info.simple.extra" after="product.info.simple" as="product_type_data_extra" label="Product Extra Info"/> </referenceContainer> -</layout> +</page> 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 3e20049ccca1fabd24866e14b262ebf0a2ffd5ea..36f3d627bde7b9c2f02516b853636882290a7b33 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="product.info.type"> <block class="Magento\Catalog\Block\Product\View\Type\Virtual" name="product.info.virtual" as="product_type_data" template="product/view/type/default.phtml"/> <container name="product.info.virtual.extra" after="product.info.virtual" as="product_type_data_extra" label="Product Extra Info"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/Catalog/view/frontend/layout/catalogsearch_advanced_result.xml index 11343e429557596582dbc6bc4fce9787bc236b72..f58e41ede006d1bdfa8deafc5a8b1434b1b8bdd2 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalogsearch_advanced_result.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/Catalog/view/frontend/layout/catalogsearch_result_index.xml index 11343e429557596582dbc6bc4fce9787bc236b72..f58e41ede006d1bdfa8deafc5a8b1434b1b8bdd2 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalogsearch_result_index.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_index.xml index 11343e429557596582dbc6bc4fce9787bc236b72..f58e41ede006d1bdfa8deafc5a8b1434b1b8bdd2 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_index.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> -</layout> +</page> 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 6c53eb77e5a9357b92019e39aeeaeb896fc696a0..7dbba6d2774d67de98d1a59712d0184f193311f0 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="virtual" template="cart/item/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/checkout_onepage_failure.xml b/app/code/Magento/Catalog/view/frontend/layout/checkout_onepage_failure.xml index 11343e429557596582dbc6bc4fce9787bc236b72..f58e41ede006d1bdfa8deafc5a8b1434b1b8bdd2 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/checkout_onepage_failure.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/checkout_onepage_failure.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Catalog/view/frontend/layout/checkout_onepage_success.xml index 11343e429557596582dbc6bc4fce9787bc236b72..f58e41ede006d1bdfa8deafc5a8b1434b1b8bdd2 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/checkout_onepage_success.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/default.xml b/app/code/Magento/Catalog/view/frontend/layout/default.xml index 55e002b5b0b9d5731a20d518f433136586d1d668..ea388d154c91ef2170ae598ad0c2b4dac7eb15fa 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/default.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="top.links"> <block class="Magento\Catalog\Block\Product\Compare\Link" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml"/> </referenceBlock> @@ -33,4 +33,4 @@ <referenceBlock name="head"> <block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Catalog::js/components.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/review_product_list.xml b/app/code/Magento/Catalog/view/frontend/layout/review_product_list.xml index f3c85114cb58fdec5ffc6580e5765847a96e8059..8073b2b1cfe1c0aeaa73372e3827efa4e1beface 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/review_product_list.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/review_product_list.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> <update handle="MAP_price_msrp_item"/> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/wishlist_index_index.xml b/app/code/Magento/Catalog/view/frontend/layout/wishlist_index_index.xml index bd2bd10029190eebba4413e600b5f5536dd4c605..c8ae02657dcbed8cca224f69ee9994b2ad70b7d9 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/wishlist_index_index.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/wishlist_index_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> <update handle="MAP_price_msrp_wishlist_item"/> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/wishlist_search_view.xml b/app/code/Magento/Catalog/view/frontend/layout/wishlist_search_view.xml index bd2bd10029190eebba4413e600b5f5536dd4c605..c8ae02657dcbed8cca224f69ee9994b2ad70b7d9 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/wishlist_search_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/wishlist_search_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> <update handle="MAP_price_msrp_wishlist_item"/> -</layout> +</page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/wishlist_shared_index.xml b/app/code/Magento/Catalog/view/frontend/layout/wishlist_shared_index.xml index bd2bd10029190eebba4413e600b5f5536dd4c605..c8ae02657dcbed8cca224f69ee9994b2ad70b7d9 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/wishlist_shared_index.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/wishlist_shared_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="MAP_popup"/> <update handle="MAP_price_msrp_wishlist_item"/> -</layout> +</page> diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 0562b37b7362373f62f8a4c120dc2658145c21f6..b5203bb1b3146643ce2ee88ec48fe38a91893579 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -475,9 +475,9 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity protected $dateTime; /** - * @var \Magento\Indexer\Model\Indexer + * @var \Magento\Indexer\Model\IndexerFactory */ - protected $newIndexer; + protected $indexerFactory; /** * @var \Magento\Framework\Logger @@ -517,7 +517,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param \Magento\Framework\Logger $logger - * @param \Magento\Indexer\Model\Indexer $newIndexer + * @param \Magento\Indexer\Model\IndexerFactory $indexerFactory * @param array $data */ public function __construct( @@ -548,7 +548,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Logger $logger, - \Magento\Indexer\Model\Indexer $newIndexer, + \Magento\Indexer\Model\IndexerFactory $indexerFactory, array $data = array() ) { $this->_eventManager = $eventManager; @@ -569,7 +569,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity $this->_stockResItemFac = $stockResItemFac; $this->_localeDate = $localeDate; $this->dateTime = $dateTime; - $this->newIndexer = $newIndexer; + $this->indexerFactory = $indexerFactory; $this->_logger = $logger; parent::__construct($coreData, $importExportData, $importData, $config, $resource, $resourceHelper, $string); $this->_optionEntity = isset( @@ -1754,6 +1754,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity */ protected function _saveStockItem() { + $indexer = $this->indexerFactory->create()->load('catalog_product_category'); /** @var $stockResource \Magento\CatalogInventory\Model\Resource\Stock\Item */ $stockResource = $this->_stockResItemFac->create(); $entityTable = $stockResource->getMainTable(); @@ -1811,7 +1812,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity } if ($productIdsToReindex) { - $this->newIndexer->load('catalog_product_category')->reindexList($productIdsToReindex); + $indexer->reindexList($productIdsToReindex); } } return $this; diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index 06bd15c68c2aad3cae640ef78d8388c25dfb63d6..a34245cd89aaa9298133d9ee9ec69d98ce0f4191 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-import-export": "0.1.0-alpha91", - "magento/module-indexer": "0.1.0-alpha91", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-import-export": "0.1.0-alpha92", + "magento/module-indexer": "0.1.0-alpha92", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index 5721d7045b058bd9d3bf1ea41327983b29e74b8a..3dca3ff3f962ecb3aaa9e92558ad6c7160867521 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-indexer": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-indexer": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 2c6bd20ea614db82a69ac6c762039d64619d63b5..3c07fd93ca5a7ce6e918844dbc1b5dd41cf7419d 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="product.info.extrahint"> <block class="Magento\CatalogInventory\Block\Qtyincrements" name="product.info.extrahint.qtyincrements" template="qtyincrements.phtml"/> </referenceContainer> -</layout> +</page> 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 967f6921631b7f58f7713b421cf7f7605ea5b161..8ed999f0b5a725267e6052418cf429f4cf234ba8 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="product.info.simple.extra"> <block class="Magento\CatalogInventory\Block\Stockqty\DefaultStockqty" template="stockqty/default.phtml"/> </referenceContainer> -</layout> +</page> 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 f442a05d7cc8603324da7432c4ee1ffbea5d77cb..cdbc11ed5dec42f9da78104c426da9a9d460d073 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="product.info.virtual.extra"> <block class="Magento\CatalogInventory\Block\Stockqty\DefaultStockqty" template="stockqty/default.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index 28608b1c1fe96547d4e79b69248e46d5b293c704..b2d53a4a92a3d9efd7ea80e716b4722c788d6bcb 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-rule": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-index": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-rule": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-index": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml index 06309c2f1b17b04e55b321a6f40f72ad878bf8e0..5c0eeb324c301a7b08a69818e4f5fbd337caae82 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.promo.catalog.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="promo.catalog.grid" as="grid"> <arguments> @@ -106,4 +106,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 8d90f3d1f3de2bd3ceed9a1c2d8d63c4987f2472..176f55a129e2bc5ec93e310e51ced224c669df38 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setCanLoadExtJs"> <argument name="flag" xsi:type="string">1</argument> @@ -57,4 +57,4 @@ <referenceContainer name="js"> <block class="Magento\CatalogRule\Block\Adminhtml\Promo\Catalog\Edit\Js" template="promo/js.phtml"/> </referenceContainer> -</layout> +</page> 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 f6a3c50c521ee7a6262a3175cfbe11c026976620..afcedbe068cc5e5daed2ea356de0d583c495d162 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_rule_promo_catalog_block"/> <referenceContainer name="content"> <block class="Magento\CatalogRule\Block\Adminhtml\Promo\Catalog" name="adminhtml.promo.catalog.grid.container"/> </referenceContainer> -</layout> +</page> 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 cb7ee134697dde0fdffa684f7a623b520456ee59..b67eea7bcd226f0da16dac8bb6019ae843d894f5 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml +++ b/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml @@ -36,9 +36,12 @@ </fieldset> </div> <script type="text/javascript"> -require(["jquery", "prototype","Magento_Rule/rules"], function(jQuery){ +require([ + "prototype", + "Magento_Rule/rules" +], function(){ -var <?php echo $_element->getHtmlId() ?> = new VarienRulesForm('<?php echo $_element->getHtmlId() ?>', '<?php echo $this->getNewChildUrl() ?>'); +window.<?php echo $_element->getHtmlId() ?> = new VarienRulesForm('<?php echo $_element->getHtmlId() ?>', '<?php echo $this->getNewChildUrl() ?>'); <?php if ($_element->getReadonly()): ?> <?php echo $_element->getHtmlId() ?>.setReadonly(true); <?php endif; ?> diff --git a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php index bd40c6e9c3df1f30371014ebf6a943ddf20e4a8f..5764354f7a8fb1949df5f7da28a07c63900064ba 100644 --- a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php +++ b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php @@ -30,6 +30,7 @@ */ namespace Magento\CatalogSearch\Model\Config\Backend\Search; +use Magento\CatalogSearch\Model\Indexer\Fulltext as FulltextIndexer; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\CatalogSearch\Model\Fulltext; use Magento\Framework\App\Config\Value; @@ -37,6 +38,7 @@ use Magento\Framework\Model\Context; use Magento\Framework\Registry; use Magento\Framework\Model\Resource\AbstractResource; use Magento\Framework\Data\Collection\Db; +use Magento\Indexer\Model\IndexerFactory; class Type extends Value { @@ -48,11 +50,17 @@ class Type extends Value protected $_catalogSearchFulltext; /** - * @param \Magento\Framework\Model\Context $context + * @var \Magento\Indexer\Model\IndexerFactory + */ + protected $indexerFactory; + + /** + * @param Context $context * @param Registry $registry * @param ScopeConfigInterface $config * @param Fulltext $catalogSearchFulltext - * @param \Magento\Framework\Model\Resource\AbstractResource $resource + * @param IndexerFactory $indexerFactory + * @param AbstractResource $resource * @param Db $resourceCollection * @param array $data */ @@ -61,11 +69,13 @@ class Type extends Value Registry $registry, ScopeConfigInterface $config, Fulltext $catalogSearchFulltext, + IndexerFactory $indexerFactory, AbstractResource $resource = null, Db $resourceCollection = null, array $data = array() ) { $this->_catalogSearchFulltext = $catalogSearchFulltext; + $this->indexerFactory = $indexerFactory; parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); } @@ -84,6 +94,10 @@ class Type extends Value ); if ($newValue != $oldValue) { $this->_catalogSearchFulltext->resetSearchResults(); + + $indexer = $this->indexerFactory->create(); + $indexer->load(FulltextIndexer::INDEXER_ID); + $indexer->invalidate(); } return $this; diff --git a/app/code/Magento/CatalogSearch/Model/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Fulltext.php index 773fd5bd16b8f68302de7c9a640f31028ae08ac9..1744b288221894955cab83257e193656541db341 100644 --- a/app/code/Magento/CatalogSearch/Model/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Fulltext.php @@ -99,45 +99,6 @@ class Fulltext extends \Magento\Framework\Model\AbstractModel $this->_init('Magento\CatalogSearch\Model\Resource\Fulltext'); } - /** - * Regenerate all Stores index - * - * Examples: - * (null, null) => Regenerate index for all stores - * (1, null) => Regenerate index for store Id=1 - * (1, 2) => Regenerate index for product Id=2 and its store view Id=1 - * (null, 2) => Regenerate index for all store views of product Id=2 - * - * @param int|null $storeId Store View Id - * @param int|array|null $productIds Product Entity Id - * - * @return $this - */ - public function rebuildIndex($storeId = null, $productIds = null) - { - $this->getResource()->rebuildIndex($storeId, $productIds); - return $this; - } - - /** - * Delete index data - * - * Examples: - * (null, null) => Clean index of all stores - * (1, null) => Clean index of store Id=1 - * (1, 2) => Clean index of product Id=2 and its store view Id=1 - * (null, 2) => Clean index of all store views of product Id=2 - * - * @param int $storeId Store View Id - * @param int $productId Product Entity Id - * @return $this - */ - public function cleanIndex($storeId = null, $productId = null) - { - $this->getResource()->cleanIndex($storeId, $productId); - return $this; - } - /** * Reset search results cache * @@ -182,36 +143,4 @@ class Fulltext extends \Magento\Framework\Model\AbstractModel $storeId ); } - - // Deprecated methods - - /** - * Set whether table changes are allowed - * - * @deprecated after 1.6.1.0 - * - * @param bool $value - * @return $this - */ - public function setAllowTableChanges($value = true) - { - $this->_allowTableChanges = $value; - return $this; - } - - /** - * Update category products indexes - * - * @deprecated after 1.6.2.0 - * - * @param array $productIds - * @param array $categoryIds - * - * @return $this - */ - public function updateCategoryIndex($productIds, $categoryIds) - { - $this->getResource()->updateCategoryIndex($productIds, $categoryIds); - return $this; - } } diff --git a/app/code/Magento/CatalogSearch/Model/Fulltext/Observer.php b/app/code/Magento/CatalogSearch/Model/Fulltext/Observer.php deleted file mode 100644 index 70e561a7e1a2e4bb4fa22de087d1f352a55baf10..0000000000000000000000000000000000000000 --- a/app/code/Magento/CatalogSearch/Model/Fulltext/Observer.php +++ /dev/null @@ -1,251 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * CatalogSearch Fulltext Observer - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\CatalogSearch\Model\Fulltext; - -class Observer -{ - /** - * Store manager - * - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * Catalog search fulltext - * - * @var \Magento\CatalogSearch\Model\Fulltext - */ - protected $_catalogSearchFulltext; - - /** - * Eav config - * - * @var \Magento\Eav\Model\Config - */ - protected $_eavConfig; - - /** - * Backend url - * - * @var \Magento\Backend\Model\UrlInterface - */ - protected $_backendUrl; - - /** - * Backend session - * - * @var \Magento\Backend\Model\Session - */ - protected $_backendSession; - - /** - * @var \Magento\Framework\Message\ManagerInterface - */ - protected $messageManager; - - /** - * Construct - * - * @param \Magento\Backend\Model\Session $backendSession - * @param \Magento\Backend\Model\UrlInterface $backendUrl - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Message\ManagerInterface $messageManager - */ - public function __construct( - \Magento\Backend\Model\Session $backendSession, - \Magento\Backend\Model\UrlInterface $backendUrl, - \Magento\Eav\Model\Config $eavConfig, - \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Message\ManagerInterface $messageManager - ) { - $this->_backendSession = $backendSession; - $this->_backendUrl = $backendUrl; - $this->_eavConfig = $eavConfig; - $this->_catalogSearchFulltext = $catalogSearchFulltext; - $this->_storeManager = $storeManager; - $this->messageManager = $messageManager; - } - - /** - * Retrieve fulltext (indexer) model - * - * @return \Magento\CatalogSearch\Model\Fulltext - */ - protected function _getFulltextModel() - { - return $this->_catalogSearchFulltext; - } - - /** - * Update product index when product data updated - * - * @deprecated since 1.11 - * @param \Magento\Framework\Event\Observer $observer - * @return \Magento\CatalogSearch\Model\Fulltext\Observer - */ - public function refreshProductIndex(\Magento\Framework\Event\Observer $observer) - { - $product = $observer->getEvent()->getProduct(); - - $this->_getFulltextModel()->rebuildIndex(null, $product->getId())->resetSearchResults(); - - return $this; - } - - /** - * Clean product index when product deleted or marked as unsearchable/invisible - * - * @deprecated since 1.11 - * @param \Magento\Framework\Event\Observer $observer - * @return \Magento\CatalogSearch\Model\Fulltext\Observer - */ - public function cleanProductIndex(\Magento\Framework\Event\Observer $observer) - { - $product = $observer->getEvent()->getProduct(); - - $this->_getFulltextModel()->cleanIndex(null, $product->getId())->resetSearchResults(); - - return $this; - } - - /** - * Update all attribute-dependant index - * - * @param \Magento\Framework\Event\Observer $observer - * @return \Magento\CatalogSearch\Model\Fulltext\Observer - */ - public function eavAttributeChange(\Magento\Framework\Event\Observer $observer) - { - $attribute = $observer->getEvent()->getAttribute(); - /* @var $attribute \Magento\Eav\Model\Entity\Attribute */ - $entityType = $this->_eavConfig->getEntityType(\Magento\Catalog\Model\Product::ENTITY); - /* @var $entityType \Magento\Eav\Model\Entity\Type */ - - if ($attribute->getEntityTypeId() != $entityType->getId()) { - return $this; - } - $delete = $observer->getEventName() == 'eav_entity_attribute_delete_after'; - - if (!$delete && !$attribute->dataHasChangedFor('is_searchable')) { - return $this; - } - - $showNotice = false; - if ($delete) { - if ($attribute->getIsSearchable()) { - $showNotice = true; - } - } elseif ($attribute->dataHasChangedFor('is_searchable')) { - $showNotice = true; - } - - if ($showNotice) { - $url = $this->_backendUrl->getUrl('adminhtml/system_cache'); - $this->messageManager->addNotice( - __( - 'Attribute setting change related with Search Index. Please run <a href="%1">Rebuild Search Index</a> process.', - $url - ) - ); - } - - return $this; - } - - /** - * Rebuild index after import - * - * @return \Magento\CatalogSearch\Model\Fulltext\Observer - */ - public function refreshIndexAfterImport() - { - $this->_getFulltextModel()->rebuildIndex(); - return $this; - } - - /** - * Refresh fulltext index when we add new store - * - * @param \Magento\Framework\Event\Observer $observer - * @return \Magento\CatalogSearch\Model\Fulltext\Observer - */ - public function refreshStoreIndex(\Magento\Framework\Event\Observer $observer) - { - $storeId = $observer->getEvent()->getStore()->getId(); - $this->_getFulltextModel()->rebuildIndex($storeId); - return $this; - } - - /** - * Catalog Product mass website update - * - * @deprecated since 1.11 - * @param \Magento\Framework\Event\Observer $observer - * @return \Magento\CatalogSearch\Model\Fulltext\Observer - */ - public function catalogProductWebsiteUpdate(\Magento\Framework\Event\Observer $observer) - { - $websiteIds = $observer->getEvent()->getWebsiteIds(); - $productIds = $observer->getEvent()->getProductIds(); - $actionType = $observer->getEvent()->getAction(); - - foreach ($websiteIds as $websiteId) { - foreach ($this->_storeManager->getWebsite($websiteId)->getStoreIds() as $storeId) { - if ($actionType == 'remove') { - $this->_getFulltextModel()->cleanIndex($storeId, $productIds)->resetSearchResults(); - } elseif ($actionType == 'add') { - $this->_getFulltextModel()->rebuildIndex($storeId, $productIds)->resetSearchResults(); - } - } - } - - return $this; - } - - /** - * Store delete processing - * - * @param \Magento\Framework\Event\Observer $observer - * @return \Magento\CatalogSearch\Model\Fulltext\Observer - */ - public function cleanStoreIndex(\Magento\Framework\Event\Observer $observer) - { - $store = $observer->getEvent()->getStore(); - /* @var $store \Magento\Store\Model\Store */ - - $this->_getFulltextModel()->cleanIndex($store->getId()); - - return $this; - } -} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php index 833989742cbbd00ca02c4936ef5b5cfb7d9b74cb..b3e8547a1a0b19e46f75855033ba183e39ce2fc3 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php @@ -21,519 +21,89 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - - -/** - * CatalogSearch fulltext indexer model - */ namespace Magento\CatalogSearch\Model\Indexer; -use Magento\Framework\App\Config\ValueInterface; -use Magento\Catalog\Model\Category; -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ProductFactory; -use Magento\Catalog\Model\Resource\Eav\Attribute; -use Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory; -use Magento\CatalogSearch\Model\Fulltext as ModelFulltext; -use Magento\CatalogSearch\Model\Resource\Indexer\Fulltext as IndexerFulltext; -use Magento\Framework\Model\Context; -use Magento\Framework\Registry; -use Magento\Framework\Model\Resource\AbstractResource; -use Magento\Store\Model\Store; -use Magento\Store\Model\Group; -use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\Data\Collection\Db; -use Magento\Index\Model\Event; -use Magento\Index\Model\Indexer\AbstractIndexer; -use Magento\Index\Model\Process; - -class Fulltext extends AbstractIndexer +class Fulltext implements \Magento\Indexer\Model\ActionInterface, \Magento\Framework\Mview\ActionInterface { /** - * Data key for matching result to be saved in - */ - const EVENT_MATCH_RESULT_KEY = 'catalogsearch_fulltext_match_result'; - - /** - * List of searchable attributes - * - * @var null|array - */ - protected $_searchableAttributes; - - /** - * Store manager - * - * @var StoreManagerInterface - */ - protected $_storeManager; - - /** - * Product factory - * - * @var ProductFactory + * Indexer ID in configuration */ - protected $_productFactory; + const INDEXER_ID = 'catalogsearch_fulltext'; /** - * Catalog search fulltext - * - * @var ModelFulltext + * @var \Magento\Catalog\Model\Indexer\Category\Flat\Action\FullFactory */ - protected $_catalogSearchFulltext; + protected $fullActionFactory; /** - * Attribute collection factory - * - * @var CollectionFactory + * @var \Magento\Catalog\Model\Indexer\Category\Flat\Action\RowsFactory */ - protected $_attributeCollectionFactory; + protected $rowsActionFactory; /** - * Catalog search indexer fulltext - * - * @var IndexerFulltext + * @var \Magento\Indexer\Model\IndexerInterface */ - protected $_catalogSearchIndexerFulltext; + protected $indexer; /** - * Construct - * - * @param Context $context - * @param Registry $registry - * @param IndexerFulltext $catalogSearchIndexerFulltext - * @param CollectionFactory $attributeCollectionFactory - * @param ModelFulltext $catalogSearchFulltext - * @param ProductFactory $productFactory - * @param StoreManagerInterface $storeManager - * @param AbstractResource $resource - * @param Db $resourceCollection - * @param array $data + * @param Fulltext\Action\FullFactory $fullActionFactory + * @param Fulltext\Action\RowsFactory $rowsActionFactory + * @param \Magento\Indexer\Model\IndexerInterface $indexer */ public function __construct( - Context $context, - Registry $registry, - IndexerFulltext $catalogSearchIndexerFulltext, - CollectionFactory $attributeCollectionFactory, - ModelFulltext $catalogSearchFulltext, - ProductFactory $productFactory, - StoreManagerInterface $storeManager, - AbstractResource $resource = null, - Db $resourceCollection = null, - array $data = array() + Fulltext\Action\FullFactory $fullActionFactory, + Fulltext\Action\RowsFactory $rowsActionFactory, + \Magento\Indexer\Model\IndexerInterface $indexer ) { - $this->_catalogSearchIndexerFulltext = $catalogSearchIndexerFulltext; - $this->_attributeCollectionFactory = $attributeCollectionFactory; - $this->_catalogSearchFulltext = $catalogSearchFulltext; - $this->_productFactory = $productFactory; - $this->_storeManager = $storeManager; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * Retrieve resource instance - * - * @return IndexerFulltext - */ - protected function _getResource() - { - return $this->_catalogSearchIndexerFulltext; - } - - /** - * Indexer must be match entities - * - * @var array - */ - protected $_matchedEntities = array( - Product::ENTITY => array(Event::TYPE_SAVE, Event::TYPE_MASS_ACTION, Event::TYPE_DELETE), - Attribute::ENTITY => array(Event::TYPE_SAVE, Event::TYPE_DELETE), - Store::ENTITY => array(Event::TYPE_SAVE, Event::TYPE_DELETE), - Group::ENTITY => array(Event::TYPE_SAVE), - ValueInterface::ENTITY => array(Event::TYPE_SAVE), - Category::ENTITY => array(Event::TYPE_SAVE) - ); - - /** - * Related Configuration Settings for match - * - * @var string[] - */ - protected $_relatedConfigSettings = array(ModelFulltext::XML_PATH_CATALOG_SEARCH_TYPE); - - /** - * Retrieve Fulltext Search instance - * - * @return ModelFulltext - */ - protected function _getIndexer() - { - return $this->_catalogSearchFulltext; - } - - /** - * Retrieve Indexer name - * - * @return string - */ - public function getName() - { - return __('Catalog Search'); - } - - /** - * Retrieve Indexer description - * - * @return string - */ - public function getDescription() - { - return __('Rebuild Catalog product fulltext search index'); + $this->fullActionFactory = $fullActionFactory; + $this->rowsActionFactory = $rowsActionFactory; + $this->indexer = $indexer; } /** - * Check if event can be matched by process - * Overwrote for check is flat catalog product is enabled and specific save - * attribute, store, store_group + * Execute materialization on ids entities * - * @param Event $event - * @return bool - */ - public function matchEvent(Event $event) - { - $data = $event->getNewData(); - if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { - return $data[self::EVENT_MATCH_RESULT_KEY]; - } - - $entity = $event->getEntity(); - if ($entity == Attribute::ENTITY) { - /* @var $attribute Attribute */ - $attribute = $event->getDataObject(); - - if (!$attribute) { - $result = false; - } elseif ($event->getType() == Event::TYPE_SAVE) { - $result = $attribute->dataHasChangedFor('is_searchable'); - } elseif ($event->getType() == Event::TYPE_DELETE) { - $result = $attribute->getIsSearchable(); - } else { - $result = false; - } - } else { - if ($entity == Store::ENTITY) { - if ($event->getType() == Event::TYPE_DELETE) { - $result = true; - } else { - /* @var $store Store */ - $store = $event->getDataObject(); - if ($store && $store->isObjectNew()) { - $result = true; - } else { - $result = false; - } - } - } else { - if ($entity == Group::ENTITY) { - /* @var $storeGroup Group */ - $storeGroup = $event->getDataObject(); - if ($storeGroup && $storeGroup->dataHasChangedFor('website_id')) { - $result = true; - } else { - $result = false; - } - } else { - if ($entity == ValueInterface::ENTITY) { - $data = $event->getDataObject(); - if ($data && in_array($data->getPath(), $this->_relatedConfigSettings)) { - $result = $data->isValueChanged(); - } else { - $result = false; - } - } else { - $result = parent::matchEvent($event); - } - } - } - } - - $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result); - - return $result; - } - - /** - * Register data required by process in event object - * - * @param Event $event + * @param int[] $ids * @return void */ - protected function _registerEvent(Event $event) - { - $event->addNewData(self::EVENT_MATCH_RESULT_KEY, true); - switch ($event->getEntity()) { - case Product::ENTITY: - $this->_registerCatalogProductEvent($event); - break; - - case ValueInterface::ENTITY: - case Store::ENTITY: - case Attribute::ENTITY: - case Group::ENTITY: - $event->addNewData('catalogsearch_fulltext_skip_call_event_handler', true); - $process = $event->getProcess(); - $process->changeStatus(Process::STATUS_REQUIRE_REINDEX); - break; - case Category::ENTITY: - $this->_registerCatalogCategoryEvent($event); - break; - default: - break; - } - } - - /** - * Get data required for category'es products reindex - * - * @param Event $event - * @return $this - */ - protected function _registerCatalogCategoryEvent(Event $event) + public function execute($ids) { - switch ($event->getType()) { - case Event::TYPE_SAVE: - /* @var $category Category */ - $category = $event->getDataObject(); - $productIds = $category->getAffectedProductIds(); - if ($productIds) { - $event->addNewData('catalogsearch_category_update_product_ids', $productIds); - $event->addNewData('catalogsearch_category_update_category_ids', array($category->getId())); - } else { - $movedCategoryId = $category->getMovedCategoryId(); - if ($movedCategoryId) { - $event->addNewData('catalogsearch_category_update_product_ids', array()); - $event->addNewData('catalogsearch_category_update_category_ids', array($movedCategoryId)); - } - } - break; - default: - break; - } + $this->indexer->load(self::INDEXER_ID); - return $this; + /** @var Fulltext\Action\Rows $action */ + $action = $this->rowsActionFactory->create(); + $action->reindex($ids); } /** - * Register data required by catatalog product process in event object + * Execute full indexation * - * @param Event $event - * @return $this - */ - protected function _registerCatalogProductEvent(Event $event) - { - switch ($event->getType()) { - case Event::TYPE_SAVE: - /* @var $product Product */ - $product = $event->getDataObject(); - - $event->addNewData('catalogsearch_update_product_id', $product->getId()); - break; - case Event::TYPE_DELETE: - /* @var $product Product */ - $product = $event->getDataObject(); - - $event->addNewData('catalogsearch_delete_product_id', $product->getId()); - break; - case Event::TYPE_MASS_ACTION: - /* @var $actionObject \Magento\Framework\Object */ - $actionObject = $event->getDataObject(); - - $reindexData = array(); - $rebuildIndex = false; - - // check if status changed - $attrData = $actionObject->getAttributesData(); - if (isset($attrData['status'])) { - $rebuildIndex = true; - $reindexData['catalogsearch_status'] = $attrData['status']; - } - - // check changed websites - if ($actionObject->getWebsiteIds()) { - $rebuildIndex = true; - $reindexData['catalogsearch_website_ids'] = $actionObject->getWebsiteIds(); - $reindexData['catalogsearch_action_type'] = $actionObject->getActionType(); - } - - $searchableAttributes = array(); - if (is_array($attrData)) { - $searchableAttributes = array_intersect($this->_getSearchableAttributes(), array_keys($attrData)); - } - - if (count($searchableAttributes) > 0) { - $rebuildIndex = true; - $reindexData['catalogsearch_force_reindex'] = true; - } - - // register affected products - if ($rebuildIndex) { - $reindexData['catalogsearch_product_ids'] = $actionObject->getProductIds(); - foreach ($reindexData as $k => $v) { - $event->addNewData($k, $v); - } - } - break; - default: - break; - } - - return $this; - } - - /** - * Retrieve searchable attributes list - * - * @return array - */ - protected function _getSearchableAttributes() - { - if (is_null($this->_searchableAttributes)) { - /** @var $attributeCollection \Magento\Catalog\Model\Resource\Product\Attribute\Collection */ - $attributeCollection = $this->_attributeCollectionFactory->create(); - $attributeCollection->addIsSearchableFilter(); - - foreach ($attributeCollection as $attribute) { - $this->_searchableAttributes[] = $attribute->getAttributeCode(); - } - } - - return $this->_searchableAttributes; - } - - /** - * Check if product is composite - * - * @param int $productId - * @return bool + * @return void */ - protected function _isProductComposite($productId) + public function executeFull() { - $product = $this->_productFactory->create()->load($productId); - return $product->isComposite(); + $this->fullActionFactory->create()->reindexAll(); } /** - * Process event + * Execute partial indexation by ID list * - * @param Event $event + * @param int[] $ids * @return void */ - protected function _processEvent(Event $event) + public function executeList($ids) { - $data = $event->getNewData(); - - if (!empty($data['catalogsearch_fulltext_reindex_all'])) { - $this->reindexAll(); - } else { - if (!empty($data['catalogsearch_delete_product_id'])) { - $productId = $data['catalogsearch_delete_product_id']; - - if (!$this->_isProductComposite($productId)) { - $parentIds = $this->_getResource()->getRelationsByChild($productId); - if (!empty($parentIds)) { - $this->_getIndexer()->rebuildIndex(null, $parentIds); - } - } - - $this->_getIndexer()->cleanIndex( - null, - $productId - )->getResource()->resetSearchResults( - null, - $productId - ); - } elseif (!empty($data['catalogsearch_update_product_id'])) { - $productId = $data['catalogsearch_update_product_id']; - $productIds = array($productId); - - if (!$this->_isProductComposite($productId)) { - $parentIds = $this->_getResource()->getRelationsByChild($productId); - if (!empty($parentIds)) { - $productIds = array_merge($productIds, $parentIds); - } - } - - $this->_getIndexer()->rebuildIndex(null, $productIds); - } else { - if (!empty($data['catalogsearch_product_ids'])) { - // mass action - $productIds = $data['catalogsearch_product_ids']; - - if (!empty($data['catalogsearch_website_ids'])) { - $websiteIds = $data['catalogsearch_website_ids']; - $actionType = $data['catalogsearch_action_type']; - - foreach ($websiteIds as $websiteId) { - foreach ($this->_storeManager->getWebsite($websiteId)->getStoreIds() as $storeId) { - if ($actionType == 'remove') { - $this->_getIndexer()->cleanIndex( - $storeId, - $productIds - )->getResource()->resetSearchResults( - $storeId, - $productIds - ); - } elseif ($actionType == 'add') { - $this->_getIndexer()->rebuildIndex($storeId, $productIds); - } - } - } - } - if (isset($data['catalogsearch_status'])) { - $status = $data['catalogsearch_status']; - if ($status == \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) { - $this->_getIndexer()->rebuildIndex(null, $productIds); - } else { - $this->_getIndexer()->cleanIndex( - null, - $productIds - )->getResource()->resetSearchResults( - null, - $productIds - ); - } - } - if (isset($data['catalogsearch_force_reindex'])) { - $this->_getIndexer()->rebuildIndex(null, $productIds)->resetSearchResults(); - } - } else { - if (isset($data['catalogsearch_category_update_product_ids'])) { - $productIds = $data['catalogsearch_category_update_product_ids']; - $categoryIds = $data['catalogsearch_category_update_category_ids']; - - $this->_getIndexer()->updateCategoryIndex($productIds, $categoryIds); - } - } - } - } + $this->execute($ids); } /** - * Rebuild all index data + * Execute partial indexation by ID * + * @param int $id * @return void - * @throws \Exception */ - public function reindexAll() + public function executeRow($id) { - $resourceModel = $this->_getIndexer()->getResource(); - $resourceModel->beginTransaction(); - try { - $this->_getIndexer()->rebuildIndex(); - $resourceModel->commit(); - } catch (\Exception $e) { - $resourceModel->rollBack(); - throw $e; - } + $this->execute([$id]); } } diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php new file mode 100644 index 0000000000000000000000000000000000000000..f3e0932fd33388b05a4a3edae4ea23437fa51767 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php @@ -0,0 +1,810 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Action; + +class Full +{ + /** + * Searchable attributes cache + * + * @var \Magento\Eav\Model\Entity\Attribute[] + */ + protected $searchableAttributes; + + /** + * Index values separator + * + * @var string + */ + protected $separator = '|'; + + /** + * Array of \Magento\Framework\Stdlib\DateTime\DateInterface objects per store + * + * @var array + */ + protected $dates = []; + + /** + * Product Type Instances cache + * + * @var array + */ + protected $productTypes = []; + + /** + * Product Emulators cache + * + * @var array + */ + protected $productEmulators = []; + + /** + * @var \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory + */ + protected $productAttributeCollectionFactory; + + /** + * Catalog product status + * + * @var \Magento\Catalog\Model\Product\Attribute\Source\Status + */ + protected $catalogProductStatus; + + /** + * Eav config + * + * @var \Magento\Eav\Model\Config + */ + protected $eavConfig; + + /** + * Catalog product type + * + * @var \Magento\Catalog\Model\Product\Type + */ + protected $catalogProductType; + + /** + * Catalog search data + * + * @var \Magento\CatalogSearch\Helper\Data + */ + protected $catalogSearchData; + + /** + * Core event manager proxy + * + * @var \Magento\Framework\Event\ManagerInterface + */ + protected $eventManager; + + /** + * Core store config + * + * @var \Magento\Framework\App\Config\ScopeConfigInterface + */ + protected $scopeConfig; + + /** + * Store manager + * + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + + /** + * @var \Magento\CatalogSearch\Model\Resource\EngineProvider + */ + protected $engineProvider; + + /** + * @var \Magento\Framework\Stdlib\DateTime + */ + protected $dateTime; + + /** + * @var \Magento\Framework\Locale\ResolverInterface + */ + protected $localeResolver; + + /** + * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface + */ + protected $localeDate; + + /** + * @var \Magento\Framework\App\Resource + */ + protected $resource; + + /** + * @var \Magento\CatalogSearch\Model\Resource\Fulltext + */ + protected $fulltextResource; + + /** + * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Catalog\Model\Product\Type $catalogProductType + * @param \Magento\Eav\Model\Config $eavConfig + * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $productAttributeCollectionFactory + * @param \Magento\CatalogSearch\Model\Resource\EngineProvider $engineProvider + * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param \Magento\Framework\Locale\ResolverInterface $localeResolver + * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate + * @param \Magento\CatalogSearch\Model\Resource\Fulltext $fulltextResource + */ + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Catalog\Model\Product\Type $catalogProductType, + \Magento\Eav\Model\Config $eavConfig, + \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $productAttributeCollectionFactory, + \Magento\CatalogSearch\Model\Resource\EngineProvider $engineProvider, + \Magento\Framework\Event\ManagerInterface $eventManager, + \Magento\CatalogSearch\Helper\Data $catalogSearchData, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Store\Model\StoreManagerInterface $storeManager, + \Magento\Framework\Stdlib\DateTime $dateTime, + \Magento\Framework\Locale\ResolverInterface $localeResolver, + \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, + \Magento\CatalogSearch\Model\Resource\Fulltext $fulltextResource + ) { + $this->resource = $resource; + $this->catalogProductType = $catalogProductType; + $this->eavConfig = $eavConfig; + $this->catalogProductStatus = $catalogProductStatus; + $this->productAttributeCollectionFactory = $productAttributeCollectionFactory; + $this->eventManager = $eventManager; + $this->catalogSearchData = $catalogSearchData; + $this->scopeConfig = $scopeConfig; + $this->storeManager = $storeManager; + $this->engineProvider = $engineProvider; + $this->dateTime = $dateTime; + $this->localeResolver = $localeResolver; + $this->localeDate = $localeDate; + $this->fulltextResource = $fulltextResource; + } + + /** + * Rebuild whole fulltext index + * + * @return void + */ + public function reindexAll() + { + $this->rebuildIndex(); + } + + /** + * Return validated table name + * + * @param string|string[] $table + * @return string + */ + protected function getTable($table) + { + return $this->resource->getTableName($table); + } + + /** + * Retrieve connection for read data + * + * @return \Magento\Framework\DB\Adapter\AdapterInterface + */ + protected function getReadAdapter() + { + $writeAdapter = $this->getWriteAdapter(); + if ($writeAdapter && $writeAdapter->getTransactionLevel() > 0) { + // if transaction is started we should use write connection for reading + return $writeAdapter; + } + return $this->resource->getConnection('read'); + } + + /** + * Retrieve connection for write data + * + * @return \Magento\Framework\DB\Adapter\AdapterInterface + */ + protected function getWriteAdapter() + { + return $this->resource->getConnection('write'); + } + + /** + * Regenerate search index for store(s) + * + * @param int|array|null $productIds + * @return void + */ + protected function rebuildIndex($productIds = null) + { + $storeIds = array_keys($this->storeManager->getStores()); + foreach ($storeIds as $storeId) { + $this->rebuildStoreIndex($storeId, $productIds); + } + } + + /** + * Regenerate search index for specific store + * + * @param int $storeId Store View Id + * @param int|array $productIds Product Entity Id + * @return void + */ + protected function rebuildStoreIndex($storeId, $productIds = null) + { + $this->cleanIndex($storeId, $productIds); + + // prepare searchable attributes + $staticFields = []; + foreach ($this->getSearchableAttributes('static') as $attribute) { + $staticFields[] = $attribute->getAttributeCode(); + } + $dynamicFields = [ + 'int' => array_keys($this->getSearchableAttributes('int')), + 'varchar' => array_keys($this->getSearchableAttributes('varchar')), + 'text' => array_keys($this->getSearchableAttributes('text')), + 'decimal' => array_keys($this->getSearchableAttributes('decimal')), + 'datetime' => array_keys($this->getSearchableAttributes('datetime')), + ]; + + // status and visibility filter + $visibility = $this->getSearchableAttribute('visibility'); + $status = $this->getSearchableAttribute('status'); + $statusIds = $this->catalogProductStatus->getVisibleStatusIds(); + $allowedVisibility = $this->engineProvider->get()->getAllowedVisibility(); + + $lastProductId = 0; + while (true) { + $products = $this->getSearchableProducts($storeId, $staticFields, $productIds, $lastProductId); + if (!$products) { + break; + } + + $productAttributes = []; + $productRelations = []; + foreach ($products as $productData) { + $lastProductId = $productData['entity_id']; + $productAttributes[$productData['entity_id']] = $productData['entity_id']; + $productChildren = $this->getProductChildIds($productData['entity_id'], $productData['type_id']); + $productRelations[$productData['entity_id']] = $productChildren; + if ($productChildren) { + foreach ($productChildren as $productChildId) { + $productAttributes[$productChildId] = $productChildId; + } + } + } + + $productIndexes = []; + $productAttributes = $this->getProductAttributes($storeId, $productAttributes, $dynamicFields); + foreach ($products as $productData) { + if (!isset($productAttributes[$productData['entity_id']])) { + continue; + } + + $productAttr = $productAttributes[$productData['entity_id']]; + if (!isset( + $productAttr[$visibility->getId()] + ) || !in_array( + $productAttr[$visibility->getId()], + $allowedVisibility + ) + ) { + continue; + } + if (!isset($productAttr[$status->getId()]) || !in_array($productAttr[$status->getId()], $statusIds)) { + continue; + } + + $productIndex = [$productData['entity_id'] => $productAttr]; + + $hasChildren = false; + $productChildren = $productRelations[$productData['entity_id']]; + if ($productChildren) { + foreach ($productChildren as $productChildId) { + if (isset($productAttributes[$productChildId])) { + $productChildAttr = $productAttributes[$productChildId]; + if (!isset($productChildAttr[$status->getId()]) + || !in_array($productChildAttr[$status->getId()], $statusIds) + ) { + continue; + } + + $hasChildren = true; + $productIndex[$productChildId] = $productChildAttr; + } + } + } + if (!is_null($productChildren) && !$hasChildren) { + continue; + } + + $index = $this->prepareProductIndex($productIndex, $productData, $storeId); + + $productIndexes[$productData['entity_id']] = $index; + } + + $this->saveProductIndexes($storeId, $productIndexes); + } + + // Reset only product-specific queries and results. + $this->fulltextResource->resetSearchResults($storeId, $productIds); + } + + /** + * Retrieve searchable products per store + * + * @param int $storeId + * @param array $staticFields + * @param array|int $productIds + * @param int $lastProductId + * @param int $limit + * @return array + */ + protected function getSearchableProducts( + $storeId, + array $staticFields, + $productIds = null, + $lastProductId = 0, + $limit = 100 + ) { + $websiteId = $this->storeManager->getStore($storeId)->getWebsiteId(); + $writeAdapter = $this->getWriteAdapter(); + + $select = $writeAdapter->select()->useStraightJoin( + true + )->from( + ['e' => $this->getTable('catalog_product_entity')], + array_merge(['entity_id', 'type_id'], $staticFields) + )->join( + ['website' => $this->getTable('catalog_product_website')], + $writeAdapter->quoteInto('website.product_id = e.entity_id AND website.website_id = ?', $websiteId), + [] + ); + + if (!is_null($productIds)) { + $select->where('e.entity_id IN (?)', $productIds); + } + + $select->where('e.entity_id > ?', $lastProductId)->limit($limit)->order('e.entity_id'); + + $result = $writeAdapter->fetchAll($select); + + return $result; + } + + /** + * Delete search index data for store + * + * @param int $storeId Store View Id + * @param int $productId Product Entity Id + * @return void + */ + protected function cleanIndex($storeId = null, $productId = null) + { + if ($this->engineProvider->get()) { + $this->engineProvider->get()->cleanIndex($storeId, $productId); + } + } + + /** + * Retrieve EAV Config Singleton + * + * @return \Magento\Eav\Model\Config + */ + protected function getEavConfig() + { + return $this->eavConfig; + } + + /** + * Retrieve searchable attributes + * + * @param string $backendType + * @return \Magento\Eav\Model\Entity\Attribute[] + */ + protected function getSearchableAttributes($backendType = null) + { + if (null === $this->searchableAttributes) { + $this->searchableAttributes = []; + + $productAttributes = $this->productAttributeCollectionFactory->create(); + + if ($this->engineProvider->get() && $this->engineProvider->get()->allowAdvancedIndex()) { + $productAttributes->addToIndexFilter(true); + } else { + $productAttributes->addSearchableAttributeFilter(); + } + /** @var \Magento\Eav\Model\Entity\Attribute[] $attributes */ + $attributes = $productAttributes->getItems(); + + $this->eventManager->dispatch( + 'catelogsearch_searchable_attributes_load_after', + ['engine' => $this->engineProvider->get(), 'attributes' => $attributes] + ); + + $entity = $this->getEavConfig()->getEntityType(\Magento\Catalog\Model\Product::ENTITY)->getEntity(); + + foreach ($attributes as $attribute) { + $attribute->setEntity($entity); + } + + $this->searchableAttributes = $attributes; + } + + if (!is_null($backendType)) { + $attributes = []; + foreach ($this->searchableAttributes as $attributeId => $attribute) { + if ($attribute->getBackendType() == $backendType) { + $attributes[$attributeId] = $attribute; + } + } + + return $attributes; + } + + return $this->searchableAttributes; + } + + /** + * Retrieve searchable attribute by Id or code + * + * @param int|string $attribute + * @return \Magento\Eav\Model\Entity\Attribute + */ + protected function getSearchableAttribute($attribute) + { + $attributes = $this->getSearchableAttributes(); + if (is_numeric($attribute)) { + if (isset($attributes[$attribute])) { + return $attributes[$attribute]; + } + } elseif (is_string($attribute)) { + foreach ($attributes as $attributeModel) { + if ($attributeModel->getAttributeCode() == $attribute) { + return $attributeModel; + } + } + } + + return $this->getEavConfig()->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attribute); + } + + /** + * Returns expression for field unification + * + * @param string $field + * @param string $backendType + * @return \Zend_Db_Expr + */ + protected function unifyField($field, $backendType = 'varchar') + { + if ($backendType == 'datetime') { + $expr = $this->getReadAdapter()->getDateFormatSql($field, '%Y-%m-%d %H:%i:%s'); + } else { + $expr = $field; + } + return $expr; + } + + /** + * Load product(s) attributes + * + * @param int $storeId + * @param array $productIds + * @param array $attributeTypes + * @return array + */ + protected function getProductAttributes($storeId, array $productIds, array $attributeTypes) + { + $result = []; + $selects = []; + $adapter = $this->getWriteAdapter(); + $ifStoreValue = $adapter->getCheckSql('t_store.value_id > 0', 't_store.value', 't_default.value'); + foreach ($attributeTypes as $backendType => $attributeIds) { + if ($attributeIds) { + $tableName = $this->getTable('catalog_product_entity_' . $backendType); + $selects[] = $adapter->select()->from( + ['t_default' => $tableName], + ['entity_id', 'attribute_id'] + )->joinLeft( + ['t_store' => $tableName], + $adapter->quoteInto( + 't_default.entity_id=t_store.entity_id' . + ' AND t_default.attribute_id=t_store.attribute_id' . + ' AND t_store.store_id = ?', + $storeId + ), + ['value' => $this->unifyField($ifStoreValue, $backendType)] + )->where( + 't_default.store_id = ?', + 0 + )->where( + 't_default.attribute_id IN (?)', + $attributeIds + )->where( + 't_default.entity_id IN (?)', + $productIds + ); + } + } + + if ($selects) { + $select = $adapter->select()->union($selects, \Zend_Db_Select::SQL_UNION_ALL); + $query = $adapter->query($select); + while ($row = $query->fetch()) { + $result[$row['entity_id']][$row['attribute_id']] = $row['value']; + } + } + + return $result; + } + + /** + * Retrieve Product Type Instance + * + * @param string $typeId + * @return \Magento\Catalog\Model\Product\Type\AbstractType + */ + protected function getProductTypeInstance($typeId) + { + if (!isset($this->productTypes[$typeId])) { + $productEmulator = $this->getProductEmulator($typeId); + + $this->productTypes[$typeId] = $this->catalogProductType->factory($productEmulator); + } + return $this->productTypes[$typeId]; + } + + /** + * Return all product children ids + * + * @param int $productId Product Entity Id + * @param string $typeId Super Product Link Type + * @return array|null + */ + protected function getProductChildIds($productId, $typeId) + { + $typeInstance = $this->getProductTypeInstance($typeId); + $relation = $typeInstance->isComposite( + $this->getProductEmulator($typeId) + ) ? $typeInstance->getRelationInfo() : false; + + if ($relation && $relation->getTable() && $relation->getParentFieldName() && $relation->getChildFieldName()) { + $select = $this->getReadAdapter()->select()->from( + ['main' => $this->getTable($relation->getTable())], + [$relation->getChildFieldName()] + )->where( + $relation->getParentFieldName() . ' = ?', + $productId + ); + if (!is_null($relation->getWhere())) { + $select->where($relation->getWhere()); + } + return $this->getReadAdapter()->fetchCol($select); + } + + return null; + } + + /** + * Retrieve Product Emulator (Magento Object) + * + * @param string $typeId + * @return \Magento\Framework\Object + */ + protected function getProductEmulator($typeId) + { + if (!isset($this->productEmulators[$typeId])) { + $productEmulator = new \Magento\Framework\Object(); + $productEmulator->setIdFieldName('entity_id')->setTypeId($typeId); + $this->productEmulators[$typeId] = $productEmulator; + } + return $this->productEmulators[$typeId]; + } + + /** + * Prepare Fulltext index value for product + * + * @param array $indexData + * @param array $productData + * @param int $storeId + * @return string + */ + protected function prepareProductIndex($indexData, $productData, $storeId) + { + $index = []; + + foreach ($this->getSearchableAttributes('static') as $attribute) { + $attributeCode = $attribute->getAttributeCode(); + + if (isset($productData[$attributeCode])) { + $value = $this->getAttributeValue($attribute->getId(), $productData[$attributeCode], $storeId); + if ($value) { + if (isset($index[$attributeCode])) { + if (!is_array($index[$attributeCode])) { + $index[$attributeCode] = [$index[$attributeCode]]; + } + $index[$attributeCode][] = $value; + } else { + $index[$attributeCode] = $value; + } + } + } + } + + foreach ($indexData as $entityId => $attributeData) { + foreach ($attributeData as $attributeId => $attributeValue) { + $value = $this->getAttributeValue($attributeId, $attributeValue, $storeId); + if (!is_null($value) && $value !== false) { + $attributeCode = $this->getSearchableAttribute($attributeId)->getAttributeCode(); + + if (isset($index[$attributeCode])) { + $index[$attributeCode][$entityId] = $value; + } else { + $index[$attributeCode] = [$entityId => $value]; + } + } + } + } + + if (!$this->engineProvider->get()->allowAdvancedIndex()) { + $product = $this->getProductEmulator( + $productData['type_id'] + )->setId( + $productData['entity_id'] + )->setStoreId( + $storeId + ); + $typeInstance = $this->getProductTypeInstance($productData['type_id']); + $data = $typeInstance->getSearchableData($product); + if ($data) { + $index['options'] = $data; + } + } + + if ($this->engineProvider->get()) { + return $this->engineProvider->get()->prepareEntityIndex($index, $this->separator); + } + + return $this->catalogSearchData->prepareIndexdata($index, $this->separator); + } + + /** + * Retrieve attribute source value for search + * + * @param int $attributeId + * @param mixed $value + * @param int $storeId + * @return mixed + */ + protected function getAttributeValue($attributeId, $value, $storeId) + { + $attribute = $this->getSearchableAttribute($attributeId); + if (!$attribute->getIsSearchable()) { + if ($this->engineProvider->get()->allowAdvancedIndex()) { + if ($attribute->getAttributeCode() == 'visibility') { + return $value; + } elseif (!($attribute->getIsVisibleInAdvancedSearch() || + $attribute->getIsFilterable() || + $attribute->getIsFilterableInSearch() || + $attribute->getUsedForSortBy()) + ) { + return null; + } + } else { + return null; + } + } + + if ($attribute->usesSource()) { + if ($this->engineProvider->get()->allowAdvancedIndex()) { + return $value; + } + + $attribute->setStoreId($storeId); + $value = $attribute->getSource()->getIndexOptionText($value); + + if (is_array($value)) { + $value = implode($this->separator, $value); + } elseif (empty($value)) { + $inputType = $attribute->getFrontend()->getInputType(); + if ($inputType == 'select' || $inputType == 'multiselect') { + return null; + } + } + } elseif ($attribute->getBackendType() == 'datetime') { + $value = $this->getStoreDate($storeId, $value); + } else { + $inputType = $attribute->getFrontend()->getInputType(); + if ($inputType == 'price') { + $value = $this->storeManager->getStore($storeId)->roundPrice($value); + } + } + + $value = preg_replace("#\s+#siu", ' ', trim(strip_tags($value))); + + return $value; + } + + /** + * Save Multiply Product indexes + * + * @param int $storeId + * @param array $productIndexes + * @return $this + */ + protected function saveProductIndexes($storeId, $productIndexes) + { + if ($this->engineProvider->get()) { + $this->engineProvider->get()->saveEntityIndexes($storeId, $productIndexes); + } + + return $this; + } + + /** + * Retrieve Date value for store + * + * @param int $storeId + * @param string $date + * @return string|null + */ + protected function getStoreDate($storeId, $date = null) + { + if (!isset($this->dates[$storeId])) { + $timezone = $this->scopeConfig->getValue( + $this->localeDate->getDefaultTimezonePath(), + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + $storeId + ); + $locale = $this->scopeConfig->getValue( + $this->localeResolver->getDefaultLocalePath(), + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + $storeId + ); + $locale = new \Zend_Locale($locale); + + $dateObj = new \Magento\Framework\Stdlib\DateTime\Date(null, null, $locale); + $dateObj->setTimezone($timezone); + $this->dates[$storeId] = [$dateObj, $locale->getTranslation(null, 'date', $locale)]; + } + + if (!$this->dateTime->isEmptyDate($date)) { + list($dateObj, $format) = $this->dates[$storeId]; + $dateObj->setDate($date, \Magento\Framework\Stdlib\DateTime::DATETIME_INTERNAL_FORMAT); + + return $dateObj->toString($format); + } + + return null; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Rows.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Rows.php new file mode 100644 index 0000000000000000000000000000000000000000..cfa2bfc583486fc58e4b8b93f7f069b53aef72e8 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Rows.php @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Action; + +class Rows extends \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full +{ + /** + * Refresh entities index + * + * @param int[] $entityIds + * @return void + */ + public function reindex(array $entityIds = array()) + { + // Index basic products + $this->rebuildIndex($entityIds); + // Index parent products + $this->rebuildIndex($this->getProductIdsFromParents($entityIds)); + } + + /** + * Get parents IDs of product IDs to be re-indexed + * + * @param int[] $entityIds + * @return int[] + */ + protected function getProductIdsFromParents(array $entityIds) + { + return $this->getWriteAdapter()->select() + ->from($this->getTable('catalog_product_relation'), 'parent_id') + ->distinct(true) + ->where('child_id IN (?)', $entityIds) + ->where('parent_id NOT IN (?)', $entityIds) + ->query()->fetchAll(\Zend_Db::FETCH_COLUMN); + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AbstractPlugin.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AbstractPlugin.php new file mode 100644 index 0000000000000000000000000000000000000000..5f1a512b4ca572f9d38b941fc0bfd574d3926e16 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AbstractPlugin.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin; + +use Magento\CatalogSearch\Model\Indexer\Fulltext; + +abstract class AbstractPlugin +{ + /** + * @var \Magento\Indexer\Model\IndexerInterface + */ + protected $indexer; + + /** + * @param \Magento\Indexer\Model\IndexerInterface $indexer + */ + public function __construct( + \Magento\Indexer\Model\IndexerInterface $indexer + ) { + $this->indexer = $indexer; + } + + /** + * Return own indexer object + * + * @return \Magento\Indexer\Model\IndexerInterface + */ + protected function getIndexer() + { + if (!$this->indexer->getId()) { + $this->indexer->load(Fulltext::INDEXER_ID); + } + return $this->indexer; + } + + /** + * Reindex by product if indexer is not scheduled + * + * @param int $productId + * @return void + */ + protected function reindexRow($productId) + { + if (!$this->getIndexer()->isScheduled()) { + $this->getIndexer()->reindexRow($productId); + } + } + + /** + * Reindex by product if indexer is not scheduled + * + * @param int[] $productIds + * @return void + */ + protected function reindexList(array $productIds) + { + if (!$this->getIndexer()->isScheduled()) { + $this->getIndexer()->reindexList($productIds); + } + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Attribute.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Attribute.php new file mode 100644 index 0000000000000000000000000000000000000000..20200e4e6814dba69fa54f3a7a3b0aab212038e8 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Attribute.php @@ -0,0 +1,75 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin; + +class Attribute extends AbstractPlugin +{ + /** + * Invalidate indexer on attribute save (searchable flag change) + * + * @param \Magento\Catalog\Model\Resource\Attribute $subject + * @param \Closure $proceed + * @param \Magento\Framework\Model\AbstractModel $attribute + * + * @return \Magento\Catalog\Model\Resource\Attribute + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundSave( + \Magento\Catalog\Model\Resource\Attribute $subject, + \Closure $proceed, + \Magento\Framework\Model\AbstractModel $attribute + ) { + $needInvalidation = !$attribute->isObjectNew() && $attribute->dataHasChangedFor('is_searchable'); + $result = $proceed($attribute); + if ($needInvalidation) { + $this->getIndexer()->invalidate(); + } + + return $result; + } + + /** + * Invalidate indexer on searchable attribute delete + * + * @param \Magento\Catalog\Model\Resource\Attribute $subject + * @param \Closure $proceed + * @param \Magento\Framework\Model\AbstractModel $attribute + * + * @return \Magento\Catalog\Model\Resource\Attribute + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundDelete( + \Magento\Catalog\Model\Resource\Attribute $subject, + \Closure $proceed, + \Magento\Framework\Model\AbstractModel $attribute + ) { + $needInvalidation = !$attribute->isObjectNew() && $attribute->getIsSearchable(); + $result = $proceed($attribute); + if ($needInvalidation) { + $this->getIndexer()->invalidate(); + } + + return $result; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product.php new file mode 100644 index 0000000000000000000000000000000000000000..0da970b76ee20dcba16d7cc8d56be7402779972a --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product.php @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin; + +class Product extends AbstractPlugin +{ + /** + * Reindex on product save + * + * @param \Magento\Catalog\Model\Product $product + * @return \Magento\Catalog\Model\Product + */ + public function afterSave(\Magento\Catalog\Model\Product $product) + { + $this->reindexRow($product->getId()); + return $product; + } + + /** + * Reindex on product delete + * + * @param \Magento\Catalog\Model\Product $product + * @return \Magento\Catalog\Model\Product + */ + public function afterDelete(\Magento\Catalog\Model\Product $product) + { + $this->reindexRow($product->getId()); + return $product; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Action.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Action.php new file mode 100644 index 0000000000000000000000000000000000000000..d878b62e070a87f64f140cb264c24c2dc2cf30a6 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Action.php @@ -0,0 +1,76 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product; + +use Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\AbstractPlugin; + +class Action extends AbstractPlugin +{ + /** + * Reindex on product attribute mass change + * + * @param \Magento\Catalog\Model\Product\Action $subject + * @param \Closure $closure + * @param array $productIds + * @param array $attrData + * @param int $storeId + * @return \Magento\Catalog\Model\Product\Action + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundUpdateAttributes( + \Magento\Catalog\Model\Product\Action $subject, + \Closure $closure, + array $productIds, + array $attrData, + $storeId + ) { + $result = $closure($productIds, $attrData, $storeId); + $this->reindexList(array_unique($productIds)); + return $result; + } + + /** + * Reindex on product websites mass change + * + * @param \Magento\Catalog\Model\Product\Action $subject + * @param \Closure $closure + * @param array $productIds + * @param array $websiteIds + * @param string $type + * @return \Magento\Catalog\Model\Product\Action + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundUpdateWebsites( + \Magento\Catalog\Model\Product\Action $subject, + \Closure $closure, + array $productIds, + array $websiteIds, + $type + ) { + $result = $closure($productIds, $websiteIds, $type); + $this->reindexList(array_unique($productIds)); + return $result; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/Group.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/Group.php new file mode 100644 index 0000000000000000000000000000000000000000..7222e6826f515556939cfbb928bdc7b9175dd36e --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/Group.php @@ -0,0 +1,71 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Store; + +use Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\AbstractPlugin; + +class Group extends AbstractPlugin +{ + /** + * Invalidate indexer on store group save + * + * @param \Magento\Store\Model\Resource\Group $subject + * @param \Closure $proceed + * @param \Magento\Framework\Model\AbstractModel $group + * + * @return \Magento\Store\Model\Resource\Group + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundSave( + \Magento\Store\Model\Resource\Group $subject, + \Closure $proceed, + \Magento\Framework\Model\AbstractModel $group + ) { + $needInvalidation = !$group->isObjectNew() && $group->dataHasChangedFor('website_id'); + $result = $proceed($group); + if ($needInvalidation) { + $this->getIndexer()->invalidate(); + } + + return $result; + } + + /** + * Invalidate indexer on store group delete + * + * @param \Magento\Store\Model\Resource\Group $subject + * @param \Magento\Store\Model\Resource\Group $result + * + * @return \Magento\Store\Model\Resource\Group + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDelete( + \Magento\Store\Model\Resource\Group $subject, + \Magento\Store\Model\Resource\Group $result + ) { + $this->getIndexer()->invalidate(); + + return $result; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/View.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/View.php new file mode 100644 index 0000000000000000000000000000000000000000..6757ba73a85c68dd65954926a8e808de150d504f --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/View.php @@ -0,0 +1,71 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Store; + +use Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\AbstractPlugin; + +class View extends AbstractPlugin +{ + /** + * Invalidate indexer on store view save + * + * @param \Magento\Store\Model\Resource\Store $subject + * @param \Closure $proceed + * @param \Magento\Framework\Model\AbstractModel $store + * + * @return \Magento\Store\Model\Resource\Store + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundSave( + \Magento\Store\Model\Resource\Store $subject, + \Closure $proceed, + \Magento\Framework\Model\AbstractModel $store + ) { + $needInvalidation = $store->isObjectNew(); + $result = $proceed($store); + if ($needInvalidation) { + $this->getIndexer()->invalidate(); + } + + return $result; + } + + /** + * Invalidate indexer on store view delete + * + * @param \Magento\Store\Model\Resource\Store $subject + * @param \Magento\Store\Model\Resource\Store $result + * + * @return \Magento\Store\Model\Resource\Store + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDelete( + \Magento\Store\Model\Resource\Store $subject, + \Magento\Store\Model\Resource\Store $result + ) { + $this->getIndexer()->invalidate(); + + return $result; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Resource/EngineProvider.php b/app/code/Magento/CatalogSearch/Model/Resource/EngineProvider.php index c70666cb550df96fb074e7019a843422204854ba..0536348bc2020393f55be72cf553102540242d70 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/EngineProvider.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/EngineProvider.php @@ -27,6 +27,8 @@ */ namespace Magento\CatalogSearch\Model\Resource; +use Magento\Store\Model\ScopeInterface; + class EngineProvider { /** @@ -64,7 +66,7 @@ class EngineProvider public function get() { if (!$this->_engine) { - $engineClassName = $this->_scopeConfig->getValue('catalog/search/engine', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); + $engineClassName = $this->_scopeConfig->getValue('catalog/search/engine', ScopeInterface::SCOPE_STORE); /** * This needed if there already was saved in configuration some none-default engine diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php index 8afd014c99e2103b84b573dc77490b190653ad9e..961e5e2e618708da3470c7fe4d0edd9b798a706d 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php @@ -28,74 +28,6 @@ namespace Magento\CatalogSearch\Model\Resource; */ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb { - /** - * Searchable attributes cache - * - * @var array - */ - protected $_searchableAttributes = null; - - /** - * Index values separator - * - * @var string - */ - protected $_separator = '|'; - - /** - * Array of \Magento\Framework\Stdlib\DateTime\DateInterface objects per store - * - * @var array - */ - protected $_dates = array(); - - /** - * Product Type Instances cache - * - * @var array - */ - protected $_productTypes = array(); - - /** - * Product Emulators cache - * - * @var array - */ - protected $_productEmulators = array(); - - /** - * @var \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory - */ - protected $_productAttributeCollectionFactory; - - /** - * Catalog product status - * - * @var \Magento\Catalog\Model\Product\Attribute\Source\Status - */ - protected $_catalogProductStatus; - - /** - * Eav config - * - * @var \Magento\Eav\Model\Config - */ - protected $_eavConfig; - - /** - * Catalog product type - * - * @var \Magento\Catalog\Model\Product\Type - */ - protected $_catalogProductType; - - /** - * Catalog search data - * - * @var \Magento\CatalogSearch\Helper\Data - */ - protected $_catalogSearchData; - /** * Core string * @@ -110,20 +42,6 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb */ protected $_eventManager; - /** - * Core store config - * - * @var \Magento\Framework\App\Config\ScopeConfigInterface - */ - protected $_scopeConfig; - - /** - * Store manager - * - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * CatalogSearch resource helper * @@ -131,74 +49,21 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb */ protected $_resourceHelper; - /** - * @var \Magento\CatalogSearch\Model\Resource\EngineProvider - */ - protected $_engineProvider; - - /** - * @var \Magento\Framework\Stdlib\DateTime - */ - protected $dateTime; - - /** - * @var \Magento\Framework\Locale\ResolverInterface - */ - protected $_localeResolver; - - /** - * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface - */ - protected $_localeDate; - /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Catalog\Model\Product\Type $catalogProductType - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $productAttributeCollectionFactory - * @param EngineProvider $engineProvider * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Filter\FilterManager $filter - * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param Helper $resourceHelper - * @param \Magento\Framework\Stdlib\DateTime $dateTime - * @param \Magento\Framework\Locale\ResolverInterface $localeResolver - * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Catalog\Model\Product\Type $catalogProductType, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus, - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $productAttributeCollectionFactory, - \Magento\CatalogSearch\Model\Resource\EngineProvider $engineProvider, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Filter\FilterManager $filter, - \Magento\CatalogSearch\Helper\Data $catalogSearchData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\CatalogSearch\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Stdlib\DateTime $dateTime, - \Magento\Framework\Locale\ResolverInterface $localeResolver, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate + \Magento\CatalogSearch\Model\Resource\Helper $resourceHelper ) { - $this->_catalogProductType = $catalogProductType; - $this->_eavConfig = $eavConfig; - $this->_catalogProductStatus = $catalogProductStatus; - $this->_productAttributeCollectionFactory = $productAttributeCollectionFactory; $this->_eventManager = $eventManager; $this->filter = $filter; - $this->_catalogSearchData = $catalogSearchData; - $this->_scopeConfig = $scopeConfig; - $this->_storeManager = $storeManager; $this->_resourceHelper = $resourceHelper; - $this->_engineProvider = $engineProvider; - $this->dateTime = $dateTime; - $this->_localeResolver = $localeResolver; - $this->_localeDate = $localeDate; parent::__construct($resource); } @@ -212,180 +77,6 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb $this->_init('catalogsearch_fulltext', 'product_id'); } - /** - * Return options separator - * - * @return string - */ - public function getSeparator() - { - return $this->_separator; - } - - /** - * Regenerate search index for store(s) - * - * @param int|null $storeId - * @param int|array|null $productIds - * @return $this - */ - public function rebuildIndex($storeId = null, $productIds = null) - { - if (is_null($storeId)) { - $storeIds = array_keys($this->_storeManager->getStores()); - foreach ($storeIds as $storeId) { - $this->_rebuildStoreIndex($storeId, $productIds); - } - } else { - $this->_rebuildStoreIndex($storeId, $productIds); - } - - return $this; - } - - /** - * Regenerate search index for specific store - * - * @param int $storeId Store View Id - * @param int|array $productIds Product Entity Id - * @return $this - */ - protected function _rebuildStoreIndex($storeId, $productIds = null) - { - $this->cleanIndex($storeId, $productIds); - - // prepare searchable attributes - $staticFields = array(); - foreach ($this->_getSearchableAttributes('static') as $attribute) { - $staticFields[] = $attribute->getAttributeCode(); - } - $dynamicFields = array( - 'int' => array_keys($this->_getSearchableAttributes('int')), - 'varchar' => array_keys($this->_getSearchableAttributes('varchar')), - 'text' => array_keys($this->_getSearchableAttributes('text')), - 'decimal' => array_keys($this->_getSearchableAttributes('decimal')), - 'datetime' => array_keys($this->_getSearchableAttributes('datetime')) - ); - - // status and visibility filter - $visibility = $this->_getSearchableAttribute('visibility'); - $status = $this->_getSearchableAttribute('status'); - $statusVals = $this->_catalogProductStatus->getVisibleStatusIds(); - $allowedVisibility = $this->_engineProvider->get()->getAllowedVisibility(); - - $lastProductId = 0; - while (true) { - $products = $this->_getSearchableProducts($storeId, $staticFields, $productIds, $lastProductId); - if (!$products) { - break; - } - - $productAttributes = array(); - $productRelations = array(); - foreach ($products as $productData) { - $lastProductId = $productData['entity_id']; - $productAttributes[$productData['entity_id']] = $productData['entity_id']; - $productChildren = $this->_getProductChildIds($productData['entity_id'], $productData['type_id']); - $productRelations[$productData['entity_id']] = $productChildren; - if ($productChildren) { - foreach ($productChildren as $productChildId) { - $productAttributes[$productChildId] = $productChildId; - } - } - } - - $productIndexes = array(); - $productAttributes = $this->_getProductAttributes($storeId, $productAttributes, $dynamicFields); - foreach ($products as $productData) { - if (!isset($productAttributes[$productData['entity_id']])) { - continue; - } - - $productAttr = $productAttributes[$productData['entity_id']]; - if (!isset( - $productAttr[$visibility->getId()] - ) || !in_array( - $productAttr[$visibility->getId()], - $allowedVisibility - ) - ) { - continue; - } - if (!isset($productAttr[$status->getId()]) || !in_array($productAttr[$status->getId()], $statusVals)) { - continue; - } - - $productIndex = array($productData['entity_id'] => $productAttr); - - $productChildren = $productRelations[$productData['entity_id']]; - if ($productChildren) { - foreach ($productChildren as $productChildId) { - if (isset($productAttributes[$productChildId])) { - $productIndex[$productChildId] = $productAttributes[$productChildId]; - } - } - } - - $index = $this->_prepareProductIndex($productIndex, $productData, $storeId); - - $productIndexes[$productData['entity_id']] = $index; - } - - $this->_saveProductIndexes($storeId, $productIndexes); - } - - // Reset only product-specific queries and results. - $this->resetSearchResults($storeId, $productIds); - - return $this; - } - - /** - * Retrieve searchable products per store - * - * @param int $storeId - * @param array $staticFields - * @param array|int $productIds - * @param int $lastProductId - * @param int $limit - * @return array - */ - protected function _getSearchableProducts( - $storeId, - array $staticFields, - $productIds = null, - $lastProductId = 0, - $limit = 100 - ) { - $websiteId = $this->_storeManager->getStore($storeId)->getWebsiteId(); - $writeAdapter = $this->_getWriteAdapter(); - - $select = $writeAdapter->select()->useStraightJoin( - true - )->from( - array('e' => $this->getTable('catalog_product_entity')), - array_merge(array('entity_id', 'type_id'), $staticFields) - )->join( - array('website' => $this->getTable('catalog_product_website')), - $writeAdapter->quoteInto('website.product_id=e.entity_id AND website.website_id=?', $websiteId), - array() - )->join( - array('stock_status' => $this->getTable('cataloginventory_stock_status')), - $writeAdapter->quoteInto('stock_status.product_id=e.entity_id AND stock_status.website_id=?', $websiteId), - array('in_stock' => 'stock_status') - ); - - if (!is_null($productIds)) { - $select->where('e.entity_id IN(?)', $productIds); - } - - $select->where('e.entity_id>?', $lastProductId)->limit($limit)->order('e.entity_id'); - - $result = $writeAdapter->fetchAll($select); - - return $result; - } - /** * Reset search results * @@ -442,22 +133,6 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb return $this; } - /** - * Delete search index data for store - * - * @param int $storeId Store View Id - * @param int $productId Product Entity Id - * @return $this - */ - public function cleanIndex($storeId = null, $productId = null) - { - if ($this->_engineProvider->get()) { - $this->_engineProvider->get()->cleanIndex($storeId, $productId); - } - - return $this; - } - /** * Prepare results for query * @@ -536,432 +211,4 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb return $this; } - - /** - * Retrieve EAV Config Singleton - * - * @return \Magento\Eav\Model\Config - */ - public function getEavConfig() - { - return $this->_eavConfig; - } - - /** - * Retrieve searchable attributes - * - * @param string $backendType - * @return array - */ - protected function _getSearchableAttributes($backendType = null) - { - if (null === $this->_searchableAttributes) { - $this->_searchableAttributes = array(); - - $productAttributes = $this->_productAttributeCollectionFactory->create(); - - if ($this->_engineProvider->get() && $this->_engineProvider->get()->allowAdvancedIndex()) { - $productAttributes->addToIndexFilter(true); - } else { - $productAttributes->addSearchableAttributeFilter(); - } - $attributes = $productAttributes->getItems(); - - $this->_eventManager->dispatch( - 'catelogsearch_searchable_attributes_load_after', - array('engine' => $this->_engineProvider->get(), 'attributes' => $attributes) - ); - - $entity = $this->getEavConfig()->getEntityType(\Magento\Catalog\Model\Product::ENTITY)->getEntity(); - - foreach ($attributes as $attribute) { - $attribute->setEntity($entity); - } - - $this->_searchableAttributes = $attributes; - } - - if (!is_null($backendType)) { - $attributes = array(); - foreach ($this->_searchableAttributes as $attributeId => $attribute) { - if ($attribute->getBackendType() == $backendType) { - $attributes[$attributeId] = $attribute; - } - } - - return $attributes; - } - - return $this->_searchableAttributes; - } - - /** - * Retrieve searchable attribute by Id or code - * - * @param int|string $attribute - * @return \Magento\Eav\Model\Entity\Attribute - */ - protected function _getSearchableAttribute($attribute) - { - $attributes = $this->_getSearchableAttributes(); - if (is_numeric($attribute)) { - if (isset($attributes[$attribute])) { - return $attributes[$attribute]; - } - } elseif (is_string($attribute)) { - foreach ($attributes as $attributeModel) { - if ($attributeModel->getAttributeCode() == $attribute) { - return $attributeModel; - } - } - } - - return $this->getEavConfig()->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attribute); - } - - /** - * Returns expression for field unification - * - * @param string $field - * @param string $backendType - * @return \Zend_Db_Expr - */ - protected function _unifyField($field, $backendType = 'varchar') - { - if ($backendType == 'datetime') { - $expr = $this->_getReadAdapter()->getDateFormatSql($field, '%Y-%m-%d %H:%i:%s'); - } else { - $expr = $field; - } - return $expr; - } - - /** - * Load product(s) attributes - * - * @param int $storeId - * @param array $productIds - * @param array $attributeTypes - * @return array - */ - protected function _getProductAttributes($storeId, array $productIds, array $attributeTypes) - { - $result = array(); - $selects = array(); - $adapter = $this->_getWriteAdapter(); - $ifStoreValue = $adapter->getCheckSql('t_store.value_id > 0', 't_store.value', 't_default.value'); - foreach ($attributeTypes as $backendType => $attributeIds) { - if ($attributeIds) { - $tableName = $this->getTable('catalog_product_entity_' . $backendType); - $selects[] = $adapter->select()->from( - array('t_default' => $tableName), - array('entity_id', 'attribute_id') - )->joinLeft( - array('t_store' => $tableName), - $adapter->quoteInto( - 't_default.entity_id=t_store.entity_id' . - ' AND t_default.attribute_id=t_store.attribute_id' . - ' AND t_store.store_id=?', - $storeId - ), - array('value' => $this->_unifyField($ifStoreValue, $backendType)) - )->where( - 't_default.store_id=?', - 0 - )->where( - 't_default.attribute_id IN (?)', - $attributeIds - )->where( - 't_default.entity_id IN (?)', - $productIds - ); - } - } - - if ($selects) { - $select = $adapter->select()->union($selects, \Zend_Db_Select::SQL_UNION_ALL); - $query = $adapter->query($select); - while ($row = $query->fetch()) { - $result[$row['entity_id']][$row['attribute_id']] = $row['value']; - } - } - - return $result; - } - - /** - * Retrieve Product Type Instance - * - * @param string $typeId - * @return \Magento\Catalog\Model\Product\Type\AbstractType - */ - protected function _getProductTypeInstance($typeId) - { - if (!isset($this->_productTypes[$typeId])) { - $productEmulator = $this->_getProductEmulator($typeId); - - $this->_productTypes[$typeId] = $this->_catalogProductType->factory($productEmulator); - } - return $this->_productTypes[$typeId]; - } - - /** - * Return all product children ids - * - * @param int $productId Product Entity Id - * @param string $typeId Super Product Link Type - * @return array|null - */ - protected function _getProductChildIds($productId, $typeId) - { - $typeInstance = $this->_getProductTypeInstance($typeId); - $relation = $typeInstance->isComposite( - $this->_getProductEmulator($typeId) - ) ? $typeInstance->getRelationInfo() : false; - - if ($relation && $relation->getTable() && $relation->getParentFieldName() && $relation->getChildFieldName()) { - $select = $this->_getReadAdapter()->select()->from( - array('main' => $this->getTable($relation->getTable())), - array($relation->getChildFieldName()) - )->where( - $relation->getParentFieldName() . '=?', - $productId - ); - if (!is_null($relation->getWhere())) { - $select->where($relation->getWhere()); - } - return $this->_getReadAdapter()->fetchCol($select); - } - - return null; - } - - /** - * Retrieve Product Emulator (Magento Object) - * - * @param string $typeId - * @return \Magento\Framework\Object - */ - protected function _getProductEmulator($typeId) - { - if (!isset($this->_productEmulators[$typeId])) { - $productEmulator = new \Magento\Framework\Object(); - $productEmulator->setIdFieldName('entity_id')->setTypeId($typeId); - $this->_productEmulators[$typeId] = $productEmulator; - } - return $this->_productEmulators[$typeId]; - } - - /** - * Prepare Fulltext index value for product - * - * @param array $indexData - * @param array $productData - * @param int $storeId - * @return string - */ - protected function _prepareProductIndex($indexData, $productData, $storeId) - { - $index = array(); - - foreach ($this->_getSearchableAttributes('static') as $attribute) { - $attributeCode = $attribute->getAttributeCode(); - - if (isset($productData[$attributeCode])) { - $value = $this->_getAttributeValue($attribute->getId(), $productData[$attributeCode], $storeId); - if ($value) { - if (isset($index[$attributeCode])) { - if (!is_array($index[$attributeCode])) { - $index[$attributeCode] = array($index[$attributeCode]); - } - $index[$attributeCode][] = $value; - } else { - $index[$attributeCode] = $value; - } - } - } - } - - foreach ($indexData as $entityId => $attributeData) { - foreach ($attributeData as $attributeId => $attributeValue) { - $value = $this->_getAttributeValue($attributeId, $attributeValue, $storeId); - if (!is_null($value) && $value !== false) { - $attributeCode = $this->_getSearchableAttribute($attributeId)->getAttributeCode(); - - if (isset($index[$attributeCode])) { - $index[$attributeCode][$entityId] = $value; - } else { - $index[$attributeCode] = array($entityId => $value); - } - } - } - } - - if (!$this->_engineProvider->get()->allowAdvancedIndex()) { - $product = $this->_getProductEmulator( - $productData['type_id'] - )->setId( - $productData['entity_id'] - )->setStoreId( - $storeId - ); - $typeInstance = $this->_getProductTypeInstance($productData['type_id']); - $data = $typeInstance->getSearchableData($product); - if ($data) { - $index['options'] = $data; - } - } - - if (isset($productData['in_stock'])) { - $index['in_stock'] = $productData['in_stock']; - } - - if ($this->_engineProvider->get()) { - return $this->_engineProvider->get()->prepareEntityIndex($index, $this->_separator); - } - - return $this->_catalogSearchData->prepareIndexdata($index, $this->_separator); - } - - /** - * Retrieve attribute source value for search - * - * @param int $attributeId - * @param mixed $value - * @param int $storeId - * @return mixed - */ - protected function _getAttributeValue($attributeId, $value, $storeId) - { - $attribute = $this->_getSearchableAttribute($attributeId); - if (!$attribute->getIsSearchable()) { - if ($this->_engineProvider->get()->allowAdvancedIndex()) { - if ($attribute->getAttributeCode() == 'visibility') { - return $value; - } elseif (!($attribute->getIsVisibleInAdvancedSearch() || - $attribute->getIsFilterable() || - $attribute->getIsFilterableInSearch() || - $attribute->getUsedForSortBy()) - ) { - return null; - } - } else { - return null; - } - } - - if ($attribute->usesSource()) { - if ($this->_engineProvider->get()->allowAdvancedIndex()) { - return $value; - } - - $attribute->setStoreId($storeId); - $value = $attribute->getSource()->getIndexOptionText($value); - - if (is_array($value)) { - $value = implode($this->_separator, $value); - } elseif (empty($value)) { - $inputType = $attribute->getFrontend()->getInputType(); - if ($inputType == 'select' || $inputType == 'multiselect') { - return null; - } - } - } elseif ($attribute->getBackendType() == 'datetime') { - $value = $this->_getStoreDate($storeId, $value); - } else { - $inputType = $attribute->getFrontend()->getInputType(); - if ($inputType == 'price') { - $value = $this->_storeManager->getStore($storeId)->roundPrice($value); - } - } - - $value = preg_replace("#\s+#siu", ' ', trim(strip_tags($value))); - - return $value; - } - - /** - * Save Product index - * - * @param int $productId - * @param int $storeId - * @param string $index - * @return $this - */ - protected function _saveProductIndex($productId, $storeId, $index) - { - if ($this->_engineProvider->get()) { - $this->_engineProvider->get()->saveEntityIndex($productId, $storeId, $index); - } - - return $this; - } - - /** - * Save Multiply Product indexes - * - * @param int $storeId - * @param array $productIndexes - * @return $this - */ - protected function _saveProductIndexes($storeId, $productIndexes) - { - if ($this->_engineProvider->get()) { - $this->_engineProvider->get()->saveEntityIndexes($storeId, $productIndexes); - } - - return $this; - } - - /** - * Retrieve Date value for store - * - * @param int $storeId - * @param string $date - * @return string|null - */ - protected function _getStoreDate($storeId, $date = null) - { - if (!isset($this->_dates[$storeId])) { - $timezone = $this->_scopeConfig->getValue( - $this->_localeDate->getDefaultTimezonePath(), - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $storeId - ); - $locale = $this->_scopeConfig->getValue( - $this->_localeResolver->getDefaultLocalePath(), - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $storeId - ); - $locale = new \Zend_Locale($locale); - - $dateObj = new \Magento\Framework\Stdlib\DateTime\Date(null, null, $locale); - $dateObj->setTimezone($timezone); - $this->_dates[$storeId] = array($dateObj, $locale->getTranslation(null, 'date', $locale)); - } - - if (!$this->dateTime->isEmptyDate($date)) { - list($dateObj, $format) = $this->_dates[$storeId]; - $dateObj->setDate($date, \Magento\Framework\Stdlib\DateTime::DATETIME_INTERNAL_FORMAT); - - return $dateObj->toString($format); - } - - return null; - } - - // Deprecated methods - /** - * Update category products indexes - * - * @deprecated after 1.6.2.0 - * - * @param array $productIds - * @param array $categoryIds - * @return $this - */ - public function updateCategoryIndex($productIds, $categoryIds) - { - return $this; - } } diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php index 40f66fb756c808f99fd850de68ed8c741478d70e..2f779dd844078cb10804673ec6ae406631f1379f 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php @@ -23,13 +23,15 @@ */ namespace Magento\CatalogSearch\Model\Resource\Fulltext; +use Magento\CatalogSearch\Model\Resource\EngineInterface; +use Magento\Framework\Model\Resource\Db\AbstractDb; + /** * CatalogSearch Fulltext Index Engine resource model * * @author Magento Core Team <core@magentocommerce.com> */ -class Engine extends \Magento\Framework\Model\Resource\Db\AbstractDb implements - \Magento\CatalogSearch\Model\Resource\EngineInterface +class Engine extends AbstractDb implements EngineInterface { /** * Catalog product visibility @@ -198,10 +200,7 @@ class Engine extends \Magento\Framework\Model\Resource\Db\AbstractDb implements $where[] = $this->_getWriteAdapter()->quoteInto('product_id IN (?)', $entityId); } - // Delete locks reading queries and causes performance issues - // Insert into index goes with ON_DUPLICATE options. - // Insert into catalogsearch_result goes with catalog_product_entity inner join - //$this->_getWriteAdapter()->delete($this->getMainTable(), $where); + $this->_getWriteAdapter()->delete($this->getMainTable(), $where); return $this; } diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index e0fdcebdc80a75eeabae2f984e3e8a8cc9694926..2da508b5d13ca13a60102bef90b3bbb57004e5cf 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-index": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-indexer": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/CatalogSearch/etc/di.xml b/app/code/Magento/CatalogSearch/etc/di.xml index 279573603076f318620e7e6cc2185332f444913e..6b995a09fc79c0367850f1cf28852bb1f2d13d80 100644 --- a/app/code/Magento/CatalogSearch/etc/di.xml +++ b/app/code/Magento/CatalogSearch/etc/di.xml @@ -41,4 +41,24 @@ <argument name="layer" xsi:type="object">Magento\CatalogSearch\Model\Layer\Advanced</argument> </arguments> </type> + <type name="Magento\Catalog\Model\Product"> + <plugin name="catalogsearchFulltextProduct" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product"/> + </type> + <type name="Magento\Catalog\Model\Product\Action"> + <plugin name="catalogsearchFulltextMassAction" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product\Action"/> + </type> + <type name="Magento\Store\Model\Resource\Store"> + <plugin name="catalogsearchFulltextIndexerStoreView" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Store\View" /> + </type> + <type name="Magento\Store\Model\Resource\Group"> + <plugin name="catalogsearchFulltextIndexerStoreGroup" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Store\Group"/> + </type> + <type name="Magento\Catalog\Model\Resource\Attribute"> + <plugin name="catalogsearchFulltextIndexerAttribute" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Attribute"/> + </type> + <type name="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\AbstractPlugin"> + <arguments> + <argument name="indexer" xsi:type="object" shared="false">Magento\Indexer\Model\IndexerInterface</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/CatalogSearch/etc/indexer.xml b/app/code/Magento/CatalogSearch/etc/indexer.xml new file mode 100644 index 0000000000000000000000000000000000000000..a80470a021072a209341e74eec7937ced816b0e8 --- /dev/null +++ b/app/code/Magento/CatalogSearch/etc/indexer.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Indexer/etc/indexer.xsd"> + <indexer id="catalogsearch_fulltext" view_id="catalogsearch_fulltext" class="Magento\CatalogSearch\Model\Indexer\Fulltext"> + <title translate="true">Catalog Search</title> + <description translate="true">Rebuild Catalog product fulltext search index</description> + </indexer> +</config> diff --git a/app/code/Magento/CatalogSearch/etc/module.xml b/app/code/Magento/CatalogSearch/etc/module.xml index b796f63bc82039b4bb48838396654ca5c769e68b..a52085a6f433b4b91076d619d1e0482983c929dd 100644 --- a/app/code/Magento/CatalogSearch/etc/module.xml +++ b/app/code/Magento/CatalogSearch/etc/module.xml @@ -34,7 +34,7 @@ <module name="Magento_Customer"/> <module name="Magento_Core"/> <module name="Magento_Directory"/> - <module name="Magento_Index"/> + <module name="Magento_Indexer"/> <module name="Magento_Eav"/> <module name="Magento_Backend"/> <module name="Magento_Theme"/> diff --git a/app/code/Magento/CatalogSearch/etc/mview.xml b/app/code/Magento/CatalogSearch/etc/mview.xml new file mode 100644 index 0000000000000000000000000000000000000000..f734e614cfcae7786792bbcf645433bdeff58b03 --- /dev/null +++ b/app/code/Magento/CatalogSearch/etc/mview.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> + <view id="catalogsearch_fulltext" class="Magento\CatalogSearch\Model\Indexer\Fulltext" group="indexer"> + <subscriptions> + <table name="catalog_product_entity" entity_column="entity_id" /> + <table name="catalog_product_entity_int" entity_column="entity_id" /> + <table name="catalog_product_entity_decimal" entity_column="entity_id" /> + <table name="catalog_product_entity_text" entity_column="entity_id" /> + <table name="catalog_product_entity_varchar" entity_column="entity_id" /> + <table name="catalog_product_entity_datetime" entity_column="entity_id" /> + <table name="catalog_product_website" entity_column="product_id" /> + <table name="cataloginventory_stock_item" entity_column="product_id" /> + <table name="catalog_product_bundle_selection" entity_column="parent_product_id" /> + <table name="catalog_product_super_link" entity_column="product_id" /> + <table name="catalog_product_link" entity_column="product_id" /> + </subscriptions> + </view> +</config> diff --git a/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_edit.xml b/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_edit.xml index f24c5eaa9e269f6d276f8ff75950aa12eec4bf26..984a6ca8820445a9d1b924b7f97390ab8b9abf44 100644 --- a/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_edit.xml +++ b/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_edit.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Adminhtml\Search\Edit" name="adminhtml.catalog.search.edit"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_grid_block.xml b/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_grid_block.xml index f0ae3c276b7b6df6a5d728a952fad675cee0efdd..9ff0faaf11f10afa3bc32e2a1bfad4ec7028bcd1 100644 --- a/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_grid_block.xml +++ b/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_grid_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.catalog.search.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.catalog.search.grid" as="grid"> <arguments> @@ -137,4 +137,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_index.xml b/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_index.xml index dde3c22bee361847ebd15488e3353a892cb2d57e..6661c5f2dd515fb04fdba32ac20aeb6a56fc7058 100644 --- a/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_index.xml +++ b/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_index.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_search_grid_block"/> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Adminhtml\Search" name="adminhtml.catalog.search.grid.container"/> </referenceContainer> -</layout> +</page> 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 16915284a346199f41bdecdad0d117038e08dd60..e85347f277e352279a5fb27516feaf6122f00800 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 @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Advanced Search</argument> @@ -35,4 +34,4 @@ <block class="Magento\CatalogSearch\Block\Advanced\Form" name="catalogsearch_advanced_form" template="advanced/form.phtml"/> <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/> </referenceContainer> -</layout> +</page> 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 7d74b44e6dfaf4981e809986041675e02dff3638..b53ae3e2927752046ce07b8a2e363eff490bc563 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 @@ -23,14 +23,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_two_columns_left"/> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="page.main.title"> <action method="setPageTitle"> <argument translate="true" name="title" xsi:type="string">Catalog Advanced Search</argument> </action> </referenceBlock> - <referenceBlock name="root"> + <referenceBlock name="body.class"> <action method="addBodyClass"> <argument name="class" xsi:type="string">page-products</argument> </action> @@ -50,4 +49,4 @@ <action method="setListCollection"/> </block> </referenceContainer> -</layout> +</page> 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 9f1a39a4d35ab8a91d325dc36cdd0349ad5cdfb0..6d62792a75ea52752e891cc1ddaae11869ca836e 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 @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_two_columns_left"/> - <referenceBlock name="root"> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="body.class"> <action method="addBodyClass"> <argument name="class" xsi:type="string">page-products</argument> </action> @@ -51,4 +50,4 @@ <action method="setListCollection"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_term_popular.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_term_popular.xml index a5eb3a3fbe63fc14e65086d6042f0969ca70d703..42b07876ccb3531aa3c05efd704ccd75d4b0f720 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_term_popular.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_term_popular.xml @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Popular Search Terms</argument> @@ -33,4 +32,4 @@ <referenceContainer name="content"> <block class="Magento\CatalogSearch\Block\Term" name="seo.searchterm" template="term.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml index 097f32d0d93d04c85cd805162fda7cb4d7652888..853a6600d788071037044b4bb8385bc0b1dc4588 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="header-wrapper"> <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_CatalogSearch::form.mini.phtml"/> </referenceContainer> @@ -41,4 +41,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index 69054e6d6ebbd94cf3e137fdb027524107306cef..62b37171d84ab75b50a0a40ffaa1b556560d6ff3 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-store": "0.1.0-alpha91", - "magento/module-url-redirect": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91" + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-store": "0.1.0-alpha92", + "magento/module-url-redirect": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Centinel/composer.json b/app/code/Magento/Centinel/composer.json index 9de60f403a4afaab5f6ade9de9424f29fd8e2a5b..12621985669b1cfcc191e3d5a8edfcb7753c7405 100644 --- a/app/code/Magento/Centinel/composer.json +++ b/app/code/Magento/Centinel/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationcomplete.xml b/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationcomplete.xml index c41427f4c2542d212e057e6086c361d62197bc8d..d650192c0b2f99024565b2fe159229c0dbfb102b 100644 --- a/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationcomplete.xml +++ b/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationcomplete.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Centinel\Block\Authentication\Complete" name="root" output="1" template="authentication/complete.phtml"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Centinel\Block\Authentication\Complete" name="page.block" template="authentication/complete.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationstart.xml b/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationstart.xml index 3eb88166c8b013c6fedf5fc1d7e3917604303449..1341a5df8c330bc8460017dd31e282b70f0ed945 100644 --- a/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationstart.xml +++ b/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationstart.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Centinel\Block\Authentication\Start" name="root" output="1" template="authentication/start.phtml"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Centinel\Block\Authentication\Start" name="page.block" template="authentication/start.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml index 7d01e16b916139584686acce652a6855f17d9196..6833b9424b1c88e21cd10ab250031c70109924bc 100644 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="data"> <block class="Magento\Centinel\Block\Adminhtml\Validation" as="card_validation" name="card_validation" template="order/create/abstract.phtml"> <block class="Magento\Centinel\Block\Adminhtml\Validation\Form" template="validation/form.phtml" name="centinel.validation.form" as="form"/> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_card_validation.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_card_validation.xml index 675d566dc2dc1934fb3a11a0aa9de232eeac9399..615777f8d69b00ca004a3fc5780b54c937d0deb6 100644 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_card_validation.xml +++ b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_card_validation.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Centinel\Block\Adminhtml\Validation" as="card_validation" name="card_validation" template="order/create/abstract.phtml"> <block class="Magento\Centinel\Block\Adminhtml\Validation\Form" template="validation/form.phtml" name="form"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_data.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_data.xml index 6ee4f76a4480708544da118949e099b2a6388362..5aa24fbcaabd63cc8bcc102054a16cf339370d40 100644 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_data.xml +++ b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_data.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="data"> <block class="Magento\Centinel\Block\Adminhtml\Validation" as="card_validation" name="card_validation" template="order/create/abstract.phtml"> <block class="Magento\Centinel\Block\Adminhtml\Validation\Form" template="validation/form.phtml" name="form"/> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_start.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_start.xml index cf3e18cf191bf1d6b072bf19c73573308275d440..ca66e4cc0d4efef7407d2d5db675d7fd978acf19 100644 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_start.xml +++ b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_start.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_create_index"/> -</layout> +</page> diff --git a/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationcomplete.xml b/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationcomplete.xml index 2087dc8ff2a2d8fd18695d4e537df7e32ac31f16..e1d2e20199b97b76fd81b400cc3acd4c75ae4204 100644 --- a/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationcomplete.xml +++ b/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationcomplete.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Centinel\Block\Authentication\Complete" name="root" output="1" template="authentication/complete.phtml" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Centinel\Block\Authentication\Complete" name="page.block" template="authentication/complete.phtml" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationstart.xml b/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationstart.xml index 4a055f62c0ae96c028e30cb0e61de2457ef47aa3..498e5bc44c7ace73f3bce7702457ad64215a0c51 100644 --- a/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationstart.xml +++ b/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationstart.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Centinel\Block\Authentication\Start" name="root" output="1" template="authentication/start.phtml" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Centinel\Block\Authentication\Start" name="page.block" template="authentication/start.phtml" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_review.xml index 811f7a62f0a3d734951a67bf69c2d9f9d16dbe9e..0bc96a1832560d9c314a9e3134231da9ef6c0910 100644 --- a/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_review.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="checkout.onepage.review.info.items.before"> <block class="Magento\Centinel\Block\Authentication" name="centinel.frame" template="authentication.phtml"> <action method="setAuthenticationStartMode"> @@ -31,4 +31,4 @@ </action> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Centinel/view/frontend/layout/multishipping_checkout_overview.xml b/app/code/Magento/Centinel/view/frontend/layout/multishipping_checkout_overview.xml index b4bcbc67fbc25dab6acfc34d874e49e609c700e1..6e1f31ba7e7beaa3e5675c3877eabc13b8978ea6 100644 --- a/app/code/Magento/Centinel/view/frontend/layout/multishipping_checkout_overview.xml +++ b/app/code/Magento/Centinel/view/frontend/layout/multishipping_checkout_overview.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="checkout.multishipping.overview.items.after"> <block class="Magento\Centinel\Block\Authentication" name="centinel.frame" template="authentication.phtml"> <action method="setAuthenticationStartMode"> @@ -31,4 +31,4 @@ </action> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Checkout/Block/Onepage/Review/Button.php b/app/code/Magento/Checkout/Block/Onepage/Review/Button.php new file mode 100644 index 0000000000000000000000000000000000000000..1b161111da8c115bda71882d967411c3f944cd05 --- /dev/null +++ b/app/code/Magento/Checkout/Block/Onepage/Review/Button.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Onepage\Review; + +use Magento\Framework\View\Element\Template; + +/** + * One page checkout order review button + */ +class Button extends Template +{ + /** + * {@inheritdoc} + * + * @param string $template + * @return $this + */ + public function setTemplate($template) + { + if (!empty($template)) { + parent::setTemplate($template); + } + return $this; + } +} diff --git a/app/code/Magento/Checkout/Controller/Action.php b/app/code/Magento/Checkout/Controller/Action.php index 13f0fb857fb76132e5d2fe9eb2fd953d7252e853..90d42ded9c9a2c5d2eff4aaefc5386c965f198d3 100644 --- a/app/code/Magento/Checkout/Controller/Action.php +++ b/app/code/Magento/Checkout/Controller/Action.php @@ -86,7 +86,7 @@ abstract class Action extends \Magento\Framework\App\Action\Action if (isset($customer)) { $validationResult = $this->_customerAccountService->validateCustomerData( $customer, - $this->_customerMetadataService->getAllCustomerAttributeMetadata() + $this->_customerMetadataService->getAllAttributesMetadata() ); if (!$validationResult->isValid()) { if ($addErrors) { diff --git a/app/code/Magento/Checkout/Controller/Onepage.php b/app/code/Magento/Checkout/Controller/Onepage.php index 7daee3e4bc336d5fbe8b713015dc64e3437e384b..2aa6ef73ca24f0addd57f663c1556ed6f7e9625d 100755 --- a/app/code/Magento/Checkout/Controller/Onepage.php +++ b/app/code/Magento/Checkout/Controller/Onepage.php @@ -61,6 +61,11 @@ class Onepage extends Action */ protected $_formKeyValidator; + /** + * @var \Magento\Framework\View\LayoutFactory + */ + protected $layoutFactory; + /** * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession @@ -69,6 +74,7 @@ class Onepage extends Action * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Framework\Translate\InlineInterface $translateInline * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator + * @param \Magento\Framework\View\LayoutFactory $layoutFactory */ public function __construct( \Magento\Framework\App\Action\Context $context, @@ -77,11 +83,13 @@ class Onepage extends Action CustomerMetadataService $customerMetadataService, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\Translate\InlineInterface $translateInline, - \Magento\Core\App\Action\FormKeyValidator $formKeyValidator + \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, + \Magento\Framework\View\LayoutFactory $layoutFactory ) { $this->_coreRegistry = $coreRegistry; $this->_translateInline = $translateInline; $this->_formKeyValidator = $formKeyValidator; + $this->layoutFactory = $layoutFactory; parent::__construct($context, $customerSession, $customerAccountService, $customerMetadataService); } @@ -155,9 +163,8 @@ class Onepage extends Action */ protected function _getHtmlByHandle($handle) { - $layout = $this->_view->getLayout(); - $layout->getUpdate()->addPageHandles(array($handle)); - $layout->getUpdate()->load(); + $layout = $this->layoutFactory->create(); + $layout->getUpdate()->load(array($handle)); $layout->generateXml(); $layout->generateElements(); $output = $layout->getOutput(); diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index 2f2b214c8cfe1b9e69890ab6f654d08d64fac323..72da607acbe6681b88076a46852a3af08d85ec3f 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -361,7 +361,7 @@ class Onepage $address = $this->getQuote()->getBillingAddress(); $addressForm = $this->_formFactory->create( - \Magento\Customer\Service\V1\CustomerMetadataServiceInterface::ENTITY_TYPE_ADDRESS, + \Magento\Customer\Service\V1\AddressMetadataServiceInterface::ENTITY_TYPE_ADDRESS, 'customer_address_edit', array(), $this->_request->isAjax(), diff --git a/app/code/Magento/Checkout/Service/V1/Address/Converter.php b/app/code/Magento/Checkout/Service/V1/Address/Converter.php index def300b8fd3bce8927e221c1819a8f4bbad94e4d..ae48933ae95c4746a8934962270715308f2ca793 100644 --- a/app/code/Magento/Checkout/Service/V1/Address/Converter.php +++ b/app/code/Magento/Checkout/Service/V1/Address/Converter.php @@ -27,6 +27,7 @@ namespace Magento\Checkout\Service\V1\Address; use \Magento\Checkout\Service\V1\Data\Cart\Address; use \Magento\Checkout\Service\V1\Data\Cart\AddressBuilder; use \Magento\Checkout\Service\V1\Data\Cart\Address\Region; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; use \Magento\Framework\Service\Data\Eav\AttributeValue; class Converter @@ -36,12 +37,19 @@ class Converter */ protected $addressBuilder; + /** + * @var CustomerMetadataServiceInterface + */ + protected $metadataService; + /** * @param AddressBuilder $addressBuilder + * @param CustomerMetadataServiceInterface $metadataService */ - public function __construct(AddressBuilder $addressBuilder) + public function __construct(AddressBuilder $addressBuilder, CustomerMetadataServiceInterface $metadataService) { $this->addressBuilder = $addressBuilder; + $this->metadataService = $metadataService; } /** @@ -74,7 +82,8 @@ class Converter Address::KEY_VAT_ID => $address->getVatId() ]; - foreach ($this->addressBuilder->getCustomAttributesCodes() as $attributeCode) { + foreach ($this->metadataService->getCustomAttributesMetadata() as $attributeMetadata) { + $attributeCode = $attributeMetadata->getAttributeCode(); $method = 'get' . \Magento\Framework\Service\DataObjectConverter::snakeCaseToCamelCase($attributeCode); $data[Address::CUSTOM_ATTRIBUTES_KEY][] = [AttributeValue::ATTRIBUTE_CODE => $attributeCode, AttributeValue::VALUE => $address->$method()]; diff --git a/app/code/Magento/Checkout/Service/V1/Coupon/ReadService.php b/app/code/Magento/Checkout/Service/V1/Coupon/ReadService.php new file mode 100644 index 0000000000000000000000000000000000000000..de967a49e0b379a92fd1b0b60c9e4a59c6446b90 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Coupon/ReadService.php @@ -0,0 +1,76 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\Coupon; + +use \Magento\Checkout\Service\V1\Data\Cart\CouponBuilder as CouponBuilder; +use \Magento\Checkout\Service\V1\Data\Cart\Coupon as Coupon; + +/** + * Class ReadService + */ +class ReadService implements ReadServiceInterface +{ + /** + * @var \Magento\Checkout\Service\V1\QuoteLoader + */ + protected $quoteLoader; + + /** + * @var CouponBuilder + */ + protected $couponBuilder; + + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + + /** + * @param \Magento\Checkout\Service\V1\QuoteLoader $quoteLoader + * @param CouponBuilder $couponBuilder + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + */ + public function __construct( + \Magento\Checkout\Service\V1\QuoteLoader $quoteLoader, + CouponBuilder $couponBuilder, + \Magento\Store\Model\StoreManagerInterface $storeManager + ) { + $this->quoteLoader = $quoteLoader; + $this->couponBuilder = $couponBuilder; + $this->storeManager = $storeManager; + } + + /** + * {@inheritdoc} + */ + public function get($cartId) + { + $storeId = $this->storeManager->getStore()->getId(); + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $this->quoteLoader->load($cartId, $storeId); + $data = [Coupon::COUPON_CODE => $quote->getCouponCode()]; + $output = $this->couponBuilder->populateWithArray($data)->create(); + return $output; + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Coupon/ReadServiceInterface.php b/app/code/Magento/Checkout/Service/V1/Coupon/ReadServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..b6d24ef3a31c3e45e4c6b7e17957807e46847fd7 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Coupon/ReadServiceInterface.php @@ -0,0 +1,39 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\Coupon; + +/** + * Interface ReadServiceInterface + */ +interface ReadServiceInterface +{ + /** + * Retrieve information about coupon in cart + * + * @param int $cartId + * @return \Magento\Checkout\Service\V1\Data\Cart\Coupon + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + public function get($cartId); +} diff --git a/app/code/Magento/Checkout/Service/V1/Coupon/WriteService.php b/app/code/Magento/Checkout/Service/V1/Coupon/WriteService.php new file mode 100644 index 0000000000000000000000000000000000000000..5fef831aadbe61f29f6042ce9d8d09357092eb6e --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Coupon/WriteService.php @@ -0,0 +1,115 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\Coupon; + +use \Magento\Checkout\Service\V1\Data\Cart\CouponBuilder as CouponBuilder; +use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Exception\CouldNotSaveException; + +/** + * Class WriteService + */ +class WriteService implements WriteServiceInterface +{ + /** + * @var \Magento\Checkout\Service\V1\QuoteLoader + */ + protected $quoteLoader; + + /** + * @var CouponBuilder + */ + protected $couponBuilder; + + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + + /** + * @param \Magento\Checkout\Service\V1\QuoteLoader $quoteLoader + * @param CouponBuilder $couponBuilder + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + */ + public function __construct( + \Magento\Checkout\Service\V1\QuoteLoader $quoteLoader, + CouponBuilder $couponBuilder, + \Magento\Store\Model\StoreManagerInterface $storeManager + ) { + $this->quoteLoader = $quoteLoader; + $this->couponBuilder = $couponBuilder; + $this->storeManager = $storeManager; + } + + /** + * {@inheritdoc} + */ + public function set($cartId, \Magento\Checkout\Service\V1\Data\Cart\Coupon $couponCodeData) + { + $storeId = $this->storeManager->getStore()->getId(); + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $this->quoteLoader->load($cartId, $storeId); + if (!$quote->getItemsCount()) { + throw new NoSuchEntityException("Cart $cartId doesn't contain products"); + } + $quote->getShippingAddress()->setCollectShippingRates(true); + $couponCode = trim($couponCodeData->getCouponCode()); + + try { + $quote->setCouponCode($couponCode); + $quote->collectTotals()->save(); + } catch (\Exception $e) { + throw new CouldNotSaveException('Could not apply coupon code'); + } + if ($quote->getCouponCode() != $couponCode) { + throw new NoSuchEntityException('Coupon code is not valid'); + } + return true; + } + + /** + * {@inheritdoc} + */ + public function delete($cartId) + { + $storeId = $this->storeManager->getStore()->getId(); + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $this->quoteLoader->load($cartId, $storeId); + if (!$quote->getItemsCount()) { + throw new NoSuchEntityException("Cart $cartId doesn't contain products"); + } + $quote->getShippingAddress()->setCollectShippingRates(true); + try { + $quote->setCouponCode(''); + $quote->collectTotals()->save(); + } catch (\Exception $e) { + throw new CouldNotDeleteException('Could not delete coupon code'); + } + if ($quote->getCouponCode() != '') { + throw new CouldNotDeleteException('Could not delete coupon code'); + } + return true; + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Coupon/WriteServiceInterface.php b/app/code/Magento/Checkout/Service/V1/Coupon/WriteServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..f6b6f3ee47e510cfdb19c9aa11b97a6213585b96 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Coupon/WriteServiceInterface.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\Coupon; + +/** + * Interface WriteServiceInterface + */ +interface WriteServiceInterface +{ + /** + * Add coupon by code to cart + * + * @param int $cartId + * @param \Magento\Checkout\Service\V1\Data\Cart\Coupon $couponCodeData + * @return bool + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\CouldNotSaveException + */ + public function set($cartId, \Magento\Checkout\Service\V1\Data\Cart\Coupon $couponCodeData); + + /** + * Delete coupon from cart + * + * @param int $cartId + * @return bool + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\CouldNotDeleteException + */ + public function delete($cartId); +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/AddressBuilder.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/AddressBuilder.php index f16445015becc76ac02834e5cb5b80c29351ec1d..c41062b53a5936e957e450a702be1804316f2031 100644 --- a/app/code/Magento/Checkout/Service/V1/Data/Cart/AddressBuilder.php +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/AddressBuilder.php @@ -23,16 +23,17 @@ */ namespace Magento\Checkout\Service\V1\Data\Cart; +use Magento\Checkout\Service\V1\Data\Cart\Address\Region; +use Magento\Checkout\Service\V1\Data\Cart\Address\RegionBuilder; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; use Magento\Framework\Service\Data\Eav\AbstractObjectBuilder; use Magento\Framework\Service\Data\Eav\AttributeValueBuilder; -use \Magento\Checkout\Service\V1\Data\Cart\Address\RegionBuilder; -use \Magento\Checkout\Service\V1\Data\Cart\Address\Region; /** * Quote address data object builder * * @codeCoverageIgnore - */ + */ class AddressBuilder extends AbstractObjectBuilder { /** @@ -42,25 +43,19 @@ class AddressBuilder extends AbstractObjectBuilder */ protected $_regionBuilder; - /** - * @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface - */ - protected $metadataService; - /** * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder + * @param CustomerMetadataServiceInterface $metadataService * @param RegionBuilder $regionBuilder - * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $metadataService */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, AttributeValueBuilder $valueBuilder, - RegionBuilder $regionBuilder, - \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $metadataService + CustomerMetadataServiceInterface $metadataService, + RegionBuilder $regionBuilder ) { - parent::__construct($objectFactory, $valueBuilder); - $this->metadataService = $metadataService; + parent::__construct($objectFactory, $valueBuilder, $metadataService); $this->_regionBuilder = $regionBuilder; $this->_data[Address::KEY_REGION] = $regionBuilder->create(); } @@ -108,18 +103,6 @@ class AddressBuilder extends AbstractObjectBuilder return parent::_setDataValues($data); } - /** - * {@inheritdoc} - */ - public function getCustomAttributesCodes() - { - $attributeCodes = array(); - foreach ($this->metadataService->getCustomAddressAttributeMetadata() as $attribute) { - $attributeCodes[] = $attribute->getAttributeCode(); - } - return $attributeCodes; - } - /** * Set region * diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/Coupon.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/Coupon.php new file mode 100644 index 0000000000000000000000000000000000000000..bf2b0b8979cbdca1255a76601599a45f17848e80 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/Coupon.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\Cart; + +/** + * Coupon data for quote + * + * @codeCoverageIgnore + */ +class Coupon extends \Magento\Framework\Service\Data\AbstractObject +{ + /** + * Constants defined for keys of array + */ + const COUPON_CODE = 'coupon_code'; + + /** + * @return string + */ + public function getCouponCode() + { + return $this->_get(self::COUPON_CODE); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/CouponBuilder.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/CouponBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..06e5c68a7882c32b03509b889681d63490842517 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/CouponBuilder.php @@ -0,0 +1,41 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\Cart; + +/** + * @codeCoverageIgnore + */ +class CouponBuilder extends \Magento\Framework\Service\Data\AbstractObjectBuilder +{ + /** + * @param string $value + * @return $this + */ + public function setCouponCode($value) + { + $this->_set(Coupon::COUPON_CODE, $value); + return $this; + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod.php new file mode 100644 index 0000000000000000000000000000000000000000..975c34467bd7d103607b45115756989645649836 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod.php @@ -0,0 +1,148 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\Cart; + +class PaymentMethod extends \Magento\Framework\Service\Data\AbstractObject +{ + /** + * Payment method + */ + const METHOD = 'method'; + + /** + * Purchase order number + */ + const PO_NUMBER = 'po_number'; + + /** + * Credit card owner + */ + const CC_OWNER = 'cc_owner'; + + /** + * Credit card number + */ + const CC_NUMBER = 'cc_number'; + + /** + * Credit card type + */ + const CC_TYPE = 'cc_type'; + + /** + * Credit card expiration year + */ + const CC_EXP_YEAR = 'cc_exp_year'; + + /** + * Credit card expiration month + */ + const CC_EXP_MONTH = 'cc_exp_month'; + + /** + * Additional payment details + */ + const PAYMENT_DETAILS = 'payment_details'; + + /** + * Get purchase order number + * + * @return string|null + */ + public function getPoNumber() + { + return $this->_get(self::PO_NUMBER); + } + + /** + * Get payment method code + * + * @return string + */ + public function getMethod() + { + return $this->_get(self::METHOD); + } + + /** + * Get credit card owner + * + * @return string|null + */ + public function getCcOwner() + { + return $this->_get(self::CC_OWNER); + } + + /** + * Get credit card number + * + * @return string|null + */ + public function getCcNumber() + { + return $this->_get(self::CC_NUMBER); + } + + /** + * Get credit card type + * + * @return string|null + */ + public function getCcType() + { + return $this->_get(self::CC_TYPE); + } + + /** + * Get credit card expiration year + * + * @return string|null + */ + public function getCcExpYear() + { + return $this->_get(self::CC_EXP_YEAR); + } + + /** + * Get credit card expiration month + * + * @return string|null + */ + public function getCcExpMonth() + { + return $this->_get(self::CC_EXP_MONTH); + } + + /** + * Get payment additional details + * + * @return string|null + */ + public function getPaymentDetails() + { + return $this->_get(self::PAYMENT_DETAILS); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod/Builder.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod/Builder.php new file mode 100644 index 0000000000000000000000000000000000000000..7a8b8062f0093951cdb43c1a75bff791b82f77d1 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod/Builder.php @@ -0,0 +1,67 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\Cart\PaymentMethod; + +use Magento\Checkout\Service\V1\Data\Cart\PaymentMethod as QuotePaymentMethod; +use Magento\Sales\Model\Quote; +use Magento\Framework\Exception\LocalizedException; + +/** + * Class Builder + */ +class Builder +{ + /** + * @param QuotePaymentMethod $object + * @param Quote $quote + * @return \Magento\Sales\Model\Quote\Payment + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function build(QuotePaymentMethod $object, Quote $quote) + { + $payment = $quote->getPayment(); + try { + $data = $object->__toArray(); + $additionalDataValue = $object->getPaymentDetails(); + unset($data[QuotePaymentMethod::PAYMENT_DETAILS]); + if (!empty($additionalDataValue)) { + $additionalData = @unserialize($additionalDataValue); + if (is_array($additionalData) && !empty($additionalData)) { + $data = array_merge($data, $additionalData); + } + } + $data['checks'] = array( + \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_CHECKOUT, + \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_FOR_COUNTRY, + \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_FOR_CURRENCY, + \Magento\Payment\Model\Method\AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX + ); + $payment->importData($data); + } catch (\Exception $e) { + throw new LocalizedException('The requested Payment Method is not available.'); + } + return $payment; + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod/Converter.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod/Converter.php new file mode 100644 index 0000000000000000000000000000000000000000..e57d7cb16d22e6dce0a1324c64e4dbbab32fa69b --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethod/Converter.php @@ -0,0 +1,66 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\Cart\PaymentMethod; + +use Magento\Checkout\Service\V1\Data\Cart\PaymentMethod as QuotePaymentMethod; + +class Converter +{ + /** + * @var \Magento\Checkout\Service\V1\Data\Cart\PaymentMethodBuilder + */ + protected $builder; + + /** + * @param \Magento\Checkout\Service\V1\Data\Cart\PaymentMethodBuilder $builder + */ + public function __construct( + \Magento\Checkout\Service\V1\Data\Cart\PaymentMethodBuilder $builder + ) { + $this->builder = $builder; + } + + /** + * Convert quote payment object to payment data object + * + * @param \Magento\Sales\Model\Quote\Payment $object + * @return QuotePaymentMethod + */ + public function toDataObject(\Magento\Sales\Model\Quote\Payment $object) + { + $data = [ + QuotePaymentMethod::METHOD => $object->getMethod(), + QuotePaymentMethod::PO_NUMBER => $object->getPoNumber(), + QuotePaymentMethod::CC_OWNER => $object->getCcOwner(), + QuotePaymentMethod::CC_NUMBER => $object->getCcNumber(), + QuotePaymentMethod::CC_TYPE => $object->getCcType(), + QuotePaymentMethod::CC_EXP_YEAR => $object->getCcExpYear(), + QuotePaymentMethod::CC_EXP_MONTH => $object->getCcExpMonth(), + QuotePaymentMethod::PAYMENT_DETAILS => $object->getAdditionalData(), + ]; + + return $this->builder->populateWithArray($data)->create(); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethodBuilder.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethodBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..6112d4e36e8c1c84da5f593c0b91e4ab9fa4ad67 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/PaymentMethodBuilder.php @@ -0,0 +1,119 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\Cart; + +/** + * @method PaymentMethod create() + */ +class PaymentMethodBuilder extends \Magento\Framework\Service\Data\AbstractObjectBuilder +{ + /** + * Get purchase order number + * + * @param string $value + * @return $this + */ + public function setPoNumber($value) + { + return $this->_set(PaymentMethod::PO_NUMBER, $value); + } + + /** + * Get payment method code + * + * @param string $value + * @return $this + */ + public function setMethod($value) + { + return $this->_set(PaymentMethod::METHOD, $value); + } + + /** + * Get credit card owner + * + * @param string $value + * @return $this + */ + public function setCcOwner($value) + { + return $this->_set(PaymentMethod::CC_OWNER, $value); + } + + /** + * Get credit card number + * + * @param string $value + * @return $this + */ + public function setCcNumber($value) + { + return $this->_set(PaymentMethod::CC_NUMBER, $value); + } + + /** + * Get credit card type + * + * @param string $value + * @return $this + */ + public function setCcType($value) + { + return $this->_set(PaymentMethod::CC_TYPE, $value); + } + + /** + * Get credit card expiration year + * + * @param string $value + * @return $this + */ + public function setCcExpYear($value) + { + return $this->_set(PaymentMethod::CC_EXP_YEAR, $value); + } + + /** + * Get credit card expiration month + * + * @param string $value + * @return $this + */ + public function setCcExpMonth($value) + { + return $this->_set(PaymentMethod::CC_EXP_MONTH, $value); + } + + /** + * Set payment additional payment details + * + * @param string $value + * @return $this + */ + public function setPaymentDetails($value) + { + return $this->_set(PaymentMethod::PAYMENT_DETAILS, $value); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethod.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethod.php new file mode 100644 index 0000000000000000000000000000000000000000..8d38fb13476e28e1ea523c06f0d9a37132ff2bc7 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethod.php @@ -0,0 +1,120 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\Data\Cart; + +/** + * Quote shipping method data + * + * @codeCoverageIgnore + */ +class ShippingMethod extends \Magento\Framework\Service\Data\AbstractObject +{ + /**#@+ + * Constants defined for keys of array, makes typos less likely + */ + const CARRIER_CODE = 'carrier_code'; + + const METHOD_CODE = 'method_code'; + + const CARRIER_TITLE = 'carrier_title'; + + const METHOD_TITLE = 'method_title'; + + const SHIPPING_AMOUNT = 'amount'; + + const BASE_SHIPPING_AMOUNT = 'base_amount'; + + const AVAILABLE = 'available'; + /**#@-*/ + + /** + * Get carrier code + * + * @return string + */ + public function getCarrierCode() + { + return $this->_get(self::CARRIER_CODE); + } + + /** + * Get shipping method code + * + * @return string + */ + public function getMethodCode() + { + return $this->_get(self::METHOD_CODE); + } + + /** + * Get shipping carrier title + * + * @return string|null + */ + public function getCarrierTitle() + { + return $this->_get(self::CARRIER_TITLE); + } + + /** + * Get shipping method title + * + * @return string|null + */ + public function getMethodTitle() + { + return $this->_get(self::METHOD_TITLE); + } + + /** + * Get shipping amount + * + * @return float + */ + public function getAmount() + { + return $this->_get(self::SHIPPING_AMOUNT); + } + + /** + * Get base shipping amount + * + * @return float + */ + public function getBaseAmount() + { + return $this->_get(self::BASE_SHIPPING_AMOUNT); + } + + /** + * Get availability flag of current method + * + * @return bool + */ + public function getAvailable() + { + return $this->_get(self::AVAILABLE); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodBuilder.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..6917ebb09d3932b223e46f1f042cc6a80c926ac4 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodBuilder.php @@ -0,0 +1,107 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\Data\Cart; + +/** + * Builder for the Shipping Method Data + */ +class ShippingMethodBuilder extends \Magento\Framework\Service\Data\AbstractObjectBuilder +{ + /** + * Set carrier code + * + * @param string $value + * @return $this + */ + public function setCarrierCode($value) + { + return $this->_set(ShippingMethod::CARRIER_CODE, $value); + } + + /** + * Set shipping method code + * + * @param string $value + * @return $this + */ + public function setMethodCode($value) + { + return $this->_set(ShippingMethod::METHOD_CODE, $value); + } + + /** + * Set shipping carrier title + * + * @param string $value + * @return $this + */ + public function setCarrierTitle($value) + { + return $this->_set(ShippingMethod::CARRIER_TITLE, $value); + } + + /** + * Set shipping method title + * + * @param string $value + * @return $this + */ + public function setMethodTitle($value) + { + return $this->_set(ShippingMethod::METHOD_TITLE, $value); + } + + /** + * Set shipping amount + * + * @param float $value + * @return $this + */ + public function setAmount($value) + { + return $this->_set(ShippingMethod::SHIPPING_AMOUNT, $value); + } + + /** + * Set base shipping amount + * + * @param float $value + * @return $this + */ + public function setBaseAmount($value) + { + return $this->_set(ShippingMethod::BASE_SHIPPING_AMOUNT, $value); + } + + /** + * Set method availability flag + * + * @param bool $value + * @return $this + */ + public function setAvailable($value) + { + return $this->_set(ShippingMethod::AVAILABLE, (bool)$value); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodConverter.php b/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodConverter.php new file mode 100644 index 0000000000000000000000000000000000000000..584ba7c8eab1d73debf3a592efcba1bb51e47d99 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodConverter.php @@ -0,0 +1,75 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\Data\Cart; + +/** + * Quote shipping method data + * + * @codeCoverageIgnore + */ +class ShippingMethodConverter +{ + /** + * @var ShippingMethodBuilder + */ + protected $builder; + + /** + * @param ShippingMethodBuilder $builder + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + */ + public function __construct( + \Magento\Checkout\Service\V1\Data\Cart\ShippingMethodBuilder $builder, + \Magento\Store\Model\StoreManagerInterface $storeManager + ) { + $this->builder = $builder; + $this->storeManager = $storeManager; + } + + /** + * Convert rate model to ShippingMethod data object + * @param string $quoteCurrencyCode + * @param \Magento\Sales\Model\Quote\Address\Rate $rateModel + * + * @return \Magento\Checkout\Service\V1\Data\Cart\ShippingMethod + */ + public function modelToDataObject($rateModel, $quoteCurrencyCode) + { + /** @var \Magento\Directory\Model\Currency $currency */ + $currency = $this->storeManager->getStore()->getBaseCurrency(); + + $errorMessage = $rateModel->getErrorMessage(); + $data = [ + ShippingMethod::CARRIER_CODE => $rateModel->getCarrier(), + ShippingMethod::METHOD_CODE => $rateModel->getMethod(), + ShippingMethod::CARRIER_TITLE => $rateModel->getCarrierTitle(), + ShippingMethod::METHOD_TITLE => $rateModel->getMethodTitle(), + ShippingMethod::SHIPPING_AMOUNT => $currency->convert($rateModel->getPrice(), $quoteCurrencyCode), + ShippingMethod::BASE_SHIPPING_AMOUNT => $rateModel->getPrice(), + ShippingMethod::AVAILABLE => empty($errorMessage), + ]; + $this->builder->populateWithArray($data); + return $this->builder->create(); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/PaymentMethod.php b/app/code/Magento/Checkout/Service/V1/Data/PaymentMethod.php new file mode 100644 index 0000000000000000000000000000000000000000..d746e71f5741e6ef5f2bdaa5e7001c3274f46882 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/PaymentMethod.php @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data; + +class PaymentMethod extends \Magento\Framework\Service\Data\AbstractObject +{ + const CODE = 'code'; + + const TITLE = 'title'; + + /** + * Get payment method code + * + * @return string + */ + public function getCode() + { + return $this->_get(self::CODE); + } + + /** + * Get payment method title + * + * @return string + */ + public function getTitle() + { + return $this->_get(self::TITLE); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/PaymentMethod/Converter.php b/app/code/Magento/Checkout/Service/V1/Data/PaymentMethod/Converter.php new file mode 100644 index 0000000000000000000000000000000000000000..ab448fbae0bd4f29505f5de98038a50404683350 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/PaymentMethod/Converter.php @@ -0,0 +1,58 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\PaymentMethod; + +use Magento\Checkout\Service\V1\Data\PaymentMethod as QuotePaymentMethod; + +class Converter +{ + /** + * @var \Magento\Checkout\Service\V1\Data\Cart\PaymentMethodBuilder + */ + protected $builder; + + /** + * @param \Magento\Checkout\Service\V1\Data\PaymentMethodBuilder $builder + */ + public function __construct(\Magento\Checkout\Service\V1\Data\PaymentMethodBuilder $builder) + { + $this->builder = $builder; + } + + /** + * Convert quote payment object to payment data object + * + * @param \Magento\Payment\Model\MethodInterface $object + * @return \Magento\Checkout\Service\V1\Data\Cart\PaymentMethod + */ + public function toDataObject(\Magento\Payment\Model\MethodInterface $object) + { + $data = [ + QuotePaymentMethod::CODE => $object->getCode(), + QuotePaymentMethod::TITLE => $object->getTitle(), + ]; + return $this->builder->populateWithArray($data)->create(); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/Data/PaymentMethodBuilder.php b/app/code/Magento/Checkout/Service/V1/Data/PaymentMethodBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..74f5208124a9a7b4a2110275675f8fe2ad0f7464 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/Data/PaymentMethodBuilder.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data; + +/** + * @method PaymentMethod create() + */ +class PaymentMethodBuilder extends \Magento\Framework\Service\Data\AbstractObjectBuilder +{ + /** + * Set payment method code + * + * @param string $value + * @return $this + */ + public function setCode($value) + { + return $this->_set(PaymentMethod::CODE, $value); + } + + /** + * Set payment method title + * + * @param string $value + * @return $this + */ + public function setTitle($value) + { + return $this->_set(PaymentMethod::TITLE, $value); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/PaymentMethod/ReadService.php b/app/code/Magento/Checkout/Service/V1/PaymentMethod/ReadService.php new file mode 100644 index 0000000000000000000000000000000000000000..9a7939c873391f6f6eca249da5dd2fdea7ec62d8 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/PaymentMethod/ReadService.php @@ -0,0 +1,110 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\PaymentMethod; + +use \Magento\Checkout\Service\V1\QuoteLoader; +use \Magento\Store\Model\StoreManagerInterface; +use Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Converter as QuoteMethodConverter; +use Magento\Checkout\Service\V1\Data\PaymentMethod\Converter as PaymentMethodConverter; +use \Magento\Payment\Model\MethodList; +use \Magento\Framework\Exception\State\InvalidTransitionException; + +class ReadService implements ReadServiceInterface +{ + /** + * @var StoreManagerInterface + */ + protected $storeManager; + + /** + * @var QuoteLoader + */ + protected $quoteLoader; + + /** + * @var QuoteMethodConverter + */ + protected $quoteMethodConverter; + + /** + * @var PaymentMethodConverter + */ + protected $paymentMethodConverter; + + /** + * @var MethodList + */ + protected $methodList; + + /** + * @param QuoteLoader $quoteLoader + * @param StoreManagerInterface $storeManager + * @param QuoteMethodConverter $quoteMethodConverter + * @param PaymentMethodConverter $paymentMethodConverter + * @param MethodList $methodList + */ + public function __construct( + QuoteLoader $quoteLoader, + StoreManagerInterface $storeManager, + QuoteMethodConverter $quoteMethodConverter, + PaymentMethodConverter $paymentMethodConverter, + MethodList $methodList + ) { + $this->storeManager = $storeManager; + $this->quoteLoader = $quoteLoader; + $this->quoteMethodConverter = $quoteMethodConverter; + $this->paymentMethodConverter = $paymentMethodConverter; + $this->methodList = $methodList; + } + + /** + * {@inheritdoc} + */ + public function getPayment($cartId) + { + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $this->quoteLoader->load($cartId, $this->storeManager->getStore()->getId()); + + $payment = $quote->getPayment(); + if (!$payment->getId()) { + return null; + } + return $this->quoteMethodConverter->toDataObject($payment); + } + + /** + * {@inheritdoc} + */ + public function getList($cartId) + { + $output = []; + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $this->quoteLoader->load($cartId, $this->storeManager->getStore()->getId()); + foreach ($this->methodList->getAvailableMethods($quote) as $method) { + $output[] = $this->paymentMethodConverter->toDataObject($method); + } + return $output; + } +} diff --git a/app/code/Magento/Checkout/Service/V1/PaymentMethod/ReadServiceInterface.php b/app/code/Magento/Checkout/Service/V1/PaymentMethod/ReadServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..4447057cfa7c3e5701d04531e161cf979d11908b --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/PaymentMethod/ReadServiceInterface.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\PaymentMethod; + +interface ReadServiceInterface +{ + /** + * Get list of payment methods + * + * @param int $cartId + * @return \Magento\Checkout\Service\V1\Data\Cart\PaymentMethod + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + public function getPayment($cartId); + + /** + * Get the list of available payment methods for a shopping cart + * + * @param int $cartId + * @return \Magento\Checkout\Service\V1\Data\PaymentMethod[] + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + public function getList($cartId); +} diff --git a/app/code/Magento/Checkout/Service/V1/PaymentMethod/WriteService.php b/app/code/Magento/Checkout/Service/V1/PaymentMethod/WriteService.php new file mode 100644 index 0000000000000000000000000000000000000000..bdc62911779f00d26d504d23afd7ba5eb0b2a4e4 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/PaymentMethod/WriteService.php @@ -0,0 +1,108 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\PaymentMethod; + +use \Magento\Checkout\Service\V1\QuoteLoader; +use \Magento\Store\Model\StoreManagerInterface; +use \Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Builder; +use \Magento\Framework\Exception\State\InvalidTransitionException; +use \Magento\Payment\Model\MethodList; + +class WriteService implements WriteServiceInterface +{ + /** + * @var StoreManagerInterface + */ + protected $storeManager; + + /** + * @var QuoteLoader + */ + protected $quoteLoader; + + /** + * @var Builder + */ + protected $paymentMethodBuilder; + + /** + * @var \Magento\Payment\Model\Checks\ZeroTotal + */ + protected $zeroTotalValidator; + + /** + * @param QuoteLoader $quoteLoader + * @param StoreManagerInterface $storeManager + * @param Builder $paymentMethodBuilder + * @param \Magento\Payment\Model\Checks\ZeroTotal $zeroTotalValidator + */ + public function __construct( + QuoteLoader $quoteLoader, + StoreManagerInterface $storeManager, + Builder $paymentMethodBuilder, + \Magento\Payment\Model\Checks\ZeroTotal $zeroTotalValidator + ) { + $this->storeManager = $storeManager; + $this->quoteLoader = $quoteLoader; + $this->paymentMethodBuilder = $paymentMethodBuilder; + $this->zeroTotalValidator = $zeroTotalValidator; + } + + /** + * {@inheritdoc} + */ + public function set(\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod $method, $cartId) + { + $quote = $this->quoteLoader->load($cartId, $this->storeManager->getStore()->getId()); + + $payment = $this->paymentMethodBuilder->build($method, $quote); + if ($quote->isVirtual()) { + // check if billing address is set + if (is_null($quote->getBillingAddress()->getCountryId())) { + throw new InvalidTransitionException('Billing address is not set'); + } + $quote->getBillingAddress()->setPaymentMethod($payment->getMethod()); + } else { + // check if shipping address is set + if (is_null($quote->getShippingAddress()->getCountryId())) { + throw new InvalidTransitionException('Shipping address is not set'); + } + $quote->getShippingAddress()->setPaymentMethod($payment->getMethod()); + } + if (!$quote->isVirtual() && $quote->getShippingAddress()) { + $quote->getShippingAddress()->setCollectShippingRates(true); + } + + if (!$this->zeroTotalValidator->isApplicable($payment->getMethodInstance(), $quote)) { + throw new InvalidTransitionException('The requested Payment Method is not available.'); + } + + $quote->setTotalsCollectedFlag(false) + ->collectTotals() + ->save(); + + return $quote->getPayment()->getId(); + } +} diff --git a/app/code/Magento/Checkout/Service/V1/PaymentMethod/WriteServiceInterface.php b/app/code/Magento/Checkout/Service/V1/PaymentMethod/WriteServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..7e3d641fdddc0ce2414f7debb002549b893a8565 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/PaymentMethod/WriteServiceInterface.php @@ -0,0 +1,39 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\PaymentMethod; + +interface WriteServiceInterface +{ + /** + * Add payment method to list of selected for cart + * + * @param \Magento\Checkout\Service\V1\Data\Cart\PaymentMethod $method + * @param int $cartId + * @return int + * @throws \Magento\Framework\Exception\State\InvalidTransitionException + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + public function set(\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod $method, $cartId); +} diff --git a/app/code/Magento/Checkout/Service/V1/QuoteLoader.php b/app/code/Magento/Checkout/Service/V1/QuoteLoader.php index 7a83786c10539e5ca2baa9b2d0066b228586b7fc..653f55c4f26086a362ed53aba48e14baaf5232f0 100644 --- a/app/code/Magento/Checkout/Service/V1/QuoteLoader.php +++ b/app/code/Magento/Checkout/Service/V1/QuoteLoader.php @@ -51,7 +51,7 @@ class QuoteLoader { $quote = $this->quoteFactory->create(); $quote->setStoreId($storeId)->load($cartId); - if (!$quote->getId()) { + if (!$quote->getId() || !$quote->getIsActive()) { throw NoSuchEntityException::singleField('cartId', $cartId); } return $quote; diff --git a/app/code/Magento/Checkout/Service/V1/ShippingMethod/ReadService.php b/app/code/Magento/Checkout/Service/V1/ShippingMethod/ReadService.php new file mode 100644 index 0000000000000000000000000000000000000000..267aab7debd26b7a3b923770e971dc549dcd70d2 --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/ShippingMethod/ReadService.php @@ -0,0 +1,153 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\ShippingMethod; + +use \Magento\Checkout\Service\V1\Data\Cart\ShippingMethod; +use \Magento\Checkout\Service\V1\Data\Cart\ShippingMethodBuilder; +use \Magento\Framework\Exception\StateException; +use \Magento\Framework\Exception\InputException; + +class ReadService implements ReadServiceInterface +{ + /** + * @var \Magento\Checkout\Service\V1\QuoteLoader + */ + protected $quoteLoader; + + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + + /** + * @var \Magento\Checkout\Service\V1\Data\Cart\ShippingMethodBuilder + */ + protected $methodBuilder; + + /** + * @var \Magento\Checkout\Service\V1\Data\Cart\ShippingMethodConverter + */ + protected $converter; + + /** + * @param \Magento\Checkout\Service\V1\QuoteLoader $quoteLoader + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param \Magento\Checkout\Service\V1\Data\Cart\ShippingMethodConverter $converter + * @param ShippingMethodBuilder $methodBuilder + */ + public function __construct( + \Magento\Checkout\Service\V1\QuoteLoader $quoteLoader, + \Magento\Store\Model\StoreManagerInterface $storeManager, + \Magento\Checkout\Service\V1\Data\Cart\ShippingMethodConverter $converter, + \Magento\Checkout\Service\V1\Data\Cart\ShippingMethodBuilder $methodBuilder + ) { + $this->quoteLoader = $quoteLoader; + $this->storeManager = $storeManager; + $this->converter = $converter; + $this->methodBuilder = $methodBuilder; + } + + /** + * {@inheritdoc} + */ + public function getMethod($cartId) + { + $storeId = $this->storeManager->getStore()->getId(); + + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $this->quoteLoader->load($cartId, $storeId); + + /** @var \Magento\Sales\Model\Quote\Address $shippingAddress */ + $shippingAddress = $quote->getShippingAddress(); + if (!$shippingAddress->getCountryId()) { + throw new StateException('Shipping address not set.'); + } + + $shippingMethod = $shippingAddress->getShippingMethod(); + if (!$shippingMethod) { + return null; + } + + list($carrierCode, $methodCode) = $this->divideNames('_', $shippingAddress->getShippingMethod()); + list($carrierTitle, $methodTitle) = $this->divideNames(' - ', $shippingAddress->getShippingDescription()); + + $output = [ + ShippingMethod::CARRIER_CODE => $carrierCode, + ShippingMethod::METHOD_CODE => $methodCode, + ShippingMethod::CARRIER_TITLE => $carrierTitle, + ShippingMethod::METHOD_TITLE => $methodTitle, + ShippingMethod::SHIPPING_AMOUNT => $shippingAddress->getShippingAmount(), + ShippingMethod::BASE_SHIPPING_AMOUNT => $shippingAddress->getBaseShippingAmount(), + ShippingMethod::AVAILABLE => true, + ]; + + return $this->methodBuilder->populateWithArray($output)->create(); + } + + /** + * @param string $delimiter + * @param string $line + * @return array + * @throws \Magento\Framework\Exception\InputException + */ + protected function divideNames($delimiter, $line) + { + if (strpos($line, $delimiter) === false) { + throw new InputException('Line "' . $line . '" doesn\'t contain delimiter ' . $delimiter); + } + return explode($delimiter, $line); + } + + /** + * {@inheritdoc} + */ + public function getList($cartId) + { + $output = []; + + $storeId = $this->storeManager->getStore()->getId(); + + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $this->quoteLoader->load($cartId, $storeId); + + // no methods applicable for empty carts or carts with virtual products + if ($quote->isVirtual() || 0 == $quote->getItemsCount()) { + return []; + } + + $shippingAddress = $quote->getShippingAddress(); + if (!$shippingAddress->getCountryId()) { + throw new StateException('Shipping address not set.'); + } + $shippingAddress->collectShippingRates(); + $shippingRates = $shippingAddress->getGroupedAllShippingRates(); + foreach ($shippingRates as $carrierRates) { + foreach ($carrierRates as $rate) { + $output[] = $this->converter->modelToDataObject($rate, $quote->getQuoteCurrencyCode()); + } + } + return $output; + } +} diff --git a/app/code/Magento/Checkout/Service/V1/ShippingMethod/ReadServiceInterface.php b/app/code/Magento/Checkout/Service/V1/ShippingMethod/ReadServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..de6e97fb506aced0120c9397a6b9d84afc8162ce --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/ShippingMethod/ReadServiceInterface.php @@ -0,0 +1,50 @@ +<?php +/** + * Quote shipping method read service + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\ShippingMethod; + +interface ReadServiceInterface +{ + /** + * Get selected shipping method of the quote + * + * @param int $cartId + * @return \Magento\Checkout\Service\V1\Data\Cart\ShippingMethod + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + */ + public function getMethod($cartId); + + + /** + * Get list of applicable shipping methods for quote + * + * @param int $cartId + * @return \Magento\Checkout\Service\V1\Data\Cart\ShippingMethod[] + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + */ + public function getList($cartId); +} diff --git a/app/code/Magento/Checkout/Service/V1/ShippingMethod/WriteService.php b/app/code/Magento/Checkout/Service/V1/ShippingMethod/WriteService.php new file mode 100644 index 0000000000000000000000000000000000000000..1d648df3b0742d77187dfec645e0c06cfaf54c5f --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/ShippingMethod/WriteService.php @@ -0,0 +1,99 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Service\V1\ShippingMethod; + +use \Magento\Framework\Exception\CouldNotSaveException; +use \Magento\Framework\Exception\NoSuchEntityException; +use \Magento\Framework\Exception\InputException; +use \Magento\Framework\Exception\StateException; + +class WriteService implements WriteServiceInterface +{ + /** + * @var \Magento\Sales\Model\Quote\AddressFactory + */ + protected $addressFactory; + + /** + * @var \Magento\Checkout\Service\V1\QuoteLoader + */ + protected $quoteLoader; + + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + + /** + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param \Magento\Sales\Model\Quote\AddressFactory $addressFactory + * @param \Magento\Checkout\Service\V1\QuoteLoader $quoteLoader + */ + public function __construct( + \Magento\Store\Model\StoreManagerInterface $storeManager, + \Magento\Sales\Model\Quote\AddressFactory $addressFactory, + \Magento\Checkout\Service\V1\QuoteLoader $quoteLoader + ) { + $this->addressFactory = $addressFactory; + $this->quoteLoader = $quoteLoader; + $this->storeManager = $storeManager; + } + + /** + * {@inheritdoc} + */ + public function setMethod($cartId, $carrierCode, $methodCode) + { + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $this->quoteLoader->load($cartId, $this->storeManager->getStore()->getId()); + if (0 == $quote->getItemsCount()) { + throw new InputException('Shipping method is not applicable for empty cart'); + } + + if ($quote->isVirtual()) { + throw new NoSuchEntityException( + 'Cart contains virtual product(s) only. Shipping method is not applicable.' + ); + } + $shippingAddress = $quote->getShippingAddress(); + if (!$shippingAddress->getCountryId()) { + throw new StateException('Shipping address is not set'); + } + $billingAddress = $quote->getBillingAddress(); + if (!$billingAddress->getCountryId()) { + throw new StateException('Billing address is not set'); + } + + $shippingAddress->setShippingMethod($carrierCode . '_' . $methodCode); + if (!$shippingAddress->requestShippingRates()) { + throw new NoSuchEntityException('Carrier with such method not found: ' . $carrierCode . ', ' . $methodCode); + } + try { + $quote->collectTotals()->save(); + } catch (\Exception $e) { + throw new CouldNotSaveException('Cannot set shipping method. ' . $e->getMessage()); + } + return true; + } +} diff --git a/app/code/Magento/Checkout/Service/V1/ShippingMethod/WriteServiceInterface.php b/app/code/Magento/Checkout/Service/V1/ShippingMethod/WriteServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..cc0ccbe38e56bf3c17c293a9d4c558487f09f58d --- /dev/null +++ b/app/code/Magento/Checkout/Service/V1/ShippingMethod/WriteServiceInterface.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\ShippingMethod; + +/** + * Interface to choose shipping method for cart address + */ +interface WriteServiceInterface +{ + /** + * Set shipping method and carrier for the specified cart + * + * @param int $cartId + * @param string $carrierCode + * @param string $methodCode + * + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\StateException + * @return bool + */ + public function setMethod($cartId, $carrierCode, $methodCode); +} diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 2e559e01a6b1fa2b46c960597420c463cd7f3d8b..eb48bc0d8e9492af1c2ccbece6ffc17d439c5238 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -3,25 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-gift-message": "0.1.0-alpha91", - "magento/module-wishlist": "0.1.0-alpha91", - "magento/module-page-cache": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-gift-message": "0.1.0-alpha92", + "magento/module-wishlist": "0.1.0-alpha92", + "magento/module-page-cache": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Checkout/etc/di.xml b/app/code/Magento/Checkout/etc/di.xml index 619a36b0ec90637105d00b5bff4caa28f959995b..8c72b8c0fa84270c80ce9d9051472cdd20d445e5 100644 --- a/app/code/Magento/Checkout/etc/di.xml +++ b/app/code/Magento/Checkout/etc/di.xml @@ -49,4 +49,10 @@ <preference for="\Magento\Checkout\Service\V1\Address\Billing\WriteServiceInterface" type="Magento\Checkout\Service\V1\Address\Billing\WriteService" /> <preference for="Magento\Checkout\Service\V1\Cart\ReadServiceInterface" type="Magento\Checkout\Service\V1\Cart\ReadService" /> <preference for="\Magento\Checkout\Service\V1\Cart\WriteServiceInterface" type="Magento\Checkout\Service\V1\Cart\WriteService" /> + <preference for="Magento\Checkout\Service\V1\ShippingMethod\WriteServiceInterface" type="Magento\Checkout\Service\V1\ShippingMethod\WriteService" /> + <preference for="Magento\Checkout\Service\V1\Coupon\ReadServiceInterface" type="Magento\Checkout\Service\V1\Coupon\ReadService" /> + <preference for="Magento\Checkout\Service\V1\Coupon\WriteServiceInterface" type="Magento\Checkout\Service\V1\Coupon\WriteService" /> + <preference for="Magento\Checkout\Service\V1\ShippingMethod\ReadServiceInterface" type="Magento\Checkout\Service\V1\ShippingMethod\ReadService" /> + <preference for="Magento\Checkout\Service\V1\PaymentMethod\ReadServiceInterface" type="\Magento\Checkout\Service\V1\PaymentMethod\ReadService" /> + <preference for="Magento\Checkout\Service\V1\PaymentMethod\WriteServiceInterface" type="\Magento\Checkout\Service\V1\PaymentMethod\WriteService" /> </config> diff --git a/app/code/Magento/Checkout/etc/webapi.xml b/app/code/Magento/Checkout/etc/webapi.xml index c641c11faab6001266b42ad14daafb55cd5a9b0b..13dfead733963690df706e52d9fc6be9e47dc98f 100644 --- a/app/code/Magento/Checkout/etc/webapi.xml +++ b/app/code/Magento/Checkout/etc/webapi.xml @@ -97,4 +97,58 @@ <resource ref="Magento_Sales::sales" /> </resources> </route> + <route url="/V1/carts/:cartId/selected-shipping-method" method="PUT"> + <service class="Magento\Checkout\Service\V1\ShippingMethod\WriteServiceInterface" method="setMethod"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> + <route url="/V1/carts/:cartId/selected-shipping-method" method="GET"> + <service class="Magento\Checkout\Service\V1\ShippingMethod\ReadServiceInterface" method="getMethod"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> + <route url="/V1/carts/:cartId/shipping-methods" method="GET"> + <service class="Magento\Checkout\Service\V1\ShippingMethod\ReadServiceInterface" method="getList"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> + <route url="/V1/carts/:cartId/coupons" method="GET"> + <service class="Magento\Checkout\Service\V1\Coupon\ReadServiceInterface" method="get"/> + <resources> + <resource ref="Magento_SalesRule::quote" /> + </resources> + </route> + <route url="/V1/carts/:cartId/coupons" method="PUT"> + <service class="Magento\Checkout\Service\V1\Coupon\WriteServiceInterface" method="set"/> + <resources> + <resource ref="Magento_SalesRule::quote" /> + </resources> + </route> + <route url="/V1/carts/:cartId/coupons" method="DELETE"> + <service class="Magento\Checkout\Service\V1\Coupon\WriteServiceInterface" method="delete"/> + <resources> + <resource ref="Magento_SalesRule::quote" /> + </resources> + </route> + <route url="/V1/carts/:cartId/selected-payment-methods" method="GET"> + <service class="Magento\Checkout\Service\V1\PaymentMethod\ReadServiceInterface" method="getPayment"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> + <route url="/V1/carts/:cartId/selected-payment-methods" method="PUT"> + <service class="Magento\Checkout\Service\V1\PaymentMethod\WriteServiceInterface" method="set"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> + <route url="/V1/carts/:cartId/payment-methods" method="GET"> + <service class="Magento\Checkout\Service\V1\PaymentMethod\ReadServiceInterface" method="getList"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> </routes> 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 8dde7251cef83f14549e31d0d8e8f4764aa1d597..4158d196a2f2ab17815b102a3ee882bb849bb8f0 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Core\Block\RequireCookie" name="require-cookie" template="Magento_Core::require_cookie.phtml"> <arguments> @@ -33,4 +33,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> 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 8dde7251cef83f14549e31d0d8e8f4764aa1d597..4158d196a2f2ab17815b102a3ee882bb849bb8f0 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Core\Block\RequireCookie" name="require-cookie" template="Magento_Core::require_cookie.phtml"> <arguments> @@ -33,4 +33,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> 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 c8c43a8b1222ca3be2689186a6b5d93754b5bc42..26481bf3057e70fab00dd59fb2fd65d6911f25cf 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_view"/> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="checkout_cart_configure_head_components" template="Magento_Checkout::js/components.phtml"/> @@ -41,4 +41,4 @@ <argument name="template" xsi:type="string">Magento_Checkout::cart/item/configure/updatecart.phtml</argument> </action> </referenceBlock> -</layout> +</page> 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 e77dd70b66dd6c80a608a664c44484895cb5bdb1..6161961da9123158a46238552a7cf2514843987d 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 @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_view_type_simple"/> -</layout> +</page> 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 149824798fb747e1490845264c63770841006a2d..b77f099b0b0fec53346a2b4c0e63d587907ba5ac 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 @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="checkout_cart_item_renderers" /> <update handle="checkout_shipping_price_renderer" /> <referenceContainer name="content"> @@ -57,4 +56,4 @@ </block> </referenceContainer> <block class="Magento\Checkout\Block\Cart\Additional\Info" name="additional.product.info" template="cart/additional/info.phtml"/> -</layout> +</page> 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 e028ee7a7d49ddb434748dd24ecbd577b910afd4..c07552a1333c5116856d17a8438fb2a13d26c04c 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="checkout_item_price_renderers" /> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="cart/item/default.phtml"/> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="simple" template="cart/item/default.phtml"/> </referenceBlock> -</layout> +</page> 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 55c9683a0006daf6e247d44b58596d4e7b500693..11bd9ae0988551db70a849f663847e3250b48008 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="minicart"> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.cart.item.price.sidebar" template="cart/item/price/sidebar.phtml"/> </referenceBlock> -</layout> +</page> 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 3a3b432707a07bb08ffd2aeeb9e2c8c20f9f7365..a0cd740e503a92f7dc7bdaaea5b69df5be6e140a 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.sidebar.item.renderers"> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="cart/sidebar/default.phtml"/> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="simple" template="cart/sidebar/default.phtml"/> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="virtual" template="cart/sidebar/default.phtml"/> </referenceBlock> -</layout> +</page> 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 a060ae1915a705ffb9743f9d98442a71279e64a0..d7ae863b2604fe9c32f7fce5364193d3b5cfddc4 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="minicart"> <block class="Magento\Checkout\Block\Cart\Sidebar" name="checkout.cart.minicart.totals" template="cart/minicart/totals.phtml"/> </referenceBlock> -</layout> +</page> 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 f7d411546d920c79fe1b41eebc0758cea5192e6d..c3e3670fe1eca401b38b2aa54a6152becd8f01ac 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 @@ -23,12 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.item.price.unit" template="item/price/unit.phtml"/> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.item.price.row" template="item/price/row.phtml"/> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.excl" template="onepage/review/item/price/unit_excl_tax.phtml"/> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.incl" template="onepage/review/item/price/unit_incl_tax.phtml"/> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.rowtotal.excl" template="onepage/review/item/price/row_excl_tax.phtml"/> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.rowtotal.incl" template="onepage/review/item/price/row_incl_tax.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_additional.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_additional.xml index 31c57a86552411b1078af10ff949b067c84431da..8f736a376d74fcb24626480c58f80ccaf3c6c728 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_additional.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_additional.xml @@ -23,10 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Checkout\Block\Onepage\Shipping\Method\Additional" name="shipping_method_additional" output="1" template="onepage/shipping_method/additional.phtml"> - <arguments> - <argument name="dontDisplayContainer" xsi:type="string">1</argument> - </arguments> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Checkout\Block\Onepage\Shipping\Method\Additional" name="shipping_method_additional" template="onepage/shipping_method/additional.phtml"> + <arguments> + <argument name="dontDisplayContainer" xsi:type="string">1</argument> + </arguments> + </block> + </container> </layout> 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 036a7a4713eb350050c812a65bdef89ded4cc2c7..202c4989e340eaf3a9ffea0eac19642b3521bbca 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 @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="page.main.title"> <action method="setPageTitle"> <argument translate="true" name="title" xsi:type="string">Your order has been received.</argument> @@ -33,4 +32,4 @@ <referenceContainer name="content"> <block class="Magento\Checkout\Block\Onepage\Failure" name="checkout.failure" template="onepage/failure.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml index 8ba34b0a8518edeabf2ee6b19e3d13a25c0ef0ce..b1c0c6fc979b9ef10e3c8b160ca5f87396086d46 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="checkout_shipping_price_renderer" /> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Onepage" name="checkout.onepage" template="onepage.phtml"> @@ -52,4 +51,4 @@ </container> </referenceContainer> <update handle="customer_form_template_handle"/> -</layout> +</page> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml index 999005a809a0e276770e91985561bf30882025b6..160910287db5aa09a5a8ec5f04d1c24b2a0b9850 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml @@ -23,9 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Checkout\Block\Onepage\Payment\Methods" name="payment_method" output="1" template="onepage/payment/methods.phtml" cacheable="false"> - <block class="Magento\Framework\View\Element\Template" name="checkout.onepage.payment.methods.scripts" as="scripts"/> - <block class="Magento\Framework\View\Element\Template" name="checkout.onepage.payment.methods.additional" as="additional"/> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Checkout\Block\Onepage\Payment\Methods" name="payment_method" template="onepage/payment/methods.phtml" cacheable="false"> + <block class="Magento\Framework\View\Element\Template" name="checkout.onepage.payment.methods.scripts" as="scripts"/> + <block class="Magento\Framework\View\Element\Template" name="checkout.onepage.payment.methods.additional" as="additional"/> + </block> + </container> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_progress.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_progress.xml index 6799c05055bb5b01dbfbc9157ed8c18213ca6b53..5e4e12042e0b668a61e7b770b5da742512c63887 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_progress.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_progress.xml @@ -23,14 +23,16 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="checkout_shipping_price_renderer" /> - <block class="Magento\Checkout\Block\Onepage\Progress" name="progress" output="1" template="onepage/progress.phtml"> - <block class="Magento\Checkout\Block\Onepage\Payment\Info" name="payment_info" cacheable="false"> - <action method="setInfoTemplate"> - <argument name="method" xsi:type="string"/> - <argument name="template" xsi:type="string"/> - </action> + <container name="root"> + <block class="Magento\Checkout\Block\Onepage\Progress" name="progress" template="onepage/progress.phtml"> + <block class="Magento\Checkout\Block\Onepage\Payment\Info" name="payment_info" cacheable="false"> + <action method="setInfoTemplate"> + <argument name="method" xsi:type="string"/> + <argument name="template" xsi:type="string"/> + </action> + </block> </block> - </block> + </container> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml index 28d0d50d807ccd14d3597a1a3e28f4b48636518e..b42358c743d357999d86a3e2de95ee53d8247c0b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml @@ -23,14 +23,16 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="checkout_onepage_review_item_renderers" /> - <block class="Magento\Checkout\Block\Onepage\Review\Info" name="order_review" output="1" template="onepage/review/info.phtml"> - <block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list" /> - <block class="Magento\Checkout\Block\Cart\Totals" name="checkout.onepage.review.info.totals" as="totals" template="onepage/review/totals.phtml"/> - <container name="checkout.onepage.review.info.items.before" as="items_before" label="Items Before"/> - <container name="checkout.onepage.review.info.items.after" as="items_after" label="Items After"/> - <block class="Magento\Framework\View\Element\Template" name="checkout.onepage.review.button" as="button" template="Magento_Checkout::onepage/review/button.phtml"/> - <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <update handle="checkout_onepage_review_item_renderers"/> + <container name="root"> + <block class="Magento\Checkout\Block\Onepage\Review\Info" name="order_review" template="onepage/review/info.phtml"> + <block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list"/> + <block class="Magento\Checkout\Block\Cart\Totals" name="checkout.onepage.review.info.totals" as="totals" template="onepage/review/totals.phtml"/> + <container name="checkout.onepage.review.info.items.before" as="items_before" label="Items Before"/> + <container name="checkout.onepage.review.info.items.after" as="items_after" label="Items After"/> + <block class="Magento\Checkout\Block\Onepage\Review\Button" name="checkout.onepage.review.button" as="button" template="Magento_Checkout::onepage/review/button.phtml"/> + <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + </block> + </container> </layout> 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 cb328bbefff725cb1d2b75f36b67ee844579e919..5cc06c2e7ee893cb8fb4a55f9f2123d7f9318418 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="checkout_item_price_renderers" /> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="onepage/review/item.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml index 36e31690129bc99926b7c859bfd278df46523e6c..f6239ab9ab05322da1f17848d656fb99bce952a5 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml @@ -23,7 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="checkout_shipping_price_renderer" /> - <block class="Magento\Checkout\Block\Onepage\Shipping\Method\Available" name="shipping_method" output="1" template="onepage/shipping_method/available.phtml"/> + <container name="root"> + <block class="Magento\Checkout\Block\Onepage\Shipping\Method\Available" name="shipping_method" template="onepage/shipping_method/available.phtml"/> + </container> </layout> 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 f0dc79b258d663b9164f4244db783db106299df5..b3bc14ca22b2a7324977db8df05ebb09f8e77fa7 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 @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="page.main.title"> <block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success.print.button" template="button.phtml"/> <action method="setPageTitle"> @@ -35,4 +34,4 @@ <block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success" template="success.phtml" cacheable="false"/> </referenceContainer> <container name="order.success.additional.info" label="Order Success Additional Info"/> -</layout> +</page> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml index e7e061fa3c659f269e2c9500dcd1dff23a3328d5..d339288bda7c8276e3e2c16a5ad370d0f6c91b3b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Checkout\Block\Shipping\Price" name="checkout.shipping.price" as="shipping.price" template="shipping/price.phtml"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> + <block class="Magento\Checkout\Block\Shipping\Price" name="checkout.shipping.price" as="shipping.price" template="shipping/price.phtml"/> + </container> </layout> - diff --git a/app/code/Magento/Checkout/view/frontend/layout/default.xml b/app/code/Magento/Checkout/view/frontend/layout/default.xml index a8748a6d115ce738150103aaef3cfc111a273f11..959321b5f82819438e92577f5d303e306b785687 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/default.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="checkout_cart_sidebar_item_renderers" /> <update handle="checkout_cart_sidebar_item_price_renderers" /> <update handle="checkout_cart_sidebar_total_renderers" /> @@ -39,4 +39,4 @@ </container> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opc-order-review.js b/app/code/Magento/Checkout/view/frontend/web/js/opc-order-review.js index 16b48f9447c58d768fa63eb6f9110e55dc13e9a8..5b587d129b6b07f5c2a5cdd24abf3533317eeac1 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opc-order-review.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opc-order-review.js @@ -37,7 +37,7 @@ define([ review: { continueSelector: '#opc-review [data-role=review-save]', container: '#opc-review', - agreementFormSelector: '#checkout-agreements-form' + agreementGroupSelector: '#checkout-agreements' } }, @@ -50,18 +50,26 @@ define([ }, _saveOrder: function() { - var agreementForm = $(this.options.review.agreementFormSelector), + var agreementFormsGroup = $(this.options.review.agreementGroupSelector), paymentForm = $(this.options.payment.form); - agreementForm.validation(); - if (agreementForm.validation && - agreementForm.validation('isValid') && + var isAgreementValid = true; + agreementFormsGroup.find('form').each( + function(){ + $(this).validation(); + isAgreementValid = isAgreementValid && $(this).validation && $(this).validation('isValid'); + } + ); + + if (isAgreementValid && paymentForm.validation && paymentForm.validation('isValid')) { + var serializedAgreement = ''; + agreementFormsGroup.find('form').each(function(){serializedAgreement += '&' + $(this).serialize();}); this._ajaxContinue( this.options.review.saveUrl, - paymentForm.serialize() + '&' + agreementForm.serialize()); + paymentForm.serialize() + serializedAgreement); } } }); -}); \ No newline at end of file +}); diff --git a/app/code/Magento/CheckoutAgreements/Service/V1/Agreement/ReadService.php b/app/code/Magento/CheckoutAgreements/Service/V1/Agreement/ReadService.php new file mode 100644 index 0000000000000000000000000000000000000000..8671e62df157a0782935e1c6511f2b1d760779dd --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Service/V1/Agreement/ReadService.php @@ -0,0 +1,116 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CheckoutAgreements\Service\V1\Agreement; + +use \Magento\CheckoutAgreements\Model\Resource\Agreement\CollectionFactory as AgreementCollectionFactory; +use \Magento\CheckoutAgreements\Model\Resource\Agreement\Collection as AgreementCollection; +use \Magento\CheckoutAgreements\Model\Agreement; +use \Magento\Framework\App\Config\ScopeConfigInterface; +use \Magento\Store\Model\StoreManagerInterface; +use \Magento\Store\Model\ScopeInterface; +use \Magento\CheckoutAgreements\Service\V1\Data\AgreementBuilder; +use \Magento\CheckoutAgreements\Service\V1\Data\Agreement as AgreementDataObject; + +class ReadService implements ReadServiceInterface +{ + /** + * @var AgreementCollectionFactory + */ + private $collectionFactory; + + /** + * @var AgreementBuilder + */ + private $agreementBuilder; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @param AgreementCollectionFactory $collectionFactory + * @param AgreementBuilder $agreementBuilder + * @param StoreManagerInterface $storeManager + * @param ScopeConfigInterface $scopeConfig + */ + public function __construct( + AgreementCollectionFactory $collectionFactory, + AgreementBuilder $agreementBuilder, + StoreManagerInterface $storeManager, + ScopeConfigInterface $scopeConfig + ) { + $this->collectionFactory = $collectionFactory; + $this->agreementBuilder = $agreementBuilder; + $this->storeManager = $storeManager; + $this->scopeConfig = $scopeConfig; + } + + /** + * {@inheritdoc} + */ + public function getList() + { + if (!$this->scopeConfig->isSetFlag('checkout/options/enable_agreements', ScopeInterface::SCOPE_STORE)) { + return array(); + } + $storeId = $this->storeManager->getStore()->getId(); + /** @var $agreementCollection AgreementCollection */ + $agreementCollection = $this->collectionFactory->create(); + $agreementCollection->addStoreFilter($storeId); + $agreementCollection->addFieldToFilter('is_active', 1); + + $agreementDataObjects = array(); + foreach ($agreementCollection as $agreement) { + $agreementDataObjects[] = $this->createAgreementDataObject($agreement); + } + + return $agreementDataObjects; + } + + /** + * Create agreement data object based on given agreement model + * + * @param Agreement $agreement + * @return AgreementDataObject + */ + protected function createAgreementDataObject(Agreement $agreement) + { + $this->agreementBuilder->populateWithArray(array( + AgreementDataObject::ID => $agreement->getId(), + AgreementDataObject::NAME => $agreement->getName(), + AgreementDataObject::CONTENT => $agreement->getContent(), + AgreementDataObject::CONTENT_HEIGHT => $agreement->getContentHeight(), + AgreementDataObject::CHECKBOX_TEXT => $agreement->getCheckboxText(), + AgreementDataObject::ACTIVE => (bool)$agreement->getIsActive(), + AgreementDataObject::HTML => (bool)$agreement->getIsHtml(), + )); + return $this->agreementBuilder->create(); + } +} diff --git a/app/code/Magento/CheckoutAgreements/Service/V1/Agreement/ReadServiceInterface.php b/app/code/Magento/CheckoutAgreements/Service/V1/Agreement/ReadServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..2274a7ed767a940897dd52ee52064d76c7b69098 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Service/V1/Agreement/ReadServiceInterface.php @@ -0,0 +1,34 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CheckoutAgreements\Service\V1\Agreement; + +interface ReadServiceInterface +{ + /** + * Retrieve the list of active checkout agreements + * + * @return \Magento\CheckoutAgreements\Service\V1\Data\Agreement[] + */ + public function getList(); +} diff --git a/app/code/Magento/CheckoutAgreements/Service/V1/Data/Agreement.php b/app/code/Magento/CheckoutAgreements/Service/V1/Data/Agreement.php new file mode 100644 index 0000000000000000000000000000000000000000..5d00772811b3b7b50d5d7643c3c56adfddc34512 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Service/V1/Data/Agreement.php @@ -0,0 +1,110 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CheckoutAgreements\Service\V1\Data; + +use \Magento\Framework\Service\Data\AbstractObject; + +/** + * @codeCoverageIgnore + */ +class Agreement extends AbstractObject +{ + const ID = 'id'; + const NAME = 'name'; + const CONTENT = 'content'; + const CONTENT_HEIGHT = 'content_height'; + const CHECKBOX_TEXT = 'checkbox_text'; + const ACTIVE = 'active'; + const HTML = 'html'; + + /** + * Retrieve agreement ID + * + * @return int + */ + public function getId() + { + return $this->_get(self::ID); + } + + /** + * Retrieve agreement name + * + * @return string + */ + public function getName() + { + return $this->_get(self::NAME); + } + + /** + * Retrieve agreement content + * + * @return string + */ + public function getContent() + { + return $this->_get(self::CONTENT); + } + + /** + * Retrieve agreement content height (optional CSS property) + * + * @return string|null + */ + public function getContentHeight() + { + return $this->_get(self::CONTENT_HEIGHT); + } + + /** + * Retrieve agreement checkbox text + * + * @return string + */ + public function getCheckboxText() + { + return $this->_get(self::CHECKBOX_TEXT); + } + + /** + * Retrieve agreement status + * + * @return bool + */ + public function isActive() + { + return $this->_get(self::ACTIVE); + } + + /** + * Retrieve agreement content type + * + * @return bool + */ + public function isHtml() + { + return $this->_get(self::HTML); + } +} diff --git a/app/code/Magento/CheckoutAgreements/Service/V1/Data/AgreementBuilder.php b/app/code/Magento/CheckoutAgreements/Service/V1/Data/AgreementBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..b9f713be3ea491d5514f9c9c8381e78b8f886662 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Service/V1/Data/AgreementBuilder.php @@ -0,0 +1,109 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CheckoutAgreements\Service\V1\Data; + +use \Magento\Framework\Service\Data\AbstractObjectBuilder; + +/** + * @codeCoverageIgnore + */ +class AgreementBuilder extends AbstractObjectBuilder +{ + /** + * Set agreement ID + * + * @param int $value + * @return $this + */ + public function setId($value) + { + return $this->_set(Agreement::ID, $value); + } + + /** + * Set agreement name + * + * @param string $value + * @return $this + */ + public function setName($value) + { + return $this->_set(Agreement::NAME, $value); + } + + /** + * Set agreement content + * + * @param string $value + * @return $this + */ + public function setContent($value) + { + return $this->_set(Agreement::CONTENT, $value); + } + + /** + * Set agreement content height (optional CSS property) + * + * @param string $value + * @return $this + */ + public function setContentHeight($value) + { + return $this->_set(Agreement::CONTENT_HEIGHT, $value); + } + + /** + * Set agreement checkbox text + * + * @param string $value + * @return $this + */ + public function setCheckboxText($value) + { + return $this->_set(Agreement::CHECKBOX_TEXT, $value); + } + + /** + * Set agreement status + * + * @param bool $value + * @return $this + */ + public function setActive($value) + { + return $this->_set(Agreement::ACTIVE, $value); + } + + /** + * Set agreement content type + * + * @param bool $value + * @return $this + */ + public function setHtml($value) + { + return $this->_set(Agreement::HTML, $value); + } +} diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index 35a7284e76f3742104ba6d931baf6cc675a10e63..988fcdf04ab544003a5cad88b50b09b815a02fa1 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/CheckoutAgreements/etc/di.xml b/app/code/Magento/CheckoutAgreements/etc/di.xml index 3bd5af6262c1b478bc264000b0b01c9850b37c31..6c510e71f654f2bb4d76c1c6b69524c536663eba 100644 --- a/app/code/Magento/CheckoutAgreements/etc/di.xml +++ b/app/code/Magento/CheckoutAgreements/etc/di.xml @@ -24,6 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + <preference for="Magento\CheckoutAgreements\Service\V1\Agreement\ReadServiceInterface" type="Magento\CheckoutAgreements\Service\V1\Agreement\ReadService" /> <type name="Magento\Framework\Module\Updater\SetupFactory"> <arguments> <argument name="resourceTypes" xsi:type="array"> diff --git a/app/code/Magento/CheckoutAgreements/etc/webapi.xml b/app/code/Magento/CheckoutAgreements/etc/webapi.xml new file mode 100644 index 0000000000000000000000000000000000000000..c9e1492a34d7fcf812fe37923e7854513faaef30 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/etc/webapi.xml @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + <route url="/V1/carts/licence" method="GET"> + <service class="Magento\CheckoutAgreements\Service\V1\Agreement\ReadServiceInterface" method="getList"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> +</routes> diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/CheckoutAgreements/view/frontend/layout/checkout_onepage_review.xml index 74cb412a7edbe3a0fb1739752e30892e2941710f..98e8901bffee327341d66fc04793a161fc881815 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/CheckoutAgreements/view/frontend/layout/checkout_onepage_review.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_review"> <block class="Magento\CheckoutAgreements\Block\Agreements" name="checkout.onepage.agreements" as="agreements" template="agreements.phtml"/> </referenceBlock> -</layout> +</page> 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 9f2bfb6784870a5751e3152f6a471154c95d7aa8..915cabf185ddf835fd4e11a5fde811c25905ce16 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout_overview"> - <block class="Magento\CheckoutAgreements\Block\Agreements" name="checkout.multishipping.agreements" as="agreements" template="agreements.phtml" /> + <block class="Magento\CheckoutAgreements\Block\Agreements" name="checkout.multishipping.agreements" as="agreements" template="multishipping_agreements.phtml" /> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_express_review.xml index bad28a4db4dbfcdf0a1ebc6c2534cb0cb63c05b1..c221177ac6dfc86dd427bff90f805bf315683d1a 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_express_review.xml +++ b/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_express_review.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="paypal.express.review"> <block class="Magento\CheckoutAgreements\Block\Agreements" name="paypal.express.review.details.agreements" as="agreements" template="agreements.phtml" /> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_payflowexpress_review.xml b/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_payflowexpress_review.xml index bad28a4db4dbfcdf0a1ebc6c2534cb0cb63c05b1..c221177ac6dfc86dd427bff90f805bf315683d1a 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_payflowexpress_review.xml +++ b/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_payflowexpress_review.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="paypal.express.review"> <block class="Magento\CheckoutAgreements\Block\Agreements" name="paypal.express.review.details.agreements" as="agreements" template="agreements.phtml" /> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/templates/agreements.phtml b/app/code/Magento/CheckoutAgreements/view/frontend/templates/agreements.phtml index 39fc5e4e671cae37dab42efb042de804f0597bc3..e96929b51d12b5c474bb0ae46dfaabc3b42184e1 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/templates/agreements.phtml +++ b/app/code/Magento/CheckoutAgreements/view/frontend/templates/agreements.phtml @@ -38,7 +38,7 @@ <?php echo nl2br($this->escapeHtml($_a->getContent())) ?> <?php endif; ?> </div> - <form id="checkout-agreements-form" class="field choice agree required"> + <form id="checkout-agreements-form-<?php echo $_a->getId()?>" class="field choice agree required"> <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->escapeHtml($_a->getCheckboxText()) ?>" class="checkbox" data-validate="{required:true}"/> <label class="label" for="agreement-<?php echo $_a->getId()?>"><span><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->escapeHtml($_a->getCheckboxText()) ?></span></label> </form> diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/templates/multishipping_agreements.phtml b/app/code/Magento/CheckoutAgreements/view/frontend/templates/multishipping_agreements.phtml new file mode 100644 index 0000000000000000000000000000000000000000..a80392b38e0ef21f24a294d68abf72b082dace73 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/view/frontend/templates/multishipping_agreements.phtml @@ -0,0 +1,47 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * @var $this \Magento\CheckoutAgreements\Block\Agreements + */ +?> +<?php if (!$this->getAgreements()) return; ?> +<ol id="checkout-agreements" class="agreements checkout items"> + <?php foreach ($this->getAgreements() as $_a): ?> + <li class="item"> + <div class="agreement content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>> + <?php if ($_a->getIsHtml()):?> + <?php echo $_a->getContent() ?> + <?php else:?> + <?php echo nl2br($this->escapeHtml($_a->getContent())) ?> + <?php endif; ?> + </div> + <div id="checkout-agreements-form-<?php echo $_a->getId()?>" class="field choice agree required"> + <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->escapeHtml($_a->getCheckboxText()) ?>" class="checkbox" data-validate="{required:true}"/> + <label class="label" for="agreement-<?php echo $_a->getId()?>"><span><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->escapeHtml($_a->getCheckboxText()) ?></span></label> + </div> + </li> + <?php endforeach ?> +</ol> diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php index 7aec0429a02f07c5b7e053e7f86baf0908815ccb..d69bb5de7867059f2ff62b206f7d5f4e3cc19847 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php @@ -39,12 +39,18 @@ class Design extends \Magento\Backend\Block\Widget\Form\Generic implements */ protected $_pageLayout; + /** + * @var \Magento\Core\Model\PageLayout\Config\Builder + */ + protected $pageLayoutBuilder; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Data\FormFactory $formFactory * @param \Magento\Theme\Model\Layout\Source\Layout $pageLayout * @param \Magento\Framework\View\Design\Theme\LabelFactory $labelFactory + * @param \Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder * @param array $data */ public function __construct( @@ -53,8 +59,10 @@ class Design extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Framework\Data\FormFactory $formFactory, \Magento\Theme\Model\Layout\Source\Layout $pageLayout, \Magento\Framework\View\Design\Theme\LabelFactory $labelFactory, + \Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder, array $data = array() ) { + $this->pageLayoutBuilder = $pageLayoutBuilder; $this->_labelFactory = $labelFactory; $this->_pageLayout = $pageLayout; parent::__construct($context, $registry, $formFactory, $data); @@ -95,13 +103,13 @@ class Design extends \Magento\Backend\Block\Widget\Form\Generic implements ); $layoutFieldset->addField( - 'root_template', + 'page_layout', 'select', array( - 'name' => 'root_template', + 'name' => 'page_layout', 'label' => __('Layout'), 'required' => true, - 'values' => $this->_pageLayout->toOptionArray(), + 'values' => $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray(), 'disabled' => $isElementDisabled ) ); @@ -168,12 +176,12 @@ class Design extends \Magento\Backend\Block\Widget\Form\Generic implements ); $designFieldset->addField( - 'custom_root_template', + 'custom_page_layout', 'select', array( - 'name' => 'custom_root_template', + 'name' => 'custom_page_layout', 'label' => __('Custom Layout'), - 'values' => $this->_pageLayout->toOptionArray(true), + 'values' => $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray(true), 'disabled' => $isElementDisabled ) ); diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php index 721ee74ee7278458e59185faa2f80afc6128bde5..690c14c619635cd56422ecf56c993222d5233222 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php @@ -25,8 +25,6 @@ namespace Magento\Cms\Block\Adminhtml\Page; /** * Adminhtml cms pages grid - * - * @author Magento Core Team <core@magentocommerce.com> */ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended { @@ -41,29 +39,29 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended protected $_cmsPage; /** - * @var \Magento\Theme\Model\Layout\Source\Layout + * @var \Magento\Core\Model\PageLayout\Config\Builder */ - protected $_pageLayout; + protected $pageLayoutBuilder; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Theme\Model\Layout\Source\Layout $pageLayout * @param \Magento\Cms\Model\Page $cmsPage * @param \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Theme\Model\Layout\Source\Layout $pageLayout, \Magento\Cms\Model\Page $cmsPage, \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory, + \Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder, array $data = array() ) { $this->_collectionFactory = $collectionFactory; - $this->_cmsPage = $cmsPage; - $this->_pageLayout = $pageLayout; + $this->_cmsPage = $cmsPage; + $this->pageLayoutBuilder = $pageLayoutBuilder; parent::__construct($context, $backendHelper, $data); } @@ -100,19 +98,17 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected function _prepareColumns() { - $baseUrl = $this->getUrl(); - $this->addColumn('title', array('header' => __('Title'), 'index' => 'title')); $this->addColumn('identifier', array('header' => __('URL Key'), 'index' => 'identifier')); $this->addColumn( - 'root_template', + 'page_layout', array( 'header' => __('Layout'), - 'index' => 'root_template', + 'index' => 'page_layout', 'type' => 'options', - 'options' => $this->_pageLayout->getOptions() + 'options' => $this->pageLayoutBuilder->getPageLayoutsConfig()->getOptions() ) ); diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Widget/Chooser.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Widget/Chooser.php index 6ff9d2b00b7718a473ed9a8fb7b49562cec1f110..93fdeab99eae106ba1de22cb68ef479bb28f1a98 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Widget/Chooser.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Widget/Chooser.php @@ -30,11 +30,6 @@ namespace Magento\Cms\Block\Adminhtml\Page\Widget; */ class Chooser extends \Magento\Backend\Block\Widget\Grid\Extended { - /** - * @var \Magento\Theme\Model\Layout\Source\Layout - */ - protected $_pageLayout; - /** * @var \Magento\Cms\Model\Page */ @@ -50,25 +45,30 @@ class Chooser extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_collectionFactory; + /** + * @var \Magento\Core\Model\PageLayout\Config\Builder + */ + protected $pageLayoutBuilder; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Theme\Model\Layout\Source\Layout $pageLayout * @param \Magento\Cms\Model\Page $cmsPage * @param \Magento\Cms\Model\PageFactory $pageFactory * @param \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Theme\Model\Layout\Source\Layout $pageLayout, \Magento\Cms\Model\Page $cmsPage, \Magento\Cms\Model\PageFactory $pageFactory, \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory, + \Magento\Core\Model\PageLayout\Config\Builder $pageLayoutBuilder, array $data = array() ) { - $this->_pageLayout = $pageLayout; + $this->pageLayoutBuilder = $pageLayoutBuilder; $this->_cmsPage = $cmsPage; $this->_pageFactory = $pageFactory; $this->_collectionFactory = $collectionFactory; @@ -205,12 +205,12 @@ class Chooser extends \Magento\Backend\Block\Widget\Grid\Extended ); $this->addColumn( - 'chooser_root_template', + 'chooser_page_layout', array( 'header' => __('Layout'), - 'index' => 'root_template', + 'index' => 'page_layout', 'type' => 'options', - 'options' => $this->_pageLayout->getOptions(), + 'options' => $this->pageLayoutBuilder->getPageLayoutsConfig()->getOptions(), 'header_css_class' => 'col-layout', 'column_css_class' => 'col-layout' ) diff --git a/app/code/Magento/Cms/Block/Page.php b/app/code/Magento/Cms/Block/Page.php index 38520d81ccf5b58497ed2ac2dce0eb1114bdbf53..b43fbe302312a9dcce9ee5eeabacb8e35fc3db86 100644 --- a/app/code/Magento/Cms/Block/Page.php +++ b/app/code/Magento/Cms/Block/Page.php @@ -52,6 +52,11 @@ class Page extends \Magento\Framework\View\Element\AbstractBlock implements \Mag */ protected $_pageFactory; + /** + * @var \Magento\Framework\View\Page\Config + */ + protected $pageConfig; + /** * Construct * @@ -60,6 +65,7 @@ class Page extends \Magento\Framework\View\Element\AbstractBlock implements \Mag * @param \Magento\Cms\Model\Template\FilterProvider $filterProvider * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Cms\Model\PageFactory $pageFactory + * @param \Magento\Framework\View\Page\Config $pageConfig * @param array $data */ public function __construct( @@ -68,6 +74,7 @@ class Page extends \Magento\Framework\View\Element\AbstractBlock implements \Mag \Magento\Cms\Model\Template\FilterProvider $filterProvider, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Cms\Model\PageFactory $pageFactory, + \Magento\Framework\View\Page\Config $pageConfig, array $data = array() ) { parent::__construct($context, $data); @@ -76,6 +83,7 @@ class Page extends \Magento\Framework\View\Element\AbstractBlock implements \Mag $this->_filterProvider = $filterProvider; $this->_storeManager = $storeManager; $this->_pageFactory = $pageFactory; + $this->pageConfig = $pageConfig; } /** @@ -132,10 +140,7 @@ class Page extends \Magento\Framework\View\Element\AbstractBlock implements \Mag $breadcrumbs->addCrumb('cms_page', array('label' => $page->getTitle(), 'title' => $page->getTitle())); } - $root = $this->getLayout()->getBlock('root'); - if ($root) { - $root->addBodyClass('cms-' . $page->getIdentifier()); - } + $this->pageConfig->addBodyClass('cms-' . $page->getIdentifier()); $head = $this->getLayout()->getBlock('head'); if ($head) { diff --git a/app/code/Magento/Cms/Helper/Page.php b/app/code/Magento/Cms/Helper/Page.php index e4f02528586b52e9c66eccee205afdbf3accdf24..cfea022b04e6851de955316044bd717095391af0 100644 --- a/app/code/Magento/Cms/Helper/Page.php +++ b/app/code/Magento/Cms/Helper/Page.php @@ -45,13 +45,6 @@ class Page extends \Magento\Framework\App\Helper\AbstractHelper */ const XML_PATH_HOME_PAGE = 'web/default/cms_home_page'; - /** - * Catalog product - * - * @var \Magento\Theme\Helper\Layout - */ - protected $_pageLayout; - /** * Design package instance * @@ -98,40 +91,45 @@ class Page extends \Magento\Framework\App\Helper\AbstractHelper */ protected $_view; + /** + * @var \Magento\Framework\View\Page\Config + */ + protected $pageConfig; + /** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param \Magento\Cms\Model\Page $page - * @param \Magento\Theme\Helper\Layout $pageLayout * @param \Magento\Framework\View\DesignInterface $design * @param \Magento\Cms\Model\PageFactory $pageFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\App\ViewInterface $view + * @param \Magento\Framework\View\Page\Config $pageConfig */ public function __construct( \Magento\Framework\App\Helper\Context $context, \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Cms\Model\Page $page, - \Magento\Theme\Helper\Layout $pageLayout, \Magento\Framework\View\DesignInterface $design, \Magento\Cms\Model\PageFactory $pageFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Escaper $escaper, - \Magento\Framework\App\ViewInterface $view + \Magento\Framework\App\ViewInterface $view, + \Magento\Framework\View\Page\Config $pageConfig ) { $this->messageManager = $messageManager; $this->_view = $view; $this->_page = $page; - $this->_pageLayout = $pageLayout; $this->_design = $design; $this->_pageFactory = $pageFactory; $this->_storeManager = $storeManager; $this->_storeManager = $storeManager; $this->_localeDate = $localeDate; $this->_escaper = $escaper; + $this->pageConfig = $pageConfig; parent::__construct($context); } @@ -186,21 +184,20 @@ class Page extends \Magento\Framework\App\Helper\AbstractHelper $this->_design->setDesignTheme($this->_page->getCustomTheme()); } } - $this->_view->getLayout()->getUpdate()->addHandle('default')->addHandle('cms_page_view'); - $this->_view->addPageLayoutHandles(array('id' => $this->_page->getIdentifier())); - - $this->_view->addActionLayoutHandles(); - if ($this->_page->getRootTemplate()) { - if ($this->_page->getCustomRootTemplate() - && $this->_page->getCustomRootTemplate() != 'empty' + if ($this->_page->getPageLayout()) { + if ($this->_page->getCustomPageLayout() + && $this->_page->getCustomPageLayout() != 'empty' && $inRange ) { - $handle = $this->_page->getCustomRootTemplate(); + $handle = $this->_page->getCustomPageLayout(); } else { - $handle = $this->_page->getRootTemplate(); + $handle = $this->_page->getPageLayout(); } - $this->_pageLayout->applyHandle($handle); + $this->pageConfig->setPageLayout($handle); } + $this->_view->getPage()->initLayout(); + $this->_view->getLayout()->getUpdate()->addHandle('cms_page_view'); + $this->_view->addPageLayoutHandles(array('id' => $this->_page->getIdentifier())); $this->_eventManager->dispatch( 'cms_page_render', @@ -224,10 +221,6 @@ class Page extends \Magento\Framework\App\Helper\AbstractHelper $contentHeadingBlock->setContentHeading($contentHeading); } - if ($this->_page->getRootTemplate()) { - $this->_pageLayout->applyTemplate($this->_page->getRootTemplate()); - } - /* @TODO: Move catalog and checkout storage types to appropriate modules */ $messageBlock = $this->_view->getLayout()->getMessagesBlock(); $messageBlock->addStorageType($this->messageManager->getDefaultGroup()); diff --git a/app/code/Magento/Cms/Model/Page.php b/app/code/Magento/Cms/Model/Page.php index 4e4fcce399c4a789e9ffa04104280c16fa6e5885..93a2c676c66f013c4ce4bd9c9ad583e22b2662be 100644 --- a/app/code/Magento/Cms/Model/Page.php +++ b/app/code/Magento/Cms/Model/Page.php @@ -30,8 +30,8 @@ namespace Magento\Cms\Model; * @method \Magento\Cms\Model\Resource\Page getResource() * @method string getTitle() * @method \Magento\Cms\Model\Page setTitle(string $value) - * @method string getRootTemplate() - * @method \Magento\Cms\Model\Page setRootTemplate(string $value) + * @method string getPageLayout() + * @method \Magento\Cms\Model\Page setPageLayout(string $value) * @method string getMetaKeywords() * @method \Magento\Cms\Model\Page setMetaKeywords(string $value) * @method string getMetaDescription() @@ -54,8 +54,8 @@ namespace Magento\Cms\Model; * @method \Magento\Cms\Model\Page setLayoutUpdateXml(string $value) * @method string getCustomTheme() * @method \Magento\Cms\Model\Page setCustomTheme(string $value) - * @method string getCustomRootTemplate() - * @method \Magento\Cms\Model\Page setCustomRootTemplate(string $value) + * @method string getCustomPageLayout() + * @method \Magento\Cms\Model\Page setCustomPageLayout(string $value) * @method string getCustomLayoutUpdateXml() * @method \Magento\Cms\Model\Page setCustomLayoutUpdateXml(string $value) * @method string getCustomThemeFrom() diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index 8b65e07c9de8b3ca9a8301a3c0082880c68e5c6f..b5f0105614a1b5dc251cfbce61661eece5da71e2 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-widget": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-email": "0.1.0-alpha91", - "magento/module-install": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-widget": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-email": "0.1.0-alpha92", + "magento/module-install": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php b/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php index 06dcbc28422ca75b51c2d2467e926648a5b03280..43ac20c90e807e120054e2057c0999ff2bff537c 100644 --- a/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php +++ b/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php @@ -26,7 +26,7 @@ $cmsPages = array( array( 'title' => '404 Not Found 1', - 'root_template' => 'two_columns_right', + 'page_layout' => '2columns-right', 'meta_keywords' => 'Page keywords', 'meta_description' => 'Page description', 'identifier' => 'no-route', @@ -38,7 +38,7 @@ $cmsPages = array( ), array( 'title' => 'Home page', - 'root_template' => 'one_column', + 'page_layout' => '1column', 'identifier' => 'home', 'content_heading' => 'Home Page', 'content' => "<p>CMS homepage content goes here.</p>\r\n", @@ -48,7 +48,7 @@ $cmsPages = array( ), array( 'title' => 'Enable Cookies', - 'root_template' => 'one_column', + 'page_layout' => '1column', 'identifier' => 'enable-cookies', 'content_heading' => 'What are Cookies?', 'content' => "<div class=\"message notice\">\r\n <div>Please enable cookies in your web browser to continue.</div>\r\n </div>\r\n <p>Cookies are short pieces of data that are sent to your computer when you visit a website. On later visits, this data is then returned to that website. Cookies allow us to recognize you automatically whenever you visit our site so that we can personalize your experience and provide you with better service. We also use cookies (and similar browser data, such as Flash cookies) for fraud prevention and other purposes. If your web browser is set to refuse cookies from our website, you will not be able to complete a purchase or take advantage of certain features of our website, such as storing items in your Shopping Cart or receiving personalized recommendations. As a result, we strongly encourage you to configure your web browser to accept cookies from our website.</p>\r\n <h2 class=\"subtitle\">Enabling Cookies</h2>\r\n <ul class=\"disc\">\r\n <li><a href=\"#ie7\">Internet Explorer 7.x</a></li>\r\n <li><a href=\"#ie6\">Internet Explorer 6.x</a></li>\r\n <li><a href=\"#firefox\">Mozilla/Firefox</a></li>\r\n <li><a href=\"#opera\">Opera 7.x</a></li>\r\n </ul>\r\n <h3><a name=\"ie7\"></a>Internet Explorer 7.x</h3>\r\n <ol>\r\n <li>\r\n <p>Start Internet Explorer</p>\r\n </li>\r\n <li>\r\n <p>Under the <strong>Tools</strong> menu, click <strong>Internet Options</strong></p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/ie7-1.gif\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>Click the <strong>Privacy</strong> tab</p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/ie7-2.gif\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>Click the <strong>Advanced</strong> button</p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/ie7-3.gif\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>Put a check mark in the box for <strong>Override Automatic Cookie Handling</strong>, put another check mark in the <strong>Always accept session cookies </strong>box</p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/ie7-4.gif\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>Click <strong>OK</strong></p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/ie7-5.gif\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>Click <strong>OK</strong></p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/ie7-6.gif\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>Restart Internet Explore</p>\r\n </li>\r\n </ol>\r\n <p class=\"a-top\"><a href=\"#top\">Back to Top</a></p>\r\n <h3><a name=\"ie6\"></a>Internet Explorer 6.x</h3>\r\n <ol>\r\n <li>\r\n <p>Select <strong>Internet Options</strong> from the Tools menu</p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/ie6-1.gif\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>Click on the <strong>Privacy</strong> tab</p>\r\n </li>\r\n <li>\r\n <p>Click the <strong>Default</strong> button (or manually slide the bar down to <strong>Medium</strong>) under <strong>Settings</strong>. Click <strong>OK</strong></p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/ie6-2.gif\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n </ol>\r\n <p class=\"a-top\"><a href=\"#top\">Back to Top</a></p>\r\n <h3><a name=\"firefox\"></a>Mozilla/Firefox</h3>\r\n <ol>\r\n <li>\r\n <p>Click on the <strong>Tools</strong>-menu in Mozilla</p>\r\n </li>\r\n <li>\r\n <p>Click on the <strong>Options...</strong> item in the menu - a new window open</p>\r\n </li>\r\n <li>\r\n <p>Click on the <strong>Privacy</strong> selection in the left part of the window. (See image below)</p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/firefox.png\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>Expand the <strong>Cookies</strong> section</p>\r\n </li>\r\n <li>\r\n <p>Check the <strong>Enable cookies</strong> and <strong>Accept cookies normally</strong> checkboxes</p>\r\n </li>\r\n <li>\r\n <p>Save changes by clicking <strong>Ok</strong>.</p>\r\n </li>\r\n </ol>\r\n <p class=\"a-top\"><a href=\"#top\">Back to Top</a></p>\r\n <h3><a name=\"opera\"></a>Opera 7.x</h3>\r\n <ol>\r\n <li>\r\n <p>Click on the <strong>Tools</strong> menu in Opera</p>\r\n </li>\r\n <li>\r\n <p>Click on the <strong>Preferences...</strong> item in the menu - a new window open</p>\r\n </li>\r\n <li>\r\n <p>Click on the <strong>Privacy</strong> selection near the bottom left of the window. (See image below)</p>\r\n <p><img src=\"{{view url=\"Magento_Cms::images/cookies/opera.png\" area=frontend}}\" alt=\"\" /></p>\r\n </li>\r\n <li>\r\n <p>The <strong>Enable cookies</strong> checkbox must be checked, and <strong>Accept all cookies</strong> should be selected in the "<strong>Normal cookies</strong>" drop-down</p>\r\n </li>\r\n <li>\r\n <p>Save changes by clicking <strong>Ok</strong></p>\r\n </li>\r\n </ol>\r\n <p class=\"a-top\"><a href=\"#top\">Back to Top</a></p>\r\n", diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php similarity index 99% rename from app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php rename to app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php index 2ad56df0bea7e1b426cb3edd270b58e6d7cafaed..b201c72f7e3855ff401dc122ea78550fa21f318c 100644 --- a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php +++ b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php @@ -237,7 +237,7 @@ EOD; $privacyPageData = array( 'title' => 'Privacy Policy', 'content_heading' => 'Privacy Policy', - 'root_template' => 'one_column', + 'page_layout' => '1column', 'identifier' => 'privacy-policy-cookie-restriction-mode', 'content' => $pageContent, 'is_active' => 1, diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0.2-1.6.0.0.3.php b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.2-1.6.0.3.php similarity index 100% rename from app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0.2-1.6.0.0.3.php rename to app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.2-1.6.0.3.php diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0.3-2.0.0.0.php b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.3-2.0.0.0.php similarity index 100% rename from app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0.3-2.0.0.0.php rename to app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.3-2.0.0.0.php diff --git a/app/code/Magento/Cms/etc/module.xml b/app/code/Magento/Cms/etc/module.xml index a1e90deba9cc7b462b0fe166c116fc98671bc0cb..0258aa60d6e0cb8e7299aa138df9c4edb622fcbb 100644 --- a/app/code/Magento/Cms/etc/module.xml +++ b/app/code/Magento/Cms/etc/module.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Cms" schema_version="2.0.0.0" active="true"> + <module name="Magento_Cms" schema_version="2.0.0.1" active="true"> <sequence> <module name="Magento_Core"/> <module name="Magento_Store"/> diff --git a/app/code/Magento/Cms/sql/cms_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/Magento/Cms/sql/cms_setup/upgrade-1.6.0.1-1.6.0.2.php similarity index 100% rename from app/code/Magento/Cms/sql/cms_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php rename to app/code/Magento/Cms/sql/cms_setup/upgrade-1.6.0.1-1.6.0.2.php diff --git a/app/code/Magento/Cms/sql/cms_setup/upgrade-2.0.0.0-2.0.0.1.php b/app/code/Magento/Cms/sql/cms_setup/upgrade-2.0.0.0-2.0.0.1.php new file mode 100644 index 0000000000000000000000000000000000000000..fd2d029f7e897a0e8cb900f564f5bfb1afa018d3 --- /dev/null +++ b/app/code/Magento/Cms/sql/cms_setup/upgrade-2.0.0.0-2.0.0.1.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer \Magento\Framework\Module\Setup */ +$installer = $this; + +$installer->startSetup(); +$connection = $installer->getConnection(); + +/** + * Rename column "root_template" into "page_layout" + */ +$connection->changeColumn( + $installer->getTable('cms_page'), + 'root_template', + 'page_layout', + [ + 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 'length' => 255, + 'nullable' => true, + 'comment' => 'Page Layout' + ] +); + +$installer->endSetup(); diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml index 9568b096e8d4fb8a93e312377517b60af1691c96..311554cd27d0e30495eff1f0865b8bda3d13e583 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="editor"/> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> @@ -40,4 +40,4 @@ <referenceContainer name="content"> <block class="Magento\Cms\Block\Adminhtml\Block\Edit" name="cms_block_edit"/> </referenceContainer> -</layout> \ No newline at end of file +</page> \ No newline at end of file diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml index ba39fb8c8798acf58e2896385b8c0d2a485dd811..db432ae388337048653afa631c1f2549ea04096f 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Cms\Block\Adminhtml\Block" name="cms_block"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.cms.block.grid" as="grid"> @@ -106,4 +106,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_new.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_new.xml index 2480a9c5081d135679863aefb88e8adab86d5392..01ca2f6dc4f204e3b27414d882e610397eb9cdb1 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_new.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_new.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="cms_block_edit"/> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml index bd330c01a4015de83d9e48177f0eee125ab922e7..c80aed98c482ea8a21a257b5dd522beec21cb8c4 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> @@ -64,4 +64,4 @@ </action> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml index b1203d7a33ee9022b03829adb2a8d2699535b43a..0ade3cda6558a3f45e78900ab0c5c71e6ad5d2d9 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Cms\Block\Adminhtml\Page" name="cms_page"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_new.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_new.xml index 98e46138cb1201db1bd301490b323a27409908ff..98b741cc5da044cef1a124c2ff89612c3917e2b8 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_new.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_new.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="cms_page_edit"/> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_contents.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_contents.xml index e9c0f40ee715f6422fec623c23df9064195af022..718e5353d60a662809728110b79795ace5dae6aa 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_contents.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_contents.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files" name="wysiwyg_images.files" template="browser/content/files.phtml" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files" name="wysiwyg_images.files" template="browser/content/files.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_index.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_index.xml index 0d39c082f9e318bab1c1ed334fade34616657f2a..7c8cbbcb290e973fad99b21f574bdd2d9dc97c49 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_index.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <remove name="footer"/> <remove name="head"/> <remove name="left"/> @@ -33,4 +33,4 @@ <block class="Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Uploader" name="wysiwyg_images.uploader" template="Magento_Cms::browser/content/uploader.phtml"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml index 932560b2c5fe15b2de39773e49eb3c4752a7273b..9de082fb7429278bb6ab7bd7dd2b3e6ad767ad84 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml @@ -23,13 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="default_home_page" template="Magento_Cms::default/home.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml index 7fd06112dc1a6ab547728502ae7800c4fa2e345b..6f358ae111abc63e8d0b990338bdde7b973fbc78 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml @@ -23,13 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="default_no_route" template="Magento_Cms::default/no-route.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..65d1bc0c6d95521988f2a57d50e185ad4965b9e9 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml b/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml index 405118832b1c666f9f163fbe5bdd2b36996a50ea..b665dcf4f6408411b5d2fab12f17dd7a9769a6b9 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Cms\Block\Page" name="cms_page"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/frontend/layout/default.xml b/app/code/Magento/Cms/view/frontend/layout/default.xml index c26c7b1b4108fb2245075b2b7dbbae8ea3e28cb5..2680f611724a8e07476e06213389cafec2ca5e6d 100644 --- a/app/code/Magento/Cms/view/frontend/layout/default.xml +++ b/app/code/Magento/Cms/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="footer"> <container name="cms_footer_links_container" label="CMS Footer Links" htmlTag="div" htmlClass="links" before="footer_links"> <block class="Magento\Cms\Block\Block" name="cms_footer_links"> @@ -33,4 +33,4 @@ </block> </container> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Cms/view/frontend/layout/print.xml b/app/code/Magento/Cms/view/frontend/layout/print.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/Cms/view/frontend/layout/print.xml +++ b/app/code/Magento/Cms/view/frontend/layout/print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index ee8135442f53429dadadd8c16677e1a5e4aa45a3..063c9c841c1187a0f567100914c131db8ad6b647 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-url-redirect": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91" + "magento/module-store": "0.1.0-alpha92", + "magento/module-url-redirect": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index e73c6a4fc6212bc3dbac4d193c4bddc03ba04bfb..08c3e7ac715263d1dd7be9c0f88cc108a9b1ef0b 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-catalog-import-export": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-import-export": "0.1.0-alpha91", - "magento/module-configurable-product": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91" + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-catalog-import-export": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-import-export": "0.1.0-alpha92", + "magento/module-configurable-product": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php index ef1473a86ba08c9e0ca8753d19097657b85a443a..c3b8abf590a7f50ffffe944ce52626d351162f11 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php @@ -70,7 +70,10 @@ class Configurable extends \Magento\Framework\Model\Resource\Db\AbstractDb $mainProductId = $mainProduct->getId(); $isProductInstance = true; } - $old = $mainProduct->getTypeInstance()->getUsedProductIds($mainProduct); + $old = array(); + if (!$mainProduct->getIsDuplicate()) { + $old = $mainProduct->getTypeInstance()->getUsedProductIds($mainProduct); + } $insert = array_diff($productIds, $old); $delete = array_diff($old, $productIds); diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 5ccabdd7a7a8a735e1309220e4720f4030e791c8..b11cab300cbf808ce0405960bb47d495b58afcd9 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -3,25 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-catalog-rule": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-weee": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", - "magento/module-webapi": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-catalog-rule": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-weee": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", + "magento/module-webapi": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit.xml index 4d516b6ee8b62cb871156ae02ef9e99bf9f5b5e1..853f9abf1e1110700c28b5d2a42613cf6ce4f445 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" name="attribute_edit_js_configurable" template="Magento_ConfigurableProduct::catalog/product/attribute/js.phtml" after="attribute_edit_js"/> </referenceContainer> -</layout> +</page> 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 e4ed2d3074e5b5ed5adf90a2d527a1398b93d5dd..7b05745a67be03fdc0b7c0021edb182af58e9c4b 100644 --- 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <remove name="left"/> <referenceBlock name="attribute_edit_content"> <arguments> @@ -37,4 +37,4 @@ <block class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front" as="front-options"/> </container> </referenceBlock> -</layout> +</page> 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 a632971d08dc2d145100837495d9e4cf5721d160..cf299a6cb02440c71c8c97c776b993b12aed53ec 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_superconfig_config"/> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="magento-grouped-product-css-grouped-product-css"> @@ -45,4 +45,4 @@ <argument name="block" xsi:type="string">admin.product.edit.tab.super.config.grid.container</argument> </action> </referenceBlock> -</layout> +</page> 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 904215ea3a970df7fa275091dfad9dd9a267efcc..386ab12e51ec25d09e727d89e6120d56bf76276d 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_superconfig_config"/> <referenceBlock name="product_tabs"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config" name="admin.product.edit.tab.super.config.grid.container"> @@ -38,4 +38,4 @@ <argument name="block" xsi:type="string">admin.product.edit.tab.super.config.grid.container</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_generatevariations_index.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_generatevariations_index.xml index d6bafe5262056ef67ed3a7f8d71155f9a78d2007..a891595b108e582f6345fe26a8b17ebbf89049ae 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_generatevariations_index.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_generatevariations_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config" template="Magento_ConfigurableProduct::catalog/product/edit/super/generator.phtml" name="product-variations-generator" as="generator"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config" template="Magento_ConfigurableProduct::catalog/product/edit/super/attribute-js-template.phtml" as="template"/> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config\Attribute" template="Magento_ConfigurableProduct::catalog/product/edit/super/attribute-template.phtml" as="attribute-renderer"/> 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 5c6bfe6e98c13f20525c8f3ad05a128f6e3a6b5f..151948983939bb5fb0bf5e30ddad09add1f3e4f6 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="js"> <block class="Magento\ConfigurableProduct\Block\Product\Configurable\AttributeSelector" template="product/configurable/attribute-selector/js.phtml"/> <block class="Magento\ConfigurableProduct\Block\Product\Configurable\AttributeSelector" template="product/configurable/affected-attribute-set-selector/js.phtml"/> @@ -39,4 +39,4 @@ <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="affected-attribute-set-form" template="Magento_ConfigurableProduct::product/configurable/affected-attribute-set-selector/form.phtml"/> </referenceContainer> -</layout> +</page> 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 bda502fb07eea29861f36959b4df7367ade4b73a..572ff0bbe75e53e12830797d219b30bf0a5ff7ee 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Backend\Block\Template" name="adminhtml.catalog.product.set.edit.configurable" template="Magento_ConfigurableProduct::catalog/product/attribute/set/js.phtml" after="adminhtml.catalog.product.set.edit"/> </referenceContainer> -</layout> +</page> 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 904215ea3a970df7fa275091dfad9dd9a267efcc..386ab12e51ec25d09e727d89e6120d56bf76276d 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_superconfig_config"/> <referenceBlock name="product_tabs"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config" name="admin.product.edit.tab.super.config.grid.container"> @@ -38,4 +38,4 @@ <argument name="block" xsi:type="string">admin.product.edit.tab.super.config.grid.container</argument> </action> </referenceBlock> -</layout> +</page> 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 a5189c8767fc63d1139b334589c3bd2648060018..3d55a7decd045743267c64cda9a97313cd4d3ef7 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="admin.product.edit.tab.super.config.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="admin.product.edit.tab.super.config.grid" as="grid"> <arguments> @@ -119,4 +119,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_index.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_index.xml index 77c4e886d1f011cd30d95d7915a544de34afcabf..ebae1ddde3278db8eb422df5150a3b704d9bb2a4 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_index.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_index.xml @@ -23,7 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="catalog_product_superconfig_config"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="admin.product.edit.tab.super.config.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="admin.product.edit.tab.super.config.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 d44df69b0fe2c4c55e43b078ce0315800601a110..8ae8aa4f5f8cb47b355700ecc0982e76e12733de 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product.composite.fieldset"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Composite\Fieldset\Configurable" name="product.composite.fieldset.configurable" before="product.composite.fieldset.options" template="catalog/product/composite/fieldset/configurable.phtml"/> </referenceBlock> -</layout> +</page> 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 904215ea3a970df7fa275091dfad9dd9a267efcc..386ab12e51ec25d09e727d89e6120d56bf76276d 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_superconfig_config"/> <referenceBlock name="product_tabs"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config" name="admin.product.edit.tab.super.config.grid.container"> @@ -38,4 +38,4 @@ <argument name="block" xsi:type="string">admin.product.edit.tab.super.config.grid.container</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml index cdd1018c2c51f6797aeb5a59a619bb060106e4a3..edeaf4bfebc661b5cdca8e236ee7bef0d43231b3 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml @@ -24,7 +24,7 @@ */ ?> <script type="text/javascript"> - +require(['jquery'], function(){ ConfigurableNodeExists = function(currentNode) { for (var i in currentNode.childNodes ) { if (currentNode.childNodes[i].id) { @@ -36,7 +36,6 @@ ConfigurableNodeExists = function(currentNode) { } return false; }; -var editSet = editSet; editSet.submit = editSet.submit.wrap(function(original) { if (editSet.currentNode){ @@ -64,4 +63,5 @@ editSet.rightBeforeInsert = editSet.rightBeforeInsert.wrap(function(original, tr return original(tree, nodeThis, node, newParent); }); +}); </script> 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 1e51e658aae43020d1897704e50c29e91558a0ac..a8a78e7adde0e22118476a623ea4173ed64a4891 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="configurableproduct_product_view_head_components" template="Magento_ConfigurableProduct::js/components.phtml"/> </referenceBlock> - <referenceBlock name="root"> + <referenceBlock name="body.class"> <action method="addBodyClass"> <argument name="value" xsi:type="string">type-configurable</argument> </action> @@ -41,4 +41,4 @@ <referenceBlock name="product.info.options.wrapper"> <block class="Magento\ConfigurableProduct\Block\Product\View\Type\Configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="product/view/type/options/configurable.phtml"/> </referenceBlock> -</layout> +</page> 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 d334a00c34b0d3d7635548b6727182e6f74ae6f2..85eaee5def3f8a109ec255d5759114ffd82608a9 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 @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_view_type_configurable"/> -</layout> +</page> 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 2a37dd9f5812299ccd561ef3de9fac36932316c4..0bcc29df90eb60bcc78f650a28c55726bd0f9652 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\ConfigurableProduct\Block\Cart\Item\Renderer\Configurable" as="configurable" template="Magento_Checkout::cart/item/default.phtml" cacheable="false"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml index a51de710b43d0eb33531c20f2293c38474a93d12..72cbd1100f2fa2ceecbf6971cc1abccd37afc693 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.sidebar.item.renderers"> <block class="Magento\ConfigurableProduct\Block\Cart\Item\Renderer\Configurable" as="configurable" template="Magento_Checkout::cart/sidebar/default.phtml"/> </referenceBlock> -</layout> +</page> 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 28c3324f98fd9be3a08168af5cc19061d217349b..fb1dae71689231e5a82fc55f91e284785b81699c 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\ConfigurableProduct\Block\Cart\Item\Renderer\Configurable" as="configurable" template="Magento_Checkout::onepage/review/item.phtml" cacheable="false"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index bd64a3c22e5a66ba8f81e30ce15f9f733738b090..f81900d3c2d0df74ea649d584da1df479482a1f8 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 38834c9ac0e0a0e290b280be8ec02dc26a4dcbf2..db2198aa74737db1ee66afc6fa277a9e56100db6 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 @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Contact Us</argument> @@ -35,4 +34,4 @@ <container name="form.additional.info" label="Form Additional Info"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Contact/view/frontend/layout/default.xml b/app/code/Magento/Contact/view/frontend/layout/default.xml index 816ff288aa08eed57cf9184fe6549262bfe45248..c3c7f733943a4a29069bd73a407ce09acd16a980 100644 --- a/app/code/Magento/Contact/view/frontend/layout/default.xml +++ b/app/code/Magento/Contact/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="footer_links"> <block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="contact/contact/enabled" name="contact-us-link"> @@ -33,4 +33,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index 55787f7501a449973852b078ba669716f080197c..6130f3a4289233dc7168e54484c685600a1a9904 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -23,25 +23,23 @@ */ namespace Magento\Core\Model\Layout; +use \Magento\Core\Model\Layout\Update\Validator; + /** * Layout merge model */ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface { - /**#@+ + /** * Layout abstraction based on designer prerogative. */ const DESIGN_ABSTRACTION_CUSTOM = 'custom'; - /**#@-*/ - - /**#@+ + /** * Layout generalization guaranteed to load into View */ const DESIGN_ABSTRACTION_PAGE_LAYOUT = 'page_layout'; - /**#@-*/ - /** * XPath of handles originally declared in layout updates */ @@ -274,6 +272,39 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface return (bool)$this->_getPageHandleNode($handleName); } + /** + * Get declared page layout for current handles + * + * @return null|string + */ + public function getPageLayout() + { + $defaultPageLayout = null; + $layoutXml = $this->getFileLayoutUpdatesXml(); + foreach ($this->getHandles() as $handle) { + foreach ($layoutXml->xpath("handle[@id='{$handle}'][@layout]") as $updateXml) { + $defaultPageLayout = (string)$updateXml['layout']; + } + } + return $defaultPageLayout; + } + + /** + * Check current handles if layout was defined on it + * + * @return bool + */ + public function isLayoutDefined() + { + $fullLayoutXml = $this->getFileLayoutUpdatesXml(); + foreach ($this->getHandles() as $handle) { + if ($fullLayoutXml->xpath("layout[@id='{$handle}']")) { + return true; + } + } + return false; + } + /** * Get handle xml node by handle name * @@ -383,23 +414,30 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface } $layout = $this->asString(); + $this->_validateMergedLayout($cacheId, $layout); + $this->_saveCache($layout, $cacheId, $this->getHandles()); + return $this; + } + + /** + * Validate merged layout + * + * @param string $cacheId + * @param string $layout + * @return $this + */ + protected function _validateMergedLayout($cacheId, $layout) + { $layoutStr = '<handle id="handle">' . $layout . '</handle>'; if ($this->_appState->getMode() === \Magento\Framework\App\State::MODE_DEVELOPER) { - if (!$this->_layoutValidator->isValid( - $layoutStr, - \Magento\Core\Model\Layout\Update\Validator::LAYOUT_SCHEMA_MERGED, - false - ) - ) { + if (!$this->_layoutValidator->isValid($layoutStr, Validator::LAYOUT_SCHEMA_MERGED, false)) { $messages = $this->_layoutValidator->getMessages(); //Add first message to exception - $message = array_shift($messages); + $message = reset($messages); $this->_logger->addStreamLog(\Magento\Framework\Logger::LOGGER_SYSTEM); $this->_logger->log('Cache file with merged layout: ' . $cacheId . ': ' . $message, \Zend_Log::ERR); } } - - $this->_saveCache($layout, $cacheId, $this->getHandles()); return $this; } @@ -411,11 +449,10 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface public function asSimplexml() { $updates = trim($this->asString()); - $updates = '<' . - '?xml version="1.0"?' . - '><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . - $updates . - '</layout>'; + $updates = '<?xml version="1.0"?>' + . '<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' + . $updates + . '</layout>'; return $this->_loadXmlString($updates); } @@ -456,7 +493,7 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface $_profilerKey = 'layout_package_update:' . $handle; \Magento\Framework\Profiler::start($_profilerKey); $layout = $this->getFileLayoutUpdatesXml(); - foreach ($layout->xpath("handle[@id='{$handle}']") as $updateXml) { + foreach ($layout->xpath("*[self::handle or self::layout][@id='{$handle}']") as $updateXml) { $this->_fetchRecursiveUpdates($updateXml); $this->addUpdate($updateXml->innerXml()); } @@ -630,8 +667,9 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface ); } $handleName = basename($file->getFilename(), '.xml'); - $handleAttributes = 'id="' . $handleName . '"' . $this->_renderXmlAttributes($fileXml); - $handleStr = '<handle ' . $handleAttributes . '>' . $fileXml->innerXml() . '</handle>'; + $tagName = $fileXml->getName() === 'layout' ? 'layout' : 'handle'; + $handleAttributes = ' id="' . $handleName . '"' . $this->_renderXmlAttributes($fileXml); + $handleStr = '<' . $tagName . $handleAttributes . '>' . $fileXml->innerXml() . '</' . $tagName . '>'; $layoutStr .= $handleStr; } libxml_use_internal_errors($useErrors); diff --git a/app/code/Magento/Core/Model/PageLayout/Config/Builder.php b/app/code/Magento/Core/Model/PageLayout/Config/Builder.php new file mode 100644 index 0000000000000000000000000000000000000000..0d6fafdf6abda76aad3a764b44e7d18eb42e2744 --- /dev/null +++ b/app/code/Magento/Core/Model/PageLayout/Config/Builder.php @@ -0,0 +1,86 @@ +<?php +/** + * Magento validator config factory + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\PageLayout\Config; + +/** + * Page layout config builder + */ +class Builder +{ + /** + * @var \Magento\Framework\ObjectManager + */ + protected $objectManager; + + /** + * @var \Magento\Framework\View\PageLayout\File\Collector\Aggregated + */ + protected $fileCollector; + + /** + * @var \Magento\Core\Model\Resource\Theme\Collection + */ + protected $themeCollection; + + /** + * @param \Magento\Framework\ObjectManager $objectManager + * @param \Magento\Framework\View\PageLayout\File\Collector\Aggregated $fileCollector + * @param \Magento\Core\Model\Resource\Theme\Collection $themeCollection + */ + public function __construct( + \Magento\Framework\ObjectManager $objectManager, + \Magento\Framework\View\PageLayout\File\Collector\Aggregated $fileCollector, + \Magento\Core\Model\Resource\Theme\Collection $themeCollection + ) { + $this->objectManager = $objectManager; + $this->fileCollector = $fileCollector; + $this->themeCollection = $themeCollection; + } + + /** + * @return \Magento\Framework\View\PageLayout\Config + */ + public function getPageLayoutsConfig() + { + return $this->objectManager->create( + 'Magento\Framework\View\PageLayout\Config', + array('configFiles' => $this->getConfigFiles()) + ); + } + + /** + * @return array + */ + protected function getConfigFiles() + { + $configFiles = []; + foreach ($this->themeCollection->loadRegisteredThemes() as $theme) { + $configFiles = array_merge($configFiles, $this->fileCollector->getFilesContent($theme, 'layouts.xml')); + } + + return $configFiles; + } +} diff --git a/app/code/Magento/Core/Model/Resource/Theme/Collection.php b/app/code/Magento/Core/Model/Resource/Theme/Collection.php index ff95197fc57f62fdc39e4555666e24a9f2f62193..495b31a20d391f1ebfc4d3f3779406cab4d58436 100644 --- a/app/code/Magento/Core/Model/Resource/Theme/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Theme/Collection.php @@ -232,13 +232,17 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function getLabels() { - $this->_reset()->clear(); - $labels = $this->setOrder( - 'theme_title', - \Magento\Framework\Data\Collection::SORT_ORDER_ASC - )->filterVisibleThemes()->addAreaFilter( - \Magento\Framework\App\Area::AREA_FRONTEND - ); + $labels = $this->loadRegisteredThemes(); return $labels->toOptionArray(); } + + /** + * @return $this + */ + public function loadRegisteredThemes() + { + $this->_reset()->clear(); + return $this->setOrder('theme_title', \Magento\Framework\Data\Collection::SORT_ORDER_ASC) + ->filterVisibleThemes()->addAreaFilter(\Magento\Framework\App\Area::AREA_FRONTEND); + } } diff --git a/app/code/Magento/Core/composer.json b/app/code/Magento/Core/composer.json index fe40e8dd03b1d6a41c33f04f2cc7441ac28baae7..80b3c122eff41676534478c803131b0849d9ad40 100644 --- a/app/code/Magento/Core/composer.json +++ b/app/code/Magento/Core/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-cron": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-page-cache": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-cron": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-page-cache": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Core/etc/di.xml b/app/code/Magento/Core/etc/di.xml index 11f0d9edf03e39fb0d1b470b35d79b41db17765a..ea46458a942b9a0c127ee2d0f8c64f0f63db427b 100644 --- a/app/code/Magento/Core/etc/di.xml +++ b/app/code/Magento/Core/etc/di.xml @@ -201,6 +201,71 @@ </arguments> </type> + <virtualType name="pageFileSourceBase" type="Magento\Framework\View\File\Collector\Base"/> + <virtualType name="pageFileSourceBaseFiltered" type="Magento\Framework\View\File\Collector\Decorator\ModuleOutput"> + <arguments> + <argument name="subject" xsi:type="object">pageFileSourceBase</argument> + </arguments> + </virtualType> + <virtualType name="pageFileSourceBaseSorted" type="Magento\Framework\View\File\Collector\Decorator\ModuleDependency"> + <arguments> + <argument name="subject" xsi:type="object">pageFileSourceBaseFiltered</argument> + </arguments> + </virtualType> + + <virtualType name="pageFileSourceTheme" type="Magento\Framework\View\File\Collector\ThemeModular"/> + <virtualType name="pageFileSourceThemeFiltered" type="Magento\Framework\View\File\Collector\Decorator\ModuleOutput"> + <arguments> + <argument name="subject" xsi:type="object">pageFileSourceTheme</argument> + </arguments> + </virtualType> + <virtualType name="pageFileSourceThemeSorted" type="Magento\Framework\View\File\Collector\Decorator\ModuleDependency"> + <arguments> + <argument name="subject" xsi:type="object">pageFileSourceThemeFiltered</argument> + </arguments> + </virtualType> + + <virtualType name="pageFileSourceOverrideBase" type="Magento\Framework\View\File\Collector\Override\Base"> + <arguments> + <argument name="subDir" xsi:type="string">page/override</argument> + </arguments> + </virtualType> + <virtualType name="pageFileSourceOverrideBaseFiltered" type="Magento\Framework\View\File\Collector\Decorator\ModuleOutput"> + <arguments> + <argument name="subject" xsi:type="object">pageFileSourceOverrideBase</argument> + </arguments> + </virtualType> + <virtualType name="pageFileSourceOverrideBaseSorted" type="Magento\Framework\View\File\Collector\Decorator\ModuleDependency"> + <arguments> + <argument name="subject" xsi:type="object">pageFileSourceOverrideBaseFiltered</argument> + </arguments> + </virtualType> + + <virtualType name="pageFileSourceOverrideTheme" type="Magento\Framework\View\File\Collector\Override\ThemeModular"> + <arguments> + <argument name="subDir" xsi:type="string">override/theme</argument> + </arguments> + </virtualType> + <virtualType name="pageFileSourceOverrideThemeFiltered" type="Magento\Framework\View\File\Collector\Decorator\ModuleOutput"> + <arguments> + <argument name="subject" xsi:type="object">pageFileSourceOverrideTheme</argument> + </arguments> + </virtualType> + <virtualType name="pageFileSourceOverrideThemeSorted" type="Magento\Framework\View\File\Collector\Decorator\ModuleDependency"> + <arguments> + <argument name="subject" xsi:type="object">pageFileSourceOverrideThemeFiltered</argument> + </arguments> + </virtualType> + + <type name="Magento\Framework\View\PageLayout\File\Collector\Aggregated"> + <arguments> + <argument name="baseFiles" xsi:type="object">pageFileSourceBaseSorted</argument> + <argument name="themeFiles" xsi:type="object">pageFileSourceThemeSorted</argument> + <argument name="overrideBaseFiles" xsi:type="object">pageFileSourceOverrideBaseSorted</argument> + <argument name="overrideThemeFiles" xsi:type="object">pageFileSourceOverrideThemeSorted</argument> + </arguments> + </type> + <type name="Magento\Framework\View\Design\Theme\Image"> <arguments> <argument name="uploader" xsi:type="object">Magento\Framework\View\Design\Theme\Image\Uploader\Proxy</argument> diff --git a/app/code/Magento/Core/etc/layout_generic.xsd b/app/code/Magento/Core/etc/layout_generic.xsd new file mode 100644 index 0000000000000000000000000000000000000000..97d7c1e83828ba23946950095746d0c8e2a9b039 --- /dev/null +++ b/app/code/Magento/Core/etc/layout_generic.xsd @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:include schemaLocation="page.xsd"/> + + <xs:element name="layout" type="pageType"/> +</xs:schema> diff --git a/app/code/Magento/Core/etc/layout_single.xsd b/app/code/Magento/Core/etc/layout_single.xsd index 04802a80e44ad41cdefdec823aec135fd5902253..c67ef1a8d07a062199524d88910eb6e022e3db0a 100644 --- a/app/code/Magento/Core/etc/layout_single.xsd +++ b/app/code/Magento/Core/etc/layout_single.xsd @@ -27,10 +27,6 @@ <xs:include schemaLocation="layouts.xsd"/> <xs:element name="layout" type="layoutType"> - <xs:unique name="blockKey"> - <xs:selector xpath=".//block"/> - <xs:field xpath="@name"/> - </xs:unique> <xs:unique name="containerKey"> <xs:selector xpath=".//container"/> <xs:field xpath="@name"/> diff --git a/app/code/Magento/Core/etc/layouts.xsd b/app/code/Magento/Core/etc/layouts.xsd index 25b19855ff7868d1d8447677e61aab6d3b0bdca2..cbaf7c5a2bf6482579ee7a85ddd7cf04a667201c 100644 --- a/app/code/Magento/Core/etc/layouts.xsd +++ b/app/code/Magento/Core/etc/layouts.xsd @@ -82,23 +82,12 @@ </xs:documentation> </xs:annotation> <xs:sequence minOccurs="0" maxOccurs="unbounded"> - <xs:element ref="referenceBlock" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="referenceContainer" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="container" minOccurs="0" maxOccurs="unbounded"/> - <xs:element ref="block" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="update" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="remove" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="move" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> - <xs:attribute type="xs:string" name="label"/> - <xs:attribute name="design_abstraction"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="custom"/> - <xs:enumeration value="page_layout"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> </xs:complexType> <xs:complexType name="updaterType"> @@ -191,7 +180,7 @@ <xs:simpleType name="htmlIdentifierType"> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z][a-zA-Z\d\-_]*"/> + <xs:pattern value="[a-zA-Z][a-zA-Z\d\-_:]*"/> </xs:restriction> </xs:simpleType> diff --git a/app/code/Magento/Core/etc/page.xsd b/app/code/Magento/Core/etc/page.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1d4a4e6b766a69c2fa87b9913b3096e1b0bc40e1 --- /dev/null +++ b/app/code/Magento/Core/etc/page.xsd @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:include schemaLocation="layouts.xsd"/> + + <xs:element name="page" type="pageType"> + <xs:unique name="blockKey"> + <xs:selector xpath=".//block"/> + <xs:field xpath="@name"/> + </xs:unique> + <xs:unique name="containerKey"> + <xs:selector xpath=".//container"/> + <xs:field xpath="@name"/> + </xs:unique> + </xs:element> + + <xs:complexType name="pageType"> + <xs:sequence minOccurs="0" maxOccurs="unbounded"> + <xs:element ref="block" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="referenceBlock" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="referenceContainer" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="container" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="update" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="remove" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="move" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute type="xs:string" name="layout" /> + <xs:attribute type="xs:string" name="label" /> + <xs:attribute type="xs:string" name="design_abstraction" /> + </xs:complexType> +</xs:schema> diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index aa23e8c2982ee50e4de1956135253f5f1afd845b..03e0ba310796c450fa9a2d0b490e913cba8d3c26 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index e4057a028bf553af9e2e15f7592720b846f6da72..35f434b91f02aa36d4762fdf2c802e3832f5492d 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-page-cache": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-page-cache": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 0d4fb588e5bcdb518bd3f7be5377ce764f202f80..813f219c3fed676b80936722b0a6287d07cba9d0 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\CurrencySymbol\Block\Adminhtml\System\Currencysymbol" name="mage.system.currencysymbol" template="grid.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php index bb357c8462c2e08da75ba464a5604a53ae81f5d3..f6ee9c74ab7008d4317f0b71f6a1d74bbb2c737c 100644 --- a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php @@ -50,9 +50,9 @@ class DefaultRenderer extends AbstractBlock implements RendererInterface protected $_countryFactory; /** - * @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface + * @var \Magento\Customer\Service\V1\AddressMetadataServiceInterface */ - protected $_metadataService; + protected $_addressMetadataService; /** * Address converter @@ -68,7 +68,7 @@ class DefaultRenderer extends AbstractBlock implements RendererInterface * @param ElementFactory $elementFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory , * @param \Magento\Customer\Model\Address\Converter $addressConverter - * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $metadataService + * @param \Magento\Customer\Service\V1\AddressMetadataServiceInterface $metadataService * @param array $data */ public function __construct( @@ -76,13 +76,13 @@ class DefaultRenderer extends AbstractBlock implements RendererInterface ElementFactory $elementFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Customer\Model\Address\Converter $addressConverter, - \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $metadataService, + \Magento\Customer\Service\V1\AddressMetadataServiceInterface $metadataService, array $data = array() ) { $this->_elementFactory = $elementFactory; $this->_addressConverter = $addressConverter; $this->_countryFactory = $countryFactory; - $this->_metadataService = $metadataService; + $this->_addressMetadataService = $metadataService; parent::__construct($context, $data); $this->_isScopePrivate = true; } @@ -175,7 +175,7 @@ class DefaultRenderer extends AbstractBlock implements RendererInterface break; } - $attributesMetadata = $this->_metadataService->getAllAddressAttributeMetadata(); + $attributesMetadata = $this->_addressMetadataService->getAllAttributesMetadata(); $data = array(); foreach ($attributesMetadata as $attributeMetadata) { if (!$attributeMetadata->isVisible()) { diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit.php b/app/code/Magento/Customer/Block/Adminhtml/Edit.php index 0f67142df521851e028a2d42913b0b8b1d4b0ef8..f81a10eeface4646982956d8f938fca2f699e726 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit.php @@ -119,6 +119,20 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container 0 ); } + + if ($customerId) { + $url = $this->getUrl('customer/customer/invalidateToken', array('customer_id' => $customerId)); + $deleteConfirmMsg = __("Are you sure you want to revoke the customer\'s tokens?"); + $this->buttonList->add( + 'invalidate_token', + array( + 'label' => __('Force Sign-In'), + 'onclick' => 'deleteConfirm(\'' . $deleteConfirmMsg . '\', \'' . $url . '\')', + 'class' => 'invalidate-token' + ), + 10 + ); + } } /** diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php index f7ffe9e1333bd774c30b01e3259a7f6dc5e880bc..e0bc00510a3c8cca150085538d40c96daba0585b 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php @@ -370,7 +370,7 @@ class Account extends GenericMetadata $confirmationStatus = $this->_customerAccountService->getConfirmationStatus($customerData->getId()); $confirmationKey = $customerData->getConfirmation(); if ($confirmationStatus != CustomerAccountServiceInterface::ACCOUNT_CONFIRMED) { - $confirmationAttr = $this->_customerMetadataService->getCustomerAttributeMetadata('confirmation'); + $confirmationAttr = $this->_customerMetadataService->getAttributeMetadata('confirmation'); if (!$confirmationKey) { $confirmationKey = $this->_getRandomConfirmationKey(); } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php index 9cc44e03b3822262bf755ec7aa4b454e060582ed..7d250dda2cbfb146c59bfb13cdc0ed540e35586e 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php @@ -24,6 +24,7 @@ namespace Magento\Customer\Block\Adminhtml\Edit\Tab; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface; use Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder; use Magento\Customer\Service\V1\Data\Address; use Magento\Customer\Service\V1\CustomerAccountServiceInterface; @@ -74,8 +75,8 @@ class Addresses extends GenericMetadata /** @var CustomerAccountServiceInterface */ protected $_customerAccountService; - /** @var CustomerMetadataServiceInterface */ - protected $_metadataService; + /** @var AddressMetadataServiceInterface */ + protected $_addressMetadataService; /** @var AddressBuilder */ protected $_addressBuilder; @@ -98,7 +99,7 @@ class Addresses extends GenericMetadata * @param \Magento\Customer\Helper\Data $customerHelper * @param \Magento\Customer\Helper\Address $addressHelper * @param \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerAccountService - * @param CustomerMetadataServiceInterface $metadataService + * @param AddressMetadataServiceInterface $addressMetadataService * @param AddressBuilder $addressBuilder * @param CustomerBuilder $customerBuilder * @param AttributeMetadataBuilder $attributeMetadataBuilder @@ -119,7 +120,7 @@ class Addresses extends GenericMetadata \Magento\Customer\Helper\Data $customerHelper, \Magento\Customer\Helper\Address $addressHelper, CustomerAccountServiceInterface $customerAccountService, - CustomerMetadataServiceInterface $metadataService, + AddressMetadataServiceInterface $addressMetadataService, AddressBuilder $addressBuilder, CustomerBuilder $customerBuilder, AttributeMetadataBuilder $attributeMetadataBuilder, @@ -134,7 +135,7 @@ class Addresses extends GenericMetadata $this->_metadataFormFactory = $metadataFormFactory; $this->_systemStore = $systemStore; $this->_customerAccountService = $customerAccountService; - $this->_metadataService = $metadataService; + $this->_addressMetadataService = $addressMetadataService; $this->_addressBuilder = $addressBuilder; $this->_customerBuilder = $customerBuilder; $this->_attributeMetadataBuilder = $attributeMetadataBuilder; @@ -294,7 +295,7 @@ class Addresses extends GenericMetadata } if ($this->isReadonly()) { - foreach ($this->_metadataService->getAllAddressAttributeMetadata() as $attribute) { + foreach ($this->_addressMetadataService->getAllAttributesMetadata() as $attribute) { $element = $form->getElement($attribute->getAttributeCode()); if ($element) { $element->setReadonly(true, true); diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php index 3b3de968a0ac239fe90578d53022f135a13badcf..8a632a02aafe6f8e532871018cd9d052f7ac888f 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php @@ -218,7 +218,7 @@ class View extends \Magento\Backend\Block\Template implements \Magento\Backend\B { $date = $this->_localeDate->scopeDate( $this->getCustomer()->getStoreId(), - $this->getCustomer()->getCreatedAt(), + $this->dateTime->toTimestamp($this->getCustomer()->getCreatedAt()), true ); return $this->formatDate($date, TimezoneInterface::FORMAT_TYPE_MEDIUM, true); diff --git a/app/code/Magento/Customer/Block/Form/Register.php b/app/code/Magento/Customer/Block/Form/Register.php index ad0df7d8d0e19717143e25f8b43fb1576ef5bb58..8c8cf2f64e5b3bce1dcf8d4ac3238cd1743d603d 100644 --- a/app/code/Magento/Customer/Block/Form/Register.php +++ b/app/code/Magento/Customer/Block/Form/Register.php @@ -100,7 +100,10 @@ class Register extends \Magento\Directory\Block\Data */ protected function _prepareLayout() { - $this->getLayout()->getBlock('head')->setTitle(__('Create New Customer Account')); + $headBlock = $this->getLayout()->getBlock('head'); + if ($headBlock) { + $headBlock->setTitle(__('Create New Customer Account')); + } return parent::_prepareLayout(); } diff --git a/app/code/Magento/Customer/Block/Widget/AbstractWidget.php b/app/code/Magento/Customer/Block/Widget/AbstractWidget.php index 1e59116179765d39e21a733ccc8e72ef5ff988f5..71debbecbc27a20f7f0b0fb121a015d29c9794a0 100644 --- a/app/code/Magento/Customer/Block/Widget/AbstractWidget.php +++ b/app/code/Magento/Customer/Block/Widget/AbstractWidget.php @@ -28,7 +28,7 @@ class AbstractWidget extends \Magento\Framework\View\Element\Template /** * @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface */ - protected $_attributeMetadata; + protected $customerMetadataService; /** * @var \Magento\Customer\Helper\Address @@ -38,17 +38,17 @@ class AbstractWidget extends \Magento\Framework\View\Element\Template /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Customer\Helper\Address $addressHelper - * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $attributeMetadata + * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Helper\Address $addressHelper, - \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $attributeMetadata, + \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService, array $data = array() ) { $this->_addressHelper = $addressHelper; - $this->_attributeMetadata = $attributeMetadata; + $this->customerMetadataService = $customerMetadataService; parent::__construct($context, $data); $this->_isScopePrivate = true; } @@ -111,7 +111,7 @@ class AbstractWidget extends \Magento\Framework\View\Element\Template protected function _getAttribute($attributeCode) { try { - return $this->_attributeMetadata->getCustomerAttributeMetadata($attributeCode); + return $this->customerMetadataService->getAttributeMetadata($attributeCode); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { return null; } diff --git a/app/code/Magento/Customer/Block/Widget/Gender.php b/app/code/Magento/Customer/Block/Widget/Gender.php index 0e7ebdc9997ffcdf0b9763faab75b22069d816bb..9654cce28d44aa1f720149793ab066e4c51d97d9 100644 --- a/app/code/Magento/Customer/Block/Widget/Gender.php +++ b/app/code/Magento/Customer/Block/Widget/Gender.php @@ -48,7 +48,7 @@ class Gender extends AbstractWidget * * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Customer\Helper\Address $addressHelper - * @param CustomerMetadataServiceInterface $attributeMetadata + * @param CustomerMetadataServiceInterface $customerMetadataService * @param CustomerAccountServiceInterface $customerAccountService * @param \Magento\Customer\Model\Session $customerSession * @param array $data @@ -56,14 +56,14 @@ class Gender extends AbstractWidget public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Helper\Address $addressHelper, - CustomerMetadataServiceInterface $attributeMetadata, + CustomerMetadataServiceInterface $customerMetadataService, CustomerAccountServiceInterface $customerAccountService, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; $this->_customerAccountService = $customerAccountService; - parent::__construct($context, $addressHelper, $attributeMetadata, $data); + parent::__construct($context, $addressHelper, $customerMetadataService, $data); $this->_isScopePrivate = true; } diff --git a/app/code/Magento/Customer/Block/Widget/Name.php b/app/code/Magento/Customer/Block/Widget/Name.php index c4ae175b5fc59a0527940e536505bc0c72226b72..74940c38f6e521576d4eae659009ea27c2559ffe 100644 --- a/app/code/Magento/Customer/Block/Widget/Name.php +++ b/app/code/Magento/Customer/Block/Widget/Name.php @@ -23,6 +23,7 @@ */ namespace Magento\Customer\Block\Widget; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface; use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; use Magento\Customer\Service\V1\Data\Customer; use Magento\Framework\View\Element\Template\Context; @@ -37,6 +38,11 @@ use Magento\Customer\Helper\Data as CustomerHelper; */ class Name extends AbstractWidget { + /** + * @var \Magento\Customer\Service\V1\AddressMetadataServiceInterface + */ + protected $_addressMetadataService; + /** * @var CustomerHelper */ @@ -45,19 +51,22 @@ class Name extends AbstractWidget /** * @param Context $context * @param AddressHelper $addressHelper - * @param CustomerMetadataServiceInterface $attributeMetadata + * @param CustomerMetadataServiceInterface $customerMetadataService + * @param AddressMetadataServiceInterface $addressMetadataService * @param CustomerHelper $customerHelper * @param array $data */ public function __construct( Context $context, AddressHelper $addressHelper, - CustomerMetadataServiceInterface $attributeMetadata, + CustomerMetadataServiceInterface $customerMetadataService, + AddressMetadataServiceInterface $addressMetadataService, CustomerHelper $customerHelper, array $data = array() ) { $this->_customerHelper = $customerHelper; - parent::__construct($context, $addressHelper, $attributeMetadata, $data); + parent::__construct($context, $addressHelper, $customerMetadataService, $data); + $this->_addressMetadataService = $addressMetadataService; $this->_isScopePrivate = true; } @@ -216,7 +225,7 @@ class Name extends AbstractWidget } try { - $attribute = $this->_attributeMetadata->getAddressAttributeMetadata($attributeCode); + $attribute = $this->_addressMetadataService->getAttributeMetadata($attributeCode); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { return null; } diff --git a/app/code/Magento/Customer/Block/Widget/Taxvat.php b/app/code/Magento/Customer/Block/Widget/Taxvat.php index 78754b91be5f1a90a008233fd8ee843d48913b5f..086431070d0e240a774dc3e2ff190c274c1655cf 100644 --- a/app/code/Magento/Customer/Block/Widget/Taxvat.php +++ b/app/code/Magento/Customer/Block/Widget/Taxvat.php @@ -34,16 +34,16 @@ class Taxvat extends AbstractWidget * * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Customer\Helper\Address $addressHelper - * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $attributeMetadata + * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Helper\Address $addressHelper, - \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $attributeMetadata, + \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService, array $data = array() ) { - parent::__construct($context, $addressHelper, $attributeMetadata, $data); + parent::__construct($context, $addressHelper, $customerMetadataService, $data); $this->_isScopePrivate = true; } diff --git a/app/code/Magento/Customer/Controller/Account.php b/app/code/Magento/Customer/Controller/Account.php index dffcb758fab1f2951349ab5c4e3260d43f3cc316..235a62a4da5a218566ec77d2294a495575d9c6d6 100644 --- a/app/code/Magento/Customer/Controller/Account.php +++ b/app/code/Magento/Customer/Controller/Account.php @@ -153,6 +153,7 @@ class Account extends \Magento\Framework\App\Action\Action } else { $this->_getSession()->setNoReferer(true); } + $this->_view->getPage()->getConfig()->addBodyClass('account'); $result = parent::dispatch($request); $this->_getSession()->unsNoReferer(false); return $result; diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php b/app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php new file mode 100644 index 0000000000000000000000000000000000000000..63e0718d44097927a095f219594a863398bee631 --- /dev/null +++ b/app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php @@ -0,0 +1,63 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Controller\Adminhtml\Customer; + +use Magento\Customer\Service\V1\Data\CustomerBuilder; +use Magento\Customer\Service\V1\CustomerAddressServiceInterface; +use Magento\Customer\Service\V1\CustomerAccountServiceInterface; +use Magento\Customer\Service\V1\Data\AddressBuilder; +use Magento\Customer\Service\V1\Data\CustomerDetailsBuilder; + +/** + * Class to invalidate tokens for customers + */ +class InvalidateToken extends \Magento\Customer\Controller\Adminhtml\Index +{ + /** + * Reset customer's tokens handler + * + * @return void + */ + public function execute() + { + if ($customerId = $this->getRequest()->getParam('customer_id')) { + try { + /** @var \Magento\Integration\Service\V1\TokenService $tokenService */ + $tokenService = $this->_objectManager->get('Magento\Integration\Service\V1\TokenService'); + $tokenService->revokeCustomerAccessToken($customerId); + $this->messageManager->addSuccess(__('You have revoked the customer\'s tokens.')); + $this->_redirect('customer/index/edit', array('id' => $customerId, '_current' => true)); + return; + } catch (\Exception $e) { + $this->messageManager->addError($e->getMessage()); + $this->_redirect('customer/index/edit', array('id' => $customerId, '_current' => true)); + return; + } + } + $this->messageManager->addError(__('We can\'t find a customer to revoke.')); + $this->_redirect('customer/index/index'); + } +} diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php index 0795505f15d8c38ac92a47fc8008f46b6c0ffb33..20d7cbd68c01858c64c38f0e42aeb2b887acc21f 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php @@ -28,6 +28,7 @@ use Magento\Customer\Controller\RegistryConstants; use Magento\Customer\Service\V1\Data\Customer; use Magento\Framework\Exception\LocalizedException; use Magento\Customer\Service\V1\CustomerMetadataServiceInterface as CustomerMetadata; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface as AddressMetadata; class Save extends \Magento\Customer\Controller\Adminhtml\Index { @@ -87,7 +88,7 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index $addressData = $customerHelper->extractCustomerData( $this->getRequest(), 'adminhtml_customer_address', - CustomerMetadata::ENTITY_TYPE_ADDRESS, + AddressMetadata::ENTITY_TYPE_ADDRESS, array(), $scope ); diff --git a/app/code/Magento/Customer/Helper/Address.php b/app/code/Magento/Customer/Helper/Address.php index 2a17cc82d840c4b382f8887c5e84254caefd1d84..ea5d48d4f2f9d965dbc6cd8ddccdc954f214f5c8 100755 --- a/app/code/Magento/Customer/Helper/Address.php +++ b/app/code/Magento/Customer/Helper/Address.php @@ -91,6 +91,9 @@ class Address extends \Magento\Framework\App\Helper\AbstractHelper /** @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface */ protected $_customerMetadataService; + /** @var \Magento\Customer\Service\V1\AddressMetadataServiceInterface */ + protected $_addressMetadataService; + /** @var \Magento\Customer\Model\Address\Config*/ protected $_addressConfig; @@ -100,6 +103,7 @@ class Address extends \Magento\Framework\App\Helper\AbstractHelper * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService + * @param \Magento\Customer\Service\V1\AddressMetadataServiceInterface $addressMetadataService * @param \Magento\Customer\Model\Address\Config $addressConfig */ public function __construct( @@ -108,12 +112,14 @@ class Address extends \Magento\Framework\App\Helper\AbstractHelper \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService, + \Magento\Customer\Service\V1\AddressMetadataServiceInterface $addressMetadataService, \Magento\Customer\Model\Address\Config $addressConfig ) { $this->_blockFactory = $blockFactory; $this->_storeManager = $storeManager; $this->_scopeConfig = $scopeConfig; $this->_customerMetadataService = $customerMetadataService; + $this->_addressMetadataService = $addressMetadataService; $this->_addressConfig = $addressConfig; parent::__construct($context); } @@ -192,7 +198,7 @@ class Address extends \Magento\Framework\App\Helper\AbstractHelper { $websiteId = $this->_storeManager->getStore($store)->getWebsiteId(); if (!isset($this->_streetLines[$websiteId])) { - $attribute = $this->_customerMetadataService->getAttributeMetadata('customer_address', 'street'); + $attribute = $this->_addressMetadataService->getAttributeMetadata('street'); $lines = $attribute->getMultilineCount(); if ($lines <= 0) { @@ -251,12 +257,9 @@ class Address extends \Magento\Framework\App\Helper\AbstractHelper public function getAttributeValidationClass($attributeCode) { /** @var $attribute \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata */ - $attribute = isset( - $this->_attributes[$attributeCode] - ) ? $this->_attributes[$attributeCode] : $this->_customerMetadataService->getAttributeMetadata( - 'customer_address', - $attributeCode - ); + $attribute = isset($this->_attributes[$attributeCode]) + ? $this->_attributes[$attributeCode] + : $this->_addressMetadataService->getAttributeMetadata($attributeCode); $class = $attribute ? $attribute->getFrontendClass() : ''; if (in_array($attributeCode, array('firstname', 'middlename', 'lastname', 'prefix', 'suffix', 'taxvat'))) { if ($class && !$attribute->isVisible()) { @@ -265,7 +268,7 @@ class Address extends \Magento\Framework\App\Helper\AbstractHelper } /** @var $customerAttribute \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata */ - $customerAttribute = $this->_customerMetadataService->getAttributeMetadata('customer', $attributeCode); + $customerAttribute = $this->_customerMetadataService->getAttributeMetadata($attributeCode); $class .= $customerAttribute && $customerAttribute->isVisible() ? $customerAttribute->getFrontendClass() : ''; $class = implode(' ', array_unique(array_filter(explode(' ', $class)))); diff --git a/app/code/Magento/Customer/Helper/View.php b/app/code/Magento/Customer/Helper/View.php index cff259e17cba50bec2b5c611bbe0365ff0edb231..2c5369c82177f6821e3c4c003496c7e21c526781 100644 --- a/app/code/Magento/Customer/Helper/View.php +++ b/app/code/Magento/Customer/Helper/View.php @@ -56,21 +56,21 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper public function getCustomerName(\Magento\Customer\Service\V1\Data\Customer $customerData) { $name = ''; - $prefixMetadata = $this->_customerMetadataService->getAttributeMetadata('customer', 'prefix'); + $prefixMetadata = $this->_customerMetadataService->getAttributeMetadata('prefix'); if ($prefixMetadata->isVisible() && $customerData->getPrefix()) { $name .= $customerData->getPrefix() . ' '; } $name .= $customerData->getFirstname(); - $middleNameMetadata = $this->_customerMetadataService->getAttributeMetadata('customer', 'middlename'); + $middleNameMetadata = $this->_customerMetadataService->getAttributeMetadata('middlename'); if ($middleNameMetadata->isVisible() && $customerData->getMiddlename()) { $name .= ' ' . $customerData->getMiddlename(); } $name .= ' ' . $customerData->getLastname(); - $suffixMetadata = $this->_customerMetadataService->getAttributeMetadata('customer', 'suffix'); + $suffixMetadata = $this->_customerMetadataService->getAttributeMetadata('suffix'); if ($suffixMetadata->isVisible() && $customerData->getSuffix()) { $name .= ' ' . $customerData->getSuffix(); } diff --git a/app/code/Magento/Customer/Model/Address/Converter.php b/app/code/Magento/Customer/Model/Address/Converter.php index fa18bb3b1b92350c0753b35095379a877b85c95c..cc93635e25e1ffef6478afdec8ae8cabe5c5be55 100644 --- a/app/code/Magento/Customer/Model/Address/Converter.php +++ b/app/code/Magento/Customer/Model/Address/Converter.php @@ -25,12 +25,12 @@ namespace Magento\Customer\Model\Address; use Magento\Customer\Model\AddressFactory; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface; use Magento\Customer\Service\V1\Data\Address; use Magento\Customer\Service\V1\Data\AddressBuilder; use Magento\Customer\Model\Address as AddressModel; use Magento\Customer\Model\Address\AbstractAddress; use Magento\Customer\Service\V1\Data\Region; -use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; use Magento\Customer\Service\V1\Data\AddressConverter; /** @@ -56,23 +56,23 @@ class Converter /** * Customer metadata service * - * @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface + * @var AddressMetadataServiceInterface */ - protected $_metadataService; + protected $_addressMetadataService; /** * @param AddressBuilder $addressBuilder * @param AddressFactory $addressFactory - * @param CustomerMetadataServiceInterface $metadataService + * @param AddressMetadataServiceInterface $addressMetadataService */ public function __construct( AddressBuilder $addressBuilder, AddressFactory $addressFactory, - CustomerMetadataServiceInterface $metadataService + AddressMetadataServiceInterface $addressMetadataService ) { $this->_addressBuilder = $addressBuilder; $this->_addressFactory = $addressFactory; - $this->_metadataService = $metadataService; + $this->_addressMetadataService = $addressMetadataService; } /** @@ -115,7 +115,7 @@ class Converter $addressModel->setIsDefaultShipping($address->isDefaultShipping()); // Need to use attribute set or future updates can cause data loss if (!$addressModel->getAttributeSetId()) { - $addressModel->setAttributeSetId(CustomerMetadataServiceInterface::ATTRIBUTE_SET_ID_ADDRESS); + $addressModel->setAttributeSetId(AddressMetadataServiceInterface::ATTRIBUTE_SET_ID_ADDRESS); } } @@ -131,7 +131,7 @@ class Converter { $addressId = $addressModel->getId(); - $attributes = $this->_metadataService->getAllAddressAttributeMetadata(); + $attributes = $this->_addressMetadataService->getAllAttributesMetadata(); $addressData = array(); foreach ($attributes as $attribute) { $code = $attribute->getAttributeCode(); diff --git a/app/code/Magento/Customer/Model/Metadata/Form.php b/app/code/Magento/Customer/Model/Metadata/Form.php index a443ea0f85cc062103923cb9f2f7ada22f837397..4c659ab1754e4072909acecb6a45151fc7b96233 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form.php +++ b/app/code/Magento/Customer/Model/Metadata/Form.php @@ -23,6 +23,9 @@ */ namespace Magento\Customer\Model\Metadata; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; + class Form { /**#@+ @@ -35,9 +38,14 @@ class Form /**#@-*/ /** - * @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface + * @var CustomerMetadataServiceInterface */ - protected $_eavMetadataService; + protected $_customerMetadataService; + + /** + * @var AddressMetadataServiceInterface + */ + protected $_addressMetadataService; /** * @var ElementFactory @@ -102,7 +110,8 @@ class Form protected $_attributes; /** - * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $eavMetadataService + * @param CustomerMetadataServiceInterface $customerMetadataService + * @param AddressMetadataServiceInterface $addressMetadataService * @param ElementFactory $elementFactory * @param \Magento\Framework\App\RequestInterface $httpRequest * @param \Magento\Framework\Module\Dir\Reader $modulesReader @@ -117,7 +126,8 @@ class Form * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $eavMetadataService, + CustomerMetadataServiceInterface $customerMetadataService, + AddressMetadataServiceInterface $addressMetadataService, ElementFactory $elementFactory, \Magento\Framework\App\RequestInterface $httpRequest, \Magento\Framework\Module\Dir\Reader $modulesReader, @@ -129,7 +139,8 @@ class Form $filterAttributes = array(), $isAjax = false ) { - $this->_eavMetadataService = $eavMetadataService; + $this->_customerMetadataService = $customerMetadataService; + $this->_addressMetadataService = $addressMetadataService; $this->_elementFactory = $elementFactory; $this->_attributeValues = $attributeValues; $this->_entityType = $entityType; @@ -146,11 +157,18 @@ class Form * Retrieve attributes metadata for the form * * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] + * @throws \LogicException For undefined entity type */ public function getAttributes() { if (!isset($this->_attributes)) { - $this->_attributes = $this->_eavMetadataService->getAttributes($this->_entityType, $this->_formCode); + if ($this->_entityType === CustomerMetadataServiceInterface::ENTITY_TYPE_CUSTOMER) { + $this->_attributes = $this->_customerMetadataService->getAttributes($this->_formCode); + } else if ($this->_entityType === AddressMetadataServiceInterface::ENTITY_TYPE_ADDRESS) { + $this->_attributes = $this->_addressMetadataService->getAttributes($this->_formCode); + } else { + throw new \LogicException('Undefined entity type: ' . $this->_entityType); + } } return $this->_attributes; } diff --git a/app/code/Magento/Customer/Model/Resource/Customer/Grid/ServiceCollection.php b/app/code/Magento/Customer/Model/Resource/Customer/Grid/ServiceCollection.php index a9cd122d15d415cf63f27ff8571a5969677f85e7..3388889e4adc1ffec02d2b25a508132d89e1c3cc 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer/Grid/ServiceCollection.php +++ b/app/code/Magento/Customer/Model/Resource/Customer/Grid/ServiceCollection.php @@ -29,6 +29,7 @@ use Magento\Customer\Service\V1\CustomerAccountServiceInterface; use Magento\Customer\Service\V1\Data\CustomerDetails; use Magento\Framework\Service\V1\Data\FilterBuilder; use Magento\Framework\Service\V1\Data\SearchCriteriaBuilder; +use Magento\Framework\Service\V1\Data\SortOrderBuilder; /** * Customer Grid Collection backed by Services @@ -45,14 +46,16 @@ class ServiceCollection extends AbstractServiceCollection * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param CustomerAccountServiceInterface $accountService + * @param SortOrderBuilder $sortOrderBuilder */ public function __construct( EntityFactory $entityFactory, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, + SortOrderBuilder $sortOrderBuilder, CustomerAccountServiceInterface $accountService ) { - parent::__construct($entityFactory, $filterBuilder, $searchCriteriaBuilder); + parent::__construct($entityFactory, $filterBuilder, $searchCriteriaBuilder, $sortOrderBuilder); $this->accountService = $accountService; } diff --git a/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php b/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php index 6307da41ed2e3e18cd7b5a5d09abf53002508725..ddf83cae987fb4cef2cbc16d66fe7f3b0a887c4c 100644 --- a/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php +++ b/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php @@ -29,6 +29,7 @@ use Magento\Customer\Service\V1\CustomerGroupServiceInterface; use Magento\Customer\Service\V1\Data\CustomerGroup; use Magento\Framework\Service\V1\Data\FilterBuilder; use Magento\Framework\Service\V1\Data\SearchCriteriaBuilder; +use Magento\Framework\Service\V1\Data\SortOrderBuilder; /** * Customer group collection backed by services @@ -45,14 +46,16 @@ class ServiceCollection extends AbstractServiceCollection * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param CustomerGroupServiceInterface $groupService + * @param SortOrderBuilder $sortOrderBuilder */ public function __construct( EntityFactory $entityFactory, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, + SortOrderBuilder $sortOrderBuilder, CustomerGroupServiceInterface $groupService ) { - parent::__construct($entityFactory, $filterBuilder, $searchCriteriaBuilder); + parent::__construct($entityFactory, $filterBuilder, $searchCriteriaBuilder, $sortOrderBuilder); $this->groupService = $groupService; } diff --git a/app/code/Magento/Customer/Model/Session.php b/app/code/Magento/Customer/Model/Session.php index 5b847f192ad4a1062fa3bde6fc86678f8be1673a..1a160afe61635f4349dbd47c5493817538555d33 100755 --- a/app/code/Magento/Customer/Model/Session.php +++ b/app/code/Magento/Customer/Model/Session.php @@ -253,6 +253,12 @@ class Session extends \Magento\Framework\Session\SessionManager $customerModel->setConfirmation(null)->save(); } + /** + * The next line is a workaround. + * It is used to distinguish users that are logged in from user data set via methods similar to setCustomerId() + */ + $this->unsIsCustomerEmulated(); + return $this; } @@ -356,7 +362,9 @@ class Session extends \Magento\Framework\Session\SessionManager */ public function isLoggedIn() { - return (bool)$this->getCustomerId() && (bool)$this->checkCustomerId($this->getId()); + return (bool)$this->getCustomerId() + && $this->checkCustomerId($this->getId()) + && !$this->getIsCustomerEmulated(); } /** diff --git a/app/code/Magento/Customer/Service/V1/AddressMetadataService.php b/app/code/Magento/Customer/Service/V1/AddressMetadataService.php new file mode 100644 index 0000000000000000000000000000000000000000..233f0da47688c30a8554b56a244827cfe4a95e92 --- /dev/null +++ b/app/code/Magento/Customer/Service/V1/AddressMetadataService.php @@ -0,0 +1,158 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +use Magento\Customer\Service\V1\Data\Eav\AttributeMetadataConverter; +use Magento\Customer\Service\V1\Data\Eav\AttributeMetadataDataProvider; +use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Service\Config\MetadataConfig; + +/** + * Service to fetch customer address related custom attributes + */ +class AddressMetadataService implements AddressMetadataServiceInterface +{ + /** + * @var array + */ + private $addressDataObjectMethods; + + /** + * @var MetadataConfig + */ + private $metadataConfig; + + /** + * @var AttributeMetadataConverter + */ + private $attributeMetadataConverter; + + /** + * @var AttributeMetadataDataProvider + */ + private $attributeMetadataDataProvider; + + /** + * @param MetadataConfig $metadataConfig + * @param AttributeMetadataConverter $attributeMetadataConverter + * @param AttributeMetadataDataProvider $attributeMetadataDataProvider + */ + public function __construct( + MetadataConfig $metadataConfig, + AttributeMetadataConverter $attributeMetadataConverter, + AttributeMetadataDataProvider $attributeMetadataDataProvider + ) { + $this->metadataConfig = $metadataConfig; + $this->attributeMetadataConverter = $attributeMetadataConverter; + $this->attributeMetadataDataProvider = $attributeMetadataDataProvider; + } + + /** + * {@inheritdoc} + */ + public function getAttributes($formCode) + { + $attributes = []; + $attributesFormCollection = $this->attributeMetadataDataProvider->loadAttributesCollection( + self::ENTITY_TYPE_ADDRESS, + $formCode + ); + foreach ($attributesFormCollection as $attribute) { + $attributes[$attribute->getAttributeCode()] = $this->attributeMetadataConverter + ->createMetadataAttribute($attribute); + } + return $attributes; + } + + /** + * {@inheritdoc} + */ + public function getAttributeMetadata($attributeCode) + { + /** @var AbstractAttribute $attribute */ + $attribute = $this->attributeMetadataDataProvider->getAttribute(self::ENTITY_TYPE_ADDRESS, $attributeCode); + if ($attribute) { + $attributeMetadata = $this->attributeMetadataConverter->createMetadataAttribute($attribute); + return $attributeMetadata; + } else { + throw new NoSuchEntityException( + NoSuchEntityException::MESSAGE_DOUBLE_FIELDS, + [ + 'fieldName' => 'entityType', + 'fieldValue' => self::ENTITY_TYPE_ADDRESS, + 'field2Name' => 'attributeCode', + 'field2Value' => $attributeCode, + ] + ); + } + } + + /** + * {@inheritdoc} + */ + public function getAllAttributesMetadata() + { + /** @var AbstractAttribute[] $attribute */ + $attributeCodes = $this->attributeMetadataDataProvider->getAllAttributeCodes( + self::ENTITY_TYPE_ADDRESS, + self::ATTRIBUTE_SET_ID_ADDRESS + ); + + $attributesMetadata = []; + + foreach ($attributeCodes as $attributeCode) { + try { + $attributesMetadata[] = $this->getAttributeMetadata($attributeCode); + } catch (NoSuchEntityException $e) { + //If no such entity, skip + } + } + + return $attributesMetadata; + } + + /** + * {@inheritdoc} + */ + public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_OBJECT_CLASS_NAME) + { + $customAttributes = []; + if (!$this->addressDataObjectMethods) { + $this->addressDataObjectMethods = array_flip(get_class_methods($dataObjectClassName)); + } + foreach ($this->getAllAttributesMetadata() as $attributeMetadata) { + $attributeCode = $attributeMetadata->getAttributeCode(); + $camelCaseKey = \Magento\Framework\Service\DataObjectConverter::snakeCaseToCamelCase($attributeCode); + $isDataObjectMethod = isset($this->addressDataObjectMethods['get' . $camelCaseKey]) + || isset($this->addressDataObjectMethods['is' . $camelCaseKey]); + + if (!$isDataObjectMethod && !$attributeMetadata->isSystem()) { + $customAttributes[] = $attributeMetadata; + } + } + return array_merge($customAttributes, $this->metadataConfig->getCustomAttributesMetadata($dataObjectClassName)); + } +} diff --git a/app/code/Magento/Customer/Service/V1/AddressMetadataServiceCached.php b/app/code/Magento/Customer/Service/V1/AddressMetadataServiceCached.php new file mode 100644 index 0000000000000000000000000000000000000000..86d4e554885806968fc2cdb0da16dbdc1b506f58 --- /dev/null +++ b/app/code/Magento/Customer/Service/V1/AddressMetadataServiceCached.php @@ -0,0 +1,41 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +/** + * Cached customer address attribute metadata service + */ +class AddressMetadataServiceCached extends MetadataServiceCached implements AddressMetadataServiceInterface +{ + /** + * Initialize dependencies. + * + * @param AddressMetadataService $metadataService + */ + public function __construct(AddressMetadataService $metadataService) + { + $this->metadataService = $metadataService; + } +} diff --git a/dev/tests/unit/testsuite/Magento/_files/session_backend_mock.php b/app/code/Magento/Customer/Service/V1/AddressMetadataServiceInterface.php similarity index 68% rename from dev/tests/unit/testsuite/Magento/_files/session_backend_mock.php rename to app/code/Magento/Customer/Service/V1/AddressMetadataServiceInterface.php index 452dc30815458dbdedac88136daaf5bad869e6bf..fa905240c66fd38bd44f5723e4aacecd7c5dccbd 100644 --- a/dev/tests/unit/testsuite/Magento/_files/session_backend_mock.php +++ b/app/code/Magento/Customer/Service/V1/AddressMetadataServiceInterface.php @@ -21,31 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Framework\Session; -use \Magento\Backend\Model\SessionTest; +namespace Magento\Customer\Service\V1; -function headers_sent() -{ - return false; -} - -function session_status() -{ - return PHP_SESSION_NONE; -} - -function session_name($name) +/** + * Interface providing APIs to fetch Address related custom attributes + */ +interface AddressMetadataServiceInterface extends MetadataServiceInterface { - SessionTest::assertEquals($name, 'adminhtml'); -} + const ATTRIBUTE_SET_ID_ADDRESS = 2; -function session_start() -{ - SessionTest::$sessionStart = true; -} + const ENTITY_TYPE_ADDRESS = 'customer_address'; -function register_shutdown_function() -{ - SessionTest::$registerShutdownFunction = true; + const DATA_OBJECT_CLASS_NAME = 'Magento\Customer\Service\V1\Data\Address'; } diff --git a/app/code/Magento/Customer/Service/V1/CustomerAccountService.php b/app/code/Magento/Customer/Service/V1/CustomerAccountService.php index 5a14411d22d21702485d3f48d132b19d0dff7542..ced1681b605b8c8ec4e9b9d2d62d2b4d799f3cde 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerAccountService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerAccountService.php @@ -24,34 +24,34 @@ namespace Magento\Customer\Service\V1; -use Magento\Customer\Service\V1\Data\CustomerDetails; -use Magento\Store\Model\StoreManagerInterface; +use Magento\Customer\Model\AddressRegistry; +use Magento\Customer\Model\Config\Share as ConfigShare; use Magento\Customer\Model\Converter; use Magento\Customer\Model\Customer as CustomerModel; use Magento\Customer\Model\CustomerFactory; use Magento\Customer\Model\CustomerRegistry; use Magento\Customer\Model\Metadata\Validator; use Magento\Customer\Model\Resource\Customer\Collection; -use Magento\Framework\Service\V1\Data\Search\FilterGroup; +use Magento\Customer\Service\V1\Data\CustomerDetails; +use Magento\Framework\Encryption\EncryptorInterface as Encryptor; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\Exception\AuthenticationException; use Magento\Framework\Exception\EmailNotConfirmedException; +use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\InvalidEmailOrPasswordException; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Exception\State\ExpiredException; -use Magento\Framework\Exception\InputException; -use Magento\Framework\Exception\AuthenticationException; -use Magento\Framework\Exception\StateException; use Magento\Framework\Exception\State\InputMismatchException; use Magento\Framework\Exception\State\InvalidTransitionException; -use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Exception\StateException; +use Magento\Framework\Logger; use Magento\Framework\Mail\Exception as MailException; use Magento\Framework\Math\Random; +use Magento\Framework\Service\V1\Data\Search\FilterGroup; use Magento\Framework\Service\V1\Data\SearchCriteria; +use Magento\Framework\Service\V1\Data\SortOrder; use Magento\Framework\UrlInterface; -use Magento\Framework\Logger; -use Magento\Framework\Encryption\EncryptorInterface as Encryptor; -use Magento\Customer\Model\Config\Share as ConfigShare; -use Magento\Customer\Model\AddressRegistry; -use Magento\Framework\Service\V1\Data\Filter; +use Magento\Store\Model\StoreManagerInterface; /** * Handle various customer account actions @@ -434,7 +434,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface * * @param CustomerModel $customerModel * @param Data\Customer $customer - * @param string $redirectUrl + * @param string $redirectUrl * @return void */ protected function _sendEmailConfirmation(CustomerModel $customerModel, Data\Customer $customer, $redirectUrl) @@ -508,7 +508,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface /** @var Collection $collection */ $collection = $this->customerFactory->create()->getCollection(); // This is needed to make sure all the attributes are properly loaded - foreach ($this->customerMetadataService->getAllCustomerAttributeMetadata() as $metadata) { + foreach ($this->customerMetadataService->getAllAttributesMetadata() as $metadata) { $collection->addAttributeToSelect($metadata->getAttributeCode()); } // Needed to enable filtering on name as a whole @@ -526,9 +526,13 @@ class CustomerAccountService implements CustomerAccountServiceInterface } $this->searchResultsBuilder->setTotalCount($collection->getSize()); $sortOrders = $searchCriteria->getSortOrders(); + /** @var SortOrder $sortOrder */ if ($sortOrders) { - foreach ($searchCriteria->getSortOrders() as $field => $direction) { - $collection->addOrder($field, $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); + foreach ($searchCriteria->getSortOrders() as $sortOrder) { + $collection->addOrder( + $sortOrder->getField(), + ($sortOrder->getDirection() == SearchCriteria::SORT_ASC) ? 'ASC' : 'DESC' + ); } } $collection->setCurPage($searchCriteria->getCurrentPage()); @@ -762,7 +766,13 @@ class CustomerAccountService implements CustomerAccountServiceInterface $exception->addError(InputException::REQUIRED_FIELD, ['fieldName' => 'lastname']); } - if (!\Zend_Validate::is($customerModel->getEmail(), 'EmailAddress')) { + $isEmailAddress = \Zend_Validate::is( + $customerModel->getEmail(), + 'EmailAddress', + ['allow' => ['allow'=> \Zend_Validate_Hostname::ALLOW_ALL, 'tld' => false]] + ); + + if (!$isEmailAddress) { $exception->addError( InputException::INVALID_FIELD_VALUE, ['fieldName' => 'email', 'value' => $customerModel->getEmail()] @@ -830,7 +840,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface private function getAttributeMetadata($attributeCode) { try { - return $this->customerMetadataService->getCustomerAttributeMetadata($attributeCode); + return $this->customerMetadataService->getAttributeMetadata($attributeCode); } catch (NoSuchEntityException $e) { return null; } diff --git a/app/code/Magento/Customer/Service/V1/CustomerGroupService.php b/app/code/Magento/Customer/Service/V1/CustomerGroupService.php index 90214977d78c755c1a9f2f236b2b377cc2cd6e78..9f14aecfaa99814311a4d0077d2bd04849511705 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerGroupService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerGroupService.php @@ -38,6 +38,7 @@ use Magento\Framework\Exception\State\InvalidTransitionException; use Magento\Framework\Service\V1\Data\SearchCriteria; use Magento\Tax\Service\V1\Data\TaxClass; use Magento\Tax\Service\V1\TaxClassServiceInterface; +use Magento\Framework\Service\V1\Data\SortOrder; /** * Customer service is responsible for customer business workflow encapsulation @@ -153,10 +154,14 @@ class CustomerGroupService implements CustomerGroupServiceInterface } $this->_searchResultsBuilder->setTotalCount($collection->getSize()); $sortOrders = $searchCriteria->getSortOrders(); + /** @var SortOrder $sortOrder */ if ($sortOrders) { - foreach ($searchCriteria->getSortOrders() as $field => $direction) { - $field = $this->translateField($field); - $collection->addOrder($field, $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); + foreach ($searchCriteria->getSortOrders() as $sortOrder) { + $field = $this->translateField($sortOrder->getField()); + $collection->addOrder( + $field, + ($sortOrder->getDirection() == SearchCriteria::SORT_ASC) ? 'ASC' : 'DESC' + ); } } $collection->setCurPage($searchCriteria->getCurrentPage()); diff --git a/app/code/Magento/Customer/Service/V1/CustomerMetadataService.php b/app/code/Magento/Customer/Service/V1/CustomerMetadataService.php index ae79cc3044e330078537f63f5fda8a421900c83c..f274f2b6c35e3694faf2a04a5d27ba2e30e88747 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerMetadataService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerMetadataService.php @@ -21,98 +21,89 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1; +use Magento\Customer\Service\V1\Data\Eav\AttributeMetadataConverter; +use Magento\Customer\Service\V1\Data\Eav\AttributeMetadataDataProvider; use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Service\Config\MetadataConfig; /** - * EAV attribute metadata service - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * Service to fetch customer related custom attributes */ class CustomerMetadataService implements CustomerMetadataServiceInterface { /** - * @var \Magento\Eav\Model\Config - */ - private $_eavConfig; - - /** - * @var \Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory - */ - private $_attrFormCollectionFactory; - - /** - * @var \Magento\Store\Model\StoreManager - */ - private $_storeManager; - - /** - * @var Data\Eav\OptionBuilder + * @var array */ - private $_optionBuilder; + private $customerDataObjectMethods; /** - * @var Data\Eav\ValidationRuleBuilder + * @var MetadataConfig */ - private $_validationRuleBuilder; + private $metadataConfig; /** - * @var Data\Eav\AttributeMetadataBuilder + * @var AttributeMetadataConverter */ - private $_attributeMetadataBuilder; + private $attributeMetadataConverter; /** - * @var array + * @var AttributeMetadataDataProvider */ - private $customerDataObjectMethods; + private $attributeMetadataDataProvider; /** - * @var array + * @param MetadataConfig $metadataConfig + * @param AttributeMetadataConverter $attributeMetadataConverter + * @param AttributeMetadataDataProvider $attributeMetadataDataProvider */ - private $addressDataObjectMethods; + public function __construct( + MetadataConfig $metadataConfig, + AttributeMetadataConverter $attributeMetadataConverter, + AttributeMetadataDataProvider $attributeMetadataDataProvider + ) { + $this->metadataConfig = $metadataConfig; + $this->attributeMetadataConverter = $attributeMetadataConverter; + $this->attributeMetadataDataProvider = $attributeMetadataDataProvider; + } /** - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory $attrFormCollectionFactory - * @param \Magento\Store\Model\StoreManager $storeManager - * @param Data\Eav\OptionBuilder $optionBuilder - * @param Data\Eav\ValidationRuleBuilder $validationRuleBuilder - * @param Data\Eav\AttributeMetadataBuilder $attributeMetadataBuilder + * {@inheritdoc} */ - public function __construct( - \Magento\Eav\Model\Config $eavConfig, - \Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory $attrFormCollectionFactory, - \Magento\Store\Model\StoreManager $storeManager, - Data\Eav\OptionBuilder $optionBuilder, - Data\Eav\ValidationRuleBuilder $validationRuleBuilder, - Data\Eav\AttributeMetadataBuilder $attributeMetadataBuilder - ) { - $this->_eavConfig = $eavConfig; - $this->_attrFormCollectionFactory = $attrFormCollectionFactory; - $this->_storeManager = $storeManager; - $this->_optionBuilder = $optionBuilder; - $this->_validationRuleBuilder = $validationRuleBuilder; - $this->_attributeMetadataBuilder = $attributeMetadataBuilder; + public function getAttributes($formCode) + { + $attributes = []; + $attributesFormCollection = $this->attributeMetadataDataProvider->loadAttributesCollection( + self::ENTITY_TYPE_CUSTOMER, + $formCode + ); + foreach ($attributesFormCollection as $attribute) { + /** @var $attribute \Magento\Customer\Model\Attribute */ + $attributes[$attribute->getAttributeCode()] = $this->attributeMetadataConverter + ->createMetadataAttribute($attribute); + } + return $attributes; } /** * {@inheritdoc} */ - public function getAttributeMetadata($entityType, $attributeCode) + public function getAttributeMetadata($attributeCode) { /** @var AbstractAttribute $attribute */ - $attribute = $this->_eavConfig->getAttribute($entityType, $attributeCode); + $attribute = $this->attributeMetadataDataProvider->getAttribute(self::ENTITY_TYPE_CUSTOMER, $attributeCode); if ($attribute) { - $attributeMetadata = $this->_createMetadataAttribute($attribute); + $attributeMetadata = $this->attributeMetadataConverter->createMetadataAttribute($attribute); return $attributeMetadata; } else { throw new NoSuchEntityException( NoSuchEntityException::MESSAGE_DOUBLE_FIELDS, [ 'fieldName' => 'entityType', - 'fieldValue' => $entityType, + 'fieldValue' => self::ENTITY_TYPE_CUSTOMER, 'field2Name' => 'attributeCode', 'field2Value' => $attributeCode, ] @@ -123,147 +114,37 @@ class CustomerMetadataService implements CustomerMetadataServiceInterface /** * {@inheritdoc} */ - public function getAllAttributeSetMetadata($entityType, $attributeSetId = 0, $storeId = null) + public function getAllAttributesMetadata() { - if (null === $storeId) { - $storeId = $this->_storeManager->getStore()->getId(); - } - $object = new \Magento\Framework\Object( - [ - 'store_id' => $storeId, - 'attribute_set_id' => $attributeSetId, - ] + /** @var AbstractAttribute[] $attribute */ + $attributeCodes = $this->attributeMetadataDataProvider->getAllAttributeCodes( + self::ENTITY_TYPE_CUSTOMER, + self::ATTRIBUTE_SET_ID_CUSTOMER ); - $attributeCodes = $this->_eavConfig->getEntityAttributeCodes($entityType, $object); $attributesMetadata = []; + foreach ($attributeCodes as $attributeCode) { try { - $attributesMetadata[] = $this->getAttributeMetadata($entityType, $attributeCode); + $attributesMetadata[] = $this->getAttributeMetadata($attributeCode); } catch (NoSuchEntityException $e) { //If no such entity, skip } } + return $attributesMetadata; } /** * {@inheritdoc} */ - public function getAttributes($entityType, $formCode) - { - $attributes = []; - $attributesFormCollection = $this->_loadAttributesCollection($entityType, $formCode); - foreach ($attributesFormCollection as $attribute) { - $attributes[$attribute->getAttributeCode()] = $this->_createMetadataAttribute($attribute); - } - return $attributes; - } - - /** - * @inheritdoc - */ - public function getCustomerAttributeMetadata($attributeCode) - { - return $this->getAttributeMetadata(self::ENTITY_TYPE_CUSTOMER, $attributeCode); - } - - /** - * @inheritdoc - */ - public function getAllCustomerAttributeMetadata() - { - return $this->getAllAttributeSetMetadata(self::ENTITY_TYPE_CUSTOMER, self::ATTRIBUTE_SET_ID_CUSTOMER); - } - - /** - * @inheritdoc - */ - public function getAddressAttributeMetadata($attributeCode) - { - return $this->getAttributeMetadata(self::ENTITY_TYPE_ADDRESS, $attributeCode); - } - - /** - * @inheritdoc - */ - public function getAllAddressAttributeMetadata() - { - return $this->getAllAttributeSetMetadata(self::ENTITY_TYPE_ADDRESS, self::ATTRIBUTE_SET_ID_ADDRESS); - } - - /** - * Load collection with filters applied - * - * @param string $entityType - * @param string $formCode - * @return \Magento\Customer\Model\Resource\Form\Attribute\Collection - */ - private function _loadAttributesCollection($entityType, $formCode) - { - $attributesFormCollection = $this->_attrFormCollectionFactory->create(); - $attributesFormCollection->setStore($this->_storeManager->getStore()) - ->setEntityType($entityType) - ->addFormCodeFilter($formCode) - ->setSortOrder(); - - return $attributesFormCollection; - } - - /** - * @param \Magento\Customer\Model\Attribute $attribute - * @return Data\Eav\AttributeMetadata - */ - private function _createMetadataAttribute($attribute) - { - $options = []; - if ($attribute->usesSource()) { - foreach ($attribute->getSource()->getAllOptions() as $option) { - $options[] = $this->_optionBuilder->setLabel($option['label']) - ->setValue($option['value']) - ->create(); - } - } - $validationRules = []; - foreach ($attribute->getValidateRules() as $name => $value) { - $validationRules[] = $this->_validationRuleBuilder->setName($name) - ->setValue($value) - ->create(); - } - - $this->_attributeMetadataBuilder->setAttributeCode($attribute->getAttributeCode()) - ->setFrontendInput($attribute->getFrontendInput()) - ->setInputFilter($attribute->getInputFilter()) - ->setStoreLabel($attribute->getStoreLabel()) - ->setValidationRules($validationRules) - ->setVisible($attribute->getIsVisible()) - ->setRequired($attribute->getIsRequired()) - ->setMultilineCount($attribute->getMultilineCount()) - ->setDataModel($attribute->getDataModel()) - ->setOptions($options) - ->setFrontendClass($attribute->getFrontend()->getClass()) - ->setFrontendLabel($attribute->getFrontendLabel()) - ->setBackendType($attribute->getBackendType()) - ->setNote($attribute->getNote()) - ->setIsSystem($attribute->getIsSystem()) - ->setIsUserDefined($attribute->getIsUserDefined()) - ->setSortOrder($attribute->getSortOrder()); - - return $this->_attributeMetadataBuilder->create(); - } - - /** - * @inheritdoc - */ - public function getCustomCustomerAttributeMetadata() + public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_OBJECT_CLASS_NAME) { $customAttributes = []; if (!$this->customerDataObjectMethods) { - $this->customerDataObjectMethods = array_flip( - get_class_methods('Magento\Customer\Service\V1\Data\Customer') - ); + $this->customerDataObjectMethods = array_flip(get_class_methods($dataObjectClassName)); } - foreach ($this->getAllCustomerAttributeMetadata() as $attributeMetadata) { + foreach ($this->getAllAttributesMetadata() as $attributeMetadata) { $attributeCode = $attributeMetadata->getAttributeCode(); $camelCaseKey = \Magento\Framework\Service\DataObjectConverter::snakeCaseToCamelCase($attributeCode); $isDataObjectMethod = isset($this->customerDataObjectMethods['get' . $camelCaseKey]) @@ -276,30 +157,6 @@ class CustomerMetadataService implements CustomerMetadataServiceInterface $customAttributes[] = $attributeMetadata; } } - return $customAttributes; - } - - /** - * @inheritdoc - */ - public function getCustomAddressAttributeMetadata() - { - $customAttributes = []; - if (!$this->addressDataObjectMethods) { - $this->addressDataObjectMethods = array_flip( - get_class_methods('Magento\Customer\Service\V1\Data\Address') - ); - } - foreach ($this->getAllAddressAttributeMetadata() as $attributeMetadata) { - $attributeCode = $attributeMetadata->getAttributeCode(); - $camelCaseKey = \Magento\Framework\Service\DataObjectConverter::snakeCaseToCamelCase($attributeCode); - $isDataObjectMethod = isset($this->addressDataObjectMethods['get' . $camelCaseKey]) - || isset($this->addressDataObjectMethods['is' . $camelCaseKey]); - - if (!$isDataObjectMethod && !$attributeMetadata->isSystem()) { - $customAttributes[] = $attributeMetadata; - } - } - return $customAttributes; + return array_merge($customAttributes, $this->metadataConfig->getCustomAttributesMetadata($dataObjectClassName)); } } diff --git a/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceCached.php b/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceCached.php new file mode 100644 index 0000000000000000000000000000000000000000..4805a5f0f3164722718b2974b03a34c698c7b4da --- /dev/null +++ b/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceCached.php @@ -0,0 +1,41 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +/** + * Cached customer attribute metadata service + */ +class CustomerMetadataServiceCached extends MetadataServiceCached implements CustomerMetadataServiceInterface +{ + /** + * Initialize dependencies. + * + * @param CustomerMetadataService $metadataService + */ + public function __construct(CustomerMetadataService $metadataService) + { + $this->metadataService = $metadataService; + } +} diff --git a/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php b/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php index 4a5b15104074e0303b93f06f418a74d57b6d15de..ba5df7a303a47e1304ce4df0bc929e84522da9fa 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php +++ b/app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php @@ -26,88 +26,11 @@ namespace Magento\Customer\Service\V1; /** * Interface CustomerMetadataServiceInterface */ -interface CustomerMetadataServiceInterface +interface CustomerMetadataServiceInterface extends MetadataServiceInterface { const ATTRIBUTE_SET_ID_CUSTOMER = 1; - const ATTRIBUTE_SET_ID_ADDRESS = 2; - const ENTITY_TYPE_CUSTOMER = 'customer'; - const ENTITY_TYPE_ADDRESS = 'customer_address'; - - /** - * Retrieve Attribute Metadata - * - * @param string $entityType - * @param string $attributeCode - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata - * @throws \Magento\Framework\Exception\NoSuchEntityException - */ - public function getAttributeMetadata($entityType, $attributeCode); - - /** - * Returns all known attributes metadata for a given entity type - * - * @param string $entityType - * @param int $attributeSetId - * @param int $storeId - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] - */ - public function getAllAttributeSetMetadata($entityType, $attributeSetId = 0, $storeId = null); - - /** - * Retrieve all attributes for entityType filtered by form code - * - * @param string $entityType - * @param string $formCode - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] - */ - public function getAttributes($entityType, $formCode); - - /** - * Retrieve Customer EAV attribute metadata - * - * @param string $attributeCode - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata - * @throws \Magento\Framework\Exception\NoSuchEntityException - */ - public function getCustomerAttributeMetadata($attributeCode); - - /** - * Get all attribute metadata for customers - * - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] - */ - public function getAllCustomerAttributeMetadata(); - - /** - * Get custom attribute metadata for customer. - * - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] - */ - public function getCustomCustomerAttributeMetadata(); - - /** - * Retrieve Customer Addresses EAV attribute metadata - * - * @param string $attributeCode - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata - * @throws \Magento\Framework\Exception\NoSuchEntityException - */ - public function getAddressAttributeMetadata($attributeCode); - - /** - * Get all attribute metadata for Addresses - * - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] - */ - public function getAllAddressAttributeMetadata(); - - /** - * Get custom attribute metadata for customer address. - * - * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] - */ - public function getCustomAddressAttributeMetadata(); + const DATA_OBJECT_CLASS_NAME = 'Magento\Customer\Service\V1\Data\Customer'; } diff --git a/app/code/Magento/Customer/Service/V1/Data/AddressBuilder.php b/app/code/Magento/Customer/Service/V1/Data/AddressBuilder.php index fa328ae876bba945d1b0859c595f48b463256512..27df6a3f0cc2c8a9914e1860e65b9b1b08c13374 100644 --- a/app/code/Magento/Customer/Service/V1/Data/AddressBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Data/AddressBuilder.php @@ -21,11 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1\Data; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface; use Magento\Framework\Service\Data\Eav\AbstractObject; use Magento\Framework\Service\Data\Eav\AbstractObjectBuilder; -use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; use Magento\Framework\Service\Data\Eav\AttributeValueBuilder; /** @@ -44,23 +45,19 @@ class AddressBuilder extends AbstractObjectBuilder */ protected $_regionBuilder; - /** @var CustomerMetadataServiceInterface */ - protected $_metadataService; - /** * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder + * @param AddressMetadataServiceInterface $metadataService * @param RegionBuilder $regionBuilder - * @param CustomerMetadataServiceInterface $metadataService */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, AttributeValueBuilder $valueBuilder, - RegionBuilder $regionBuilder, - CustomerMetadataServiceInterface $metadataService + AddressMetadataServiceInterface $metadataService, + RegionBuilder $regionBuilder ) { - parent::__construct($objectFactory, $valueBuilder); - $this->_metadataService = $metadataService; + parent::__construct($objectFactory, $valueBuilder, $metadataService); $this->_regionBuilder = $regionBuilder; $this->_data[Address::KEY_REGION] = $regionBuilder->create(); } @@ -130,18 +127,6 @@ class AddressBuilder extends AbstractObjectBuilder return parent::_setDataValues($data); } - /** - * {@inheritdoc} - */ - public function getCustomAttributesCodes() - { - $attributeCodes = array(); - foreach ($this->_metadataService->getCustomAddressAttributeMetadata() as $attribute) { - $attributeCodes[] = $attribute->getAttributeCode(); - } - return $attributeCodes; - } - /** * Set region * diff --git a/app/code/Magento/Customer/Service/V1/Data/CustomerBuilder.php b/app/code/Magento/Customer/Service/V1/Data/CustomerBuilder.php index ffc2549adf8fc7e16e26299c3e979819f9a6336e..49056de1a19cc0398232f31bb89f6619082ac09a 100644 --- a/app/code/Magento/Customer/Service/V1/Data/CustomerBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Data/CustomerBuilder.php @@ -21,12 +21,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1\Data; -use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; use Magento\Framework\Service\Data\Eav\AbstractObject; use Magento\Framework\Service\Data\Eav\AbstractObjectBuilder; use Magento\Framework\Service\Data\Eav\AttributeValueBuilder; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; /** * Builder for the Customer Service Data Object @@ -37,11 +38,6 @@ use Magento\Framework\Service\Data\Eav\AttributeValueBuilder; */ class CustomerBuilder extends AbstractObjectBuilder { - /** - * @var CustomerMetadataServiceInterface - */ - protected $_metadataService; - /** * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder @@ -52,22 +48,7 @@ class CustomerBuilder extends AbstractObjectBuilder AttributeValueBuilder $valueBuilder, CustomerMetadataServiceInterface $metadataService ) { - parent::__construct($objectFactory, $valueBuilder); - $this->_metadataService = $metadataService; - } - - /** - * Template method used to configure the attribute codes for the custom attributes - * - * @return string[] - */ - public function getCustomAttributesCodes() - { - $attributeCodes = array(); - foreach ($this->_metadataService->getCustomCustomerAttributeMetadata() as $attribute) { - $attributeCodes[] = $attribute->getAttributeCode(); - } - return $attributeCodes; + parent::__construct($objectFactory, $valueBuilder, $metadataService); } /** diff --git a/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadata.php b/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadata.php index 4ba3c371fcb15e73580eb4a4343225496844c690..c628a6adb8385fcbb80dc48e25fed07b38cfd14e 100644 --- a/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadata.php +++ b/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadata.php @@ -23,10 +23,12 @@ */ namespace Magento\Customer\Service\V1\Data\Eav; +use Magento\Framework\Service\Data\Eav\MetadataObjectInterface; + /** * Class AttributeMetadata */ -class AttributeMetadata extends \Magento\Framework\Service\Data\AbstractObject +class AttributeMetadata extends \Magento\Framework\Service\Data\AbstractObject implements MetadataObjectInterface { /**#@+ * Constants used as keys into $_data diff --git a/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataBuilder.php b/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataBuilder.php index ef50ab9a124a1cdf2e076b9ffd8491d71dad5999..c5a02ed9097cd9ddc2d8e87d3a16507270c23cb5 100644 --- a/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataBuilder.php @@ -23,10 +23,13 @@ */ namespace Magento\Customer\Service\V1\Data\Eav; +use Magento\Framework\Service\Data\AttributeMetadataBuilderInterface; +use Magento\Framework\Service\Data\AbstractObjectBuilder; + /** * Class AttributeMetadataBuilder */ -class AttributeMetadataBuilder extends \Magento\Framework\Service\Data\AbstractObjectBuilder +class AttributeMetadataBuilder extends AbstractObjectBuilder implements AttributeMetadataBuilderInterface { /** * Option builder @@ -116,7 +119,7 @@ class AttributeMetadataBuilder extends \Magento\Framework\Service\Data\AbstractO /** * Set options - * + * * @param \Magento\Customer\Service\V1\Data\Eav\Option[] $options * @return $this */ diff --git a/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataConverter.php b/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataConverter.php new file mode 100644 index 0000000000000000000000000000000000000000..8f86564c8e02a94b88040a44f76d39ba57a9f160 --- /dev/null +++ b/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataConverter.php @@ -0,0 +1,107 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1\Data\Eav; + +/** + * Converter for AttributeMetadata + */ +class AttributeMetadataConverter +{ + /** + * @var OptionBuilder + */ + private $_optionBuilder; + + /** + * @var ValidationRuleBuilder + */ + private $_validationRuleBuilder; + + /** + * @var AttributeMetadataBuilder + */ + private $_attributeMetadataBuilder; + + /** + * Initialize the Converter + * + * @param OptionBuilder $optionBuilder + * @param ValidationRuleBuilder $validationRuleBuilder + * @param AttributeMetadataBuilder $attributeMetadataBuilder + */ + public function __construct( + OptionBuilder $optionBuilder, + ValidationRuleBuilder $validationRuleBuilder, + AttributeMetadataBuilder $attributeMetadataBuilder + ) { + $this->_optionBuilder = $optionBuilder; + $this->_validationRuleBuilder = $validationRuleBuilder; + $this->_attributeMetadataBuilder = $attributeMetadataBuilder; + } + + /** + * Create AttributeMetadata Data object from the Attribute Model + * + * @param \Magento\Customer\Model\Attribute $attribute + * @return AttributeMetadata + */ + public function createMetadataAttribute($attribute) + { + $options = []; + if ($attribute->usesSource()) { + foreach ($attribute->getSource()->getAllOptions() as $option) { + $options[] = $this->_optionBuilder->setLabel($option['label']) + ->setValue($option['value']) + ->create(); + } + } + $validationRules = []; + foreach ($attribute->getValidateRules() as $name => $value) { + $validationRules[] = $this->_validationRuleBuilder->setName($name) + ->setValue($value) + ->create(); + } + + $this->_attributeMetadataBuilder->setAttributeCode($attribute->getAttributeCode()) + ->setFrontendInput($attribute->getFrontendInput()) + ->setInputFilter($attribute->getInputFilter()) + ->setStoreLabel($attribute->getStoreLabel()) + ->setValidationRules($validationRules) + ->setVisible($attribute->getIsVisible()) + ->setRequired($attribute->getIsRequired()) + ->setMultilineCount($attribute->getMultilineCount()) + ->setDataModel($attribute->getDataModel()) + ->setOptions($options) + ->setFrontendClass($attribute->getFrontend()->getClass()) + ->setFrontendLabel($attribute->getFrontendLabel()) + ->setBackendType($attribute->getBackendType()) + ->setNote($attribute->getNote()) + ->setIsSystem($attribute->getIsSystem()) + ->setIsUserDefined($attribute->getIsUserDefined()) + ->setSortOrder($attribute->getSortOrder()); + + return $this->_attributeMetadataBuilder->create(); + } +} diff --git a/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataDataProvider.php b/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataDataProvider.php new file mode 100644 index 0000000000000000000000000000000000000000..e96ff87ba458ff6b57b8e9c2cdc5b9fb4af82275 --- /dev/null +++ b/app/code/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataDataProvider.php @@ -0,0 +1,119 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1\Data\Eav; + +use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; + +/** + * Attribute Metadata data provider class + * + * @package Magento\Customer\Service\V1\Data\Eav + */ +class AttributeMetadataDataProvider +{ + /** + * @var \Magento\Eav\Model\Config + */ + private $eavConfig; + + /** + * @var \Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory + */ + private $attrFormCollectionFactory; + + /** + * @var \Magento\Store\Model\StoreManager + */ + private $storeManager; + + /** + * Initialize data provider with data source + * + * @param \Magento\Eav\Model\Config $eavConfig + * @param \Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory $attrFormCollectionFactory + * @param \Magento\Store\Model\StoreManager $storeManager + */ + public function __construct( + \Magento\Eav\Model\Config $eavConfig, + \Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory $attrFormCollectionFactory, + \Magento\Store\Model\StoreManager $storeManager + ) { + $this->eavConfig = $eavConfig; + $this->attrFormCollectionFactory = $attrFormCollectionFactory; + $this->storeManager = $storeManager; + } + + /** + * Get attribute model for a given entity type and code + * + * @param string $entityType + * @param string $attributeCode + * @return false|AbstractAttribute + */ + public function getAttribute($entityType, $attributeCode) + { + return $this->eavConfig->getAttribute($entityType, $attributeCode); + } + + /** + * Get all attribute codes for a given entity type and attribute set + * + * @param string $entityType + * @param int $attributeSetId + * @param string|null $storeId + * @return array Attribute codes + */ + public function getAllAttributeCodes($entityType, $attributeSetId = 0, $storeId = null) + { + if (null === $storeId) { + $storeId = $this->storeManager->getStore()->getId(); + } + $object = new \Magento\Framework\Object( + [ + 'store_id' => $storeId, + 'attribute_set_id' => $attributeSetId, + ] + ); + return $this->eavConfig->getEntityAttributeCodes($entityType, $object); + } + + /** + * Load collection with filters applied + * + * @param string $entityType + * @param string $formCode + * @return \Magento\Customer\Model\Resource\Form\Attribute\Collection + */ + public function loadAttributesCollection($entityType, $formCode) + { + $attributesFormCollection = $this->attrFormCollectionFactory->create(); + $attributesFormCollection->setStore($this->storeManager->getStore()) + ->setEntityType($entityType) + ->addFormCodeFilter($formCode) + ->setSortOrder(); + + return $attributesFormCollection; + } +} diff --git a/app/code/Magento/Customer/Service/V1/MetadataServiceCached.php b/app/code/Magento/Customer/Service/V1/MetadataServiceCached.php new file mode 100644 index 0000000000000000000000000000000000000000..43ca1ffc18998833e7d60f84f9e5273639418c42 --- /dev/null +++ b/app/code/Magento/Customer/Service/V1/MetadataServiceCached.php @@ -0,0 +1,126 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +/** + * Cached attribute metadata service + */ +class MetadataServiceCached implements MetadataServiceInterface +{ + /** + * @var MetadataServiceInterface + */ + protected $metadataService; + + /** + * @var array + */ + protected $attributeMetadataCache = []; + + /** + * @var array + */ + protected $attributesCache = []; + + /** + * @var \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] + */ + protected $allAttributeMetadataCache = null; + + /** + * @var \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] + */ + protected $customAttributesMetadataCache = null; + + const CACHE_SEPARATOR = ';'; + + /** + * Initialize dependencies. + * + * @param MetadataServiceInterface $metadataService + */ + public function __construct(MetadataServiceInterface $metadataService) + { + $this->metadataService = $metadataService; + } + + /** + * {@inheritdoc} + */ + public function getAttributes($formCode) + { + $key = $formCode; + if (isset($this->attributesCache[$key])) { + return $this->attributesCache[$key]; + } + + $value = $this->metadataService->getAttributes($formCode); + $this->attributesCache[$key] = $value; + + return $value; + } + + /** + * {@inheritdoc} + */ + public function getAttributeMetadata($attributeCode) + { + $key = $attributeCode; + if (isset($this->attributeMetadataCache[$key])) { + return $this->attributeMetadataCache[$key]; + } + + $value = $this->metadataService->getAttributeMetadata($attributeCode); + $this->attributeMetadataCache[$key] = $value; + + return $value; + } + + /** + * {@inheritdoc} + */ + public function getAllAttributesMetadata() + { + if (!is_null($this->allAttributeMetadataCache)) { + return $this->allAttributeMetadataCache; + } + + $this->allAttributeMetadataCache = $this->metadataService->getAllAttributesMetadata(); + return $this->allAttributeMetadataCache; + } + + /** + * {@inheritdoc} + */ + public function getCustomAttributesMetadata($dataObjectClassName = null) + { + if (!is_null($this->customAttributesMetadataCache)) { + return $this->customAttributesMetadataCache; + } + + $this->customAttributesMetadataCache = $this->metadataService->getCustomAttributesMetadata(); + return $this->customAttributesMetadataCache; + } +} diff --git a/app/code/Magento/Customer/Service/V1/MetadataServiceInterface.php b/app/code/Magento/Customer/Service/V1/MetadataServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..1c8a2a5e31d004b96b80bd836a966b2fde2b397b --- /dev/null +++ b/app/code/Magento/Customer/Service/V1/MetadataServiceInterface.php @@ -0,0 +1,65 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +use Magento\Framework\Service\Data\Eav\MetadataServiceInterface as EavMetadataServiceInterface; + +/** + * Interface providing APIs to fetch custom attributes metadata + */ +interface MetadataServiceInterface extends EavMetadataServiceInterface +{ + /** + * Retrieve all attributes for entityType filtered by form code + * + * @param string $formCode + * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] + */ + public function getAttributes($formCode); + + /** + * Retrieve Customer Addresses EAV attribute metadata + * + * @param string $attributeCode + * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + public function getAttributeMetadata($attributeCode); + + /** + * Get all attribute metadata for Addresses + * + * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] + */ + public function getAllAttributesMetadata(); + + /** + * Get custom attribute metadata for the given Data object's attribute set + * + * @param string $dataObjectClassName Data object class name + * @return \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata[] + */ + public function getCustomAttributesMetadata($dataObjectClassName = ''); +} diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index 24835cd97b1e784d483bf0cf312c2292dc924572..a81627d618f34ddf39b818f53052c5e62dd39140 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -3,29 +3,29 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-newsletter": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-wishlist": "0.1.0-alpha91", - "magento/module-index": "0.1.0-alpha91", - "magento/module-log": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-review": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-page-cache": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", - "magento/module-authorization": "0.1.0-alpha91", - "magento/module-integration": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-newsletter": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-wishlist": "0.1.0-alpha92", + "magento/module-index": "0.1.0-alpha92", + "magento/module-log": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-review": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-page-cache": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", + "magento/module-authorization": "0.1.0-alpha92", + "magento/module-integration": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml index f84399e87a6a733bdb24cefc127bd63299b7d0ef..d0e5445bf4945bb529ce20ad0fd1750e98dd7bc7 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -31,7 +31,9 @@ <preference for="Magento\Customer\Service\V1\CustomerAccountServiceInterface" type="Magento\Customer\Service\V1\CustomerAccountService" /> <preference for="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" - type="Magento\Customer\Service\V1\CustomerMetadataService" /> + type="Magento\Customer\Service\V1\CustomerMetadataServiceCached" /> + <preference for="Magento\Customer\Service\V1\AddressMetadataServiceInterface" + type="Magento\Customer\Service\V1\AddressMetadataServiceCached" /> <type name="Magento\Customer\Model\Session"> <arguments> <argument name="configShare" xsi:type="object">Magento\Customer\Model\Config\Share\Proxy</argument> @@ -62,11 +64,11 @@ <argument name="customerData" xsi:type="object">Magento\Customer\Helper\Data\Proxy</argument> </arguments> </type> - <type name="Magento\Customer\Service\V1\Data\AddressBuilder" shared="false" /> - <type name="Magento\Customer\Service\V1\Data\CustomerBuilder" shared="false" /> <type name="Magento\Customer\Service\V1\Data\CustomerGroupBuilder" shared="false" /> <type name="Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder" shared="false" /> <type name="Magento\Customer\Service\V1\Data\Eav\OptionBuilder" shared="false" /> + <type name="Magento\Customer\Service\V1\Data\CustomerBuilder" shared="false" /> + <type name="Magento\Customer\Service\V1\Data\AddressBuilder" shared="false" /> <type name="Magento\Customer\Service\V1\Data\RegionBuilder" shared="false" /> <!--<type name="Magento\Customer\Service\V1\Data\Response\CreateCustomerAccountResponseBuilder" shared="false" />--> <type name="Magento\Customer\Service\V1\Data\SearchResultsBuilder" shared="false" /> @@ -82,6 +84,26 @@ <argument name="url" xsi:type="object">Magento\Framework\Url</argument> </arguments> </type> + <virtualType name="Magento\Customer\Service\Config\CustomerMetadataConfig" type="Magento\Framework\Service\Config\MetadataConfig"> + <arguments> + <argument name="attributeMetadataBuilder" xsi:type="object">Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder</argument> + </arguments> + </virtualType> + <type name="Magento\Customer\Service\V1\CustomerMetadataService"> + <arguments> + <argument name="metadataConfig" xsi:type="object">Magento\Customer\Service\Config\CustomerMetadataConfig</argument> + </arguments> + </type> + <virtualType name="Magento\Customer\Service\Config\AddressMetadataConfig" type="Magento\Framework\Service\Config\MetadataConfig"> + <arguments> + <argument name="attributeMetadataBuilder" xsi:type="object">Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder</argument> + </arguments> + </virtualType> + <type name="Magento\Customer\Service\V1\AddressMetadataService"> + <arguments> + <argument name="metadataConfig" xsi:type="object">Magento\Customer\Service\Config\AddressMetadataConfig</argument> + </arguments> + </type> <type name="Magento\Framework\Model\ActionValidator\RemoveAction"> <arguments> <argument name="protectedModels" xsi:type="array"> diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index 842e90b8f04453da101e35e4c897621ef6a1b21b..c4efa8e5be8a6f643d08e23617d3a255ac67a8fa 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -25,6 +25,7 @@ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + <!-- Customer Group Service--> <route url="/V1/customerGroup/:groupId" method="GET"> <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" method="getGroup"/> <resources> @@ -67,60 +68,60 @@ <resource ref="Magento_Customer::group"/> </resources> </route> - <route url="/V1/customerMetadata/:entityType/entity/:attributeCode/attribute" method="GET"> + + <!-- Customer Metadata Service--> + <route url="/V1/customerAttributeMetadata/:attributeCode" method="GET"> <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAttributeMetadata"/> <resources> <resource ref="Magento_Customer::customer"/> </resources> </route> - <route url="/V1/customerMetadata/:entityType/entity/:attributeSetId/attributeSet/:storeId/store" method="GET"> - <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAllAttributeSetMetadata"/> - <resources> - <resource ref="Magento_Customer::customer"/> - </resources> - </route> - <route url="/V1/customerMetadata/:entityType/entity/:formCode/form" method="GET"> + <route url="/V1/customerAttributeMetadata/form/:formCode" method="GET"> <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAttributes"/> <resources> <resource ref="Magento_Customer::customer"/> </resources> </route> - <route url="/V1/customerMetadata/customer/:attributeCode/attribute" method="GET"> - <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getCustomerAttributeMetadata"/> + <route url="/V1/customerAttributeMetadata" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAllAttributesMetadata"/> <resources> <resource ref="Magento_Customer::customer"/> </resources> </route> - <route url="/V1/customerMetadata/customer/all" method="GET"> - <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAllCustomerAttributeMetadata"/> + <route url="/V1/customerAttributeMetadata/custom" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getCustomAttributesMetadata"/> <resources> <resource ref="Magento_Customer::customer"/> </resources> </route> - <route url="/V1/customerMetadata/customer/custom" method="GET"> - <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getCustomCustomerAttributeMetadata"/> + + <!-- Customer Address Metadata Service--> + <route url="/V1/addressAttributeMetadata/:attributeCode" method="GET"> + <service class="Magento\Customer\Service\V1\AddressMetadataServiceInterface" method="getAttributeMetadata"/> <resources> <resource ref="Magento_Customer::customer"/> </resources> </route> - <route url="/V1/customerMetadata/address/:attributeCode/attribute" method="GET"> - <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAddressAttributeMetadata"/> + <route url="/V1/addressAttributeMetadata/form/:formCode" method="GET"> + <service class="Magento\Customer\Service\V1\AddressMetadataServiceInterface" method="getAttributes"/> <resources> <resource ref="Magento_Customer::customer"/> </resources> </route> - <route url="/V1/customerMetadata/address/all" method="GET"> - <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAllAddressAttributeMetadata"/> + <route url="/V1/addressAttributeMetadata" method="GET"> + <service class="Magento\Customer\Service\V1\AddressMetadataServiceInterface" method="getAllAttributesMetadata"/> <resources> <resource ref="Magento_Customer::customer"/> </resources> </route> - <route url="/V1/customerMetadata/address/custom" method="GET"> - <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getCustomAddressAttributeMetadata"/> + <route url="/V1/addressAttributeMetadata/custom" method="GET"> + <service class="Magento\Customer\Service\V1\AddressMetadataServiceInterface" method="getCustomAttributesMetadata"/> <resources> <resource ref="Magento_Customer::customer"/> </resources> </route> + + <!-- Customer Account Service--> <route url="/V1/customerAccounts/details" method="GET"> <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="getCustomerDetailsByEmail"/> <resources> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_group_index.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_group_index.xml index 965e1ddd1409e7e261f5e39b24821e466375592c..5d48956d3341cd88fc8274419b415c2119c6c7bd 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_group_index.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_group_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Customer\Block\Adminhtml\Group" name="adminhtml.block.customer.group.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.customer.group.grid" as="grid"> @@ -69,4 +69,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 f6dfcf95dc35f2d254c530128c7b9ed3aea112c9..7b6f1c29d9f889d6a43726e661fc037cc61dc3a8 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Cart" name="admin.customer.view.edit.cart"/> </container> </layout> 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 c0b0f47e5fa81953e93d61fb3ef1d986191fa132..1b3e905f7166b7800b178ca505a93e6ac0a3ed3b 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Carts" name="admin.customer.carts"/> </container> </layout> 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 a70312fb623ca02d48f9c24d86d18dd24121bc3d..bf6b44f9c1b18b6d075573507e36635a22243c7f 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Customer\Block\Adminhtml\Edit" name="customer_edit"/> </referenceContainer> @@ -42,4 +42,4 @@ <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" template="Magento_Customer::edit/js.phtml" name="customer.edit.js" as="customer_edit_js"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid.xml index 682bc1d4357afd951e60b795aaef599fae5386c7..cee63688c8b0e423ad93d29e8b794d11c518233d 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid.xml @@ -23,9 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="customer_index_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="admin.block.customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="admin.block.customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid_block.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid_block.xml index 765642a13cade5da45e737855ddf9288f708a74f..045015c85f1e8aba26b45aab8667088a97c5df4d 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid_block.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid_block.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="admin.block.customer.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="admin.block.customer.grid" as="grid"> <arguments> @@ -186,4 +186,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 cdce257271cc26634140d2131f90f704976fdc43..91109be0f3c1e93640e145884007ec84a111385a 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 @@ -23,12 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="customer_index_grid_block"/> <referenceContainer name="content"> <block class="Magento\Customer\Block\Adminhtml\Customer" name="admin.block.customer.grid.container"> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_lastorders.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_lastorders.xml index 08d09a5b40bbd28972bb87302e382931b3f2ad56..734feca1cb4a15538dee7b7dfc6498a309261ab5 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_lastorders.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_lastorders.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View\Orders" name="admin.customer.lastorders"/> </container> </layout> 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 6f69a8c9051531ec4dada7a86e22526a798e78b7..0334ebf483d70f90562a7ccabf1cb7f2285596d6 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid" name="admin.customer.newsletter.grid"/> </container> </layout> 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 9b3ced0f8187c6113d86411e113ba027311d0e55..2a7ad35b69f8e45a01b662015d2a35aaf66f4b30 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Orders" name="adminhtml.customer.edit.tab.orders"/> </container> </layout> 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 8abe4642ae5d2c0e67f43cbabe65998ac2970b82..682d3e660cf406b02c203a10ab0fac71ececa453 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Reviews" name="admin.customer.reviews"/> </container> </layout> 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 f1b7a94a19ccabb5b1ed658fdf8094991355843c..05be2b4b98f4405fbcee9fd6347b42a8ca47a9b0 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View\Cart" name="admin.customer.view.cart"/> </container> </layout> 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 cf2f9990ffff0b7603549c8d7168d18c8cf3b41b..d112b92a2ba79d00eba74bca23ba8800f54e5ea5 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View\Wishlist" name="admin.customer.view.wishlist"/> </container> </layout> 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 6e92840cbf8a0464cb18f8f511107b16b8651d2d..9adff30add807e19171e87fecae77179990b1ac9 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Customer\Block\Adminhtml\Online" name="adminhtml.block.customer.online.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.customer.online.grid" as="grid"> @@ -126,4 +126,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 d9b66676627ebb787dac6e0f2d3071d7273e9b95..f0ae85bb1ab9017a0660af9a05d482bbc248e108 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Customer My Account (All Pages)" design_abstraction="custom"> - <update handle="page_two_columns_left"/> - <referenceBlock name="root"> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Customer My Account (All Pages)" design_abstraction="custom"> + <referenceBlock name="body.class"> <action method="addBodyClass"> <argument name="class" xsi:type="string">account</argument> </action> @@ -52,4 +51,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 c743fd67b69d85a6d160e1066aadced06a81b796..50a1eb3695febe097b61f195c524e1467d403c87 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 @@ -23,18 +23,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Send confirmation link</argument> </action> </referenceBlock> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="accountConfirmation" template="Magento_Customer::form/confirmation.phtml"/> </referenceContainer> -</layout> +</page> 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 ab02ec14615f2f374b1e5c02952db466db6e3047..223116ce1b4d69c803299c92cacd788338664603 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 @@ -23,15 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="customer_account_create_head_components" template="Magento_Customer::js/components.phtml"/> </referenceBlock> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> <referenceContainer name="content"> <block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="form/register.phtml" cacheable="false"> <container name="form.additional.info" label="invisible" as="form_additional_info"/> @@ -48,4 +43,4 @@ <referenceContainer name="form.additional.info"> <block class="Magento\Framework\View\Element\Template" name="form_additional_info_customer" template="Magento_Customer::additionalinfocustomer.phtml"/> </referenceContainer> -</layout> +</page> 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 c6ac5f2a9e2567093d54cc5a8d8724504137dfec..76236133690f6572ca13f88bc0923ab5d046455b 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 @@ -23,16 +23,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Reset a Password</argument> </action> </referenceBlock> <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> <action method="setHeaderTitle"> <argument translate="true" name="title" xsi:type="string">Reset a Password</argument> </action> @@ -40,4 +37,4 @@ <referenceContainer name="content"> <block class="Magento\Customer\Block\Account\Resetpassword" name="resetPassword" template="form/resetforgottenpassword.phtml"/> </referenceContainer> -</layout> +</page> 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 2b438cacc139b0d8af35b2656d64a9d5eee62690..6de3569eaa38b1457e34e99310c17a9e49ff55cd 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="customer_account_edit_head_components" template="Magento_Customer::js/components.phtml"/> @@ -36,4 +36,4 @@ <referenceContainer name="content"> <block class="Magento\Customer\Block\Form\Edit" name="customer_edit" template="form/edit.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> 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 95c9d229a99ef6744258dc57e4a76a7da47efceb..75baa8cb41cf4bc481ce2f00acb27852d687d9e0 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 @@ -23,16 +23,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Forgot Your Password</argument> </action> </referenceBlock> <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> <action method="setHeaderTitle"> <argument translate="true" name="title" xsi:type="string">Password forgotten</argument> </action> @@ -42,4 +39,4 @@ <container name="form.additional.info" label="invisible" as="form_additional_info"/> </block> </referenceContainer> -</layout> +</page> 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 c9d28e5e3cf79f2614f3385aa37e424fffc457b5..ffda3ac4609c0b991f811e68fff28cade9ade88c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceBlock name="page.main.title"> <action method="setPageTitle"> @@ -36,4 +36,4 @@ <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="account/dashboard/info.phtml"/> <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="account/dashboard/address.phtml"/> </referenceContainer> -</layout> +</page> 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 1f4f9115b4b519cdd9daad610fe1a8bd410d4745..96e458f82f9ae996fe10c6d4fcd27d2a19b26ff1 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 @@ -23,12 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <!-- customer.form.login.extra --> <container name="customer.login.container" label="Customer Login Container" htmlTag="div" htmlClass="login container"> @@ -48,4 +43,4 @@ <referenceContainer name="form.additional.info"> <block class="Magento\Framework\View\Element\Template" name="form_additional_info_customer" template="Magento_Customer::additionalinfocustomer.phtml"/> </referenceContainer> -</layout> +</page> 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 49cb585f2ff155200c0e15a41791fdf10b69b6eb..4d618e8a96163165766b3df0b2e8b91b2e208f0f 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 @@ -23,12 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="page.main.title"> <action method="setPageTitle"> <argument name="title" translate="true" xsi:type="string">You are now logged out</argument> @@ -37,4 +32,4 @@ <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="customer_logout" template="Magento_Customer::logout.phtml"/> </referenceContainer> -</layout> +</page> 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 376bf9e19baa90a74bbf5f2cb55da083d0cfdd12..99cfdfd59463732a41bb0c73b65ef5b05a3b91ec 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="customer_page_head_components" template="Magento_Customer::js/components.phtml"/> @@ -36,4 +36,4 @@ <referenceContainer name="content"> <block class="Magento\Customer\Block\Address\Edit" name="customer_address_edit" template="address/edit.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> 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 f31b052ca6f56560d50ec9c313bc8b715d664d97..33d54cad6eddf7e750fceb5311833b021096b619 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="customer_address_head_components" template="Magento_Customer::js/components.phtml"/> @@ -31,4 +31,4 @@ <referenceContainer name="content"> <block class="Magento\Customer\Block\Address\Book" name="address_book" template="address/book.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Customer/view/frontend/layout/default.xml b/app/code/Magento/Customer/view/frontend/layout/default.xml index 1d047ee2f47684bafb49882347a7ec7ad1497a70..09ed0de1f99e901fb06e966a87a347aac4c1752a 100644 --- a/app/code/Magento/Customer/view/frontend/layout/default.xml +++ b/app/code/Magento/Customer/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="top.links"> <block class="Magento\Customer\Block\Account\Link" name="my-account-link"> <arguments> @@ -37,4 +37,4 @@ </block> <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link" template="account/link/authorization.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 5230a785e9ca89fe5a154a3c998120a1c9509721..1ea7f97d0e05538eb602ebc9b8ac138023e6141e 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-import-export": "0.1.0-alpha91", - "magento/module-store": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-import-export": "0.1.0-alpha92", + "magento/module-store": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportcsv.xml b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportcsv.xml index 27777095a1e9685ee808c5f1f7c28f95acf029dc..5cbb3d519ce89509cede68b073e5c8567eda6e69 100644 --- a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportcsv.xml +++ b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportcsv.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_index_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="admin.block.customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 27777095a1e9685ee808c5f1f7c28f95acf029dc..5cbb3d519ce89509cede68b073e5c8567eda6e69 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_index_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="admin.block.customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 019d8f08b4a410e7a90131c33b782ff1cd45bc32..2728b24a1788377221c08c664d2be72574d8e359 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="admin.block.customer.grid"> <block class="Magento\Backend\Block\Widget\Grid\Export" name="admin.block.customer.grid.export" as="grid.export"> <arguments> @@ -41,4 +41,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/DesignEditor/composer.json b/app/code/Magento/DesignEditor/composer.json index 989e8759253041526da941a25254faa65281991a..c58852a9115cd96a573c361f3ac6a2c038373b82 100644 --- a/app/code/Magento/DesignEditor/composer.json +++ b/app/code/Magento/DesignEditor/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-url-rewrite": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-url-rewrite": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_contents.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_contents.xml index 945990a335367350950a1ecc47d70e8755172f39..5611bc397c087d6a59a33b915222df16c9856c07 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_contents.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_contents.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\DesignEditor\Block\Adminhtml\Editor\Tools\Files\Content\Files" name="editor_files.files" template="Magento_DesignEditor::editor/tools/files/content/files.phtml" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\DesignEditor\Block\Adminhtml\Editor\Tools\Files\Content\Files" name="editor_files.files" template="Magento_DesignEditor::editor/tools/files/content/files.phtml"/> + </container> </layout> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_index.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_index.xml index 3d2a32204c3b26408163de4f763e5ab3fcfcc5ce..b1771312b544889f0e5ad894f80a8fce47485888 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_index.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <remove name="footer"/> <remove name="head"/> <referenceContainer name="left"> @@ -35,4 +35,4 @@ <block class="Magento\DesignEditor\Block\Adminhtml\Editor\Tools\Files\Content\Uploader" name="editor_files.uploader" template="Magento_DesignEditor::editor/tools/files/content/uploader.phtml"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_firstentrance.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_firstentrance.xml index d6bc09796d40432c1e5feabf431c2f9eede95581..44888b49adac5a65b865aed2d05f5582aac6d889 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_firstentrance.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_firstentrance.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-bootstrap-edit-js"> <arguments> @@ -46,4 +46,4 @@ <block class="Magento\Backend\Block\Template" name="theme.dialog.edit" template="Magento_DesignEditor::theme/selector/theme_edit.phtml"/> <block class="Magento\DesignEditor\Block\Adminhtml\Theme\Selector\StoreView" name="theme.selector.storeview" template="Magento_DesignEditor::theme/selector/storeview.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_index.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_index.xml index d1913556e7e26a6622d0e8ee33167daf13af4768..3270aad61c716d33c4a1d942c55c30d6148d9ff9 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_index.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-bootstrap-edit-js"> <arguments> @@ -64,4 +64,4 @@ <block class="Magento\Backend\Block\Template" name="theme.dialog.edit" template="Magento_DesignEditor::theme/selector/theme_edit.phtml"/> <block class="Magento\DesignEditor\Block\Adminhtml\Theme\Selector\StoreView" name="theme.selector.storeview" template="Magento_DesignEditor::theme/selector/storeview.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml index 13d27bf353ff73d892a285f5cdc1aea33f299006..76a45cf6a6e3a985d1d388c200ff00b9e5555ae3 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="backend.page"> <action method="setTemplate"> <argument name="file" xsi:type="string">Magento_DesignEditor::editor.phtml</argument> </action> @@ -86,4 +86,4 @@ </block> <block class="Magento\Backend\Block\Template" name="theme.dialog" template="Magento_DesignEditor::dialog.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_loadthemelist.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_loadthemelist.xml index 01d6b406fd82c3251aa75697d6bc2cde5c9e42aa..543f087ee5126e1b1cdf65535b2905e6327d541c 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_loadthemelist.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_loadthemelist.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\DesignEditor\Block\Adminhtml\Theme\Selector\SelectorList\Available" name="available.theme.list" template="Magento_DesignEditor::theme/list/available_ajax.phtml"> <block class="Magento\DesignEditor\Block\Adminhtml\Theme" name="design.editor.theme" as="theme" template="Magento_DesignEditor::theme/available.phtml"/> </block> diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index e9347ff479dd40c5651dbb94a86321283fb31850..f467f32fa98387b6cd58f94f8762ee1fb3f53b4f 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-shipping": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-shipping": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index f4f9ad63d70ff1b48bc99e5bad379c7054240534..3cc0d57ac7eb2e40da8eae378a878f43825c5298 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Directory/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Directory/view/frontend/layout/catalog_category_view.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/Directory/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Directory/view/frontend/layout/catalog_category_view.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> 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 dddee11e42de78205d5a79eebd94467866d0af0f..11bde6d84c3f0db6925054c907623ce676947b7f 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 @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> \ No newline at end of file +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> \ No newline at end of file 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 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 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 @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> 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 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 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 @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/Directory/view/frontend/layout/default.xml b/app/code/Magento/Directory/view/frontend/layout/default.xml index ceb94eebba05860f23bc9fea88f0ec47dfef070f..ca17a3fd7c1f5134aef8a3defc3923ff0aad3a49 100644 --- a/app/code/Magento/Directory/view/frontend/layout/default.xml +++ b/app/code/Magento/Directory/view/frontend/layout/default.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="header.panel"> <block class="Magento\Directory\Block\Currency" name="currency" before="store_language" template="currency.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 015b58a6c067856787ebd5eebfe530a7065bfc42..63a02f5615ab02986bb3860af78883af004fe6b8 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-weee": "0.1.0-alpha91", - "magento/module-wishlist": "0.1.0-alpha91", - "magento/module-gift-message": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-weee": "0.1.0-alpha92", + "magento/module-wishlist": "0.1.0-alpha92", + "magento/module-gift-message": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_downloadable.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_downloadable.xml index ce2cc28a9e629985fbc04dc014dee847b6f70008..c30961aec4d3d22c3f613e63a3306fbaae5d0775 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_downloadable.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_downloadable.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product_tabs"> <action method="addTab"> <argument name="name" xsi:type="string">downloadable_items</argument> <argument name="block" xsi:type="string">Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable</argument> </action> </referenceBlock> -</layout> +</page> 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 ce2cc28a9e629985fbc04dc014dee847b6f70008..c30961aec4d3d22c3f613e63a3306fbaae5d0775 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product_tabs"> <action method="addTab"> <argument name="name" xsi:type="string">downloadable_items</argument> <argument name="block" xsi:type="string">Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable</argument> </action> </referenceBlock> -</layout> +</page> 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 0e5526df703a8d811efe24efa2465c5f75b1dae4..3780fb5d8f88cb026e8d92d0402f248e71d95935 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product.composite.fieldset"> <block class="Magento\Downloadable\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Downloadable" name="product.composite.fieldset.downloadable" before="product.composite.fieldset.options" template="product/composite/fieldset/downloadable.phtml"/> </referenceBlock> -</layout> +</page> 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 ce2cc28a9e629985fbc04dc014dee847b6f70008..c30961aec4d3d22c3f613e63a3306fbaae5d0775 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product_tabs"> <action method="addTab"> <argument name="name" xsi:type="string">downloadable_items</argument> <argument name="block" xsi:type="string">Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable</argument> </action> </referenceBlock> -</layout> +</page> 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 a7c3577f0b69956d962eaded49a821efa7e10cad..139349f9cdc37ba99f783d666dff232db21e573f 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer.wishlist.edit.tab"> <arguments> <argument name="product_configuration_helpers" xsi:type="array"> @@ -31,4 +31,4 @@ </argument> </arguments> </referenceBlock> -</layout> +</page> 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 b403ddd8f736960ea86b077c46cc05d8cc96ed0f..6b3a4ce19cfd9a14f44944ee44e0c26825aab2e0 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="downloadable" template="Magento_Downloadable::sales/order/creditmemo/create/items/renderer/downloadable.phtml"/> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_downloadable" template="sales/items/column/downloadable/creditmemo/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> 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 b403ddd8f736960ea86b077c46cc05d8cc96ed0f..6b3a4ce19cfd9a14f44944ee44e0c26825aab2e0 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="downloadable" template="Magento_Downloadable::sales/order/creditmemo/create/items/renderer/downloadable.phtml"/> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_downloadable" template="sales/items/column/downloadable/creditmemo/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> 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 cb4f5026f8fb9c47463c73d1322e0614f5085341..2a5688ee41afee22dfd8dbc0050d6b6bb51d3b26 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="downloadable" template="Magento_Downloadable::sales/order/creditmemo/view/items/renderer/downloadable.phtml"/> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_downloadable" template="sales/items/column/downloadable/creditmemo/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> 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 2c0e333089f7ceb3ff382e1ac6f31a5d35ecaff4..f13d76ccd551fd2501a44cff80cdad39e7c2e380 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="downloadable" template="Magento_Downloadable::sales/order/invoice/create/items/renderer/downloadable.phtml"/> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_downloadable" template="sales/items/column/downloadable/invoice/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> 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 2c0e333089f7ceb3ff382e1ac6f31a5d35ecaff4..f13d76ccd551fd2501a44cff80cdad39e7c2e380 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="downloadable" template="Magento_Downloadable::sales/order/invoice/create/items/renderer/downloadable.phtml"/> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_downloadable" template="sales/items/column/downloadable/invoice/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> 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 00c4127cc6e9979b62d3e2cb975e40f77aa54b40..46794994ac263db96a9ad0bea136ff1dccdf638a 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="downloadable" template="Magento_Downloadable::sales/order/invoice/view/items/renderer/downloadable.phtml"/> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_downloadable" template="sales/items/column/downloadable/invoice/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> 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 cf28ec103d0f35343dc3244714aa1352a8dd7e5b..da411eed580d4c751c24115d24b93eee3a2c9dd2 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer" as="downloadable" template="Magento_Downloadable::sales/order/view/items/renderer/downloadable.phtml"/> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_downloadable" template="sales/items/column/downloadable/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml index 69db92278484c06b55322f74864e4481eb574b5b..f0624865537228abddf3ac89c41281b997dd4989 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml @@ -143,7 +143,7 @@ var linkTemplate = '<tr>'+ '</div>'+ '</div>'+ '<div class="row">'+ - '<label for="downloadable_link_{{id}}_sample_url_type"><input type="radio" class="radio" id="downloadable_link_{{id}}_sample_url_type" name="downloadable[link][{{id}}][sample][type]" value="url"{{sample_url_checked}} /> URL:</label><input type="text" class="input-text validate-downloadable-url" name="downloadable[link][{{id}}][sample][url]" value="{{sample_url}}" />'+ + '<label for="downloadable_link_{{id}}_sample_url_type"><input type="radio" class="radio" id="downloadable_link_{{id}}_sample_url_type" name="downloadable[link][{{id}}][sample][type]" value="url"{{sample_url_checked}} /> URL:</label><input type="text" class="input-text validate-downloadable-url validate-url" name="downloadable[link][{{id}}][sample][url]" value="{{sample_url}}" />'+ '</div>'+ '<div>'+ '<span id="downloadable_link_{{id}}_sample_container"></span>'+ @@ -171,7 +171,7 @@ var linkTemplate = '<tr>'+ '</div>'+ '</div>'+ '<div class="row">'+ - '<label for="downloadable_link_{{id}}_url_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_link_{{id}}_url_type" name="downloadable[link][{{id}}][type]" value="url"{{url_checked}} /> URL:</label><input type="text" class="validate-downloadable-url input-text" name="downloadable[link][{{id}}][link_url]" value="{{link_url}}" />'+ + '<label for="downloadable_link_{{id}}_url_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_link_{{id}}_url_type" name="downloadable[link][{{id}}][type]" value="url"{{url_checked}} /> URL:</label><input type="text" class="validate-downloadable-url validate-url input-text" name="downloadable[link][{{id}}][link_url]" value="{{link_url}}" />'+ '</div>'+ '<div>'+ '<span id="downloadable_link_{{id}}_link_container"></span>'+ diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml index 453013f37556d3f5c78f871a3622a95c03d35068..34087abc12f2c8f7a76eadd9148322f2c4b7f458 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml @@ -101,7 +101,7 @@ var sampleTemplate = '<tr>'+ '</div>'+ '</div>'+ '<div class="row">'+ - '<label for="downloadable_sample_{{id}}_url_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_sample_{{id}}_url_type" name="downloadable[sample][{{id}}][type]" value="url"{{url_checked}} /> URL:</label> <input type="text" class="validate-downloadable-url input-text" name="downloadable[sample][{{id}}][sample_url]" value="{{sample_url}}" />'+ + '<label for="downloadable_sample_{{id}}_url_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_sample_{{id}}_url_type" name="downloadable[sample][{{id}}][type]" value="url"{{url_checked}} /> URL:</label> <input type="text" class="validate-downloadable-url validate-url input-text" name="downloadable[sample][{{id}}][sample_url]" value="{{sample_url}}" />'+ '</div>'+ '<div>'+ '<span id="downloadable_sample_{{id}}_container"></span>'+ diff --git a/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml b/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml index dd483a99be695448e8474058fe3a28454f42c1f5..aa7e7b9bf2f31ee05c9467b7ef04b7de8b995203 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="product.info.type"> <block class="Magento\Downloadable\Block\Catalog\Product\View\Type" name="product.info.downloadable" as="product_type_data" template="catalog/product/type.phtml"> - <block class="Magento\Downloadable\Block\Catalog\Product\Samples" name="product.info.downloadable.samples" as="samples" template="catalog/product/samples.phtml"/> <block class="Magento\CatalogInventory\Block\Stockqty\DefaultStockqty" name="product.info.downloadable.extra" as="product_type_data_extra" template="stockqty/default.phtml"/> + <block class="Magento\Downloadable\Block\Catalog\Product\Samples" name="product.info.downloadable.samples" as="samples" template="catalog/product/samples.phtml"/> </block> </referenceContainer> <referenceBlock name="product.info.options.wrapper"> @@ -44,4 +44,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="downloadable_page_head_components" template="Magento_Downloadable::js/components.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml index 45ba575ed710f7e013e7cf4ea294322ef545c2dd..be75e2a58e62d6f1ee333ee6fac440acf6ae4efe 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_view_type_downloadable"/> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_item_renderers.xml index 2726f51099300b071ec2d0496eb05cb5f548ade3..bdd5ec99c4209259104aeeb661b38256161a4a14 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_item_renderers.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\Downloadable\Block\Checkout\Cart\Item\Renderer" as="downloadable" template="checkout/cart/item/default.phtml"/> </referenceBlock> <referenceBlock name="additional.product.info"> <block class="Magento\Framework\View\Element\Template" name="downloadable.product.links" template="Magento_Downloadable::checkout/links.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml index 03531a64a7feb454284e2ff8111311f5f58d45bc..9b7dc670854ca7ab3d857d5031ac4fd0093dab98 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.sidebar.item.renderers"> <block class="Magento\Downloadable\Block\Checkout\Cart\Item\Renderer" as="downloadable" template="Magento_Checkout::cart/sidebar/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_review_item_renderers.xml index 71fa5a594c48bc0bfb16d3b7ec8804cab0ed0158..b66a06c83294769ede3eb4bde11c3694db98b4fa 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\Downloadable\Block\Checkout\Cart\Item\Renderer" as="downloadable" template="Magento_Checkout::onepage/review/item.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_success.xml index 42a14719565b41a3a181a24fe66b9e14e2c41b5f..6233242047dd5a821d3cc8e6bbb79495289080fb 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_success.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.success"> <block class="Magento\Downloadable\Block\Checkout\Success" name="downloadable.checkout.success" template="checkout/success.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml b/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml index 1fc82c6f7b5930d2708b49e21b65f27c9997a963..2b93c6d057e3efceea1f3c1f2bc38b5297c38eda 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-downloadable-products-link"> <arguments> @@ -32,4 +32,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml b/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml index 43969053e3317e9fed27c26f5078d872f14c8b0f..3cfb243e6b7e810a09ba1fffdc6f88b765d147b5 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Downloadable\Block\Customer\Products\ListProducts" name="downloadable_customer_products_list" template="customer/products/list.phtml"/> @@ -33,4 +33,4 @@ <argument translate="true" name="title" xsi:type="string">My Downloadable Products</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/multishipping_checkout_success.xml b/app/code/Magento/Downloadable/view/frontend/layout/multishipping_checkout_success.xml index 3cf6ea5e73cd9dc6c0de5d333c81b57cb6680205..44b6fedfa533e2325e11a7a2c3b5a6a00bcc279e 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/multishipping_checkout_success.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/multishipping_checkout_success.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout_success"> <block class="Magento\Downloadable\Block\Checkout\Success" name="downloadable.checkout.success" template="checkout/success.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_creditmemo_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_creditmemo_renderers.xml index 9e499e002ebc2e7a948994023c0293f1efa08aa5..4f26536566b3a49dc7b0af279a059c9701eb96f7 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_creditmemo_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_creditmemo_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.email.order.creditmemo.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Email\Items\Downloadable" as="downloadable" template="email/order/items/creditmemo/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_invoice_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_invoice_renderers.xml index 503ec88f44b614d354fa1da27c5d47b20d0ede32..692ea3067e0740176987eb1eac7f8df4374fa27b 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_invoice_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_invoice_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.email.order.invoice.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Email\Items\Downloadable" as="downloadable" template="email/order/items/invoice/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_renderers.xml index adf3aff47bdb5a84abbfddf739157e1e7c2763c7..0fdd84c0669ce96b745b6c067744e653347cfadc 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.email.order.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Email\Items\Order\Downloadable" as="downloadable" template="email/order/items/order/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_creditmemo_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_creditmemo_renderers.xml index d4c4103f70fc12c2d0f03dc97b59044873e68d26..174e000ff17b6a676f6432cba25c9216427f8c9e 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_creditmemo_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_creditmemo_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.creditmemo.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/creditmemo/items/renderer/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_invoice_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_invoice_renderers.xml index 9783ab26ba0598ddb288401065e68e5a5887fa05..c3ea08a88cb2dae92efe340cadc2353d7fd23a91 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_invoice_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_invoice_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/invoice/items/renderer/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_item_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_item_renderers.xml index 47fe3851241b58edba00ca8dd4d022575d0ea771..fe8139f3ba19837ccf7e3a3ef67ebaf1d11cb1e4 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_item_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.items.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/items/renderer/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_creditmemo_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_creditmemo_renderers.xml index ed08acbef86e98abeb42a4804be873028333be91..db6fe7be41083fb506cf4def6386e61195824940 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_creditmemo_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_creditmemo_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.creditmemo.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/creditmemo/items/renderer/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_invoice_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_invoice_renderers.xml index bd9da7df9f4e0960e4534ed4663d208eba73f4e6..9696092756b7d4c104a71025910408943d5856f1 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_invoice_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_invoice_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.invoice.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/invoice/items/renderer/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_renderers.xml index 491ae7cfafefc4c032cdb0897eb4c24eb50e63f6..6f738bce9585a1b00915cdfabc72c070c17889ee 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/items/renderer/downloadable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml b/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml index a4f0ec8141f4627d026a1bf3c0e1cf26bee6aed9..3115ec9085847d4f7448183def93687490d7416e 100644 --- a/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml +++ b/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml @@ -39,4 +39,4 @@ <span><?php echo __('Out of stock') ?></span> </p> <?php endif; ?> -<?php echo $this->getChildHtml('product_type_data_extra') ?> +<?php echo $this->getChildHtml() ?> \ No newline at end of file diff --git a/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php b/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php index 01df6064bf21b68d635e02b9a910f5e4af83e9ed..77fab5ff5c25f359a58443d3d6db24bad40a147e 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php @@ -369,7 +369,9 @@ abstract class AbstractData __("'%value%' appears to be a DNS hostname but cannot extract TLD part") __("'%value%' appears to be a DNS hostname but cannot match TLD against known list") */ - $validator = new \Zend_Validate_EmailAddress(); + $validator = new \Zend_Validate_EmailAddress( + ['allow' => ['allow'=> \Zend_Validate_Hostname::ALLOW_ALL, 'tld' => false]] + ); $validator->setMessage( __('"%1" invalid type entered.', $label), \Zend_Validate_EmailAddress::INVALID diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Multiline.php b/app/code/Magento/Eav/Model/Attribute/Data/Multiline.php index ab0b3e72c162a1e6d85e7bbe70dae009d6f07346..53fbed6a8f584d93aec8e598d02b8010812bff7a 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Multiline.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Multiline.php @@ -59,43 +59,49 @@ class Multiline extends \Magento\Eav\Model\Attribute\Data\Text public function validateValue($value) { $errors = array(); + $lines = $this->processValue($value); $attribute = $this->getAttribute(); - - if ($value === false) { - // try to load original value and validate it - $value = $this->getEntity()->getDataUsingMethod($attribute->getAttributeCode()); - if (!is_array($value)) { - $value = explode("\n", $value); - } + $attributeLabel = __($attribute->getStoreLabel()); + if ($attribute->getIsRequired() && empty($lines)) { + $errors[] = __('"%1" is a required value.', $attributeLabel); } - if (!is_array($value)) { - $value = array($value); + $maxAllowedLineCount = $attribute->getMultilineCount(); + if (count($lines) > $maxAllowedLineCount) { + $errors[] = __('"%1" cannot contain more than %2 lines.', $attributeLabel, $maxAllowedLineCount); } - for ($i = 0; $i < $attribute->getMultilineCount(); $i++) { - if (!isset($value[$i])) { - $value[$i] = null; - } - // validate first line - if ($i == 0) { - $result = parent::validateValue($value[$i]); + + foreach ($lines as $lineIndex => $line) { + // First line must be always validated + if ($lineIndex == 0 || !empty($line)) { + $result = parent::validateValue($line); if ($result !== true) { - $errors = $result; - } - } else { - if (!empty($value[$i])) { - $result = parent::validateValue($value[$i]); - if ($result !== true) { - $errors = array_merge($errors, $result); - } + $errors = array_merge($errors, $result); } } } - if (count($errors) == 0) { - return true; + return (count($errors) == 0) ? true : $errors; + } + + /** + * Process value before validation + * + * @param bool|string|array $value + * @return array list of lines represented by given value + */ + protected function processValue($value) + { + if ($value === false) { + // try to load original value and validate it + $attribute = $this->getAttribute(); + $entity = $this->getEntity(); + $value = $entity->getDataUsingMethod($attribute->getAttributeCode()); + } + if (!is_array($value)) { + $value = explode("\n", $value); } - return $errors; + return $value; } /** diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index e8ca045290861d86f4057ec1d288a0f3d23f15bd..459cdf68a02216b857b428b641e633125e0209e7 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index f9ad16c0141e3a8003de44e87c5a4bc2ad991c9d..4bbe60dbf22cbf9aaf92cb967c01167e94ed8699 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -315,7 +315,7 @@ class Filter extends \Magento\Framework\Filter\Template $skipParams = array('handle', 'area'); /** @var $layout \Magento\Framework\View\LayoutInterface */ - $layout = $this->_layoutFactory->create(); + $layout = $this->_layoutFactory->create(array('cacheable' => false)); $layout->getUpdate()->addHandle($this->_directiveParams['handle'])->load(); $layout->generateXml(); diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index acdd4206e94326a1e50f522f0745b05903444ab2..6b336196b861f4accfa09ce084e58bef44e631d7 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_edit.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_edit.xml index 79775302cf02c0569c11db885ffb31b4548f6561..2b1cae0e2e359f72b97ee8e3b2cfa0fb2fa4f37c 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_edit.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Script" name="magento-email-js-bootstrap-js"> <arguments> @@ -31,4 +31,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid.xml index dac01ae99546565b2476d96fd33cef3c5f054233..0c9a623cc4a9bf579e90ae01110fac4ada82acf5 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid.xml @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_email_template_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.system.email.template.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.system.email.template.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid_block.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid_block.xml index c0bfa00b2c5ee76949224c7c5c3cac1d98ad36ba..65bb7bec189f9029418f1829c4a88983e818ea72 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid_block.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.system.email.template.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.email.template.grid" as="grid"> <arguments> @@ -105,4 +105,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_index.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_index.xml index ebbd5fcdb5df276a846b8bae0506590d70ec9ada..7aa58115f1e4473862849d375bf42854b67948d0 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_index.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_index.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="adminhtml_email_template_grid_block"/> <referenceContainer name="content"> <block class="Magento\Email\Block\Adminhtml\Template" name="adminhtml.system.email.template.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml b/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml index ce58ae1b47eed6afba906b58513442625a3be7d7..4ab41a0fd66cb6e74acef4041a042fec31dc8f22 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Framework\View\Element\Template" name="root" output="1" template="Magento_Email::template/preview.phtml"> - <block class="Magento\Email\Block\Adminhtml\Template\Preview" name="content" as="content"/> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Framework\View\Element\Template" name="page.block" template="Magento_Email::template/preview.phtml"> + <block class="Magento\Email\Block\Adminhtml\Template\Preview" name="content" as="content"/> + </block> + </container> </layout> diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index fc1956a316565717f4b28253652c4a3741038394..e9f108b65148a4226a2bbbc2f86bda553ddfd4da 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-shipping": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-shipping": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 27667e3e25a5ce68231e6833a35a84e39d0ab6ed..ab8bdee8ed853730e28a1fc2a32936e3e2b36e55 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-multishipping": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-multishipping": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_index.xml index 077102960315a64f45aeb5328f8911e5e5d7d373..1a8bbcbcc11d570998a79b4cc4338c0d9fb0350b 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_item_extra_info"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Giftoptions" name="gift_options_link" template="sales/order/create/giftoptions.phtml"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Items" name="gift_options_item_data" template="sales/order/create/items.phtml"/> @@ -34,4 +34,4 @@ <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Form" name="gift_options_form" template="giftoptionsform.phtml"/> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_data.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_data.xml index 077102960315a64f45aeb5328f8911e5e5d7d373..1a8bbcbcc11d570998a79b4cc4338c0d9fb0350b 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_data.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_data.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_item_extra_info"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Giftoptions" name="gift_options_link" template="sales/order/create/giftoptions.phtml"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Items" name="gift_options_item_data" template="sales/order/create/items.phtml"/> @@ -34,4 +34,4 @@ <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Form" name="gift_options_form" template="giftoptionsform.phtml"/> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_items.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_items.xml index 077102960315a64f45aeb5328f8911e5e5d7d373..1a8bbcbcc11d570998a79b4cc4338c0d9fb0350b 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_items.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_item_extra_info"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Giftoptions" name="gift_options_link" template="sales/order/create/giftoptions.phtml"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Items" name="gift_options_item_data" template="sales/order/create/items.phtml"/> @@ -34,4 +34,4 @@ <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Form" name="gift_options_form" template="giftoptionsform.phtml"/> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml index 31991aee64616321165cccd12d392e9b50a015aa..51214d4ea0117b0a7ead18bcc824d54bf858e857 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> @@ -41,4 +41,4 @@ <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\View\Form" name="gift_options_form" template="giftoptionsform.phtml"/> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index c923d16192f375c9e23b4d0aeab7065954a276ba..1e1186e2435d370a15f75034ea0a82478262ca4e 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/GoogleAdwords/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/GoogleAdwords/view/frontend/layout/checkout_onepage_success.xml index a83e3e62352bad773f7c5d5b04ccde02fb827f70..04767858e601fa8a67d15bf15770b26964b77a7b 100644 --- a/app/code/Magento/GoogleAdwords/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/GoogleAdwords/view/frontend/layout/checkout_onepage_success.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\GoogleAdwords\Block\Code" name="google.adwords.code" template="code.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index 098c375ca4a4c7e384d7a116d66f560e1c785694..44b90179e9dd36f26df7908de7b8d3862781dc99 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml b/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml index 55f7f8d7f46d589926c19ccb30c17ac637f1ad32..ba1d676c236fdd229806e1ef6a838671d30c3bac 100644 --- a/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml +++ b/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="after_body_start"> <block class="Magento\GoogleAnalytics\Block\Ga" name="google_analytics" as="google_analytics" template="ga.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index abb7d23a5d455bcd3ef4b4f58dc2373ba1fe6542..c0c161cee8db80be2469fc19a0a4c3a2ca4f2ea8 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-google-analytics": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-google-analytics": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/adminhtml_cms_page_edit.xml b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/adminhtml_cms_page_edit.xml index afbe89e3859ed72a6af94bb8c9d9afa54fee0c9e..f4994744affc3cafa8f34a7db41d8e3efb593745 100644 --- a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/adminhtml_cms_page_edit.xml +++ b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/adminhtml_cms_page_edit.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="cms_page_edit_tabs"> <action method="addTab"> <argument name="name" xsi:type="string">google-experiment</argument> <argument name="block" xsi:type="string">Magento\GoogleOptimizer\Block\Adminhtml\Cms\Page\Edit\Tab\Googleoptimizer</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/catalog_product_new.xml index 9b556dd71c8bb17dd3d0e12780d09c05d9a0be55..6dafa0833c9290abb2f5f0d9496e469ba73a1bd5 100644 --- a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/catalog_product_new.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product_tabs"> <action method="addTab"> <argument name="name" xsi:type="string">google-experiment</argument> <argument name="block" xsi:type="string">Magento\GoogleOptimizer\Block\Adminhtml\Catalog\Product\Edit\Tab\Googleoptimizer</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_category_view.xml index 46a6e63bc046b97f8669141592f101e4fb6e2a4f..160d76cfb1661a7f2550e39288a3d561d5ebc11b 100644 --- a/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_category_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\GoogleOptimizer\Block\Code\Category" before="-" name="googleoptimizer.experiment.script"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_product_view.xml index d765f3a1d2a792c324fc22cd463afbd39849e308..536bfac60656933a81695dc7f6f3ec0f1b1d6521 100644 --- a/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_product_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\GoogleOptimizer\Block\Code\Product" before="-" name="googleoptimizer.experiment.script"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GoogleOptimizer/view/frontend/layout/cms_page_view.xml b/app/code/Magento/GoogleOptimizer/view/frontend/layout/cms_page_view.xml index 293820d4fbee1cf3e016bfda1c403b5231937806..48b2d671f56957ed4c38551d3d4dbe3e6f647f2a 100644 --- a/app/code/Magento/GoogleOptimizer/view/frontend/layout/cms_page_view.xml +++ b/app/code/Magento/GoogleOptimizer/view/frontend/layout/cms_page_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\GoogleOptimizer\Block\Code\Page" before="-" name="googleoptimizer.experiment.script"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GoogleShopping/composer.json b/app/code/Magento/GoogleShopping/composer.json index 99c1f0a77aa35244727862db82be8fc76db2b88e..301d9f7aad948e6b4500944bf79cdd6ae2e7d2d9 100644 --- a/app/code/Magento/GoogleShopping/composer.json +++ b/app/code/Magento/GoogleShopping/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_items_index.xml b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_items_index.xml index db02d1fa6995c8e461e99a3a0ab7a90157dd1bfc..07ac63527a8ea7655dfebe8ac41ea3f3cb54b7d9 100644 --- a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_items_index.xml +++ b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_items_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Script" name="magento-googleshopping-js-bootstrap-js"> <arguments> @@ -36,4 +36,4 @@ name="store_switcher" template="Magento_Backend::store/switcher.phtml" /> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_block.xml b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_block.xml index 675052bb3c4b439ba65c7c49ed14935d004a2ad3..55726205dbaa555470674afc066a3fef32c3fbad 100644 --- a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_block.xml +++ b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="googleshopping.types.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.googleshopping.types.grid" as="grid"> <arguments> @@ -74,4 +74,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_grid.xml b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_grid.xml index d2d9894218a6870fd8166c493ab1755d65c34d3f..3847e080441e7f05e75d0a621974c1de45027000 100644 --- a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_grid.xml +++ b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_grid.xml @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_googleshopping_types_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="googleshopping.types.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="googleshopping.types.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_index.xml b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_index.xml index c4beb56a021ec5beaa49ee89d179253ac2647f4b..b193cabf7143bab6c62d6d65469e3922d1d5d581 100644 --- a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_index.xml +++ b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_types_index.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="adminhtml_googleshopping_types_block"/> <referenceContainer name="content"> <block class="Magento\GoogleShopping\Block\Adminhtml\Types" name="googleshopping.types.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/GoogleShopping/view/adminhtml/templates/items.phtml b/app/code/Magento/GoogleShopping/view/adminhtml/templates/items.phtml index 2a9a34c1b0b0372a2b34f5230c95e1be0aff61aa..30673ae916c486efc16de2b63282b61166084aaa 100644 --- a/app/code/Magento/GoogleShopping/view/adminhtml/templates/items.phtml +++ b/app/code/Magento/GoogleShopping/view/adminhtml/templates/items.phtml @@ -45,11 +45,9 @@ require([ 'Magento_GoogleShopping/googleshopping' ], function(){ -//<![CDATA[ Mage.GoogleShopping.isProcessRunning = <?php echo $this->isProcessRunning() ? 'true' : 'false'; ?>; Mage.GoogleShopping.statusUrl = '<?php echo $this->getStatusUrl(); ?>'; Mage.GoogleShopping.runningMessage = '<?php echo __('Google Shopping synchronization process is running');?>'; -//]]> }); </script> diff --git a/app/code/Magento/GoogleShopping/view/adminhtml/web/googleshopping.js b/app/code/Magento/GoogleShopping/view/adminhtml/web/googleshopping.js index d4f7bf9d2597c522d277488f59f7fb54bd4354b0..60bb83764b52811f647914451f27c4072f8c7a45 100644 --- a/app/code/Magento/GoogleShopping/view/adminhtml/web/googleshopping.js +++ b/app/code/Magento/GoogleShopping/view/adminhtml/web/googleshopping.js @@ -112,33 +112,40 @@ if (typeof Mage.GoogleShopping == 'undefined') { } -Event.observe(document, 'dom:loaded', function() { - Mage.GoogleShopping.itemForm = items_massactionJsObject.form; - items_massactionJsObject.prepareForm = items_massactionJsObject.prepareForm.wrap(function (proceed) { - Mage.GoogleShopping.itemForm = proceed(); - Mage.GoogleShopping.itemForm.submit = function(){ Mage.GoogleShopping.startAction(this); }; - return Mage.GoogleShopping.itemForm; - }); + jQuery(function(){ + + setTimeout(function(){ + Mage.GoogleShopping.itemForm = items_massactionJsObject.form; + + items_massactionJsObject.prepareForm = items_massactionJsObject.prepareForm.wrap(function (proceed) { + Mage.GoogleShopping.itemForm = proceed(); + Mage.GoogleShopping.itemForm.submit = function(){ Mage.GoogleShopping.startAction(this); }; + return Mage.GoogleShopping.itemForm; + }); - Mage.GoogleShopping.productForm = googleshopping_selection_search_grid__massactionJsObject.form; - googleshopping_selection_search_grid__massactionJsObject.prepareForm = googleshopping_selection_search_grid__massactionJsObject.prepareForm.wrap(function (proceed) { - Mage.GoogleShopping.productForm = proceed(); - Mage.GoogleShopping.productForm.submit = function() { Mage.GoogleShopping.startAction(this) }; - return Mage.GoogleShopping.productForm; - }); + Mage.GoogleShopping.productForm = googleshopping_selection_search_grid__massactionJsObject.form; + + googleshopping_selection_search_grid__massactionJsObject.prepareForm = googleshopping_selection_search_grid__massactionJsObject.prepareForm.wrap(function (proceed) { + Mage.GoogleShopping.productForm = proceed(); + Mage.GoogleShopping.productForm.submit = function() { Mage.GoogleShopping.startAction(this) }; + return Mage.GoogleShopping.productForm; + }); - Mage.GoogleShopping.itemForm.submit = function(){ Mage.GoogleShopping.startAction(this); }; - Mage.GoogleShopping.productForm.submit = function() { Mage.GoogleShopping.startAction(this) }; - if (Mage.GoogleShopping.isProcessRunning) { - Mage.GoogleShopping.lock(); - Mage.GoogleShopping.poller.onSuccess = function(isRunning){ - if (!isRunning) { - this.stop() - Mage.GoogleShopping.onSuccess(); + Mage.GoogleShopping.itemForm.submit = function(){ Mage.GoogleShopping.startAction(this); }; + Mage.GoogleShopping.productForm.submit = function() { Mage.GoogleShopping.startAction(this) }; + + if (Mage.GoogleShopping.isProcessRunning) { + Mage.GoogleShopping.lock(); + Mage.GoogleShopping.poller.onSuccess = function(isRunning){ + if (!isRunning) { + this.stop() + Mage.GoogleShopping.onSuccess(); + } + } + Mage.GoogleShopping.poller.start(Mage.GoogleShopping.statusUrl); } - } - Mage.GoogleShopping.poller.start(Mage.GoogleShopping.statusUrl); - } -}); + + }, 1500); + }); }); \ No newline at end of file diff --git a/app/code/Magento/GoogleShopping/view/frontend/layout/cms_index_index.xml b/app/code/Magento/GoogleShopping/view/frontend/layout/cms_index_index.xml index 66732e78ef9b006ae599d53b3297d4ea84ab06da..fff3f77e0de8c8474348882a8f62adeb15386bd8 100644 --- a/app/code/Magento/GoogleShopping/view/frontend/layout/cms_index_index.xml +++ b/app/code/Magento/GoogleShopping/view/frontend/layout/cms_index_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\GoogleShopping\Block\SiteVerification"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index ffd9ef845df3a38b57d82361131b9a39d1f529a4..b9e3799d1ed0ce2b77d767d1a8c4325af8452677 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-import-export": "0.1.0-alpha91", - "magento/module-catalog-import-export": "0.1.0-alpha91", - "magento/module-grouped-product": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91" + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-import-export": "0.1.0-alpha92", + "magento/module-catalog-import-export": "0.1.0-alpha92", + "magento/module-grouped-product": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index 2093d016c8f3d7fd5479aac169f9b0300e670985..5f48a5be84d3ffe7bb51741dd31433b00b018000 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_grouped.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_grouped.xml index 3d6fd862df613036b2c1e8e34918ab986b24dce5..ca72e17fd6570e4feacf036ccd4bfb77e40f444a 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_grouped.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_grouped.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="groupedproduct_popup_grid"/> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="magento-grouped-product-css-grouped-product-css"> @@ -54,4 +54,4 @@ </arguments> </referenceBlock> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_new.xml index 7040cbf769f8625ac48837e836345ed051c1205f..5360a6ce095e9836a084818f7fbb9a5b2b78b8df 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_new.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="js"> <block class="Magento\Framework\View\Element\Template" template="Magento_GroupedProduct::product/stock/disabler.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml index 0e2d8a05b0a362de1d34ef26f4e89104e4079115..b041dbba665ff34bae91828012778a1ed3143e87 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product.composite.fieldset"> <block class="Magento\GroupedProduct\Block\Adminhtml\Product\Composite\Fieldset\Grouped" name="product.composite.fieldset.grouped" before="product.composite.fieldset.options" template="catalog/product/composite/fieldset/grouped.phtml"/> <remove name="product.composite.fieldset.qty"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_edit_popup.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_edit_popup.xml index ca081c55d90a1a2a005a175f01edfb1801c96e1f..d23628c37125fc20db3f8db6d48d22db3e06e819 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_edit_popup.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_edit_popup.xml @@ -23,7 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="catalog_product_grouped" /> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="catalog.product.edit.tab.super.grid.popup.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <update handle="catalog_product_grouped"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="catalog.product.edit.tab.super.grid.popup.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml index b2f456ced99360863dcd690a75ee2289a4b343cf..753488728ae1d4864544e47d1c8579b6ca1c431b 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="catalog.product.edit.tab.super.grid.popup.container"> <block class="Magento\Backend\Block\Widget\Grid" name="catalog.product.edit.tab.super.group.popup" as="grid"> <arguments> @@ -76,4 +76,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_new.xml index 6e34719dc7e2bc2ff9d877decfece11a5c7e3f00..00181c29d9dbd7101a15f95672a3f45ba799ec12 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index 6e34719dc7e2bc2ff9d877decfece11a5c7e3f00..00181c29d9dbd7101a15f95672a3f45ba799ec12 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_view.xml index fea691acc622aff4c08ab65762769e8d02de14f2..22c8958e3b4f14077c030fd7b38c6b84dbd55b0c 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_new.xml index 6e34719dc7e2bc2ff9d877decfece11a5c7e3f00..00181c29d9dbd7101a15f95672a3f45ba799ec12 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_new.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_updateqty.xml index 6e34719dc7e2bc2ff9d877decfece11a5c7e3f00..00181c29d9dbd7101a15f95672a3f45ba799ec12 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_view.xml index ead801cfff34a2fbf1d237410115e103655d9cec..2f2706f0ad4d23d5190c9c1c8fc3214972b2bfe9 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_view.xml index 6e34719dc7e2bc2ff9d877decfece11a5c7e3f00..00181c29d9dbd7101a15f95672a3f45ba799ec12 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/base/layout/catalog_product_prices.xml b/app/code/Magento/GroupedProduct/view/base/layout/catalog_product_prices.xml index fa45b6776dcdc4edec5d7423495345d14196bd14..bd252f53f43ebda4f022bad0fc2bcbb4baaf5fac 100644 --- a/app/code/Magento/GroupedProduct/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/GroupedProduct/view/base/layout/catalog_product_prices.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="grouped" xsi:type="array"> @@ -36,4 +36,4 @@ </argument> </arguments> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml index 6ce28a498987e4ab3d598a4abdb4817c2482b8cc..01274abfeaa5308f1031b0b16194acaf9753e580 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Framework\Pricing\Render" name="product.price.render.grouped"> <arguments> <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> <!-- set "override" configuration settings here --> </arguments> </block> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_view_type_grouped.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_view_type_grouped.xml index 22716a4e5735ba02d94c72a7b7d4336bd60bd52b..f157c3dc85484444f99fd117340f1acf8c638aed 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_view_type_grouped.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_view_type_grouped.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="product.info.form.content"> <block class="Magento\GroupedProduct\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="product/view/type/grouped.phtml"/> <container name="product.info.grouped.extra" after="product.info.grouped" before="product.info.grouped" as="product_type_data_extra" label="Product Extra Info"/> @@ -34,4 +34,4 @@ <referenceContainer name="product.info.type"> <block class="Magento\GroupedProduct\Block\Product\View\Type\Grouped" as="product.info.grouped" template="product/view/type/default.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_item_renderers.xml index 4eb181aeebc21f401ea847eefb9ae439f56ef08d..534237f5f2432ba32a56968332356224c20e5aa1 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\GroupedProduct\Block\Cart\Item\Renderer\Grouped" as="grouped" template="Magento_Checkout::cart/item/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml index 48aef4db772d8ce7f1a811cbc64c8a7f121d25e9..5037d6ab8e87559cb6c6dca852783cb0ab594d88 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.cart.sidebar.item.renderers"> <block class="Magento\GroupedProduct\Block\Cart\Item\Renderer\Grouped" as="grouped" template="Magento_Checkout::cart/sidebar/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml index 819b5fd2b3c9d163bf5b9eb86985eaa7c4ec2cfb..477c5dfe9fde0232ac96512f2c7beb78e5958dde 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\GroupedProduct\Block\Cart\Item\Renderer\Grouped" as="grouped" template="Magento_Checkout::onepage/review/item.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_creditmemo_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_creditmemo_renderers.xml index 1e0b09d21994966369bb4fdb9deca138ccbc8173..d5a9e85466e186e97b62a8f6ea49136f00251e77 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_creditmemo_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_creditmemo_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <referenceBlock name="sales.email.order.creditmemo.renderers"> <block class="Magento\GroupedProduct\Block\Order\Email\Items\Order\Grouped" as="grouped" template="Magento_Sales::email/items/creditmemo/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_invoice_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_invoice_renderers.xml index 92e3ef884c686c9f520f7c1e46d8d2337d533f5a..3ef1ea6d5dd5c0d7be176df47eaaf79ddae6b095 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_invoice_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_invoice_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Invoice Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Invoice Items List" design_abstraction="custom"> <referenceBlock name="sales.email.order.invoice.renderers"> <block class="Magento\GroupedProduct\Block\Order\Email\Items\Order\Grouped" as="grouped" template="Magento_Sales::email/items/invoice/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_renderers.xml index 2e45837d3739a11209e77d1ff73806cc385b7a57..4244ff7d511a99144252d4ef502b73e9034a737f 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Order Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Order Items List" design_abstraction="custom"> <block name="sales.email.order.renderers"> <block class="Magento\GroupedProduct\Block\Order\Email\Items\Order\Grouped" as="grouped" template="Magento_Sales::email/items/order/default.phtml"/> </block> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_guest_invoice.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_guest_invoice.xml index 2fa87d3e17ef5d00120ad93c8b18a705ca434662..9df7cf6639d8c764c507f7823c3cac7235b4dcfc 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_guest_invoice.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_guest_invoice.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/invoice/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_creditmemo_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_creditmemo_renderers.xml index e3600a99f370eba9571654b501f8703b4a44caa8..9f32e9a595e5d695e4ebcbcad3a093efd8a90aff 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_creditmemo_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_creditmemo_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.creditmemo.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/creditmemo/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_invoice_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_invoice_renderers.xml index 2fa87d3e17ef5d00120ad93c8b18a705ca434662..9df7cf6639d8c764c507f7823c3cac7235b4dcfc 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_invoice_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_invoice_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/invoice/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_item_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_item_renderers.xml index 154da547406c1bd58763da90b2e3fbb414aa6417..5add41f8b1101950023d18dab2a4f6d8b8b0fcce 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_item_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_item_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.items.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_creditmemo_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_creditmemo_renderers.xml index 50051dfbbe7d9e3fe9021613b3b9a1c58367602f..099a0d75ab1fe596f86255723fca052ff49d7d37 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_creditmemo_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_creditmemo_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.creditmemo.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/creditmemo/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_invoice_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_invoice_renderers.xml index 284729dd3306d8e1b5d02f8a71a7528db25d2d94..833610a391880970b98b2a6eaf403e3694f1f15a 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_invoice_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_invoice_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="checkout.order.print.invoice.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/invoice/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_renderers.xml index b468f6177df5b77570d5730d71ada773f22fe3a5..d60e003153b0548076a8a017e84e1a4e99fcfba0 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 3d32f02d68d80e4e3ee26f3cc1c503c4c8e8b4b4..aa3b560b680f0073d8b60a20a07f575ccb693e7e 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -113,9 +113,9 @@ class Import extends \Magento\ImportExport\Model\AbstractModel protected $_uploaderFactory; /** - * @var \Magento\Index\Model\Indexer + * @var \Magento\Indexer\Model\IndexerFactory */ - protected $_indexer; + protected $indexerFactory; /** * @var \Magento\ImportExport\Model\Source\Import\Behavior\Factory @@ -140,7 +140,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel * @param \Magento\Framework\HTTP\Adapter\FileTransferFactory $httpFactory * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory * @param \Magento\ImportExport\Model\Source\Import\Behavior\Factory $behaviorFactory - * @param \Magento\Index\Model\Indexer $indexer + * @param \Magento\Indexer\Model\IndexerFactory $indexerFactory * @param array $data */ public function __construct( @@ -156,7 +156,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel \Magento\Framework\HTTP\Adapter\FileTransferFactory $httpFactory, \Magento\Core\Model\File\UploaderFactory $uploaderFactory, \Magento\ImportExport\Model\Source\Import\Behavior\Factory $behaviorFactory, - \Magento\Index\Model\Indexer $indexer, + \Magento\Indexer\Model\IndexerFactory $indexerFactory, array $data = array() ) { $this->_importExportData = $importExportData; @@ -167,7 +167,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel $this->_csvFactory = $csvFactory; $this->_httpFactory = $httpFactory; $this->_uploaderFactory = $uploaderFactory; - $this->_indexer = $indexer; + $this->indexerFactory = $indexerFactory; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; parent::__construct($logger, $filesystem, $adapterFactory, $data); @@ -571,10 +571,12 @@ class Import extends \Magento\ImportExport\Model\AbstractModel return $this; } - foreach ($relatedIndexers as $indexer) { - $indexProcess = $this->_indexer->getProcessByCode($indexer); - if ($indexProcess) { - $indexProcess->changeStatus(\Magento\Index\Model\Process::STATUS_REQUIRE_REINDEX); + foreach (array_keys($relatedIndexers) as $indexerId) { + $indexer = $this->indexerFactory->create(); + try { + $indexer->load($indexerId); + $indexer->invalidate(); + } catch (\InvalidArgumentException $e) { } } diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index 224484fd26fc043cdcfcf689a423d79de4d88976..8ae46fed5df52c6918c9bd886f0b4e8817dd1a15 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-index": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-indexer": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/ImportExport/etc/module.xml b/app/code/Magento/ImportExport/etc/module.xml index 79e5ba267a3b3d30d0d1fe4faafa77197f30632c..cd449bd48b12e453de2e19caa625815a54dadfea 100644 --- a/app/code/Magento/ImportExport/etc/module.xml +++ b/app/code/Magento/ImportExport/etc/module.xml @@ -30,7 +30,7 @@ <module name="Magento_Core"/> <module name="Magento_Backend"/> <module name="Magento_Eav"/> - <module name="Magento_Index"/> + <module name="Magento_Indexer"/> </depends> </module> </config> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_getfilter.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_getfilter.xml index 008136b46828fad286f467e8014b0b59770b9ee1..e732b8a72c1b13fb2c4d0e6f2e47ebc99f02dd52 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_getfilter.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_getfilter.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\ImportExport\Block\Adminhtml\Export\Filter" name="export.filter"/> <block class="Magento\Backend\Block\Template" template="Magento_ImportExport::export/form/filter/after.phtml" name="export.form.after" as="form_after"/> </container> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_index.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_index.xml index e7a723b4b23f6a0717bf871020e4acac3b7c1812..ac895c6fd1fc61661ea79877403f704f730c25d0 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_index.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_index.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Backend\Block\Template" template="Magento_ImportExport::export/form/before.phtml" name="export.form.before" as="form_before"/> <block class="Magento\ImportExport\Block\Adminhtml\Export\Edit" name="export.form.container"/> <block class="Magento\ImportExport\Block\Adminhtml\Form\After" template="Magento_ImportExport::export/form/after.phtml" name="export.form.after" as="form_after"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml index 463eeecd04c2212323deaa7f6d620a97098ce913..479436acd5b32075f0f06994e6c769c5c404a8ec 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" template="Magento_ImportExport::busy.phtml" name="busy" as="busy"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_index.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_index.xml index 64473ce91e6a3aa587c9df68e6cc79c86cfc37f5..f0939e9e998212e818a2e5e7a77d98e89d895fff 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_index.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_index.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\ImportExport\Block\Adminhtml\Import\Edit\Before" template="Magento_ImportExport::import/form/before.phtml" name="import.form.before" as="form_before"/> <block class="Magento\ImportExport\Block\Adminhtml\Import\Edit" name="import.form.container"/> <block class="Magento\ImportExport\Block\Adminhtml\Form\After" template="Magento_ImportExport::import/form/after.phtml" name="import.form.after" as="form_after"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_start.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_start.xml index b37916dc0af8ab4edfb911f600cbb1541a713376..8e45931900594c835567a86af9482a84bdc9fec2 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_start.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_start.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\ImportExport\Block\Adminhtml\Import\Frame\Result" template="import/frame/result.phtml" name="import.frame.result" as="import_frame_result" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\ImportExport\Block\Adminhtml\Import\Frame\Result" template="import/frame/result.phtml" name="import.frame.result" as="import_frame_result"/> + </container> </layout> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_validate.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_validate.xml index b37916dc0af8ab4edfb911f600cbb1541a713376..8e45931900594c835567a86af9482a84bdc9fec2 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_validate.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_validate.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\ImportExport\Block\Adminhtml\Import\Frame\Result" template="import/frame/result.phtml" name="import.frame.result" as="import_frame_result" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\ImportExport\Block\Adminhtml\Import\Frame\Result" template="import/frame/result.phtml" name="import.frame.result" as="import_frame_result"/> + </container> </layout> diff --git a/app/code/Magento/Index/composer.json b/app/code/Magento/Index/composer.json index 23a2328951196244a6b45a200b6e019f9b2abf12..25fe7c7e83b31b462e475a905561b861221fffd3 100644 --- a/app/code/Magento/Index/composer.json +++ b/app/code/Magento/Index/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Index/view/adminhtml/layout/adminhtml_process_edit.xml b/app/code/Magento/Index/view/adminhtml/layout/adminhtml_process_edit.xml index db0e36c1bc6df20ff01c608525c17218f2d2906b..fa11da04be711957c22a7ccb65ff135be8006ddc 100644 --- a/app/code/Magento/Index/view/adminhtml/layout/adminhtml_process_edit.xml +++ b/app/code/Magento/Index/view/adminhtml/layout/adminhtml_process_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Index\Block\Adminhtml\Process\Edit" name="process_edit"/> </referenceContainer> @@ -35,4 +35,4 @@ </action> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Indexer/Model/Indexer/AbstractProcessor.php b/app/code/Magento/Indexer/Model/Indexer/AbstractProcessor.php index ddcd840c19a0f838ce4dd807a649d9db9cfcc91d..b5cccf62e6878a9ac5286ce2b6a3079ca2251312 100644 --- a/app/code/Magento/Indexer/Model/Indexer/AbstractProcessor.php +++ b/app/code/Magento/Indexer/Model/Indexer/AbstractProcessor.php @@ -107,4 +107,14 @@ abstract class AbstractProcessor { $this->getIndexer()->invalidate(); } + + /** + * Get processor indexer ID + * + * @return string + */ + public function getIndexerId() + { + return static::INDEXER_ID; + } } diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index 3556507c3e14bbbf4f4c9fdb3024dd19e8fc9a0c..e9d675725f111b4601ab3e316a656c6d8d091c18 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-page-cache": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-page-cache": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list.xml b/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list.xml index eabab65d54f440a94b670e6a4c5d327706ca01ce..1fba3b04c1b249dbc91808c6e9f2d5f6f42862a5 100644 --- a/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list.xml +++ b/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="indexer_indexer_list_grid"/> <referenceContainer name="content"> <block class="Magento\Indexer\Block\Backend\Container" name="adminhtml.indexer.grid.container"/> </referenceContainer> -</layout> \ No newline at end of file +</page> \ No newline at end of file diff --git a/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list_grid.xml b/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list_grid.xml index e5447068dff9c4e587b3019acaf0c218eb809839..7838f6daa6e5ff6a36ea9fe49a7aa99f22e5aef4 100644 --- a/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list_grid.xml +++ b/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.indexer.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.indexer.grid" as="grid"> <arguments> @@ -106,4 +106,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Install/composer.json b/app/code/Magento/Install/composer.json index 07bc5522643c88ae72ab3a716b7b125bcfcd030f..65f882ad0d88b0f7ed629bbfdee168d54ae4533f 100644 --- a/app/code/Magento/Install/composer.json +++ b/app/code/Magento/Install/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-user": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-user": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Install/view/adminhtml/layout/default.xml b/app/code/Magento/Install/view/adminhtml/layout/default.xml index 4eb246a43bf1f7239fbe75ee18f46daf61842249..b3ba328b0a5025a35708ad3ad68cdc137c0dcd33 100644 --- a/app/code/Magento/Install/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Install/view/adminhtml/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Script" name="magento-install-survey-notification-js" after="jquery"> <arguments> @@ -31,4 +31,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Install/view/install/layout/install_wizard.xml b/app/code/Magento/Install/view/install/layout/install_wizard.xml index 094292adafca54c59e40f12dee799145b37a4915..fe808ace143a74cfca9169246df299958417a933 100644 --- a/app/code/Magento/Install/view/install/layout/install_wizard.xml +++ b/app/code/Magento/Install/view/install/layout/install_wizard.xml @@ -23,14 +23,16 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Framework\View\Element\Template" name="root" output="1"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">Magento_Install::page.phtml</argument> - </action> - <block class="Magento\Backend\Block\Page\Copyright" name="copyright" as="copyright"/> - <container name="left" as="left" label="Left Column"/> - <container name="content" as="content" label="Content"/> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Framework\View\Element\Template" name="page.block"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">Magento_Install::page.phtml</argument> + </action> + <block class="Magento\Backend\Block\Page\Copyright" name="copyright" as="copyright"/> + <container name="left" as="left" label="Left Column"/> + <container name="content" as="content" label="Content"/> + </block> + </container> <block class="Magento\Install\Block\Db\Main" name="database" as="database"/> </layout> diff --git a/app/code/Magento/Install/view/install/layout/install_wizard_config.xml b/app/code/Magento/Install/view/install/layout/install_wizard_config.xml index 9ee5f2a211d3c365098ffd92b3df3a7ef332b077..3badd73bdf650da82c7aa160bebe9100a21ca57b 100644 --- a/app/code/Magento/Install/view/install/layout/install_wizard_config.xml +++ b/app/code/Magento/Install/view/install/layout/install_wizard_config.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="database"> <action method="setTemplate"> <argument name="template" xsi:type="string">db/main.phtml</argument> @@ -34,4 +34,4 @@ <argument name="template" xsi:type="string">db/mysql4.phtml</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Integration/Model/Oauth/Token.php b/app/code/Magento/Integration/Model/Oauth/Token.php index 1d692ba2c656965d1165fc5ed360a270f3b583f9..693a6fd221d0c158c1d8c929d2eac50b10699aab 100644 --- a/app/code/Magento/Integration/Model/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Oauth/Token.php @@ -380,7 +380,7 @@ class Token extends \Magento\Framework\Model\AbstractModel } /** - * Get token by admin id + * Get token by customer id * * @param int $customerId * @return $this diff --git a/app/code/Magento/Integration/Service/V1/TokenService.php b/app/code/Magento/Integration/Service/V1/TokenService.php index 0b860f33655ad7666794ac0071fbce1c791727b4..49bf1f5d5b3e437260dcb1589c1561db61fa0af1 100644 --- a/app/code/Magento/Integration/Service/V1/TokenService.php +++ b/app/code/Magento/Integration/Service/V1/TokenService.php @@ -29,10 +29,14 @@ use Magento\Framework\Exception\AuthenticationException; use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\LocalizedException; use Magento\Integration\Model\Oauth\Token\Factory as TokenModelFactory; +use Magento\Integration\Model\Oauth\Token as Token; use Magento\User\Model\User as UserModel; +use Magento\Integration\Model\Resource\Oauth\Token\CollectionFactory as TokenCollectionFactory; /** * Class to handle token generation for Admins and Customers + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class TokenService implements TokenServiceInterface { @@ -57,21 +61,31 @@ class TokenService implements TokenServiceInterface */ private $customerAccountService; + /** + * Token Collection Factory + * + * @var TokenCollectionFactory + */ + public $tokenModelCollectionFactory; + /** * Initialize service * * @param TokenModelFactory $tokenModelFactory * @param UserModel $userModel * @param CustomerAccountService $customerAccountService + * @param TokenCollectionFactory $tokenModelCollectionFactory */ public function __construct( TokenModelFactory $tokenModelFactory, UserModel $userModel, - CustomerAccountService $customerAccountService + CustomerAccountService $customerAccountService, + TokenCollectionFactory $tokenModelCollectionFactory ) { $this->tokenModelFactory = $tokenModelFactory; $this->userModel = $userModel; $this->customerAccountService = $customerAccountService; + $this->tokenModelCollectionFactory = $tokenModelCollectionFactory; } /** @@ -98,6 +112,29 @@ class TokenService implements TokenServiceInterface return $this->tokenModelFactory->create()->createAdminToken($this->userModel->getId())->getToken(); } + /** + * Revoke token by admin id. + * + * @param int $adminId + * @return bool + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function revokeAdminAccessToken($adminId) + { + $tokenCollection = $this->tokenModelCollectionFactory->create()->addFilterByAdminId($adminId); + if ($tokenCollection->getSize() == 0) { + throw new LocalizedException("This user has no tokens."); + } + try { + foreach ($tokenCollection as $token) { + $token->setRevoked(1)->save(); + } + } catch (\Exception $e) { + throw new LocalizedException("The tokens could not be revoked."); + } + return true; + } + /** * {@inheritdoc} */ @@ -108,6 +145,29 @@ class TokenService implements TokenServiceInterface return $this->tokenModelFactory->create()->createCustomerToken($customerDataObject->getId())->getToken(); } + /** + * Revoke token by customer id. + * + * @param int $customerId + * @return bool + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function revokeCustomerAccessToken($customerId) + { + $tokenCollection = $this->tokenModelCollectionFactory->create()->addFilterByCustomerId($customerId); + if ($tokenCollection->getSize() == 0) { + throw new LocalizedException("This customer has no tokens."); + } + try { + foreach ($tokenCollection as $token) { + $token->setRevoked(1)->save(); + } + } catch (\Exception $e) { + throw new LocalizedException("The tokens could not be revoked."); + } + return true; + } + /** * Validate user credentials * diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index 66472fc0f953676afac0693c005f935ca333131c..cd5f7fd93b8b96e8b5868b90bab2bd41ce46822a 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-user": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", - "magento/module-authorization": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-user": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", + "magento/module-authorization": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml index 6dad7f1d56ae23dc8d1a2fd3aec8d9002a2cd627..c32013899ef227a1614e7d0b55592420ef858b1f 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="editor"/> <referenceContainer name="left"> <block class="Magento\Integration\Block\Adminhtml\Integration\Edit\Tabs" name="integration_edit_tabs"> @@ -39,4 +39,4 @@ <referenceContainer name="content"> <block class="Magento\Integration\Block\Adminhtml\Integration\Edit" name="integration_edit_content"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid.xml index ec018b1fdd3aed72eba2d1c95b9073ad85d5fcf0..2325b44b985e3f6aebc52569a8dcefad627655f2 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid.xml @@ -23,8 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="adminhtml_integration_grid_block"/> - <block class="Magento\Integration\Block\Adminhtml\Integration" name="integration.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> -</layout> \ No newline at end of file + <container name="root"> + <block class="Magento\Integration\Block\Adminhtml\Integration" name="integration.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> +</layout> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml index c738e2992d1664e6d560431094faba04abf8736d..152395b8753eb66f8e0b58dfe132777b35786444 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="integration.grid.container"> <block class="Magento\Integration\Block\Adminhtml\Integration\Grid" name="integration.grid" as="grid"> <arguments> @@ -95,4 +95,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml index 1392c6e5bf3d4ae12762aa362826fe29b1b7e555..9084a59de97831880956b52d35316b66bd7e50df 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="magento-integration-styles-css"> <arguments> @@ -38,4 +38,4 @@ <block class="Magento\Backend\Block\Template" name="integration.popup.container" template="Magento_Integration::integration/popup_container.phtml" before="-"/> <block class="Magento\Integration\Block\Adminhtml\Integration" name="integration.grid.container"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml index 35793138899dc8d17abe01e9d17e91a99164e325..d64bd1140cd8a06500e8b09c9ace004dd34486a9 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="magento-integration-styles-css"> <arguments> @@ -35,4 +35,4 @@ <referenceBlock name="content"> <block class="Magento\Backend\Block\Template" name="integration.popup.container" template="Magento_Integration::integration/popup_container.phtml" before="-"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml index 3869875564b40f8eadf3e423696a8071a549008a..689156c76b771970ee8dd58c59c03ff1ea25b9de 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml @@ -25,8 +25,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Backend\Block\Template" name="integration.activate.permissions" template="Magento_Integration::integration/activate/permissions.phtml" output="1"> - <block class="Magento\Integration\Block\Adminhtml\Integration\Activate\Permissions\Tabs" name="integration.activate.permissions.tabs" as="tabs" /> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Backend\Block\Template" name="integration.activate.permissions" template="Magento_Integration::integration/activate/permissions.phtml"> + <block class="Magento\Integration\Block\Adminhtml\Integration\Activate\Permissions\Tabs" name="integration.activate.permissions.tabs" as="tabs"/> + </block> + </container> </layout> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml index ef92f1941f525212f58efd09884bbde8f77c0e4c..27bd30b20231c5082281114eaeb43b3b9e12f469 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Integration\Block\Adminhtml\Integration\Tokens" name="integration_token_popup" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Integration\Block\Adminhtml\Integration\Tokens" name="integration_token_popup"/> + </container> </layout> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensexchange.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensexchange.xml index 8cc5393c8b260d993c964e3a2bf4935c62a9b6c7..c3973927ef249bb8392c750e8b29da8870a1d017 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensexchange.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensexchange.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> - -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Backend\Block\Template" name="integration_tokenexchange_popup" template="Magento_Integration::integration/tokens_exchange.phtml" output="1" /> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Backend\Block\Template" name="integration_tokenexchange_popup" template="Magento_Integration::integration/tokens_exchange.phtml"/> + </container> </layout> diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index 2b6661ad71272da03f50273f182a00706fba3377..370f1216505126a35bdff2f5a1266d54d8707514 100644 --- a/app/code/Magento/LayeredNavigation/composer.json +++ b/app/code/Magento/LayeredNavigation/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml index 2aeabcd9871587250a397e5f5fabbb61e91aa009..09986a45093643089b88b9a5f8d8d1c6d289f0c6 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="sidebar.main"> <block class="Magento\LayeredNavigation\Block\Navigation\Category" name="catalog.leftnav" before="-" template="layer/view.phtml"> <block class="Magento\LayeredNavigation\Block\Navigation\State\Category" name="catalog.navigation.state" as="state" /> <block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalog.navigation.renderer" as="renderer" template="layer/filter.phtml"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered_without_children.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered_without_children.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered_without_children.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered_without_children.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_advanced_result.xml index 21260bcdc509b20c4cd8e8a7bf00225771bf2e13..e9923f2e9f1b10daf938de44b56ee09f7347aaa5 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_advanced_result.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="left"> <block class="Magento\LayeredNavigation\Block\Navigation\AdvancedSearch" name="advanced.search.leftnav" before="-" template="layer/view.phtml"> <block class="Magento\LayeredNavigation\Block\Navigation\State\AdvancedSearch" name="advanced.search.navigation.state" as="state" /> <block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="advanced.search.navigation.renderer" as="renderer" template="layer/filter.phtml"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml index 5f9ee15d0d371117f4ea1d904329a43b97069b55..eaabebd1eba38c27763658f484d3194256928073 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="sidebar.main"> <block class="Magento\LayeredNavigation\Block\Navigation\Search" name="catalogsearch.leftnav" before="-" template="layer/view.phtml"> <block class="Magento\LayeredNavigation\Block\Navigation\State\Search" name="catalogsearch.navigation.state" as="state" /> <block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalogsearch.navigation.renderer" as="renderer" template="layer/filter.phtml"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml index 5aefb99639108de134be6073acdaebdd1279865e..f289e28ac50318cdf75aa5a5f037ad44bd0c9643 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All Empty Layout Pages" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="All Empty Layout Pages" design_abstraction="page_layout"> <move element="catalog.leftnav" destination="category.product.list.additional" before="-" /> -</layout> +</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_one_column.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_one_column.xml index d99697645da7f6d5fd5a859db15a636e9d200a6c..5d0df7e4f0c738853ffc08f24ca8065e10ffca9e 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_one_column.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_one_column.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All One-Column Layout Pages" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="All One-Column Layout Pages" design_abstraction="page_layout"> <move element="catalog.leftnav" destination="content.top" after="-" /> -</layout> +</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_three_columns.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_three_columns.xml index 2cdd12bf70a1127237254cdda0e3abe4c57132f1..b98930a4669452b216d3e7c1564c312eaec478c0 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_three_columns.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_three_columns.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All Three-Column Layout Pages" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="All Three-Column Layout Pages" design_abstraction="page_layout"> <move element="catalog.leftnav" destination="sidebar.main" before="-" /> -</layout> +</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_two_columns_left.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_two_columns_left.xml index 8b4350abcef56d1da7ef5ab1c247d38192bf1353..cca2f785f0bd20351d8168b85269828f41ae5b9f 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_two_columns_left.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_two_columns_left.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All Two-Column Layout Pages (Left Column)" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="All Two-Column Layout Pages (Left Column)" design_abstraction="page_layout"> <move element="catalog.leftnav" destination="sidebar.main" before="-" /> -</layout> +</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_two_columns_right.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_two_columns_right.xml index c6aa58afafd2b0359be1a8d41a22322d23f8b58d..0d41915c8877e876001869cd57eb98b8c77fd736 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_two_columns_right.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_two_columns_right.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All Two-Column Layout Pages (Right Column)" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="All Two-Column Layout Pages (Right Column)" design_abstraction="page_layout"> <move element="catalog.leftnav" destination="sidebar.main" before="-" /> -</layout> +</page> diff --git a/app/code/Magento/Log/composer.json b/app/code/Magento/Log/composer.json index f582ea2c56c73b8a57b4ed6e35ead18dc8088891..bac2d75fc999fa2a237d91baccaf07e074ac15d9 100644 --- a/app/code/Magento/Log/composer.json +++ b/app/code/Magento/Log/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index 1413284e44a5098471aea6d4d6a863ac23d0f356..07ae882a2563f46539d6384564ff7b04cf6079f8 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-weee": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-weee": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Multishipping/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Multishipping/view/frontend/layout/checkout_cart_index.xml index dfda9048ac1192ca7687f77412df8643cc13fc55..50e74df2f9fa07ae3ac36422247c6769078898ef 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/checkout_cart_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="checkout.cart.methods"> <block class="Magento\Multishipping\Block\Checkout\Link" name="checkout.cart.methods.multishipping" template="checkout/link.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml index 594d2708bc256657adc9585e0dda5ea234c6fad8..6abf7b7f2f6175a8ee4f3bc7688aa2b290a49a7b 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Multishipping Checkout" design_abstraction="custom"> - <update handle="page_two_columns_left"/> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Multishipping Checkout" design_abstraction="custom"> <referenceContainer name="sidebar.main"> <block class="Magento\Multishipping\Block\Checkout\State" name="checkout_state" template="checkout/state.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editaddress.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editaddress.xml index 2c1f105252b7edd02da05f250c112da17692e87b..e97b6bbf2e7e6aff3a6cc60f2ed060104c9041ee 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editaddress.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editaddress.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <referenceBlock name="page.main.title"> @@ -31,4 +31,4 @@ <argument translate="true" name="label" xsi:type="string">Edit Address</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editbilling.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editbilling.xml index 977bd97d306aaa4221af03b482bd73a076776167..601d21c083d0888e164c575b27f87d2a276f522e 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editbilling.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editbilling.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <referenceBlock name="page.main.title"> @@ -31,4 +31,4 @@ <argument translate="true" name="label" xsi:type="string">Change Billing Address</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editshipping.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editshipping.xml index 523d8bb385f0c9d576d89e654cf13ce35832ef60..705c077fdecd66004f4ceb02bd1eb572788dfa6e 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editshipping.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editshipping.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <referenceBlock name="page.main.title"> @@ -31,4 +31,4 @@ <argument translate="true" name="label" xsi:type="string">Edit Shipping Address</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newbilling.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newbilling.xml index 5f5718c547b6fc349ae183ab67e709c3d7c9cf2e..4289c2e1abfd84d72f242a31c69f06249ab744b1 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newbilling.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newbilling.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <referenceBlock name="page.main.title"> @@ -31,4 +31,4 @@ <argument translate="true" name="label" xsi:type="string">Create Billing Address</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newshipping.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newshipping.xml index af17d3a6cda89f1feaa8fea58c8a11bfbad008e3..e4f0890d2a5293cbc10391255e479f90815634f4 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newshipping.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newshipping.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <referenceBlock name="page.main.title"> @@ -31,4 +31,4 @@ <argument translate="true" name="label" xsi:type="string">Create Shipping Address</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_select.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_select.xml index dfb613717faeeed924741e5fb2f99ba5431dcf02..7220afd0a8cebac2b0f8410b73aeebb4eafc2c39 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_select.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_select.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Multishipping Checkout Shipping Address Selection" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Multishipping Checkout Shipping Address Selection" design_abstraction="custom"> <update handle="multishipping_checkout"/> <referenceContainer name="content"> <block class="Magento\Multishipping\Block\Checkout\Address\Select" name="checkout_address_select" template="checkout/address/select.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_selectbilling.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_selectbilling.xml index d2b686b491f625c85a34dbe0a89662a11b9de48b..e26fe95a2d51c29028c65274a03b8d0edaf35d80 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_selectbilling.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_selectbilling.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <referenceBlock name="page.main.title"> <action method="setPageTitle"> @@ -33,4 +33,4 @@ <referenceContainer name="content"> <block class="Magento\Multishipping\Block\Checkout\Address\Select" name="checkout_address_select" template="checkout/address/select.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_addresses.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_addresses.xml index 2668fbd06c27669ee009d3859eb69cc03f029f2f..e8ded06430fb1b4e0601eb3ee26c66895b84ad48 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_addresses.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_addresses.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <update handle="checkout_cart_item_renderers" /> <referenceBlock name="page.main.title"> @@ -43,4 +43,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Template" name="multishipping_checkout_addresses_page_head_components" template="Magento_Multishipping::js/components.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_billing.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_billing.xml index 39c04becb1d7359567b4015804783d97b154d5a2..5e604097767f2f2d7434afeb5b8a55d72d255eda 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_billing.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_billing.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <referenceBlock name="page.main.title"> <action method="setPageTitle"> @@ -39,4 +39,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="multishipping_checkout_billing_page_head_components" template="Magento_Checkout::js/components.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_customer_address.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_customer_address.xml index 566da08e97d687ffe54343573b5544e71e3c9cd8..9ab1f86bc9f5e2b9188837faf0e4c9d49ca7859d 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_customer_address.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_customer_address.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Multishipping Checkout Customer Address Edit Form" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Multishipping Checkout Customer Address Edit Form" design_abstraction="custom"> <referenceContainer name="content"> <block class="Magento\Customer\Block\Address\Edit" name="customer_address_edit" template="address/edit.phtml" cacheable="false"/> </referenceContainer> <update handle="customer_form_template_handle"/> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_login.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_login.xml index d28adeb0583d1fdadff59c744ef4d8a23a076d33..d62a7ab8466581a871959f2fbf1f6a74fcdfb774 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_login.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_login.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account_login"/> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_overview.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_overview.xml index bd58b5948ba84a19a1dd6872f8e1695790db9f7d..9c9008fef6e98461eb02bcdbf4663ed931260a20 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_overview.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_overview.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <update handle="checkout_cart_item_renderers" /> <referenceBlock name="page.main.title"> @@ -49,4 +49,4 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_register.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_register.xml index 143288085c9b7c080ae8d43c25b4df4ead11893d..7377af7ad44b3fcb3ee263c0566c1bae83eb044c 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_register.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_register.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account_create"/> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_shipping.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_shipping.xml index d8b3e4b64725d4bb06b138a7ed494f2648f6f3e7..52d9c0a4847d33797cf30176f6a44e90ed164e13 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_shipping.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_shipping.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <update handle="checkout_cart_item_renderers" /> <referenceBlock name="page.main.title"> @@ -46,4 +46,4 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_success.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_success.xml index b62cd4445735a5d72777d692cde541d9d84ce80e..6f333ab37490efe3ecef4c863095b792c1332ff7 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_success.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_success.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="multishipping_checkout"/> <referenceBlock name="page.main.title"> <action method="setPageTitle"> @@ -33,4 +33,4 @@ <referenceContainer name="content"> <block class="Magento\Multishipping\Block\Checkout\Success" name="checkout_success" template="checkout/success.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index f4b419d6a8449eaf00e08c549c7121ba300a4bba..535b99bcab692ed57edc7a7bf6fcaa92c2daf958 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-widget": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-email": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-cron": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-widget": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-email": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-cron": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 c6c397799cca84c7a1e56f81d3cfc9292bfa28e5..b86e14840097bf1e62107983a51fc68969ec645d 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.newsletter.problem.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.newslettrer.problem.grid" as="grid"> <arguments> @@ -102,4 +102,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 293c53a648c49505ec9082650ff245271df9ae22..c4297aff301c8f593564475947e5de136b95cd00 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="newsletter_problem_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.problem.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.problem.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 ada3b9ceab848dbbeb490453c15bb360385862cb..de7daa85e0384e8ccd2b24193a3d7074bf8c2f15 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="newsletter_problem_block"/> <referenceContainer name="content"> <block class="Magento\Newsletter\Block\Adminhtml\Problem" name="adminhtml.newsletter.problem.container"/> </referenceContainer> -</layout> +</page> 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 251ff8a709ab5bb3494e8e16ce550a42787e49e8..c4e203a5f3fceb8731b2f133907bc83a3bd2b043 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="editor"/> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> @@ -40,4 +40,4 @@ <referenceContainer name="content"> <block class="Magento\Newsletter\Block\Adminhtml\Queue\Edit" name="queue_edit" template="queue/edit.phtml"/> </referenceContainer> -</layout> +</page> 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 a1db561d9da074c7b493ccb69df7100d8d19ce0a..370d59ca86110dcbbba3812a21d2e2b5769a66d6 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="newsletter_queue_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.queue.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.queue.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 d8f38be18da7752dc13ec7e6d19bbff4feadf564..225ac460c0f1f0930e6b1f53046167d1c70ace67 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.newsletter.queue.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.newsletter.queue.grid" as="grid"> <arguments> @@ -123,4 +123,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 d4a519a257d7c3183a3ddf38fd71152b52ff2d71..5a356a766437d80ecb1937f1f11e2c0804b1c5fe 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="newsletter_queue_grid_block"/> <referenceContainer name="content"> <block class="Magento\Backend\Block\Template" template="Magento_Newsletter::queue/list.phtml" name="adminhtml.newsletter.queue.grid.container"/> </referenceContainer> -</layout> +</page> 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 71937cc4b93c36c85be4702b8f3039dfe7fe8a06..9b0b0a8f863475724d8f048aa75d0174641ce3fc 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 @@ -23,12 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="backend.page"> <action method="setTemplate"> <argument name="template" xsi:type="string">Magento_Newsletter::preview/iframeswitcher.phtml</argument> </action> <block class="Magento\Newsletter\Block\Adminhtml\Queue\Preview\Form" name="preview_form"/> <block class="Magento\Backend\Block\Store\Switcher" name="store_switcher" template="Magento_Backend::store/switcher.phtml" /> </referenceBlock> -</layout> +</page> 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 26910f766883e695377861647a573724691b3cbe..f5b3fe213489a10341f5747a567748d5af83e054 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 @@ -23,9 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Framework\View\Element\Template" name="root" output="1" template="Magento_Newsletter::queue/preview.phtml"> - <block class="Magento\Newsletter\Block\Adminhtml\Queue\Preview" name="content" as="content"/> - </block> - <block class="Magento\Newsletter\Block\Adminhtml\Queue\Preview" name="preview_template"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Framework\View\Element\Template" name="page.block" template="Magento_Newsletter::queue/preview.phtml"> + <block class="Magento\Newsletter\Block\Adminhtml\Queue\Preview" name="content" as="content"/> + </block> + <block class="Magento\Newsletter\Block\Adminhtml\Queue\Preview" name="preview_template"/> + </container> </layout> 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 faca4b5d3944f21914b5fc64e6593d1da90cf742..eadf004719b1f330e572fb343a0f60e7abdfcede 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.newsletter.subscriber.container"> <block class="Magento\Newsletter\Block\Adminhtml\Subscriber\Grid" name="adminhtml.newslettrer.subscriber.grid" as="grid"> <arguments> @@ -181,4 +181,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 15f0ddbfce7dbe99e94b3af14d81f62b22d2040a..db9f60c888c2ceaf73ad0340247fcab57a408cd5 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="newsletter_subscriber_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.subscriber.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 15f0ddbfce7dbe99e94b3af14d81f62b22d2040a..db9f60c888c2ceaf73ad0340247fcab57a408cd5 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="newsletter_subscriber_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.subscriber.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 2fba1c42784cd86dece3021700bd2b5d3cadcc3c..7ff6ccdf469415876d3f01fce5122d25ba6dff96 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="newsletter_subscriber_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.subscriber.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.subscriber.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 db2de4f9b582bb875f47942da4a1a16f688159c7..a0bbd9ce1854154b50a03c51ef0a5c98f7cbbf47 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="newsletter_subscriber_block"/> <referenceContainer name="content"> <block class="Magento\Newsletter\Block\Adminhtml\Subscriber" name="adminhtml.newsletter.subscriber.container"/> </referenceContainer> -</layout> +</page> 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 6310713705d745aa7a8e4c10279ed0fcf3648777..774d94f3e8b19306e61a957093f0d0b4c58c11ad 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="editor"/> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> @@ -40,4 +40,4 @@ <referenceContainer name="content"> <block class="Magento\Newsletter\Block\Adminhtml\Template\Edit" name="template_edit" template="template/edit.phtml"/> </referenceContainer> -</layout> +</page> 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 cc43857dde773ad6a0ff3373d6b10c554629bb38..acb93d7f00baaecbc0e6ed980098ab2faae7cc56 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 @@ -23,12 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="backend.page"> <action method="setTemplate"> <argument name="template" xsi:type="string">Magento_Newsletter::preview/iframeswitcher.phtml</argument> </action> <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview\Form" name="preview_form"/> <block class="Magento\Backend\Block\Store\Switcher" name="store_switcher" template="Magento_Backend::store/switcher.phtml" /> </referenceBlock> -</layout> +</page> 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 3ca47ef559b532b98369db254c6a5a4525d3ab83..8d3a40de42d1b0b080cb8554eaab3ad87c31ada5 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 @@ -23,9 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Framework\View\Element\Template" name="root" output="1" template="Magento_Newsletter::template/preview.phtml"> - <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="content" as="content"/> - </block> - <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="preview_template"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Framework\View\Element\Template" name="page.block" template="Magento_Newsletter::template/preview.phtml"> + <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="content" as="content"/> + </block> + <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="preview_template"/> + </container> </layout> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml index de7ff8d6d5bbfd4d900c3842798192c4a19d4cb0..cbc9acbbce191c71821d7ad293797cb5f332de01 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Framework\View\Element\Template" name="root" output="1" template="Magento_Newsletter::template/preview.phtml"> - <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="content" as="content"/> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Framework\View\Element\Template" name="page.block" template="Magento_Newsletter::template/preview.phtml"> + <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="content" as="content"/> + </block> + </container> </layout> 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 0f5d66cff24941d273c4cf60900ed8e865a72015..dbd46e0e9043eb1f0dbd07bad4d888f5f7cc2162 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-newsletter-subscriptions-link"> <arguments> @@ -33,4 +33,4 @@ </block> </referenceBlock> <remove name="newsletter_subscription"/> -</layout> +</page> diff --git a/app/code/Magento/Newsletter/view/frontend/layout/default.xml b/app/code/Magento/Newsletter/view/frontend/layout/default.xml index 4fd3f76cafda0cd56cd3304a587c06fd2079fb6a..5a98ad81f825eef9d53516b49680aa681f4c42df 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/default.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/default.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="newsletter_head_components" template="Magento_Newsletter::js/components.phtml"/> </referenceBlock> <referenceContainer name="footer"> <block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/> </referenceContainer> -</layout> +</page> 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 8e745cab2a6ac7183f0c7a67a86771da07bd61e7..f10a78cb1d051c0641c7af03bbb2246e87340eeb 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Customer\Block\Newsletter" name="customer_newsletter"> <container name="customer.newsletter.form.before" as="form_before" label="Newsletter Subscription Form Before" htmlTag="div" htmlClass="rewards"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index a280b3e9cd85536659a3c5cae5809b810d00711a..4f1c6e19bac8825ab775f3dc00ac9266b53bbbfd 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-payment": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index 46380fe5154d418af8a110ddb1b3819e4e1c0714..4b6560c1bd057245ca36e7df64048f9167e23749 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-shipping": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-sales-rule": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-shipping": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-sales-rule": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Ogone/composer.json b/app/code/Magento/Ogone/composer.json index 846030f27c43618836b270f3bcd69a7cdbcfcf0f..463423ba7b680ed698a6bd322c22a373ce4b2f08 100644 --- a/app/code/Magento/Ogone/composer.json +++ b/app/code/Magento/Ogone/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml index 445d9a5660437fe7c5f777ad84a4fb33efeea65f..b6fae13856e8bc26ead69e8f003af10b2735a070 100644 --- a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml +++ b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <remove name="catalog.topnav"/> <referenceContainer name="header-wrapper"> <remove name="top.links"/> @@ -36,12 +36,7 @@ <remove name="footer_links"/> <remove name="store_switcher"/> </referenceBlock> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> <referenceContainer name="content"> <block class="Magento\Ogone\Block\Paypage" name="ogone_paypage" template="paypage.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml index 77540947cfd0623fcb2aa6ddcfd92200bfc3701d..95f6829c6bc5554e20ab21c2f975d72601e9bb76 100644 --- a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml +++ b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Ogone\Block\Placeform" name="ogone_placeform" template="placeform.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index b3052028f0df61d2e23816035c45ec11868cf3aa..a6be326a2cdaadf91d4ed251c7bf79cc109f8230 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/PageCache/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/PageCache/view/adminhtml/layout/adminhtml_system_config_edit.xml index 022641837e01735565d9bf0c509ab66233b395ed..0396ab1c394d75b3ad7a5ff563d84575cc9bc57a 100644 --- a/app/code/Magento/PageCache/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/PageCache/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="js"> <block class="Magento\PageCache\Block\System\Config\Form\Field\Export" template="Magento_PageCache::page_cache_validation.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/PageCache/view/frontend/layout/default.xml b/app/code/Magento/PageCache/view/frontend/layout/default.xml index 38ee47cf9a35b1885add44aadc2b58f0a2b1737f..9cd5fc1f8be794059bf69739983ae2d86bb4c64f 100644 --- a/app/code/Magento/PageCache/view/frontend/layout/default.xml +++ b/app/code/Magento/PageCache/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="pagecache_page_head_components" template="Magento_PageCache::js/components.phtml"/> </referenceBlock> @@ -31,4 +31,4 @@ <referenceContainer name="content"> <block class="Magento\PageCache\Block\Javascript" template="Magento_PageCache::javascript.phtml" name="pageCache" as="pageCache"/> </referenceContainer> -</layout> \ No newline at end of file +</page> \ No newline at end of file diff --git a/app/code/Magento/PayPalRecurringPayment/composer.json b/app/code/Magento/PayPalRecurringPayment/composer.json index b057a1b38824ff621459bd78cbbdc04f45c390fd..2d75a75ce3ed7aa4beb27d0e34c965a5d28774ae 100644 --- a/app/code/Magento/PayPalRecurringPayment/composer.json +++ b/app/code/Magento/PayPalRecurringPayment/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-paypal": "0.1.0-alpha91", - "magento/module-recurring-payment": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-paypal": "0.1.0-alpha92", + "magento/module-recurring-payment": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Payment/Block/Form/Container.php b/app/code/Magento/Payment/Block/Form/Container.php index 5f694d188e495896660e6af14c73c34a3e77daaf..b17c1b20cab63fdff2dcbe4a4943988a457a593b 100644 --- a/app/code/Magento/Payment/Block/Form/Container.php +++ b/app/code/Magento/Payment/Block/Form/Container.php @@ -72,7 +72,7 @@ class Container extends \Magento\Framework\View\Element\Template foreach ($this->getMethods() as $method) { $this->setChild( 'payment.method.' . $method->getCode(), - $this->_paymentHelper->getMethodFormBlock($method) + $this->_paymentHelper->getMethodFormBlock($method, $this->_layout) ); } diff --git a/app/code/Magento/Payment/Helper/Data.php b/app/code/Magento/Payment/Helper/Data.php index 8e88cbe898ee6d3985b2ec338ab35f16fb91620e..1dc29b8dccd1f5b626677fdb6c515dd7596a8b5f 100644 --- a/app/code/Magento/Payment/Helper/Data.php +++ b/app/code/Magento/Payment/Helper/Data.php @@ -28,6 +28,7 @@ use Magento\Store\Model\Store; use Magento\Payment\Block\Form; use Magento\Payment\Model\Info; use Magento\Framework\View\Element\Template; +use Magento\Framework\View\LayoutInterface; /** * Payment module base helper @@ -79,9 +80,8 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper * * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\View\LayoutInterface $layout + * @param LayoutInterface $layout * @param \Magento\Payment\Model\Method\Factory $paymentMethodFactory - * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Payment\Model\Config $paymentConfig * @param \Magento\Framework\App\Config\Initial $initialConfig @@ -89,7 +89,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper public function __construct( \Magento\Framework\App\Helper\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\View\LayoutInterface $layout, + LayoutInterface $layout, \Magento\Payment\Model\Method\Factory $paymentMethodFactory, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Payment\Model\Config $paymentConfig, @@ -144,10 +144,6 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper } $methodInstance = $this->_methodFactory->create($model); - if (!$methodInstance) { - continue; - } - $methodInstance->setStore($store); if (!$methodInstance->isAvailable($quote)) { /* if the payment method cannot be used at this time */ @@ -181,14 +177,15 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper * Retrieve payment method form html * * @param \Magento\Payment\Model\MethodInterface $method + * @param \Magento\Framework\View\LayoutInterface $layout * @return Form */ - public function getMethodFormBlock(\Magento\Payment\Model\MethodInterface $method) + public function getMethodFormBlock(\Magento\Payment\Model\MethodInterface $method, LayoutInterface $layout) { $block = false; $blockType = $method->getFormBlockType(); - if ($this->_layout) { - $block = $this->_layout->createBlock($blockType, $method->getCode()); + if ($layout) { + $block = $layout->createBlock($blockType, $method->getCode()); $block->setMethod($method); } return $block; diff --git a/app/code/Magento/Payment/Model/MethodList.php b/app/code/Magento/Payment/Model/MethodList.php new file mode 100644 index 0000000000000000000000000000000000000000..c5f5674701b8bfa2ceac588674066cc2a9a452db --- /dev/null +++ b/app/code/Magento/Payment/Model/MethodList.php @@ -0,0 +1,91 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Payment\Model; + +use \Magento\Payment\Model\Method\AbstractMethod; + +class MethodList +{ + /** + * @var \Magento\Payment\Helper\Data + */ + protected $paymentHelper; + + /** + * @var \Magento\Payment\Model\Checks\SpecificationFactory + */ + protected $methodSpecificationFactory; + + /** + * @param \Magento\Payment\Helper\Data $paymentHelper + * @param Checks\SpecificationFactory $specificationFactory + */ + public function __construct( + \Magento\Payment\Helper\Data $paymentHelper, + \Magento\Payment\Model\Checks\SpecificationFactory $specificationFactory + ) { + $this->paymentHelper = $paymentHelper; + $this->methodSpecificationFactory = $specificationFactory; + } + + /** + * @param \Magento\Sales\Model\Quote $quote + * @return \Magento\Payment\Model\MethodInterface[] + */ + public function getAvailableMethods(\Magento\Sales\Model\Quote $quote = null) + { + $store = $quote ? $quote->getStoreId() : null; + $methods = array(); + $specification = $this->methodSpecificationFactory->create(array(AbstractMethod::CHECK_ZERO_TOTAL)); + foreach ($this->paymentHelper->getStoreMethods($store, $quote) as $method) { + if ($this->_canUseMethod($method, $quote) && $specification->isApplicable($method, $quote)) { + $method->setInfoInstance($quote->getPayment()); + $methods[] = $method; + } + } + return $methods; + } + + /** + * Check payment method model + * + * @param \Magento\Payment\Model\MethodInterface $method + * @param \Magento\Sales\Model\Quote $quote + * @return bool + */ + protected function _canUseMethod($method, \Magento\Sales\Model\Quote $quote) + { + return $this->methodSpecificationFactory->create( + array( + AbstractMethod::CHECK_USE_FOR_COUNTRY, + AbstractMethod::CHECK_USE_FOR_CURRENCY, + AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX + ) + )->isApplicable( + $method, + $quote + ); + } +} diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index 79f3726af36525cf709d09783a6be609cd348a2c..e40a3b93c06ae3add84731e8ecc971079d3d308a 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-centinel": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-centinel": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php index 8bf6d4d6b47b267ee53ede90f1ee5288f7209a43..753ba42d52406bfdb49a27dc6aa0d24443edff53 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php @@ -41,8 +41,8 @@ class Location extends \Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Ex { $this->setElement($element); $js = ' - require(["prototype"], function(){ - document.observe("dom:loaded", function() { + require(["jquery", "prototype"], function(jQuery){ + jQuery("body").on("adminConfigDefined", function() { $$(".with-button button.button").each(function(configureButton) { togglePaypalSolutionConfigureButton(configureButton, true); }); diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php index a3135ef50fe349ba3606e4558ca887682a9110d4..92c43c955e96281c35732c30e385a5ca4767660b 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php @@ -40,7 +40,7 @@ class SaveShippingMethod extends \Magento\Paypal\Controller\Express\AbstractExpr if ($isAjax) { $this->_view->loadLayout('paypal_express_review_details'); $this->getResponse()->setBody( - $this->_view->getLayout()->getBlock('root')->setQuote($this->_getQuote())->toHtml() + $this->_view->getLayout()->getBlock('root_block')->setQuote($this->_getQuote())->toHtml() ); return; } diff --git a/app/code/Magento/Paypal/Helper/Hss.php b/app/code/Magento/Paypal/Helper/Hss.php index 775996947e29c2c897b381e88a995df0c758fb4b..6d6128b2c7c63c7f190b287a4fa6e8d85fa9e69d 100644 --- a/app/code/Magento/Paypal/Helper/Hss.php +++ b/app/code/Magento/Paypal/Helper/Hss.php @@ -45,22 +45,16 @@ class Hss extends \Magento\Framework\App\Helper\AbstractHelper protected $_checkoutSession; /** - * @var \Magento\Framework\View\LayoutInterface - */ - protected $_layout; - - /** + * Constructor + * * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\Framework\View\LayoutInterface $layout */ public function __construct( \Magento\Framework\App\Helper\Context $context, - \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Framework\View\LayoutInterface $layout + \Magento\Checkout\Model\Session $checkoutSession ) { $this->_checkoutSession = $checkoutSession; - $this->_layout = $layout; parent::__construct($context); } @@ -68,10 +62,9 @@ class Hss extends \Magento\Framework\App\Helper\AbstractHelper * Get template for button in order review page if HSS method was selected * * @param string $name template name - * @param string $block buttons block name * @return string */ - public function getReviewButtonTemplate($name, $block) + public function getReviewButtonTemplate($name) { $quote = $this->_checkoutSession->getQuote(); if ($quote) { @@ -80,12 +73,6 @@ class Hss extends \Magento\Framework\App\Helper\AbstractHelper return $name; } } - - $blockObject = $this->_layout->getBlock($block); - if ($blockObject) { - return $blockObject->getTemplate(); - } - return ''; } diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index 2093260f349235896c759487c420f1f52e6fa18f..0a1ff267fcb4db115d6063f1dbc577ecd71127be 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -3,25 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-centinel": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-centinel": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml index 573021658747f1cc98c103b691cc6b26b591bb10..581a00639e870eb5052912aedfce12406b94eac0 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.paypal.report.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="paypal.report.grid" as="grid"> <arguments> @@ -136,4 +136,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml index e4c42de476f36fcf8a2c4ccff4d7b2681e31a666..b480da881fa9d6387a2a310c1a9d3a4bae9ed9d0 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="magento-paypal-styles-css"> <arguments> @@ -31,4 +31,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml index 5c0e1e76e53e5e8b21eea89ff36218906fbfc2ef..e790808802b800fa9951e6fd7f60dcc107ab0b20 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer_edit_tabs"> <action method="addTab"> <argument name="name" xsi:type="string">customer_edit_tab_agreements</argument> <argument name="block" xsi:type="string">Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab\Agreement</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml index c007a1a77694e5fe4c08b39f7353ca9bfedbd7e4..6afd86fac23d248abf15973cfaef7c4df41213bf 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab\Agreement" name="customer.billing.agreement.grid" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab\Agreement" name="customer.billing.agreement.grid"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml index e5c5aae80f77f16312b42ed54ac3982692e01c70..3e0ae6e824ef4886e2993f37f78284fb68100b89 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Adminhtml\Billing\Agreement\Grid" name="paypal.billing.agreement.grid" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Adminhtml\Billing\Agreement\Grid" name="paypal.billing.agreement.grid"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml index 622a0201b3e5de26c75956e61bc723ac0f548374..8a2ee8b28a2acfd461e2e00453b29bc1b36538d4 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Paypal\Block\Adminhtml\Billing\Agreement" name="paypal.billing.agreement.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml index 2f7cf9fa6e86d0156151f73de5ff4830a08aa3a3..9a9e3052dfd94fdf3e6afab196eb7a431e426895 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="sales_order_grid_block"/> <referenceBlock name="sales.order.grid"> <arguments> @@ -35,5 +35,7 @@ </referenceBlock> <remove name="sales.order.grid.export"/> <remove name="sales.order.grid.massaction"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_order.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_order.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml index 841b75fc52a88d93b2113de79709be3a5465e9bf..401efcaeaa7e790455138fdc6ad21150b999d7af 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_grid_block"/> <referenceBlock name="sales.order.grid"> <arguments> @@ -51,4 +51,4 @@ </action> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml index 8a3518f1a20c70a428cdc2e7007f6a336a0a5196..75bc2386e639b26ce393d398c77225d6acd852ac 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_paypal_reports_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.paypal.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.paypal.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml index a62255093faec83722efc0b437d85787315d62de..bee42e0aff40bb0612ee8b117cbf6675709f42ae 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="adminhtml_paypal_reports_block"/> <referenceContainer name="content"> <block class="Magento\Paypal\Block\Adminhtml\Settlement\Report" name="adminhtml.paypal.report.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml index 7340e7e84b27fca4c9abba15555b2354593a7963..b081bc810d18fb6c29ba523e0f2863f1ecc610a6 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="sidebar.additional"> <block class="Magento\Paypal\Block\Logo" name="paypal.partner.right.logo" template="partner/logo.phtml"/> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.right.logo" template="bml.phtml"> @@ -41,4 +41,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml index 206662b17aa695e05376ccdee25ccec79454a90d..5275a1b3861c2962af080f94f74fa1c79909c208 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="top.container"> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.center.logo" template="bml.phtml"> <arguments> @@ -40,4 +40,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml index ff8df46b11fd9ebd7d9af6618dfd39f674dfc1f7..fd68fcd052b42bd61e7fb1fd986fd73b5123c6a2 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="top.container"> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.center.logo" template="bml.phtml"> <arguments> @@ -40,4 +40,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_index.xml index f80df51b352ef00f7b3b20d425ab36dcf01ee174..d26e00e04626ad9473f7f424fe7f7d64063b01c6 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="paypal_opcheckout_head_components" template="Magento_Paypal::js/components.phtml"/> </referenceBlock> @@ -38,4 +38,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml index e436aaa84b73b89f859fbcf64e8138f58f2cd892..2ba93fd32e2e47b561e442e0506515721ae7e94b 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="checkout.onepage.review.info.items.after"> <block class="Magento\Paypal\Block\Iframe" name="paypal.iframe" cacheable="false"/> </referenceContainer> @@ -31,8 +31,7 @@ <action method="setTemplate"> <argument name="template" xsi:type="helper" helper="Magento\Paypal\Helper\Hss::getReviewButtonTemplate"> <param name="name">Magento_Paypal::hss/review/button.phtml</param> - <param name="block">checkout.onepage.review.button</param> </argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml index 0f0a77fcd6fe7b88c731727d7ceb9982772c1ebe..260de1c596808172f3b94be68a748c47347119ab 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="order.success.additional.info"> <block class="Magento\Paypal\Block\Checkout\Onepage\Success\BillingAgreement" name="onepage.success.billing_agreement" template="checkout/onepage/success/billing_agreement.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml b/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml index 741426baecff2028d78c4a6ecde6f3fc89f16c41..a2d00f543cf9afc4f11114bd1549e5c4e22aa5c0 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="sidebar.additional"> <block class="Magento\Paypal\Block\Logo" name="paypal.partner.right.logo" template="partner/logo.phtml"/> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.right.logo" template="bml.phtml"> @@ -41,4 +41,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml b/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml index 27210bb96e418d764e7d57031e43249d63b317d8..1fab718a4cee02147334283deddf132a97fff09a 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Billing Agreements</argument> @@ -37,4 +37,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml index 676ce0ea115e5fff6450a92f99152251a68cfc7e..8fe9573edf030e30a930b7b04afab93a3ccb020a 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Paypal\Block\Billing\Agreements" name="customer.account.billing.agreement" template="billing/agreements.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml index 4c23a255a3f4ce4e2022aa15f2f6af993a10f52c..0bddee088124d3ca66a3c508c8568ad4c61e1485 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Paypal\Block\Billing\Agreement\View" name="customer.account.billing.agreement" template="billing/agreement/view.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml index 373939fdfb25ca48187e5317bb33c713a8b548c7..83b2fb5413f6942422523a42d03c95e82fdd0e57 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml @@ -23,17 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="checkout_onepage_review_item_renderers" /> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="paypal_express_review_checkout_head_components" template="Magento_Checkout::js/components.phtml"/> <block class="Magento\Framework\View\Element\Js\Components" name="paypal_express_review_head_components" template="Magento_Paypal::js/components.phtml"/> </referenceBlock> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> <referenceContainer name="content"> <block class="Magento\Paypal\Block\Express\Review" name="paypal.express.review" template="express/review.phtml"> <block class="Magento\Paypal\Block\Express\Review" name="express.review.shipping.method" @@ -47,4 +42,4 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml index b42617064a440e8f9642fb3392800f08b313f31f..e4740ac126303350129eb295f2670ab8946bcb08 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml @@ -23,10 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="checkout_onepage_review_item_renderers" /> - <block class="Magento\Paypal\Block\Express\Review\Details" output="1" name="root" template="express/review/details.phtml"> - <block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list"/> - <block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="onepage/review/totals.phtml"/> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <update handle="checkout_onepage_review_item_renderers"/> + <container name="root"> + <block class="Magento\Paypal\Block\Express\Review\Details" name="page.block" template="express/review/details.phtml"> + <block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list"/> + <block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="onepage/review/totals.phtml"/> + </block> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml index f8d8d4f51a8ad8d9596dd397675d5c506ac609cb..4441962588194436d2d19cbbb7c2994d772122c5 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Hosted\Pro\Iframe" name="hosted.pro.iframe" output="1" template="hss/redirect.phtml"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Hosted\Pro\Iframe" name="hosted.pro.iframe" template="hss/redirect.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml index 445e15540d4b19d7a5f08f4560bc06458b82e23f..7e7860bd6a56d4ed4458fd45fc0e70b498c4e005 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" - template="payflowlink/redirect.phtml" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" template="payflowlink/redirect.phtml" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml index 51fdf678fb4b4c1b0de7f06a61cc6325b03e606c..4a18d5daf1251968a6a5b061c087b04fdc4bc7b5 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" - template="payflowlink/form.phtml" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" template="payflowlink/form.phtml" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml index 445e15540d4b19d7a5f08f4560bc06458b82e23f..7e7860bd6a56d4ed4458fd45fc0e70b498c4e005 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" - template="payflowlink/redirect.phtml" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" template="payflowlink/redirect.phtml" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml index bd5d78e2c614214ecc1b184519d97a930babd021..1f6f8aa1b56f3d9e870c5ecebf83acdcebfc5f90 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" - template="payflowadvanced/redirect.phtml" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" template="payflowadvanced/redirect.phtml" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml index 141092800b9f2eab89b279009479c69ebc3e5c55..c66c26429348e1f3568d21b31066bab9be65a9d8 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" - template="payflowadvanced/form.phtml" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" template="payflowadvanced/form.phtml" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml index bd5d78e2c614214ecc1b184519d97a930babd021..1f6f8aa1b56f3d9e870c5ecebf83acdcebfc5f90 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" - template="payflowadvanced/redirect.phtml" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" template="payflowadvanced/redirect.phtml" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml index 536c740fec90f404f28354fccd3e0e3d834cbc9d..92732d9d1b4d8324f907fbb09eb6c51930d5d8d2 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml @@ -23,13 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="checkout_onepage_review_item_renderers" /> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> <referenceContainer name="content"> <block class="Magento\Paypal\Block\Express\Review" name="paypal.express.review" template="express/review.phtml"> @@ -49,4 +44,4 @@ <referenceBlock name="head"> <block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Paypal::js/components.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_standard_redirect.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_standard_redirect.xml index b0cccc03a8bf2cdfaa08324981a67c1c2c283c48..59a9c85f31d6e9b3eb40bf1121df4d8807bb14a3 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_standard_redirect.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_standard_redirect.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Paypal\Block\Standard\Redirect" output="1" name="standard.redirect" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Paypal\Block\Standard\Redirect" name="standard.redirect" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index 0c3540b5ac109223cf5a74485567edec0d870f1b..ec1ad898b037c8ed97169adecb0a8259d97d8d65 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-cron": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-cron": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml index e132249e513d694b39d6c5b24b94cb75c72759c5..216fa1db633adb4bb8abf9b89ffe044d81fac444 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.login.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> </referenceContainer> <referenceContainer name="form.billing.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me.billing" template="remember_me.phtml" before="-"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml index 9283d79d8a4b6c471cc05c571c1a6b3518896b5d..c2770a1b39b2863523ed734f348c8b292983a116 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml index 9283d79d8a4b6c471cc05c571c1a6b3518896b5d..c2770a1b39b2863523ed734f348c8b292983a116 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index 525c8d9ed503c8a6309dacb3dda6e53a775952af..21b61ae09ab1a0c78c3e4f8744a707fe96b25d27 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml index e3a050907d608ead55019b1b499690d76e98593b..0cd435cd89be4a2e785843423c91a89d1e3293c2 100644 --- a/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <referenceBlock name="product.info"> <referenceContainer name="alert.urls"> @@ -46,4 +46,4 @@ </referenceContainer> </referenceBlock> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/composer.json b/app/code/Magento/RecurringPayment/composer.json index 0e07d3798a301e5b1d253dedb32889bbecfa3af3..7949775d23c3f72641fa1e8dfc8a0559080fa09c 100644 --- a/app/code/Magento/RecurringPayment/composer.json +++ b/app/code/Magento/RecurringPayment/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/RecurringPayment/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/RecurringPayment/view/adminhtml/layout/customer_index_edit.xml index b76648298fb65135cc3558a91a1200f8b6c71ca0..30bc3f15ae4a2bf0ef3aeee9b90e41df5100715c 100644 --- a/app/code/Magento/RecurringPayment/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/RecurringPayment/view/adminhtml/layout/customer_index_edit.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> <referenceBlock name="customer_edit_tabs"> <action method="addTab"> <argument name="name" xsi:type="string">customer_edit_tab_recurring_payment</argument> <argument name="block" xsi:type="string">Magento\RecurringPayment\Block\Adminhtml\Customer\Edit\Tab\RecurringPayment</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_customergrid.xml b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_customergrid.xml index e16ec68f917eab12ae6801f23b4464cd522b844b..4e693b02cb4eaf41e30d6569e517cabefc03f39d 100644 --- a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_customergrid.xml +++ b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_customergrid.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\RecurringPayment\Block\Adminhtml\Customer\Edit\Tab\RecurringPayment" name="customer.recurring.payment.grid" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\RecurringPayment\Block\Adminhtml\Customer\Edit\Tab\RecurringPayment" name="customer.recurring.payment.grid"/> + </container> </layout> diff --git a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_grid.xml b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_grid.xml index d2784189b0312ed7d57f5ae6d2eeb68db8c4a96f..70d47338f53c5575ae3a82409553918fe10a37b7 100644 --- a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_grid.xml +++ b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_grid.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <remove name="root"/> - <block class="Magento\RecurringPayment\Block\Adminhtml\Payment\Grid" name="sales.recurring.adminhtml.payment.grid" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\RecurringPayment\Block\Adminhtml\Payment\Grid" name="sales.recurring.adminhtml.payment.grid"/> + </container> </layout> diff --git a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_index.xml b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_index.xml index a4e3814917d4be8852259b41de2e40a7a60c152b..2d75a258e1722c8213fdd6bc8cdae29ce99e9680 100644 --- a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_index.xml +++ b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\RecurringPayment\Block\Adminhtml\Payment" name="sales.recurring.payment.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_orders.xml b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_orders.xml index f21e20fb31f8c727d68b2e62c2c1b0233c752425..5566213f84cbee994f2044394b462d6ae8861bb1 100644 --- a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_orders.xml +++ b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_orders.xml @@ -23,7 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <remove name="root"/> - <block class="Magento\RecurringPayment\Block\Adminhtml\Payment\View\Tab\Orders" name="sales.recurring.payment.tab.orders" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\RecurringPayment\Block\Adminhtml\Payment\View\Tab\Orders" name="sales.recurring.payment.tab.orders"/> + </container> </layout> diff --git a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_view.xml b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_view.xml index b17b3cf9125bdb52b75dd8c7133e69eb1ef577df..3da069ee65aa7de5b4b7ee2f3dc05cf3c9532c8a 100644 --- a/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_view.xml +++ b/app/code/Magento/RecurringPayment/view/adminhtml/layout/sales_recurringpayment_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\RecurringPayment\Block\Adminhtml\Payment\View" name="sales.recurring.payment.view" template="Magento_Backend::widget/view/container.phtml"> <action method="setDestElementId"> @@ -104,4 +104,4 @@ </action> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/RecurringPayment/view/frontend/layout/catalog_product_view.xml index 3d8baf41d825721940a415686042dce5200bbb94..62de3f31373343e63d4a5748a1a30ac6ca444c93 100644 --- a/app/code/Magento/RecurringPayment/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/RecurringPayment/view/frontend/layout/catalog_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product.info.main"> <block class="Magento\RecurringPayment\Block\Catalog\Product\View\Payment" name="product.info.additional.recurring.schedule" as="recurring_info" template="catalog/product/view/payment/schedule.phtml" group="detailed_info"> <action method="setTitle"> @@ -34,4 +34,4 @@ <referenceBlock name="product.info.options.wrapper"> <block class="Magento\RecurringPayment\Block\Catalog\Product\View\Payment" name="product.info.options.recurring" as="recurring_options" template="catalog/product/view/payment/options.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/RecurringPayment/view/frontend/layout/checkout_onepage_success.xml index 733bafb50c2536a37948b6b7a53e7e60415472da..652717795f487eaaad6f5d38bd2b51a91d874f23 100644 --- a/app/code/Magento/RecurringPayment/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/RecurringPayment/view/frontend/layout/checkout_onepage_success.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> <referenceContainer name="order.success.additional.info"> <block class="Magento\RecurringPayment\Block\Checkout\Onepage\Success" name="onepage-success-recurring-payment" template="checkout/onepage/success.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/frontend/layout/customer_account.xml b/app/code/Magento/RecurringPayment/view/frontend/layout/customer_account.xml index d3cdc5c66aa910bd72d86e8c8b964cf5a404d8cf..a9cf4ab55aab611de2426b74253861adfcfe2943 100644 --- a/app/code/Magento/RecurringPayment/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/RecurringPayment/view/frontend/layout/customer_account.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-recurring-payments-link" after="customer-account-navigation-orders-link"> <arguments> @@ -32,4 +32,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_index.xml b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_index.xml index 6901d86b2b9b9e6b810dddca919fe90752adb826..c51e9954930bf69c9b4efec9da11cb8155cf095b 100644 --- a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_index.xml +++ b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceBlock name="head"> <action method="setTitle"> @@ -42,4 +42,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_orders.xml b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_orders.xml index 3af7ef92f0943eaae99fc50335dfb24422eadf85..7b4abd63963d31cbf8d3f0af4bf8e2d1bca8e3ff 100644 --- a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_orders.xml +++ b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_orders.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> <update handle="customer_account"/> <update handle="sales_recurringpayment_view__tabs"/> <referenceBlock name="sales.recurring.payment.view.tab.orders"> @@ -47,4 +47,4 @@ </action> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_view.xml b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_view.xml index 1a07f518f5f4fe5a980e5deb2560c5c637da7343..7d17eec619bcf831d046fc8226b5dc01cb1704db 100644 --- a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_view.xml +++ b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <update handle="sales_recurringpayment_view__tabs"/> <referenceBlock name="sales.recurring.payment.view.tab.payment"> @@ -84,4 +84,4 @@ </action> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_view__tabs.xml b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_view__tabs.xml index a9b1d48c313e902b20e8f1d4fb988a581be5041a..920302605221ccc3a7b37f6e8a5ac9ead5d68abe 100644 --- a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_view__tabs.xml +++ b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_view__tabs.xml @@ -23,12 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Recurring Profile View Tabs" design_abstraction="custom"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">2columns-left.phtml</argument> - </action> - </referenceBlock> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Recurring Profile View Tabs" design_abstraction="custom"> <referenceContainer name="content"> <block class="Magento\RecurringPayment\Block\Payment\View\Data" name="sales.recurring.payment.view" template="recurring/payment/view.phtml"> <action method="setShouldPrepareInfoTabs"> @@ -52,4 +47,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/Block/Product/Widget/Compared.php b/app/code/Magento/Reports/Block/Product/Widget/Compared.php index 615995722ce685d187bb0ed37e353cf1186e0042..d70aeed6aaba3103d657b6cc5853a1a1d5ecf205 100644 --- a/app/code/Magento/Reports/Block/Product/Widget/Compared.php +++ b/app/code/Magento/Reports/Block/Product/Widget/Compared.php @@ -25,8 +25,6 @@ namespace Magento\Reports\Block\Product\Widget; /** * Reports Recently Compared Products Widget - * - * @author Magento Core Team <core@magentocommerce.com> */ class Compared extends \Magento\Reports\Block\Product\Compared implements \Magento\Widget\Block\BlockInterface { @@ -38,18 +36,9 @@ class Compared extends \Magento\Reports\Block\Product\Compared implements \Magen protected function _construct() { parent::_construct(); - $this->addColumnCountLayoutDepend( - 'one_column', - 5 - )->addColumnCountLayoutDepend( - 'two_columns_left', - 4 - )->addColumnCountLayoutDepend( - 'two_columns_right', - 4 - )->addColumnCountLayoutDepend( - 'three_columns', - 3 - ); + $this->addColumnCountLayoutDepend('1column', 5) + ->addColumnCountLayoutDepend('2columns-left', 4) + ->addColumnCountLayoutDepend('2columns-right', 4) + ->addColumnCountLayoutDepend('2columns', 3); } } diff --git a/app/code/Magento/Reports/Block/Product/Widget/Viewed.php b/app/code/Magento/Reports/Block/Product/Widget/Viewed.php index c7d19f979f32597b5075a9c550bbcdec3ce43358..db96e74829aa0acd75b93b308cab6184aa09a79e 100644 --- a/app/code/Magento/Reports/Block/Product/Widget/Viewed.php +++ b/app/code/Magento/Reports/Block/Product/Widget/Viewed.php @@ -25,8 +25,6 @@ namespace Magento\Reports\Block\Product\Widget; /** * Reports Recently Viewed Products Widget - * - * @author Magento Core Team <core@magentocommerce.com> */ class Viewed extends \Magento\Reports\Block\Product\Viewed implements \Magento\Widget\Block\BlockInterface { @@ -38,9 +36,9 @@ class Viewed extends \Magento\Reports\Block\Product\Viewed implements \Magento\W protected function _construct() { parent::_construct(); - $this->addColumnCountLayoutDepend('one_column', 5) - ->addColumnCountLayoutDepend('two_columns_left', 4) - ->addColumnCountLayoutDepend('two_columns_right', 4) - ->addColumnCountLayoutDepend('three_columns', 3); + $this->addColumnCountLayoutDepend('1column', 5) + ->addColumnCountLayoutDepend('2columns-left', 4) + ->addColumnCountLayoutDepend('2columns-right', 4) + ->addColumnCountLayoutDepend('3columns', 3); } } diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index f506ed02d8963f311c393e2d41f756150ae40524..b6e5b2575c352bd888e66f8f1bf74f32dd99e5a0 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-widget": "0.1.0-alpha91", - "magento/module-log": "0.1.0-alpha91", - "magento/module-wishlist": "0.1.0-alpha91", - "magento/module-review": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-downloadable": "0.1.0-alpha91", - "magento/module-sales-rule": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-widget": "0.1.0-alpha92", + "magento/module-log": "0.1.0-alpha92", + "magento/module-wishlist": "0.1.0-alpha92", + "magento/module-review": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-downloadable": "0.1.0-alpha92", + "magento/module-sales-rule": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_index_exportsearchcsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_index_exportsearchcsv.xml index 1ee0b0dc5cfc895b48304abf191b2e9c029686ca..4b2ae4b791fafcd910ab07dfbc96959b94231789 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_index_exportsearchcsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_index_exportsearchcsv.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="reports_index_search_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="report.search.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_index_exportsearchexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_index_exportsearchexcel.xml index 1ee0b0dc5cfc895b48304abf191b2e9c029686ca..4b2ae4b791fafcd910ab07dfbc96959b94231789 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_index_exportsearchexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_index_exportsearchexcel.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="reports_index_search_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="report.search.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_index_search.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_index_search.xml index cc996b1fc4f51e917f5b4e52520627a26899a9de..4809307199a7816dcda8a145e8f612190adc3e70 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_index_search.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_index_search.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_index_search_block"/> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Search" name="report.search.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_index_search_block.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_index_search_block.xml index dc33589e6606a4200f5adcfee49f65c3a7791c47..0efe089b00508f1b8dce920b09c2d05424182fbc 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_index_search_block.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_index_search_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="report.search.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.report.search.grid" as="grid"> <arguments> @@ -106,4 +106,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts.xml index 30a3de8c5d4efdc2df0ce456f0f62b0423459997..7cd864aa67492b590a96747025ce3d498b6d8002 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_accounts_grid"/> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Customer\Accounts" name="adminhtml.report.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts_grid.xml index cb2c952b8250cf3c04d3f228c52469a7363d9868..e396043bc7303f5f83f247c42286d024052b9bc0 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_grid"/> <referenceBlock name="adminhtml.report.grid"> <arguments> @@ -60,4 +60,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountscsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountscsv.xml index 1f5754eeb843ab44d7d26d4a5d9bb1696671ccce..daf398d41e4f90487a603faf3046e8376568a318 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountscsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountscsv.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_accounts_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountsexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountsexcel.xml index 1f5754eeb843ab44d7d26d4a5d9bb1696671ccce..daf398d41e4f90487a603faf3046e8376568a318 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountsexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountsexcel.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_accounts_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportorderscsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportorderscsv.xml index 8ca4a663d3c7a7e98c4c04f894043afbc5e84990..23b16f18621c3422710c9582f0226184b5bb6dc0 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportorderscsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportorderscsv.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_orders_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportordersexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportordersexcel.xml index 8ca4a663d3c7a7e98c4c04f894043afbc5e84990..23b16f18621c3422710c9582f0226184b5bb6dc0 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportordersexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportordersexcel.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_orders_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalscsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalscsv.xml index 882bc70d21abe5ee65d119268c03f2fc6fb57f1d..c984c9cdd212ae1cef8827bc73b7a88f1b762613 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalscsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalscsv.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_totals_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalsexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalsexcel.xml index 882bc70d21abe5ee65d119268c03f2fc6fb57f1d..c984c9cdd212ae1cef8827bc73b7a88f1b762613 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalsexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalsexcel.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_totals_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders.xml index d587f6585d51b9a607a74b64b2c62825c2400ca4..0446005c97800012fbce10b51337e1e9928f8436 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_orders_grid"/> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Customer\Orders" name="adminhtml.report.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders_grid.xml index b7947703309e2f0b73db45127f452966ddb61031..ad7d7780df294f79ecbc5397cf1179ef42ab27db 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_grid"/> <referenceBlock name="adminhtml.report.grid"> <arguments> @@ -95,4 +95,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals.xml index a1209ab24cfa253c5a136937d9c3567d538e90a1..5b8bec6b2078005931eef9aa5970c396685627cc 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_totals_grid"/> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Customer\Totals" name="adminhtml.report.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals_grid.xml index 2aeb2e125fcdbe3b2dc7329c95c0fafd86a60fe1..d748afe6cc669bc033b46c90bb5fe4ae075be294 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_customer_orders_grid"/> <referenceBlock name="adminhtml.report.grid"> <arguments> @@ -49,4 +49,4 @@ <argument name="id" xsi:type="string">gridTotalsCustomerSet</argument> </arguments> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml index 45ed66ed6305c7bd80d431d2a85d5e6bcf91a34a..10f8d341c0d1985197e7ee73e8b3cba00b772085 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.report.grid.store_switcher" @@ -84,4 +84,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_downloads.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_downloads.xml index e316ce9af81985c0d2ee24a005ff6e7321a1b665..4fb51aac1c46749ac715f0d212c6fafa010b7b8b 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_downloads.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_downloads.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.report.product.downloads.store_switcher" @@ -40,4 +40,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml index 0e5c3db9f545d4f96d87c6a8b330682a9f688dea..210d10e406af5a9f7edc43810442cd0284970621 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_product_lowstock_grid"/> <container name="adminhtml.block.report.product.lowstock.grid.container" label="Export CSV"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml index 1d7db9a8121d9ff00ea290d4d71ab5ca801a7483..6297553824e1fadb7ded5948a0892ee79cc00c8b 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_product_lowstock_grid"/> <container name="adminhtml.block.report.product.lowstock.grid.container" label="Excel XML"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldcsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldcsv.xml index 82f86a9f69cafe4a0dae764f40f35907fa460cf0..00a53213553186ed84663d754a31b57a3306d5f1 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldcsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldcsv.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_product_sold_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldexcel.xml index 82f86a9f69cafe4a0dae764f40f35907fa460cf0..00a53213553186ed84663d754a31b57a3306d5f1 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldexcel.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_product_sold_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock.xml index 0acd0ecd31ecfb8b12de5341b12a17d3b89500b7..cf2c1c16910bc8f88569008c14d7d9941b50124d 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_product_lowstock_grid"/> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" @@ -44,4 +44,4 @@ <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Product\Lowstock" name="adminhtml.report.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock_grid.xml index bdd14f29a06696f67a8079af422fb93b23ba2ef4..ab009dbd3a644c59d4a8471f95e14825a67e0488 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.report.grid.container"> <block class="Magento\Reports\Block\Adminhtml\Product\Lowstock\Grid" name="adminhtml.block.report.product.lowstock.grid" as="grid"> <arguments> @@ -78,4 +78,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold.xml index 6c22719bd79744acb8173466a10f9e65d7adc806..de9d487f0d1185cd55410576af324c449296dc3d 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_product_sold_grid"/> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Product\Sold" name="adminhtml.report.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold_grid.xml index ac5f8c568c222b0aceac3546b6ee0399879a690f..f959453dec4db9fa2ff5d287982bd092012439fc 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_grid"/> <referenceBlock name="adminhtml.report.grid"> <arguments> @@ -70,4 +70,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_viewed.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_viewed.xml index 88ee522a264c4b274b41f99cec2be040b61787fd..0fb5046c497b1877b6e5b220613123e47450c657 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_viewed.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_viewed.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="messages"> <action method="addNotice"> <argument translate="true" name="message" xsi:type="string">This report uses timezone configuration data. Be sure to refresh lifetime statistics any time you change store timezone.</argument> @@ -54,4 +54,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer.xml index 1178c9c78efa0173dd8024119084b07ffa6da4b5..f4f364ea3cc451203232e0e91969a84cedbcdb32 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_review_customer_grid"/> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Review\Customer" name="adminhtml.report.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml index 71ab3265bad8f5473ffee7db982ddbc58a041a00..92abed67f4f67f0f273a52b151148a80610077ff 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.report.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.report.review.customer.grid" as="grid"> <arguments> @@ -92,4 +92,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomercsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomercsv.xml index 147403f7fdd3f76747f4857c0212a7af88f7d577..eac70f2c68346ca2e706f1c2a615b97501cd9bdd 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomercsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomercsv.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_review_customer_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomerexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomerexcel.xml index 147403f7fdd3f76747f4857c0212a7af88f7d577..eac70f2c68346ca2e706f1c2a615b97501cd9bdd 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomerexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomerexcel.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_review_customer_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductcsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductcsv.xml index fe9a37a895c4b0c413ecc7776f5024379373041e..c8ac374660f13fc3c02d149c2d2704c9aa4614bd 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductcsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductcsv.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_review_product_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductexcel.xml index fe9a37a895c4b0c413ecc7776f5024379373041e..c8ac374660f13fc3c02d149c2d2704c9aa4614bd 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductexcel.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_review_product_grid"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product.xml index cc99dd6a868ce0c7d0ed6719b3c13b7b5d75ec71..2d0abd64dd92d6d2bdd078894fe85a42eb737852 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_report_review_product_grid"/> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Review\Product" name="adminhtml.report.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml index ed9530aa909ce48c405d05abd301140e9f2f8c49..85abca3e176dc2d2a961ef04f30effd55ac16ad9 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.report.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.report.review.product.grid" as="grid"> <arguments> @@ -129,4 +129,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_bestsellers.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_bestsellers.xml index 4eee528290e3b1bbc824f378003d515e67760b98..b4da497a60360be62a2cefd1115b413691308fc9 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_bestsellers.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_bestsellers.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_sales"/> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" @@ -58,4 +58,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_coupons.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_coupons.xml index 3b46f758b21c8fa11926bee2d8fe6f543f7301aa..beb6833c23cba7ba34db92d65c92b642fb55dc22 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_coupons.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_coupons.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_sales"/> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" @@ -59,4 +59,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_invoiced.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_invoiced.xml index b21bd0905977c8d7233b71f28758f22a037eaf7e..4e2f1a3e7fb7368564e2d07a23503610df5498bf 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_invoiced.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_invoiced.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_sales"/> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" @@ -54,4 +54,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_refunded.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_refunded.xml index d31158b21c0267814cdbca0f0b19656b03c65dc4..cc2e2e17f4cc5d5d185001bcbb5252a482fd0502 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_refunded.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_refunded.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_sales"/> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" @@ -54,4 +54,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_sales.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_sales.xml index 44241d49e5de72ab33f8be17d7598b95bf9b86c0..452adeb868dbae68a698fbc13c1326ca63f02b76 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_sales.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_sales.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_sales"/> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" @@ -59,4 +59,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_shipping.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_shipping.xml index 5f6518f8dbeef8ba60be5df84aa45339ce489eb2..23d9eb29f1d46d39ffd283db257e1bae661469e0 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_shipping.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_shipping.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_sales"/> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" @@ -54,4 +54,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_tax.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_tax.xml index 552c2897d583f45ea8c251707dce4b4666e151da..79e23c070ca8fdadc5d60a0a11568d2e50d77a99 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_tax.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_tax.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="reports_sales"/> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" @@ -59,4 +59,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_shopcart_abandoned.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_shopcart_abandoned.xml index 7866b4a380f5076907c931ac226fb0f9c18c7fa5..64dd3413f19c428bdf825839794da9fff48c0a95 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_shopcart_abandoned.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_shopcart_abandoned.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.report.shopcart.abandoned.store_switcher"> @@ -36,4 +36,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml index 620d93266637f42879ac3a5c2a0496c0ae88bf1f..0baff97e59d4e7d41e99073a84b1c5f868cb0072 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Refresh\Statistics" name="adminhtml.block.report.refresh.statistics"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.report.refresh.statistics.grid" as="grid"> @@ -97,4 +97,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_sales.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_sales.xml index 1ab555d9c2c61fe6e7514bd92923ef0ee6be72bd..6bd5efedc1f4505939cdc424b7702fba04833548 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_sales.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_sales.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="messages"> <action method="addNotice"> <argument translate="true" name="message" xsi:type="string">This report uses timezone configuration data. Be sure to refresh lifetime statistics any time you change store timezone.</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/frontend/layout/default.xml b/app/code/Magento/Reports/view/frontend/layout/default.xml index 73df9454121cc7b40fff28366e7dafa9047dbf03..1f4fd3bab33769ea11d522490ebf2102c3709686 100644 --- a/app/code/Magento/Reports/view/frontend/layout/default.xml +++ b/app/code/Magento/Reports/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="sidebar.additional"> <block class="Magento\Reports\Block\Product\Viewed" name="reports.product.viewed" template="product_viewed.phtml"/> <block class="Magento\Reports\Block\Product\Compared" name="reports.product.compared" template="product_compared.phtml"/> @@ -31,4 +31,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="reports_page_head_components" template="Magento_Reports::js/components.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Reports/view/frontend/layout/print.xml b/app/code/Magento/Reports/view/frontend/layout/print.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/Reports/view/frontend/layout/print.xml +++ b/app/code/Magento/Reports/view/frontend/layout/print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index a5a5b0acffa3ae3bfbdfe0732f058da0188873b5..d058fc990d0f33ebfdf511bc4f0294b8f7d56b15 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Review/Block/Product/View/ListView.php b/app/code/Magento/Review/Block/Product/View/ListView.php index 3f4690ebd5de920450521d89b923878e00f17f05..e903a560ee85f77fe5ce0b3687bd81181b09f59f 100644 --- a/app/code/Magento/Review/Block/Product/View/ListView.php +++ b/app/code/Magento/Review/Block/Product/View/ListView.php @@ -56,7 +56,8 @@ class ListView extends \Magento\Review\Block\Product\View { parent::_prepareLayout(); - if ($toolbar = $this->getLayout()->getBlock('product_review_list.toolbar')) { + $toolbar = $this->getLayout()->getBlock('product_review_list.toolbar'); + if ($toolbar) { $toolbar->setCollection($this->getReviewsCollection()); $this->setChild('toolbar', $toolbar); } diff --git a/app/code/Magento/Review/Controller/Product/ListAction.php b/app/code/Magento/Review/Controller/Product/ListAction.php index c91277db4356ac38a1c5a7f03ebe4ca3e0458e62..1c9c49bf470e1a8cdd7d29602322b9bb8aa7e3cb 100644 --- a/app/code/Magento/Review/Controller/Product/ListAction.php +++ b/app/code/Magento/Review/Controller/Product/ListAction.php @@ -37,20 +37,18 @@ class ListAction extends \Magento\Review\Controller\Product */ protected function _initProductLayout($product) { + $this->_view->getPage()->initLayout(); + if ($product->getPageLayout()) { + /** @var \Magento\Framework\View\Page\Config $pageConfig */ + $pageConfig = $this->_objectManager->get('Magento\Framework\View\Page\Config'); + $pageConfig->setPageLayout($product->getPageLayout()); + } $update = $this->_view->getLayout()->getUpdate(); - $update->addHandle('default'); $this->_view->addPageLayoutHandles( array('id' => $product->getId(), 'sku' => $product->getSku(), 'type' => $product->getTypeId()) ); - if ($product->getPageLayout()) { - $this->_objectManager->get('Magento\Theme\Helper\Layout')->applyHandle($product->getPageLayout()); - } $this->_view->loadLayoutUpdates(); - - if ($product->getPageLayout()) { - $this->_objectManager->get('Magento\Theme\Helper\Layout')->applyTemplate($product->getPageLayout()); - } $update->addUpdate($product->getCustomLayoutUpdate()); $this->_view->generateLayoutXml(); $this->_view->generateLayoutBlocks(); diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index fb3bc3b4c9d775acb7f690be8da9bf70487e81a7..1d71cde7563a29dcf740206168224f142d6b1c01 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-newsletter": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-newsletter": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Review/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/Review/view/adminhtml/layout/catalog_product_new.xml index 860ec5d436e2528286b751f2e423f8b206191dc4..36378d9ed14baf3245cad03420ebdbb0d37a8603 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/catalog_product_new.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="product_tabs"> <block class="Magento\Review\Block\Adminhtml\Product\Edit\Tab" name="product.reviews"> <arguments> @@ -40,4 +40,4 @@ <argument name="block" xsi:type="string">product.reviews</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml b/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml index 56d58a88d329628774420701429cccaa0a2ddba1..04bd379949df7176b44353930b10002dc34bafd4 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.rating.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.rating.grid" as="grid"> <arguments> @@ -82,4 +82,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Review/view/adminhtml/layout/review_product_edit.xml b/app/code/Magento/Review/view/adminhtml/layout/review_product_edit.xml index bb5469701a503a46f9eb93379487bebb0ad0fef9..9ed0277c27ecd08c77d38656b21768fef57904cd 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/review_product_edit.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/review_product_edit.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="review_product_new"/> -</layout> +</page> diff --git a/app/code/Magento/Review/view/adminhtml/layout/review_product_reviews_grid.xml b/app/code/Magento/Review/view/adminhtml/layout/review_product_reviews_grid.xml index 3ddc307e0874c34332b64eb9b71f9e552c2c2451..2eef53e96d99e9676b9729040c240f003b2d3a44 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/review_product_reviews_grid.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/review_product_reviews_grid.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Review\Block\Adminhtml\Product\Edit\Tab\Reviews" name="admin.product.reviews"/> </container> </layout> diff --git a/app/code/Magento/Review/view/adminhtml/layout/review_rating_index.xml b/app/code/Magento/Review/view/adminhtml/layout/review_rating_index.xml index 90474ce810826a5876f42d1fbfe96dbd2e425d40..e318f0de8e44261aaef97422ad603ac12cede147 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/review_rating_index.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/review_rating_index.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="rating_block"/> <referenceContainer name="content"> <block class="Magento\Review\Block\Adminhtml\Rating" name="adminhtml.rating.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml index 263f6ff4274b02ee4479183b2ef4f53a2e1e2773..b04826d140b76163dc364aba56079803d5575a4a 100644 --- a/app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Core\Block\RequireCookie" name="require-cookie" template="Magento_Core::require_cookie.phtml"> <arguments> @@ -40,4 +40,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Review/view/frontend/layout/customer_account.xml b/app/code/Magento/Review/view/frontend/layout/customer_account.xml index ffeb9ff435f9d149519129761a0b34e8265b08d3..307ae41cc9027d8a4ebfa4bc3f12853ca06cf78f 100644 --- a/app/code/Magento/Review/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Review/view/frontend/layout/customer_account.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-product-reviews-link"> <arguments> @@ -32,4 +32,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml index 53605c230e80815046e3fa44da6eef7ad5d1c74a..9f47214355fa734fde6914e5c89e599472723b0a 100644 --- a/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Review\Block\Customer\Recent" name="customer_account_dashboard_info1" template="customer/recent.phtml" after="customer_account_dashboard_address" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml b/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml index 1f72a4b334a0b6d0e02e1f030357c89a4cd9d698..7a53d2dbe2507b7d1440485e895d2f9631ba7923 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Review\Block\Customer\ListCustomer" name="review_customer_list" template="customer/list.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml b/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml index 9b854a8898cbf94b7b2fc9f89037ee438d81a46d..cfbd782fe0b2d2809c4230a21386937e902c44cc 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Review\Block\Customer\View" name="customers_review" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_list.xml b/app/code/Magento/Review/view/frontend/layout/review_product_list.xml index e8486a7d7a62035f235facb78e459e8dcd79f7de..cb002909ff775ef5734ced7086a49dd6025aad7c 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_list.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_list.xml @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_view"/> <referenceContainer name="product.info.main"> <block class="Magento\Review\Block\Product\View\Other" name="product.info.other" as="other" template="Magento_Review::product/view/other.phtml" before="product.info.addto"/> @@ -38,4 +37,4 @@ <block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"/> </container> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_listajax.xml b/app/code/Magento/Review/view/frontend/layout/review_product_listajax.xml index 2c0d767ee8ebfd92104469e5d1831d08253bb25d..75e637d2b2efbfc86e2d7e8e113fa4e80270f88c 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_listajax.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_listajax.xml @@ -23,13 +23,14 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <remove name="root"/> - <block class="Magento\Review\Block\Product\View\ListView" name="product.info.product_additional_data" as="product_additional_data" template="product/view/list.phtml" output="1"/> - <block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar" output="1"> - <arguments> - <argument name="show_per_page" xsi:type="boolean">false</argument> - <argument name="show_amounts" xsi:type="boolean">false</argument> - </arguments> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Review\Block\Product\View\ListView" name="product.info.product_additional_data" as="product_additional_data" template="product/view/list.phtml"/> + <block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"> + <arguments> + <argument name="show_per_page" xsi:type="boolean">false</argument> + <argument name="show_amounts" xsi:type="boolean">false</argument> + </arguments> + </block> + </container> </layout> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_view.xml b/app/code/Magento/Review/view/frontend/layout/review_product_view.xml index 02df5684e34e56c3859f2c580c8b950641eb1239..249533fba57c3ec0ecd99a5158ef33d236cad97f 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_view.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_view.xml @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Review\Block\View" name="review_view"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Rss/Block/Order/Info/Buttons/Rss.php b/app/code/Magento/Rss/Block/Order/Info/Buttons/Rss.php new file mode 100644 index 0000000000000000000000000000000000000000..fca08312b50b01396ac4f2a9abd23e15e5b62016 --- /dev/null +++ b/app/code/Magento/Rss/Block/Order/Info/Buttons/Rss.php @@ -0,0 +1,87 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Rss\Block\Order\Info\Buttons; + +/** + * Block with rss feed link in Order view page + */ +class Rss extends \Magento\Framework\View\Element\Template +{ + /** + * Template of the block + * + * @var string + */ + protected $_template = 'order/info/buttons/rss.phtml'; + + /** + * Core registry + * + * @var \Magento\Framework\Registry + */ + protected $registry; + + /** + * @var \Magento\Rss\Helper\Order + */ + protected $orderHelper; + + /** + * @param \Magento\Framework\View\Element\Template\Context $context + * @param \Magento\Framework\Registry $registry + * @param \Magento\Rss\Helper\Order $orderHelper + * @param array $data + */ + public function __construct( + \Magento\Framework\View\Element\Template\Context $context, + \Magento\Framework\Registry $registry, + \Magento\Rss\Helper\Order $orderHelper, + array $data = array() + ) { + $this->registry = $registry; + $this->orderHelper = $orderHelper; + parent::__construct($context, $data); + } + + /** + * Retrieve current order model instance + * + * @return \Magento\Sales\Model\Order + */ + public function getOrder() + { + return $this->registry->registry('current_order'); + } + + /** + * Getting order helper + * + * @return \Magento\Rss\Helper\Order + */ + public function getOrderHelper() + { + return $this->orderHelper; + } +} diff --git a/app/code/Magento/Rss/Controller/Index.php b/app/code/Magento/Rss/Controller/Index.php index eb2a045351bd0932dfe71adb1f0a7e9f2e1276e6..b232d3651fb764b5ab672ec2caa99edd48a00ef4 100644 --- a/app/code/Magento/Rss/Controller/Index.php +++ b/app/code/Magento/Rss/Controller/Index.php @@ -31,9 +31,9 @@ class Index extends \Magento\Framework\App\Action\Action protected $_scopeConfig; /** - * @var \Magento\Rss\Helper\WishlistRss + * @var \Magento\Rss\Helper\Data */ - protected $_wishlistHelper; + protected $_rssHelper; /** * @var \Magento\Customer\Model\Session @@ -43,17 +43,17 @@ class Index extends \Magento\Framework\App\Action\Action /** * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Rss\Helper\WishlistRss $wishlistHelper + * @param \Magento\Rss\Helper\Data $rssHelper * @param \Magento\Customer\Model\Session $customerSession */ public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Rss\Helper\WishlistRss $wishlistHelper, + \Magento\Rss\Helper\Data $rssHelper, \Magento\Customer\Model\Session $customerSession ) { $this->_scopeConfig = $scopeConfig; - $this->_wishlistHelper = $wishlistHelper; + $this->_rssHelper = $rssHelper; $this->_customerSession = $customerSession; parent::__construct($context); } diff --git a/app/code/Magento/Rss/Controller/Index/Nofeed.php b/app/code/Magento/Rss/Controller/Index/Nofeed.php index 1222cfd72bc81229e67f9273f771c559a5ae125a..ed76be54cf761b20418680b0ab8be36dd45bb48c 100644 --- a/app/code/Magento/Rss/Controller/Index/Nofeed.php +++ b/app/code/Magento/Rss/Controller/Index/Nofeed.php @@ -33,17 +33,6 @@ class Nofeed extends \Magento\Rss\Controller\Index */ public function execute() { - $this->getResponse()->setHeader( - 'HTTP/1.1', - '404 Not Found' - )->setHeader( - 'Status', - '404 File not found' - )->setHeader( - 'Content-Type', - 'text/plain; charset=UTF-8' - )->setBody( - __('There was no RSS feed enabled.') - ); + $this->_rssHelper->sendEmptyRssFeed($this->getResponse()); } } diff --git a/app/code/Magento/Rss/Helper/Data.php b/app/code/Magento/Rss/Helper/Data.php new file mode 100644 index 0000000000000000000000000000000000000000..7fd45f558940dc86f32e6e373b9b3091c568ff24 --- /dev/null +++ b/app/code/Magento/Rss/Helper/Data.php @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Rss\Helper; + +/** + * Order rss helper + */ +class Data extends \Magento\Framework\App\Helper\AbstractHelper +{ + /** + * Setting headers to response for sending empty rss + * + * @param \Magento\Framework\App\ResponseInterface $response + * @return void + */ + public function sendEmptyRssFeed(\Magento\Framework\App\ResponseInterface $response) + { + $response->setHeader( + 'HTTP/1.1', + '404 Not Found' + )->setHeader( + 'Status', + '404 File not found' + )->setHeader( + 'Content-Type', + 'text/plain; charset=UTF-8' + )->setBody( + __('There was no RSS feed enabled.') + ); + } +} diff --git a/app/code/Magento/Rss/Helper/Order.php b/app/code/Magento/Rss/Helper/Order.php index 558ff165da51c77d31e94f8080675c4d655fcf92..8ad2bb23acf00865b10fbe3dfc2cf4068287235a 100644 --- a/app/code/Magento/Rss/Helper/Order.php +++ b/app/code/Magento/Rss/Helper/Order.php @@ -24,9 +24,7 @@ namespace Magento\Rss\Helper; /** - * Default rss helper - * - * @author Magento Core Team <core@magentocommerce.com> + * Order rss helper */ class Order extends \Magento\Framework\App\Helper\AbstractHelper { diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index c34c06f6bb5b19d2dfdab5749e60dabfed5d31d4..305d0577313d5ce054d25c8785092e0354f6c025 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -3,22 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-sales-rule": "0.1.0-alpha91", - "magento/module-wishlist": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-review": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-gift-message": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-sales-rule": "0.1.0-alpha92", + "magento/module-review": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-gift-message": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Rss/etc/adminhtml/system.xml b/app/code/Magento/Rss/etc/adminhtml/system.xml index ec5c8895c7de1c78cd6b34f7f0bb0b40802251ef..ec0fadeb971aed914b3a21d0f561b9624da82cce 100644 --- a/app/code/Magento/Rss/etc/adminhtml/system.xml +++ b/app/code/Magento/Rss/etc/adminhtml/system.xml @@ -37,13 +37,6 @@ <backend_model>Magento\Rss\Model\System\Config\Backend\Links</backend_model> </field> </group> - <group id="wishlist" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> - <label>Wishlist</label> - <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> - <label>Enable RSS</label> - <source_model>Magento\Backend\Model\Config\Source\Enabledisable</source_model> - </field> - </group> <group id="catalog" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Catalog</label> <field id="new" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Rss/etc/module.xml b/app/code/Magento/Rss/etc/module.xml index 31dc0c6d01533ae0fa97820ed6b599e1f8ea25a6..d66af033852cebb56f11cb338cc554e57df3ba1d 100644 --- a/app/code/Magento/Rss/etc/module.xml +++ b/app/code/Magento/Rss/etc/module.xml @@ -30,7 +30,6 @@ <module name="Magento_CatalogInventory"/> <module name="Magento_Sales"/> <module name="Magento_SalesRule"/> - <module name="Magento_Wishlist"/> </sequence> <depends> <module name="Magento_Store"/> @@ -38,8 +37,6 @@ <module name="Magento_CatalogInventory"/> <module name="Magento_Sales"/> <module name="Magento_SalesRule"/> - <module name="Magento_Wishlist"/> - <module name="Magento_Core"/> <module name="Magento_Review"/> <module name="Magento_Customer"/> <module name="Magento_Backend"/> diff --git a/app/code/Magento/Rss/view/adminhtml/layout/rss_catalog_notifystock.xml b/app/code/Magento/Rss/view/adminhtml/layout/rss_catalog_notifystock.xml index a2ab4e64b6cb7287f79e53506d255356651a7fda..34ac1a722cf53ca171551480f8c6e10496e236f8 100644 --- a/app/code/Magento/Rss/view/adminhtml/layout/rss_catalog_notifystock.xml +++ b/app/code/Magento/Rss/view/adminhtml/layout/rss_catalog_notifystock.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Catalog\NotifyStock" output="1" name="rss.catalog.notifystock"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Rss\Block\Catalog\NotifyStock" name="rss.catalog.notifystock"/> + </container> </layout> diff --git a/app/code/Magento/Rss/view/adminhtml/layout/rss_catalog_review.xml b/app/code/Magento/Rss/view/adminhtml/layout/rss_catalog_review.xml index 8298aea87dba9114da5ea3187b674af2acff9a9e..47b956bf71a81c128dc43188e93aa55c9da792b5 100644 --- a/app/code/Magento/Rss/view/adminhtml/layout/rss_catalog_review.xml +++ b/app/code/Magento/Rss/view/adminhtml/layout/rss_catalog_review.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Catalog\Review" output="1" name="rss.catalog.review"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Rss\Block\Catalog\Review" name="rss.catalog.review"/> + </container> </layout> diff --git a/app/code/Magento/Rss/view/adminhtml/layout/rss_order_new.xml b/app/code/Magento/Rss/view/adminhtml/layout/rss_order_new.xml index 79be0ce472f65511fb0355ebd58e5d4302bda9be..8fc8182b2bedc7bb672e9a542b67b37f0a067d45 100644 --- a/app/code/Magento/Rss/view/adminhtml/layout/rss_order_new.xml +++ b/app/code/Magento/Rss/view/adminhtml/layout/rss_order_new.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Order\NewOrder" output="1" name="rss.order.new"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Rss\Block\Order\NewOrder" name="rss.order.new"/> + </container> </layout> diff --git a/app/code/Magento/Rss/etc/di.xml b/app/code/Magento/Rss/view/adminhtml/layout/sales_order_grid_block.xml similarity index 62% rename from app/code/Magento/Rss/etc/di.xml rename to app/code/Magento/Rss/view/adminhtml/layout/sales_order_grid_block.xml index 2c9f1eff2f2ae566f1de641b99d4a3c0710d19a3..871e6f5ba8bb3f83998703ebd620c0a7d6fff62c 100644 --- a/app/code/Magento/Rss/etc/di.xml +++ b/app/code/Magento/Rss/view/adminhtml/layout/sales_order_grid_block.xml @@ -23,15 +23,15 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> - <virtualType name="Magento\Rss\Block\Context" type="Magento\Catalog\Block\Product\Context"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="sales.order.grid"> <arguments> - <argument name="wishlistHelper" xsi:type="object">Magento\Rss\Helper\WishlistRss</argument> + <argument name="rssList" xsi:type="array"> + <item name="orders" xsi:type="array"> + <item name="url" xsi:type="string">rss/order/new</item> + <item name="label" xsi:type="string" translate="true">New Order RSS</item> + </item> + </argument> </arguments> - </virtualType> - <type name="Magento\Rss\Block\Wishlist"> - <arguments> - <argument name="context" xsi:type="object">Magento\Rss\Block\Context</argument> - </arguments> - </type> -</config> + </referenceBlock> +</page> diff --git a/app/code/Magento/Rss/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Rss/view/frontend/layout/catalog_category_view.xml index da972ae8e991bbbbf3898335cc67068812743be0..86285166f3b7e093fa0e5845eb23e110ec8857ea 100644 --- a/app/code/Magento/Rss/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Rss/view/frontend/layout/catalog_category_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="page.main.title"> <block class="Magento\Catalog\Block\Category\View" name="rss.link" template="Magento_Rss::category/link.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Rss/view/frontend/layout/default.xml b/app/code/Magento/Rss/view/frontend/layout/default.xml index 23963853d642e6a9cb0312cba6ca36b61a39e9a8..7774ecf6e37e5cc05c711b295ce1f9122a3660a6 100644 --- a/app/code/Magento/Rss/view/frontend/layout/default.xml +++ b/app/code/Magento/Rss/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="footer_links"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="rss-link" ifconfig="rss/config/active"> <arguments> @@ -32,5 +32,8 @@ </arguments> </block> </referenceBlock> + <referenceBlock name="sales.order.info.buttons"> + <block class="Magento\Rss\Block\Order\Info\Buttons\Rss" name="sales.order.info.button.rss"/> + </referenceBlock> <block class="Magento\Rss\Block\ListBlock" name="head_rss" ifconfig="rss/config/active"/> -</layout> +</page> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml index b22f4d7f10867d060a99b4a3aedbfbd0bb00dfd7..0d7a43a7776eafef8f2364ffbb468c33d99e2103 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml @@ -23,12 +23,14 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Catalog\Category" output="1" name="rss.catalog.category" cacheable="false"/> - <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> - <arguments> - <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> - <!-- set "override" configuration settings here --> - </arguments> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Rss\Block\Catalog\Category" name="rss.catalog.category" cacheable="false"/> + <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> + </container> </layout> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml index abb1d44b535d991bd6a9c7e1dc0cab924eecd1d3..4be11a90b5c7e0f97cd91612af884ebe1efaf5e9 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml @@ -23,13 +23,15 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Catalog\NewCatalog" output="1" name="rss.catalog.new" cacheable="false"> - <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> - <arguments> - <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> - <!-- set "override" configuration settings here --> - </arguments> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Rss\Block\Catalog\NewCatalog" name="rss.catalog.new" cacheable="false"> + <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> </block> - </block> + </container> </layout> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_salesrule.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_salesrule.xml index eb776a24938d7acf9d85772c87e03c1944480cfe..c30898a08203c1189046d8412b28377df13c0568 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_salesrule.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_salesrule.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Catalog\Salesrule" output="1" name="rss.catalog.salesrule" cacheable="false"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Rss\Block\Catalog\Salesrule" name="rss.catalog.salesrule" cacheable="false"/> + </container> </layout> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_special.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_special.xml index 6fed0823539455dbca71d62674344f9da1f9f6d9..aeda0d2becc62275b0571ab932f9eea3c6eaaa58 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_special.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_special.xml @@ -23,12 +23,14 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Catalog\Special" output="1" name="rss.catalog.special" cacheable="false"/> - <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> - <arguments> - <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> - <!-- set "override" configuration settings here --> - </arguments> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Rss\Block\Catalog\Special" name="rss.catalog.special" cacheable="false"/> + <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> + </container> </layout> 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 6af62ae31e36ddf8d28975c6ad0ca0b260c922df..61423c030fe9aad2239b4ebafd50ae57f0b7af9d 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 @@ -23,12 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">2columns-right.phtml</argument> - </action> - </referenceBlock> +<page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="page.main.title"> <action method="setPageTitle"> <argument name="title" translate="true" xsi:type="string">RSS Feeds</argument> @@ -37,4 +32,4 @@ <referenceContainer name="content"> <block class="Magento\Rss\Block\ListBlock" name="rss.list" template="list.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_order_status.xml b/app/code/Magento/Rss/view/frontend/layout/rss_order_status.xml index 9bcf6626f6992e5cd59d9a216cd4b64a163151a8..c9735da9caf6c0b616e496cf1f536d21c944a574 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_order_status.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_order_status.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Order\Status" output="1" name="rss.order.status"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Rss\Block\Order\Status" name="rss.order.status"/> + </container> </layout> diff --git a/app/code/Magento/Rss/view/frontend/templates/order/info/buttons/rss.phtml b/app/code/Magento/Rss/view/frontend/templates/order/info/buttons/rss.phtml new file mode 100644 index 0000000000000000000000000000000000000000..8df524dfee6dcd9ec44ab85b23c58fb97c952e30 --- /dev/null +++ b/app/code/Magento/Rss/view/frontend/templates/order/info/buttons/rss.phtml @@ -0,0 +1,32 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Rss\Block\Order\Info\Buttons\Rss */ +?> +<?php if($this->getOrderHelper()->isStatusNotificationAllow()): ?> + <a href="<?php echo $this->getOrderHelper()->getStatusHistoryRssUrl($this->getOrder()) ?>" + class="action rss"> + <span><?php echo __('Subscribe to Order Status') ?></span> + </a> +<?php endif; ?> diff --git a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php index aca5ad37d2e0908a22f817a38271204b1bda2792..6ad79fb2f3bfe41ded1677e6f35397f430d34f48 100644 --- a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php +++ b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php @@ -177,6 +177,36 @@ abstract class AbstractCondition extends \Magento\Framework\Object implements Co return $out; } + /** + * Get tables to join + * + * @return array + */ + public function getTablesToJoin() + { + return []; + } + + /** + * Get value to bind + * + * @return array|float|int|mixed|string + */ + public function getBindArgumentValue() + { + return $this->getValueParsed(); + } + + /** + * Get field by attribute + * + * @return string + */ + public function getMappedSqlField() + { + return $this->getAttribute(); + } + /** * @return string */ diff --git a/app/code/Magento/Rule/Model/Condition/Combine.php b/app/code/Magento/Rule/Model/Condition/Combine.php index 469689618b2f91490333eab6e793c3a0e714e07e..e079e2d2c69d4c76026cd7d863c860f818c9f419 100644 --- a/app/code/Magento/Rule/Model/Condition/Combine.php +++ b/app/code/Magento/Rule/Model/Condition/Combine.php @@ -30,7 +30,7 @@ class Combine extends AbstractCondition * * @var array */ - protected static $_conditionModels = array(); + protected $_conditionModels = array(); /** * @var \Magento\Rule\Model\ConditionFactory @@ -90,11 +90,11 @@ class Combine extends AbstractCondition return false; } - if (!array_key_exists($modelClass, self::$_conditionModels)) { + if (!array_key_exists($modelClass, $this->_conditionModels)) { $model = $this->_conditionFactory->create($modelClass); - self::$_conditionModels[$modelClass] = $model; + $this->_conditionModels[$modelClass] = $model; } else { - $model = self::$_conditionModels[$modelClass]; + $model = $this->_conditionModels[$modelClass]; } if (!$model) { @@ -379,6 +379,28 @@ class Combine extends AbstractCondition * @return bool */ public function validate(\Magento\Framework\Object $object) + { + return $this->_isValid($object); + } + + /** + * Validate by entity ID + * + * @param int $entityId + * @return mixed + */ + public function validateByEntityId($entityId) + { + return $this->_isValid($entityId); + } + + /** + * Is entity valid + * + * @param int|\Magento\Framework\Object $entity + * @return bool + */ + protected function _isValid($entity) { if (!$this->getConditions()) { return true; @@ -388,8 +410,11 @@ class Combine extends AbstractCondition $true = (bool)$this->getValue(); foreach ($this->getConditions() as $cond) { - $validated = $cond->validate($object); - + if ($entity instanceof \Magento\Framework\Object) { + $validated = $cond->validate($entity); + } else { + $validated = $cond->validateByEntityId($entity); + } if ($all && $validated !== $true) { return false; } elseif (!$all && $validated === $true) { diff --git a/app/code/Magento/Rule/Model/Condition/ConditionInterface.php b/app/code/Magento/Rule/Model/Condition/ConditionInterface.php index f70b9402aecc8b4b14baec2413430f63b1566a95..ada58812b49b03e211dad9f4c32463291d2aeb6d 100644 --- a/app/code/Magento/Rule/Model/Condition/ConditionInterface.php +++ b/app/code/Magento/Rule/Model/Condition/ConditionInterface.php @@ -25,4 +25,24 @@ namespace Magento\Rule\Model\Condition; interface ConditionInterface { + /** + * Get tables to join + * + * @return array + */ + public function getTablesToJoin(); + + /** + * Get field by attribute + * + * @return string + */ + public function getMappedSqlField(); + + /** + * Get argument value to bind + * + * @return mixed + */ + public function getBindArgumentValue(); } diff --git a/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php b/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php index 0980463bccff908677415044accac3c89e17205c..fda5e0744cb9fa32aeefeb9a89b0776b575b7f7d 100644 --- a/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php +++ b/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php @@ -69,9 +69,9 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon protected $_config; /** - * @var \Magento\Catalog\Model\Product + * @var \Magento\Catalog\Model\ProductFactory */ - protected $_product; + protected $_productFactory; /** * @var \Magento\Catalog\Model\Resource\Product @@ -92,7 +92,7 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon * @param \Magento\Rule\Model\Condition\Context $context * @param \Magento\Backend\Helper\Data $backendData * @param \Magento\Eav\Model\Config $config - * @param \Magento\Catalog\Model\Product $product + * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\Collection $attrSetCollection * @param \Magento\Framework\Locale\FormatInterface $localeFormat @@ -102,7 +102,7 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon \Magento\Rule\Model\Condition\Context $context, \Magento\Backend\Helper\Data $backendData, \Magento\Eav\Model\Config $config, - \Magento\Catalog\Model\Product $product, + \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Eav\Model\Resource\Entity\Attribute\Set\Collection $attrSetCollection, \Magento\Framework\Locale\FormatInterface $localeFormat, @@ -110,7 +110,7 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon ) { $this->_backendData = $backendData; $this->_config = $config; - $this->_product = $product; + $this->_productFactory = $productFactory; $this->_productResource = $productResource; $this->_attrSetCollection = $attrSetCollection; $this->_localeFormat = $localeFormat; @@ -146,7 +146,7 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon $obj = $this->_config->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $this->getAttribute()); } catch (\Exception $e) { $obj = new \Magento\Framework\Object(); - $obj->setEntity($this->_product)->setFrontendInput('text'); + $obj->setEntity($this->_productFactory->create())->setFrontendInput('text'); } return $obj; } @@ -582,6 +582,107 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon } } + /** + * Get argument value to bind + * + * @return array|float|int|mixed|string|\Zend_Db_Expr + */ + public function getBindArgumentValue() + { + if ($this->getAttribute() == 'category_ids') { + return new \Zend_Db_Expr( + $this->_productResource->getReadConnection() + ->select() + ->from( + $this->_productResource->getTable('catalog_category_product'), + array('product_id') + )->where( + 'category_id IN (?)', + $this->getValueParsed() + )->__toString() + ); + + } + return parent::getBindArgumentValue(); + } + + /** + * Get field by attribute + * + * @return string + */ + public function getMappedSqlField() + { + + return ($this->getAttribute() == 'category_ids') ? 'e.entity_id' : parent::getMappedSqlField(); + } + + /** + * Validate product by entity ID + * + * @param int $productId + * @return bool + */ + public function validateByEntityId($productId) + { + if ('category_ids' == $this->getAttribute()) { + $result = $this->validateAttribute($this->_getAvailableInCategories($productId)); + } elseif ('attribute_set_id' == $this->getAttribute()) { + $result = $this->validateAttribute($this->_getAttributeSetId($productId)); + } else { + $product = $this->_productFactory->create()->load($productId); + $result = $this->validate($product); + unset($product); + } + return $result; + } + + /** + * Retrieve category ids where product is available + * + * @param int $productId + * @return array + */ + protected function _getAvailableInCategories($productId) + { + return $this->_productResource->getReadConnection() + ->fetchCol( + $this->_productResource->getReadConnection() + ->select() + ->distinct() + ->from( + $this->_productResource->getTable('catalog_category_product'), + array('category_id') + )->where( + 'product_id = ?', + $productId + ) + ); + } + + /** + * Get attribute set id for product + * + * @param int $productId + * @return string + */ + protected function _getAttributeSetId($productId) + { + return $this->_productResource->getReadConnection() + ->fetchOne( + $this->_productResource->getReadConnection() + ->select() + ->distinct() + ->from( + $this->_productResource->getTable('catalog_product_entity'), + array('attribute_set_id') + )->where( + 'entity_id = ?', + $productId + ) + ); + } + /** * Correct '==' and '!=' operators * Categories can't be equal because product is included categories selected by administrator and in their parents diff --git a/app/code/Magento/Rule/Model/Condition/Sql/Builder.php b/app/code/Magento/Rule/Model/Condition/Sql/Builder.php new file mode 100644 index 0000000000000000000000000000000000000000..2f2cedbea3055eb2ec02720cf96b7179f2f6a07d --- /dev/null +++ b/app/code/Magento/Rule/Model/Condition/Sql/Builder.php @@ -0,0 +1,202 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Rule\Model\Condition\Sql; + +use \Magento\Rule\Model\Condition\Combine; +use \Magento\Rule\Model\Condition\AbstractCondition; + +/** + * Class SQL Builder + * + * @package Magento\Rule\Model\Condition\Sql + */ +class Builder +{ + /** + * @var \Magento\Framework\DB\Adapter\AdapterInterface + */ + protected $_connection; + + /** + * @var array + */ + protected $_conditionOperatorMap = [ + '==' => ':field = ?', + '!=' => ':field <> ?', + '>=' => ':field => ?', + '>' => ':field > ?', + '<=' => ':field <= ?', + '<' => ':field < ?', + '{}' => ':field IN (?)', + '!{}' => ':field NOT IN (?)', + '()' => ':field IN (?)', + '!()' => ':field NOT IN (?)', + ]; + + /** + * @var \Magento\Rule\Model\Condition\Sql\ExpressionFactory + */ + protected $_expressionFactory; + + /** + * @param ExpressionFactory $expressionFactory + */ + public function __construct(ExpressionFactory $expressionFactory) + { + $this->_expressionFactory = $expressionFactory; + } + + /** + * Get tables to join for given conditions combination + * + * @param Combine $combine + * @return array + */ + protected function _getCombineTablesToJoin(Combine $combine) + { + $tables = $this->_getChildCombineTablesToJoin($combine); + return $tables; + } + + /** + * Get child for given conditions combination + * + * @param Combine $combine + * @param array $tables + * @return array + */ + protected function _getChildCombineTablesToJoin(Combine $combine, $tables = array()) + { + foreach ($combine->getConditions() as $condition) { + if ($condition->getConditions()) { + $tables = $this->_getChildCombineTablesToJoin($condition); + } else { + /** @var $condition AbstractCondition */ + foreach ($condition->getTablesToJoin() as $alias => $table) { + if (!isset($tables[$alias])) { + $tables[$alias] = $table; + } + } + } + } + return $tables; + } + + /** + * Join tables from conditions combination to collection + * + * @param \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection + * @param Combine $combine + * @return $this + */ + protected function _joinTablesToCollection( + \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection, + Combine $combine + ) { + foreach ($this->_getCombineTablesToJoin($combine) as $alias => $joinTable) { + /** @var $condition AbstractCondition */ + $collection->getSelect()->joinLeft( + [$alias => $collection->getResource()->getTable($joinTable['name'])], + $joinTable['condition'] + ); + } + return $this; + } + + /** + * @param AbstractCondition $condition + * @param string $value + * @return string + * @throws \Magento\Framework\Exception + */ + protected function _getMappedSqlCondition(AbstractCondition $condition, $value = '') + { + $argument = $condition->getMappedSqlField(); + if ($argument) { + $conditionOperator = $condition->getOperatorForValidate(); + + if (!isset($this->_conditionOperatorMap[$conditionOperator])) { + throw new \Magento\Framework\Exception('Unknown condition operator'); + } + + $sql = str_replace( + ':field', + $this->_connection->getIfNullSql($this->_connection->quoteIdentifier($argument), 0), + $this->_conditionOperatorMap[$conditionOperator] + ); + + return $this->_expressionFactory->create( + ['expression' => $value . $this->_connection->quoteInto($sql, $condition->getBindArgumentValue())] + ); + } + return ''; + } + + /** + * @param Combine $combine + * @param string $value + * @return string + */ + protected function _getMappedSqlCombination(Combine $combine, $value = '') + { + $out = (!empty($value) ? $value : ''); + $value = ($combine->getValue() ? '' : ' NOT '); + $getAggregator = $combine->getAggregator(); + $conditions = $combine->getConditions(); + foreach ($conditions as $key => $condition) { + /** @var $condition AbstractCondition|Combine */ + $con = ($getAggregator == 'any' ? \Zend_Db_Select::SQL_OR : \Zend_Db_Select::SQL_AND); + $con = (isset($conditions[$key+1]) ? $con : ''); + if ($condition instanceof Combine) { + $out .= $this->_getMappedSqlCombination($condition, $value); + } else { + $out .= $this->_getMappedSqlCondition($condition, $value); + } + $out.= ' ' . $con; + } + return $this->_expressionFactory->create(['expression' => $out]); + } + + /** + * Attach conditions filter to collection + * + * @param \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection + * @param Combine $combine + * + * @return void + */ + public function attachConditionToCollection( + \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection, + Combine $combine + ) { + $this->_connection = $collection->getResource()->getReadConnection(); + $this->_joinTablesToCollection($collection, $combine); + $whereExpression = (string)$this->_getMappedSqlCombination($combine); + if (!empty($whereExpression)) { + // Select ::where method adds braces even on empty expression + $collection->getSelect()->where($whereExpression); + } + } +} diff --git a/app/code/Magento/Rule/Model/Condition/Sql/Expression.php b/app/code/Magento/Rule/Model/Condition/Sql/Expression.php new file mode 100644 index 0000000000000000000000000000000000000000..ed54557ae6873dbd63e7caf6e9d769ece064bb93 --- /dev/null +++ b/app/code/Magento/Rule/Model/Condition/Sql/Expression.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Abstract Rule sql condition + * + * @author Magento Core Team <core@magentocommerce.com> + */ +namespace Magento\Rule\Model\Condition\Sql; + +class Expression extends \Zend_Db_Expr +{ + /** + * Turn expression in this object into string + * + * @return string + */ + public function __toString() + { + return empty($this->_expression) ? '' : '(' . $this->_expression . ')'; + } +} diff --git a/app/code/Magento/Rule/Model/Resource/AbstractResource.php b/app/code/Magento/Rule/Model/Resource/AbstractResource.php index e95578b60984d96764eeee8a194805ee789b6fdc..a30dca5ad21b66b1216bc12b6091155653017562 100644 --- a/app/code/Magento/Rule/Model/Resource/AbstractResource.php +++ b/app/code/Magento/Rule/Model/Resource/AbstractResource.php @@ -89,68 +89,78 @@ abstract class AbstractResource extends \Magento\Framework\Model\Resource\Db\Abs * @throws \Exception */ public function bindRuleToEntity($ruleIds, $entityIds, $entityType) + { + $this->_getWriteAdapter()->beginTransaction(); + + try { + $this->_multiplyBunchInsert($ruleIds, $entityIds, $entityType); + } catch (\Exception $e) { + $this->_getWriteAdapter()->rollback(); + throw $e; + } + + $this->_getWriteAdapter()->commit(); + + return $this; + } + + /** + * Multiply rule ids by entity ids and insert + * + * @param int|[] $ruleIds + * @param int|[] $entityIds + * @param string $entityType + * @return $this + */ + protected function _multiplyBunchInsert($ruleIds, $entityIds, $entityType) { if (empty($ruleIds) || empty($entityIds)) { return $this; } - $adapter = $this->_getWriteAdapter(); - $entityInfo = $this->_getAssociatedEntityInfo($entityType); - if (!is_array($ruleIds)) { $ruleIds = array((int)$ruleIds); } if (!is_array($entityIds)) { $entityIds = array((int)$entityIds); } - $data = array(); $count = 0; - - $adapter->beginTransaction(); - - try { - foreach ($ruleIds as $ruleId) { - foreach ($entityIds as $entityId) { - $data[] = array( - $entityInfo['entity_id_field'] => $entityId, - $entityInfo['rule_id_field'] => $ruleId + $entityInfo = $this->_getAssociatedEntityInfo($entityType); + foreach ($ruleIds as $ruleId) { + foreach ($entityIds as $entityId) { + $data[] = array( + $entityInfo['entity_id_field'] => $entityId, + $entityInfo['rule_id_field'] => $ruleId + ); + $count++; + if ($count % 1000 == 0) { + $this->_getWriteAdapter()->insertOnDuplicate( + $this->getTable($entityInfo['associations_table']), + $data, + array($entityInfo['rule_id_field']) ); - $count++; - if ($count % 1000 == 0) { - $adapter->insertOnDuplicate( - $this->getTable($entityInfo['associations_table']), - $data, - array($entityInfo['rule_id_field']) - ); - $data = array(); - } + $data = array(); } } - if (!empty($data)) { - $adapter->insertOnDuplicate( - $this->getTable($entityInfo['associations_table']), - $data, - array($entityInfo['rule_id_field']) - ); - } - - $adapter->delete( + } + if (!empty($data)) { + $this->_getWriteAdapter()->insertOnDuplicate( $this->getTable($entityInfo['associations_table']), - $adapter->quoteInto( - $entityInfo['rule_id_field'] . ' IN (?) AND ', - $ruleIds - ) . $adapter->quoteInto( - $entityInfo['entity_id_field'] . ' NOT IN (?)', - $entityIds - ) + $data, + array($entityInfo['rule_id_field']) ); - } catch (\Exception $e) { - $adapter->rollback(); - throw $e; } - $adapter->commit(); - + $this->_getWriteAdapter()->delete( + $this->getTable($entityInfo['associations_table']), + $this->_getWriteAdapter()->quoteInto( + $entityInfo['rule_id_field'] . ' IN (?) AND ', + $ruleIds + ) . $this->_getWriteAdapter()->quoteInto( + $entityInfo['entity_id_field'] . ' NOT IN (?)', + $entityIds + ) + ); return $this; } diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index 1cfb1de550dbd3953e52c28858726efa47e288ea..6ba8eb24d11e950d2e9cad0812a63ee6772e39c5 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Rule/view/adminhtml/web/rules.js b/app/code/Magento/Rule/view/adminhtml/web/rules.js index 3d412266ac342d76495c1f2c891dc2e23a71635f..cbc66858d59bfdde8eedc69a67d82faab692b0b9 100644 --- a/app/code/Magento/Rule/view/adminhtml/web/rules.js +++ b/app/code/Magento/Rule/view/adminhtml/web/rules.js @@ -208,7 +208,6 @@ VarienRulesForm.prototype = { elem.focus(); if (elem && elem.id && elem.id.match(/__value$/)) { this.updateElement = elem; - //this.showChooser(container, event); } } @@ -216,18 +215,6 @@ VarienRulesForm.prototype = { var elem = Element.down(elemContainer, '.element-value-changer'); if (elem) { elem.focus(); - // trying to emulate enter to open dropdown -// if (document.createEventObject) { -// var event = document.createEventObject(); -// event.altKey = true; -// event.keyCode = 40; -// elem.fireEvent("onkeydown", evt); -// } else { -// var event = document.createEvent("Events"); -// event.altKey = true; -// event.keyCode = 40; -// elem.dispatchEvent(event); -// } } this.shownElement = container; @@ -249,10 +236,6 @@ VarienRulesForm.prototype = { var str = selectedOptions.join(', '); label.innerHTML = str!='' ? str : '...'; -// if (elem && elem.selectedIndex>=0) { -// var str = elem.options[elem.selectedIndex].text; -// label.innerHTML = str!='' ? str : '...'; -// } } elem = Element.down(container, 'input.input-text'); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php index 337729894f92a2ee9cee83af6488fdee86049ee0..a462679088f198c87c4578a4a1b5d7976546844b 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php @@ -182,7 +182,7 @@ class Info extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder $accountData = array(); $entityType = 'customer'; - foreach ($this->_customerMetadataService->getAllCustomerAttributeMetadata($entityType) as $attribute) { + foreach ($this->_customerMetadataService->getAllAttributesMetadata($entityType) as $attribute) { /* @var $attribute \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata */ if (!$attribute->isVisible() || $attribute->isSystem()) { continue; diff --git a/app/code/Magento/Sales/Block/Order/History.php b/app/code/Magento/Sales/Block/Order/History.php index 5b974af37e4e239fed557ca5d7555d93cfafc68d..adb3a8270846fcb22332c1ec8dceb4387204b877 100644 --- a/app/code/Magento/Sales/Block/Order/History.php +++ b/app/code/Magento/Sales/Block/Order/History.php @@ -48,11 +48,17 @@ class History extends \Magento\Framework\View\Element\Template */ protected $_orderConfig; + /** + * @var \Magento\Framework\View\Page\Config + */ + protected $pageConfig; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\Order\Config $orderConfig + * @param \Magento\Framework\View\Page\Config $pageConfig * @param array $data */ public function __construct( @@ -60,11 +66,13 @@ class History extends \Magento\Framework\View\Element\Template \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\Order\Config $orderConfig, + \Magento\Framework\View\Page\Config $pageConfig, array $data = array() ) { $this->_orderCollectionFactory = $orderCollectionFactory; $this->_customerSession = $customerSession; $this->_orderConfig = $orderConfig; + $this->pageConfig = $pageConfig; parent::__construct($context, $data); $this->_isScopePrivate = true; } @@ -90,10 +98,7 @@ class History extends \Magento\Framework\View\Element\Template ); $this->setOrders($orders); - - if ($this->_layout->getBlock('root')) { - $this->_layout->getBlock('root')->setHeaderTitle(__('My Orders')); - } + $this->pageConfig->setTitle(__('My Orders')); } /** diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php index ae8584d6809ff7fb916bb6db9aebdd9193d99065..39ada051adfc920ba378f13da13e0cec006174e9 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php @@ -62,7 +62,7 @@ class AddComment extends \Magento\Sales\Controller\Adminhtml\Order $orderCommentSender->send($order, $notify, $comment); - $this->_view->loadLayout('empty'); + $this->_view->loadLayout(); $this->_view->renderLayout(); } catch (\Magento\Framework\Model\Exception $e) { $response = array('error' => true, 'message' => $e->getMessage()); diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index f28db0b90f947e440d538fb2e6d85994df3339b3..f495e26e5c1621dfb6215c7d1a36e8d6bfe1ce6e 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -25,6 +25,7 @@ namespace Magento\Sales\Model\AdminOrder; use Magento\Customer\Service\V1\CustomerAccountServiceInterface; use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface; use Magento\Customer\Service\V1\CustomerAddressServiceInterface; use Magento\Customer\Service\V1\Data\AddressBuilder as CustomerAddressBuilder; use Magento\Customer\Service\V1\Data\CustomerBuilder; @@ -1247,7 +1248,7 @@ class Create extends \Magento\Framework\Object implements \Magento\Checkout\Mode $data = isset($data['region']) && is_array($data['region']) ? array_merge($data, $data['region']) : $data; $addressForm = $this->_metadataFormFactory->create( - CustomerMetadataServiceInterface::ENTITY_TYPE_ADDRESS, + AddressMetadataServiceInterface::ENTITY_TYPE_ADDRESS, 'adminhtml_customer_address', $data, $isAjax, diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index 8a626144a1e512c6f9331ebe9ced20ca7fc78d87..83f670f323654e437d607d58ba896ab9f0b623ff 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -748,8 +748,10 @@ class Order extends \Magento\Sales\Model\AbstractModel if (!$this->_canVoidOrder()) { return false; } - - if (!$this->getPayment()->canReviewPayment() && $this->getPayment()->canFetchTransactionInfo()) { + if ($this->canUnhold()) { + return false; + } + if (!$this->canReviewPayment() && $this->canFetchPaymentReviewUpdate()) { return false; } diff --git a/app/code/Magento/Sales/Model/Quote/Address/Validator.php b/app/code/Magento/Sales/Model/Quote/Address/Validator.php index e3e5100dd19ff0d17c74c9aa12780fe545c9725b..3620b38f885e207ae0d0abe08efaee356441a268 100644 --- a/app/code/Magento/Sales/Model/Quote/Address/Validator.php +++ b/app/code/Magento/Sales/Model/Quote/Address/Validator.php @@ -36,8 +36,9 @@ class Validator extends \Magento\Framework\Validator\AbstractValidator /** * @param \Magento\Directory\Model\CountryFactory $countryFactory */ - public function __construct(\Magento\Directory\Model\CountryFactory $countryFactory) - { + public function __construct( + \Magento\Directory\Model\CountryFactory $countryFactory + ) { $this->countryFactory = $countryFactory; } diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index 5baf94d7b0adbdcf29a1ec6d14825be1b930f2dd..3ee49b89cbfba9c2da6ad33d824e2a1bda301799 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -3,31 +3,30 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-sales-rule": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-widget": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-gift-message": "0.1.0-alpha91", - "magento/module-reports": "0.1.0-alpha91", - "magento/module-weee": "0.1.0-alpha91", - "magento/module-rss": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-wishlist": "0.1.0-alpha91", - "magento/module-email": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-sales-rule": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-widget": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-gift-message": "0.1.0-alpha92", + "magento/module-reports": "0.1.0-alpha92", + "magento/module-weee": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-wishlist": "0.1.0-alpha92", + "magento/module-email": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Sales/etc/module.xml b/app/code/Magento/Sales/etc/module.xml index ac213f93832f9e76dd97641dd6bcf26ea5ab91ef..0045564ebfcaf2d49c4db2ad154ad83904f92b69 100644 --- a/app/code/Magento/Sales/etc/module.xml +++ b/app/code/Magento/Sales/etc/module.xml @@ -48,7 +48,6 @@ <module name="Magento_GiftMessage"/> <module name="Magento_Reports"/> <module name="Magento_Weee"/> - <module name="Magento_Rss"/> <module name="Magento_CatalogInventory"/> <module name="Magento_Wishlist"/> <module name="Magento_Email"/> 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 ccf448d39e0f1844a0289754f72d108f0e1495ad..680639c51f46c4160b9e5559f98a96a6a108254b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_creditmemo_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 ccf448d39e0f1844a0289754f72d108f0e1495ad..680639c51f46c4160b9e5559f98a96a6a108254b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_creditmemo_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 fdfb781e6af64912afcc05d792cf370170ffc475..c952125d72e01e1fc0dba34a4af6ed4e7696ae36 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="sales_creditmemo_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml index 4fd4361ece466f5775a41a7abd8e078801b8da96..aaf8c01d6183c45d66fe69ecb7b2bdab8b2298a4 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales_creditmemo.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.creditmemo.grid" as="grid"> <arguments> @@ -172,4 +172,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 b3293a47594af81e58a2b0cf415deac92fee1469..e365efa7e0d5b5dad09c0b632a9d1f47fc01abef 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_creditmemo_grid_block"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Creditmemo" name="sales_creditmemo.grid.container"/> </referenceContainer> -</layout> +</page> 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 7439fca2bdb478d1ff89e47124b68580106615f3..90f397c960daaf2390b84bf64b22a8d00c7ed25f 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_invoice_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 7439fca2bdb478d1ff89e47124b68580106615f3..90f397c960daaf2390b84bf64b22a8d00c7ed25f 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_invoice_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 79ea0f4c6b24b4eeb446259824a787e0df8a63cc..5dcc732e4523d5b0c69d6201885eb51dd5e97605 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" > +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="sales_invoice_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml index e8d53f24a4646e45cc55af90d70792787a34d981..09c824383bed1c51b05ff30e32b4ad694032a6f1 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales_invoice.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.invoice.grid" as="grid"> <arguments> @@ -172,4 +172,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 1b7999b2760c22da7cfaa9ee247ddd8ec48756f0..10ff07c364af75f7a8e8932decfc7d0131ffe14c 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_invoice_grid_block"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Invoice" name="sales_invoice.grid.container"/> </referenceContainer> -</layout> +</page> 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 ba49a33b144eca1b9bca1062f2d084bfd22a3d53..5e225879357b5667a6dd4da6cd3f4cf36dbf6ddf 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 @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Sales\Block\Adminhtml\Order\View\History" name="order_history" template="order/view/history.phtml" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Sales\Block\Adminhtml\Order\View\History" name="order_history" template="order/view/history.phtml"/> + </container> </layout> 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 0ca01d2a0218f16da710163cfa62b99eeb81b182..91883f95c841fc9f4301940dc4de809978769940 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Address" name="sales_order_address.form.container"/> </referenceContainer> -</layout> +</page> 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 30cac6d1047ec3cc3e36c7d6a7b7b383874cbcfc..fd3bab8b729adbc144ec8ce4412047b9e0907547 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.customer.grid.container" as="grid"> <arguments> @@ -100,4 +100,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 72367847a3e525ca3bb22563d1dfa63feb1f50a1..269e8ff39a88dca52e94df3cbb1c13cd39805cd9 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_create_customer_block"/> <referenceBlock name="page-title"> <action method="setTitleId"> @@ -46,8 +46,8 @@ <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" template="Magento_Sales::order/create/js.phtml" name="create"/> </referenceContainer> - <referenceBlock name="root"> - <block class="Magento\Sales\Block\Adminhtml\Order\Create" name="content"> + <referenceBlock name="content"> + <block class="Magento\Sales\Block\Adminhtml\Order\Create" name="order_content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Form" template="order/create/form.phtml" name="order_create_form" as="form"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Messages" name="message"/> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Customer" template="order/create/abstract.phtml" name="customer.grid.container"/> @@ -96,7 +96,7 @@ </block> </block> </referenceBlock> - <referenceContainer name="before_body_end"> + <referenceContainer name="before.body.end"> <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Configure" template="Magento_Catalog::catalog/product/composite/configure.phtml"/> </referenceContainer> -</layout> +</page> 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 5ce9893425083eb199adeb9d4e2be1d28e479425..10f894c740022eecb1d89e38bc9d9297deefaed6 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Billing\Address" template="order/create/form/address.phtml" name="billing_address"/> </referenceContainer> -</layout> +</page> 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 a39b59794546bb49603bb60138d12c41dbc35dfa..b484bfc867e0fd5b710600d1b5b0db42b9256ea8 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Billing\Method" template="order/create/abstract.phtml" name="billing_method"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Billing\Method\Form" template="order/create/billing/method/form.phtml" name="order.create.billing.method.form" as="form"/> </block> </referenceContainer> -</layout> +</page> 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 39cf053882b5292a9a3a8c6704d2913299359f0e..4e381a28429143ef8330288326f046427ccc5405 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Comment" template="order/create/comment.phtml" name="comment"/> </referenceContainer> -</layout> +</page> 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 76aa37c7671d964cb0d9a56930cd2348b63cdad5..c75dbd2ff5dac5016bd83630320bc8be1000643f 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="sales_order_create_customer_block"/> <referenceContainer name="content"> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> </referenceContainer> </layout> 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 d77e2d128272bc898fa08a52073353d3b460b306..415af2d5febea46352963e2aa72ddf14c76b6701 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Data" template="order/create/data.phtml" name="data"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar" template="order/create/sidebar.phtml" name="sidebar"> @@ -65,4 +65,4 @@ <block class="Magento\Framework\View\Element\Text\ListText" name="order_item_extra_info"/> </block> </referenceContainer> -</layout> +</page> 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 fbb5213de5081d44b54cdc58d15f0c3f018779b7..ad721cb0f5607601139633bb928f816d6294f42d 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Form\Account" template="order/create/form/account.phtml" name="form_account"/> </referenceContainer> -</layout> +</page> 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 c75bd730a964e9a38eae1c80200a85c917a4be3e..c1b604afd6b5a9d5733df72d36b35a8c0b63b6ac 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Giftmessage" template="order/create/giftmessage.phtml" name="giftmessage"/> </referenceContainer> -</layout> +</page> 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 e49af4985bddbe60b7c34cf57fa64d51f4ef635b..8d7b6a2ad11fed05c96ee4216b90e4d718623f61 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Header" name="header"/> </referenceContainer> -</layout> +</page> 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 aaa4db622fec807f8ef204516dc0bea5a4fc329d..1f61366e3045507ddc828d6c386ba9c4c2891286 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Items" template="order/create/items.phtml" name="items"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Items\Grid" template="order/create/items/grid.phtml" name="items_grid"> @@ -34,4 +34,4 @@ </block> <block class="Magento\Framework\View\Element\Text\ListText" name="order_item_extra_info"/> </referenceContainer> -</layout> +</page> 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 befc8b6bd4fa47356b1a7b8cd49f9ab8c83fa9a9..3a22ba83a656328eb09a6cbdb37c2ca0db25f02e 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="backend.page"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Load" name="content"/> </referenceBlock> -</layout> +</page> 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 f9eca8b23ddf91465c57213bbff2db970d5620d3..e99738806392a296e55c75846b2e1d9fc64a005e 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Messages" name="message"/> </referenceContainer> -</layout> +</page> 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 425446f75ad16229dab35946afe0c3451c28af70..ef040f3540a01a06ec1d819bdf1628f3bc4d45e8 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Newsletter" template="order/create/abstract.phtml" name="newsletter"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Newsletter\Form" template="order/create/newsletter/form.phtml" name="order.create.newsletter.form" as="form"/> </block> </referenceContainer> -</layout> +</page> 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 213f309462abf8e495afae313f28a2a45b55eb66..85eab90f15ac7ffe3577bc68d167c7bb989bfb89 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="backend.page"> <container name="content" label="Content"/> </referenceBlock> -</layout> +</page> 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 cac99ee576c9c94e3b50a813dd18270bef2a11d0..f9ea909e0d58eecb5fa99d26b5dd2ce2f6933875 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Search" template="order/create/abstract.phtml" name="search"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid" name="search.grid" as="grid"/> </block> </referenceContainer> -</layout> +</page> 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 73be5bed2913c1eee719184fa2dbf2d08158edba..dfc10eed87f3e5fb3a1f722ff040f32f228a5835 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid" name="serach.grid" as="grid"/> </referenceContainer> -</layout> +</page> 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 59792497e84b91cdc14f975c285138b856c309f7..9e29f4978756ad0fbbf2fd0373f77c5abbdb8edc 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Shipping\Address" template="order/create/form/address.phtml" name="shipping_address"/> </referenceContainer> -</layout> +</page> 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 1c8b39fe95e589d6f42f154cf56a16adcb655f90..4ca346515365eb1d273f7c8810b53091fc8856ec 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Shipping\Method" template="order/create/abstract.phtml" name="shipping_method"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Shipping\Method\Form" template="order/create/shipping/method/form.phtml" name="order.create.shipping.method.form" as="form"/> </block> </referenceContainer> -</layout> +</page> 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 924aa6641a67223aa0a2586f166e5a0a9e249603..c5bc9591abbe8fcc02a02cab4a9e18193ebb4f67 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar" template="order/create/sidebar.phtml" name="sidebar"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Cart" template="order/create/sidebar/items.phtml" name="cart"/> @@ -35,4 +35,4 @@ <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Pviewed" template="order/create/sidebar/items.phtml" name="pviewed"/> </block> </referenceContainer> -</layout> +</page> 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 fe5dff6cfcd16da7d68c76e57b05368c69758dc7..a43916972055e8b6f7b8477bb367fbb1f3506e1f 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Cart" template="order/create/sidebar/items.phtml" name="sidebar_cart"/> </referenceContainer> -</layout> +</page> 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 4782eafa3bfeea0cd88a17d43184c5739c72df13..1341d44ac62438d3d426e5d41fc5dfce4f3f4d77 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Compared" template="order/create/sidebar/items.phtml" name="sidebar_compared"/> </referenceContainer> -</layout> +</page> 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 7aae28367fb40987f9a08b8f3cba2d22990cb813..eac65c41b6bcf4d7c717c64d7602e31ba9565a9b 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Pcompared" template="order/create/sidebar/items.phtml" name="sidebar_pcompared"/> </referenceContainer> -</layout> +</page> 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 a8c5598d71a630070547d8c27651438b36f786e9..c58110807a4d1f31e0aeee75b9111cc7b278282c 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Pviewed" template="order/create/sidebar/items.phtml" name="sidebar_pviewed"/> </referenceContainer> -</layout> +</page> 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 04d674bc9c6931bdc1d3e601d758021c1b91b380..1759e5e4ab2324c2bf107df28b79d3ea1cbe8415 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Reorder" template="order/create/sidebar/items.phtml" name="sidebar_reorder"/> </referenceContainer> -</layout> +</page> 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 0483598a133346044fea8a93ec6b23169b1360ab..048f1ea552789abbdcf9459931aec62d8f1b2884 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Viewed" template="order/create/sidebar/items.phtml" name="sidebar_viewed"/> </referenceContainer> -</layout> +</page> 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 66c265efa3631aca5ede000957d52c686ae5f54f..64d265763671ed39e56fc4d7344375e6cd3733e4 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Wishlist" template="order/create/sidebar/items.phtml" name="sidebar_wishlist"/> </referenceContainer> -</layout> +</page> 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 7dfcdd570c3b51ac1c4f985ea929e17336b9c41b..5edd76d44af9dd1dc6a646a77bd87bcc4d1bf90c 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Totals" template="order/create/totals.phtml" name="totals"/> </referenceContainer> -</layout> +</page> 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 6d5a59c079d649c0a56da6e5b76f2048552f6eb1..469582438a5be4a3c556ef69e8ca20a369c40935 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\View\Comments" name="creditmemo_comments"> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"/> </block> -</layout> +</page> 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 8e9625a350a94d24aa007657756c18210cf45293..bb4ec6f4933a5dec78893bb7d1e6bb66734084a2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales_order_creditmemo.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_creditmemo.grid" as="grid"> <arguments> @@ -101,4 +101,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 7c43c0301e16f445f7a0383c49370cc8b594afe5..b62eddc80a2c34259b0e2cdc38f76fcd12c47e9a 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create" name="sales_creditmemo_create"> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Form" name="form" template="order/creditmemo/create/form.phtml"> @@ -45,4 +45,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 340c993e4593af07bfae4fe1f98668a7a1f4807b..94b3359c56756b6b28c2a7146de4d9368ed6ee31 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items" name="order_items" template="order/creditmemo/create/items.phtml"> <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="order/creditmemo/create/items/renderer/default.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> @@ -37,4 +37,4 @@ <container name="submit_before" label="Submit Before"/> <container name="submit_after" label="Submit After"/> </block> -</layout> +</page> 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 c120b0a3d02186c6f3f2bdb0cb41559d3dd1461e..f6eaf4b79f8f1a651f03efb5faad1a6eab65dbdf 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\View" name="sales_creditmemo_view"> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\View\Form" name="form" template="order/creditmemo/view/form.phtml"> @@ -46,4 +46,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 d0d8446fbde17495e84bcbb892581f79f9b3871b..3359bb0ad71e6ef47d32d5b01ffe0eb2563b68de 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 @@ -23,7 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="sales_order_creditmemo_grid_block"/> - <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos" name="sales_order_creditmemo.grid.container" output="1"/> -</layout> \ No newline at end of file + <container name="root"> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos" name="sales_order_creditmemo.grid.container"/> + </container> +</layout> 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 cf3e18cf191bf1d6b072bf19c73573308275d440..ca66e4cc0d4efef7407d2d5db675d7fd978acf19 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 @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_create_index"/> -</layout> +</page> 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 f183cf4655ce462344aaffe2658ecbbcf4f075db..546e13e38e7e82084f68308c0294ad912d6e1607 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_order.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 f183cf4655ce462344aaffe2658ecbbcf4f075db..546e13e38e7e82084f68308c0294ad912d6e1607 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_order.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 29b34b255b35e288544cafcbc041fb77563e6ecd..805b9e1242d561a9e7b18b417eb397fa48a4b4b9 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="sales_order_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_order.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_order.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml index 3e7e62cbc8f1d42a52e3dcbfa2820c71bff2b854..a1736952fe9c9608119df9fe9d003463bc5af3be 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales_order.grid.container"> <block class="Magento\Sales\Block\Adminhtml\Order\Grid" name="sales.order.grid" as="grid"> <arguments> @@ -36,12 +36,6 @@ <argument name="grid_url" xsi:type="url" path="*/*/grid"> <param name="_current">1</param> </argument> - <argument name="rssList" xsi:type="array"> - <item name="orders" xsi:type="array"> - <item name="url" xsi:type="string">rss/order/new</item> - <item name="label" xsi:type="string" translate="true">New Order RSS</item> - </item> - </argument> </arguments> <block class="Magento\Backend\Block\Widget\Grid\Massaction" name="sales.order.grid.massaction" as="grid.massaction"> <arguments> @@ -222,4 +216,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 1b38cd34df8428fa48a90ba830fe692fdf0847a7..806ad02294000844d55aa26bb1826484c123a7dd 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_grid_block"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order" name="sales_order.grid.container"/> </referenceContainer> -</layout> +</page> 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 c1fb00360ec51e0001e8c1e353035b34b56d7485..c48d728c39dbe3e88bf2371edd2826a75cec4efc 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\View\Comments" name="invoice_comments"> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"/> </block> -</layout> +</page> 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 e5790563327c4170859fc4bab74890f819906642..cccad024a6aace177c5713d49ae71340af1afdad 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales_order_invoice.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_invoice.grid" as="grid"> <arguments> @@ -101,4 +101,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 facb2b105051d62401f4fbf3f85520c73a939392..dca3b3ec0e1ddb8c48708f7c1c0ee8f2e4361e42 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\Create" name="sales_invoice_create"> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\Create\Form" name="form" template="order/invoice/create/form.phtml"> @@ -42,4 +42,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 0df46c7b7d1a85f96384334eb77019dfdd64cfc0..ef2a8eb5420dcf61c10b5f566e8772a379823deb 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\Create\Items" name="order_items" template="order/invoice/create/items.phtml"> <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="order/invoice/create/items/renderer/default.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> @@ -34,4 +34,4 @@ <block class="Magento\Sales\Block\Adminhtml\Order\Totals\Tax" name="tax" template="order/totals/tax.phtml"/> </block> </block> -</layout> +</page> 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 0ce92c9a93de5dd557c45d645e3f396533841d1c..363bb8c047055fb0848774ca520ebf377c130ec1 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\View" name="sales_invoice_view"> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\View\Form" name="form" template="order/invoice/view/form.phtml"> @@ -46,4 +46,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 38cee582081f9c53c3aa55d66f875453d8ef7539..3163c5c83f7ae408022ea544e0dd59adf7a52aca 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 @@ -23,7 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="sales_order_invoice_grid_block"/> - <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices" name="sales_order_invoice.grid.container" output="1"/> + <container name="root"> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices" name="sales_order_invoice.grid.container"/> + </container> </layout> 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 013f11d106442b08b9f121bc582e790e1fc565f5..252c9e83b40ece772652ca181840fdc6d2028418 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales_order_shipment.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_shipment.grid" as="grid"> <arguments> @@ -89,4 +89,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 3f60f3b38470bd686de754b34ac4baf740e2d2f8..66f35f52f8b3b71af7b54a691c050e241a5301e1 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 @@ -23,7 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="sales_order_shipment_grid_block"/> - <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments" name="sales_order_shipment.grid.container" output="1"/> + <container name="root"> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments" name="sales_order_shipment.grid.container"/> + </container> </layout> 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 4f3a066cdae7a3479b2036898ae9110d6cb36f70..59f253d5dd882cc37de8f79558b1817a58f4e2bf 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Status\Assign" name="sales_order_status.assign.container"/> </referenceContainer> -</layout> +</page> 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 5f68354bc07dba2ec85aa2479b17c160f7e31456..c75f3a9363aa1dd59187fd3b5c57552cc5610b6c 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Status\Edit" name="sales_order_status.edit.container"/> </referenceContainer> -</layout> +</page> 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 c868e50b74934a348509751d5b0436af570f87ca..b7402bfb6085c0b9121c78cece3a9b1bb3629e6a 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Status" name="sales_order_status.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales_order_status.grid" as="grid"> @@ -121,4 +121,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 53f1462700ccb02f401cf50419a379bb33a6f920..9f719b7a2d0478c7daf295c654182c149c425b78 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Status\NewStatus" name="sales_order_status.new.container"/> </referenceContainer> -</layout> +</page> 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 cff3feb40ae6db7bc220fc2827ec984ced5c70f2..f29494a991b1ad163c4d15bbc134229c8991f638 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 @@ -23,7 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="sales_order_transactions_grid_block"/> - <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Transactions" name="sales_transactions.grid.container" output="1"/> + <container name="root"> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Transactions" name="sales_transactions.grid.container"/> + </container> </layout> 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 14960f2aa40b026c79a76e174c75beac52745b6f..d91bdc57c91de972beb1f16db6bb15e6b40a35d3 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_transactions_grid_block"/> <referenceBlock name="sales.transactions.grid"> <arguments> @@ -54,4 +54,4 @@ </arguments> </referenceBlock> </referenceBlock> -</layout> +</page> 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 701ed4a52268e6e71917d084acce190ac6af6232..6b67d7a6f00894026c484e73f233fe9aae4a6964 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-sales-js-bootstrap-order-create-index-js"> <arguments> @@ -91,4 +91,4 @@ <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="sales_page_head_components" template="Magento_Sales::page/js/components.phtml"/> </referenceBlock> -</layout> +</page> 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 6de2d885fbd316458b23ef6339905827a132813c..25c231a0cdeefd42407c01184acb3ab5e989d7ca 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_shipment_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_shipment.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 7ec4617a251755e82a33159f8cd92e00163a51a7..dcdcee11a33db7ea04c3a0cbd568a061c64ea3f9 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" > +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" > <update handle="sales_shipment_grid_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_shipment.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml index 741e46cf438b7c102608c9b32ab424b252f191c0..74a55fc08906ac56b43a5504221c8c3d92c8ef5d 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales_shipment.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.shipment.grid" as="grid"> <arguments> @@ -161,4 +161,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 0df4c515a3a1b872e74db73f8ff481bceed0f04e..1a63c0a5564d0d146817229170c568255987c2ef 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_shipment_grid_block"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Shipment" name="sales_shipment.grid.container"/> </referenceContainer> -</layout> +</page> 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 396cac4a5048cd72242b3809a9bcb7b2e5a77ba2..a1cb655d70dca382cd02ec910d08b7a9ae5beb85 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_transactions_grid_block"/> <referenceBlock name="sales.transactions.grid"> <arguments> @@ -77,4 +77,4 @@ </referenceBlock> </referenceBlock> </referenceBlock> -</layout> +</page> 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 d99c4225d9a5a7cd2057dfe9a2c799524360369f..577c0617ebc8ebcc9d1a9a24382df8cd96ad46fe 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="sales_transactions_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_transactions.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_transactions.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 9022296853435b38e52cb86d023440f3fcda48cb..81f8d2abdf8fd2366805cd120ecce630bd8ac08e 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales_transactions.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.transactions.grid" as="grid"> <arguments> @@ -134,4 +134,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 40d80741c10b02ff11e0641bd6e69e9995e0c68d..ce7ba3768334d5021f4955d83dae50f4c49e7b61 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_transactions_grid_block"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Transactions" name="sales_transactions.grid.container"/> </referenceContainer> -</layout> +</page> 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 c72b95f36e85746fb93233afea97efb5ab685cc9..fc6eff51a1dd0c87e41db8eb5d65f1a139f8b35f 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_transaction_child_block"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Transactions\Detail" name="sales_transactions.detail" template="transactions/detail.phtml"> @@ -31,4 +31,4 @@ <block class="Magento\Sales\Block\Adminhtml\Transactions" name="sales_transactions.grid.container" as="child_grid"/> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Sales/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Sales/view/frontend/layout/checkout_onepage_index.xml index c8697aaf625e369ea75e40f07e804fa05bf11569..d82515052ca84bed813e23208e94f462e00991e2 100644 --- a/app/code/Magento/Sales/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/checkout_onepage_index.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <remove name="sale.reorder.sidebar"/> -</layout> +</page> 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 ff25f159ad31ca96181261d8b35f02711addee6f..63941f4a4a5d096a0971b5e1c8dc71e2eb19611a 100644 --- a/app/code/Magento/Sales/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Sales/view/frontend/layout/customer_account.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-orders-link"> <arguments> @@ -32,4 +32,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> 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 0f72460b8d27c710ca8c1f93c1095e30adcba37a..5fc75d10a62f82faaa2000ab4342a28742c31db5 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\Recent" name="customer_account_dashboard_top" after="customer_account_dashboard_hello" template="order/recent.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Sales/view/frontend/layout/default.xml b/app/code/Magento/Sales/view/frontend/layout/default.xml index 56236d02b2f1817bf6c4a57c4b852506249dfd99..79b911a43ea39d9226976e16f854c87109a8e9c1 100644 --- a/app/code/Magento/Sales/view/frontend/layout/default.xml +++ b/app/code/Magento/Sales/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="sales_page_head_components" template="Magento_Sales::js/components.phtml"/> </referenceBlock> @@ -38,4 +38,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> 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 da972fdaca5fe755a238b994b44868e7b2db4816..8381d7f455ed7462e390d0487db738d1df10742a 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <update handle="sales_email_order_creditmemo_renderers" /> <block class="Magento\Sales\Block\Order\Email\Creditmemo\Items" name="items" template="email/creditmemo/items.phtml"> <block class="Magento\Framework\View\Element\RendererList" name="sales.email.order.creditmemo.renderers" as="renderer.list" /> @@ -36,4 +36,4 @@ </block> </block> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 a3bfd1a489c46a6a12963d55c8f2466b8218bd3b..67954e4de6d1240846f5642bc676bd3f6a8a0cb8 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <referenceBlock name="sales.email.order.creditmemo.renderers"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/creditmemo/default.phtml"/> </referenceBlock> -</layout> +</page> 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 38701faf6084d7dd43b93591c96528dc8b709343..63401ce4e6dac7c13a99809dfa79f2a51585de78 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Invoice Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Invoice Items List" design_abstraction="custom"> <update handle="sales_email_order_invoice_renderers" /> <block class="Magento\Sales\Block\Order\Email\Invoice\Items" name="items" template="email/invoice/items.phtml"> <block class="Magento\Framework\View\Element\RendererList" name="sales.email.order.invoice.renderers" as="renderer.list" /> @@ -36,4 +36,4 @@ </block> </block> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 4540fecfde93a82b3cbd9bc82184d17fe3789f15..bfb71c3d186b77be4759a34a6b5aad24e1628cbb 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <referenceBlock name="sales.email.order.invoice.renderers"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/invoice/default.phtml"/> </referenceBlock> -</layout> +</page> 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 d1adea9686bd170aa8805f2eaf64cf3777d1b074..c1c1f8ce53cbebe987788ece1716760230bbdeec 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Order Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Order Items List" design_abstraction="custom"> <update handle="sales_email_order_renderers" /> <block class="Magento\Sales\Block\Order\Email\Items" name="items" template="email/items.phtml" cacheable="false"> <block class="Magento\Framework\View\Element\RendererList" name="sales.email.order.renderers" as="renderer.list" /> @@ -40,4 +40,4 @@ </block> </block> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 9539af341c185e311d4592d891d7018431dd2c92..1db2ed4edaa61b43b57ad03ef55905095816fb7b 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <referenceBlock name="sales.email.order.renderers"> <block class="Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder" as="default" template="email/items/order/default.phtml"/> </referenceBlock> -</layout> +</page> 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 46a58a56ca834e4b5b3682e3f3ed72474d1b5f21..098e5be82004559e0b6c637e72081c81b451c491 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Shipment Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Shipment Items List" design_abstraction="custom"> <update handle="sales_email_order_shipment_renderers" /> <block class="Magento\Sales\Block\Order\Email\Shipment\Items" name="items" template="email/shipment/items.phtml"> <block class="Magento\Framework\View\Element\RendererList" name="sales.email.order.shipment.renderers" as="renderer.list" /> </block> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 291efb9fed6ada06bce091e9ae50db25332f93f6..0e2808597afb697aa4bc52a4f9eafc31f7af9b21 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <referenceBlock name="sales.email.order.shipment.renderers"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/shipment/default.phtml"/> </referenceBlock> -</layout> +</page> 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 8dd9837696f5a93938fd12dbf504e4e8437d0be4..d93dfc482bad56e9bd56528d26544b41fd6a767c 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 @@ -23,13 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_creditmemo_renderers" /> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> <block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> @@ -49,4 +44,4 @@ </block> </referenceContainer> <update handle="sales_order_guest_info_links"/> -</layout> +</page> 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 57628cfbc120a19e6b1b990931799c6c1e1c2c60..72bdf3043058b35d139b2cfb22218cd2dc2963d0 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 @@ -23,13 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Widget\Guest\Form" name="guest.form" template="guest/form.phtml"/> </referenceContainer> -</layout> +</page> 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 19fa9255d297fc4ed2417001aceabdd5968f0cf5..878019f482ecc125ea8bdc63f4b1af39fac9068f 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 @@ -23,13 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_invoice_renderers" /> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> <block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> @@ -49,4 +44,4 @@ </block> </referenceContainer> <update handle="sales_order_guest_info_links"/> -</layout> +</page> 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 641c95d2a26d6c46872b1ffb991ef32f89832e6c..145d7594337272df4f045fba6fa6486b0b26041b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_print_renderers" /> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintShipment" name="sales.order.print" template="order/print.phtml"> @@ -41,4 +41,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 777e389c40963585003702574b8e41b8f7236b1b..bdf4a55bf5743a0e4b0af0342cc56d4489c6371e 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_print_creditmemo_renderers" /> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Creditmemo" name="sales.order.print.creditmemo" template="order/print/creditmemo.phtml"> @@ -37,4 +37,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 b4ffa2d68a70bc061826c6b582f075b7f941cb97..e85e2125e27b48041b3babb965a9e6e111c208c2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_print_invoice_renderers" /> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Invoice" name="sales.order.print.invoice" template="order/print/invoice.phtml"> @@ -37,4 +37,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 631e704fe1b4f07d0bcd601b0a72d6392ebc5874..d119842555fe1debade8a0433033de42547b0d16 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 @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_print_shipment_renderers" /> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Shipment" name="sales.order.print.shipment" template="order/print/shipment.phtml"> <block class="Magento\Framework\View\Element\RendererList" name="sales.order.print.shipment.renderers" as="renderer.list" /> </block> </referenceContainer> -</layout> +</page> 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 1702797973dfd2475209861617d27d8d8ceecffc..c429c91bb6055c832374c767bb50c2a5d6bd530d 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 @@ -23,13 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\View" name="sales.order.view" cacheable="false"/> </referenceContainer> -</layout> +</page> 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 cf63a514242456ac1e2dce9aaf35539d5ec0ef3d..f5a2ff1c5fe3fec38882787bf7088be74389e662 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 @@ -23,16 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> <block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> </block> </referenceContainer> <update handle="sales_order_guest_info_links"/> -</layout> +</page> 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 ed667450e4ab9f90be303bbdc1567804c3253985..822d7f48a35d8a760fb977b075e47645a576207d 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 @@ -23,14 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_item_renderers"/> - - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> <referenceContainer name="page.main.title"> <container name="order.actions.container" htmlTag="div" htmlClass="actions-toolbar order-actions-toolbar"> <block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> @@ -52,4 +46,4 @@ </block> </referenceContainer> <update handle="sales_order_guest_info_links"/> -</layout> +</page> 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 bcb05b783805c2bdbcd633844f9b2147320d4af4..d9156d16f3acceb70fe21af8f7a08f3b76b5772d 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_creditmemo_renderers" /> <update handle="customer_account"/> <referenceContainer name="page.main.title"> @@ -31,7 +31,6 @@ <block class="Magento\Sales\Block\Order\Info" name="order.date" template="order/order_date.phtml" /> <container name="order.actions.container" htmlTag="div" htmlClass="actions-toolbar order-actions-toolbar"> <block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> - <block class="Magento\Sales\Block\Order\Info" name="order.rss" template="order/order_rss.phtml" /> </container> </referenceContainer> <referenceContainer name="content"> @@ -51,4 +50,4 @@ </referenceContainer> <update handle="sales_order_info_links"/> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 33342e6642d1705d70db4bd85c6078f872af5fc9..f6b7de33a7eb7f76eb4285c6a0a634b1b8ffd7c6 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.creditmemo.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/creditmemo/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> 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 6b9aad1c5fe9ed1d89f7db0ba45c4f3f57a80d3b..cc675fc4f719ae67ccd961b0d4167e14ab3d2e76 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.info"> <block class="Magento\Framework\View\Element\Html\Links" as="links" name="sales.order.info.links"> <arguments> @@ -58,4 +58,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 60f447276a49a15db96ce47d867e43569fe5f2e8..f7b739e5e23db6e388830e5aecb0b17bab41c505 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\History" name="sales.order.history" cacheable="false"> @@ -31,4 +31,4 @@ </block> <block class="Magento\Customer\Block\Account\Dashboard" name="customer.account.link.back" template="account/link/back.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> 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 aabd36d18af947e31b837fbb2aedef32976af5a4..59ec675ea688e02fc1e92aeef5b4fe11471dbc4e 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Html\Links" as="links" name="sales.order.info.links" before="-"> <arguments> @@ -58,4 +58,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 13934744f2c830b3a377867449e8003236f33559..e10f531f7bc790e5834f791652de75645880633b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <update handle="sales_order_invoice_renderers" /> <referenceContainer name="page.main.title"> @@ -31,7 +31,6 @@ <block class="Magento\Sales\Block\Order\Info" name="order.date" template="order/order_date.phtml" /> <container name="order.actions.container" htmlTag="div" htmlClass="actions-toolbar order-actions-toolbar"> <block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> - <block class="Magento\Sales\Block\Order\Info" name="order.rss" template="order/order_rss.phtml" /> </container> </referenceContainer> <referenceContainer name="content"> @@ -52,4 +51,4 @@ </referenceContainer> <update handle="sales_order_info_links"/> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 64f8a58a7ec789df7d3ff6f303b84b7f9ffb2214..78da98b1ae0f36056a3f52fa64938dcaeb360f5a 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/invoice/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> 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 26e60d768c3451cacab0257394d86828dc188f51..daa2db64cb1af9d5951543f562e9fa58d57a1aaa 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.items.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> 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 daa0c8d45e1091096abf1e616d7c0bba879ef04d..8bf5e903d19325748cb5b9089a333245b17b8619 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_print_renderers" /> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintShipment" name="sales.order.print" template="order/print.phtml"> @@ -42,4 +42,4 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 a8c2f8ce947cc09823acdfdac2d63eb3cb8e545a..2c1c3e473bfc5c5e91504e0cab79692890ac78a7 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.creditmemo.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/creditmemo/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> 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 da7ddfd9b2a4787987f608241b78c2598f6977fb..ce82abbef6fd627dbbf3ea356070135b7f27d1c4 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.invoice.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/invoice/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> 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 b778488ff8f360ff1d4caff379aa04875bd3dfee..845c5b6a7dde873525d49cdc0fdf52c755768901 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> 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 ceaa3dd97e570b82e5ae904d17a717c43cce064a..fa912d8bcbe728ce96c8ab5f1cd08fbf331f705c 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.print.shipment.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> 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 3eaaf3748bd9b6dbe1382bbbda88879046b55d95..210ff8f7bb45d99c2d1566cf6efb8068c26fa619 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_print_creditmemo_renderers" /> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Creditmemo" name="sales.order.print.creditmemo" template="order/print/creditmemo.phtml"> @@ -38,4 +38,4 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 8f3a595e263e67526d7e76117194c0a12a988cd4..99b5554448b385eab5d0d1cbc0f52014a2c4641c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_print_invoice_renderers" /> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Invoice" name="sales.order.print.invoice" template="order/print/invoice.phtml"> @@ -38,4 +38,4 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 e6beda135bbde085374b3b2aa6c69e1ffdcfe557..23d9201c0307e23cc9dffb9bffd71b03044f6ccc 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_print_shipment_renderers" /> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Shipment" name="sales.order.print.shipment" template="order/print/shipment.phtml"> @@ -31,4 +31,4 @@ </block> </referenceContainer> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 1e14e90cbf55eb7cb62fe6f4f7d3f9a493f57356..dfb9dbfda4aa488fcf0c8c4c3ccc3d61566e2a99 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\View" name="sales.order.view" cacheable="false"/> </referenceContainer> -</layout> +</page> 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 45a152d0dd0cdb87a423fa7c3a103c72753d2eb3..ee3aafe4591e6d91b9d8ad6bd9997534723d6eaf 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 @@ -23,14 +23,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="page.main.title"> <block class="Magento\Sales\Block\Order\Info" name="order.status" template="order/order_status.phtml" /> <block class="Magento\Sales\Block\Order\Info" name="order.date" template="order/order_date.phtml" /> <container name="order.actions.container" htmlTag="div" htmlClass="actions-toolbar order-actions-toolbar"> <block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> - <block class="Magento\Sales\Block\Order\Info" name="order.rss" template="order/order_rss.phtml" /> </container> </referenceContainer> <referenceContainer name="content"> @@ -38,4 +37,4 @@ </referenceContainer> <update handle="sales_order_info_links"/> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> 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 ee49c44e2f7d06e5a7987fdeb1d258bae332a9a6..b9298c05132ae975b38d6fcba8d68cdaa29ca94a 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.shipment.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> </referenceBlock> -</layout> +</page> 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 bd4dce6776bb173a31b0105249b377fbde85e29b..d327227a9219e7a1a14e805b1358b9336f3f2fbc 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <update handle="sales_order_item_renderers"/> <referenceContainer name="page.main.title"> @@ -31,7 +31,6 @@ <block class="Magento\Sales\Block\Order\Info" name="order.date" template="order/order_date.phtml" /> <container name="order.actions.container" htmlTag="div" htmlClass="actions-toolbar order-actions-toolbar"> <block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> - <block class="Magento\Sales\Block\Order\Info" name="order.rss" template="order/order_rss.phtml" /> </container> </referenceContainer> <referenceContainer name="content"> @@ -52,4 +51,4 @@ </referenceContainer> <update handle="sales_order_info_links"/> <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Sales/view/frontend/templates/order/info/buttons.phtml b/app/code/Magento/Sales/view/frontend/templates/order/info/buttons.phtml index 8091ba39faa0536a86d02dd2d32e5e10b6cfa9d9..677e8380319ef37e5264d17160468400a94a729e 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/info/buttons.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/info/buttons.phtml @@ -34,11 +34,5 @@ onclick="this.target='_blank';"> <span><?php echo __('Print Order') ?></span> </a> - <?php if($this->helper('Magento\Rss\Helper\Order')->isStatusNotificationAllow()): ?> - <a href="<?php echo $this->helper('Magento\Rss\Helper\Order')->getStatusHistoryRssUrl($_order) ?>" - class="action rss"> - <span><?php echo __('Subscribe to Order Status') ?></span> - </a> - <?php endif; ?> <?php echo $this->getChildHtml(); ?> -</div> \ No newline at end of file +</div> diff --git a/app/code/Magento/SalesRule/Model/Rule/Condition/Product.php b/app/code/Magento/SalesRule/Model/Rule/Condition/Product.php index 3181c83d2b064fb46cc143230e217c7ad11fcea9..165465cff4570fbbadb24e5be9bc042e875c74b8 100644 --- a/app/code/Magento/SalesRule/Model/Rule/Condition/Product.php +++ b/app/code/Magento/SalesRule/Model/Rule/Condition/Product.php @@ -30,46 +30,6 @@ namespace Magento\SalesRule\Model\Rule\Condition; */ class Product extends \Magento\Rule\Model\Condition\Product\AbstractProduct { - /** - * @var \Magento\Catalog\Model\ProductFactory - */ - protected $_productFactory; - - /** - * @param \Magento\Rule\Model\Condition\Context $context - * @param \Magento\Backend\Helper\Data $backendData - * @param \Magento\Eav\Model\Config $config - * @param \Magento\Catalog\Model\Product $product - * @param \Magento\Catalog\Model\Resource\Product $productResource - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\Collection $attrSetCollection - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param array $data - */ - public function __construct( - \Magento\Rule\Model\Condition\Context $context, - \Magento\Backend\Helper\Data $backendData, - \Magento\Eav\Model\Config $config, - \Magento\Catalog\Model\Product $product, - \Magento\Catalog\Model\Resource\Product $productResource, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\Collection $attrSetCollection, - \Magento\Framework\Locale\FormatInterface $localeFormat, - \Magento\Catalog\Model\ProductFactory $productFactory, - array $data = array() - ) { - parent::__construct( - $context, - $backendData, - $config, - $product, - $productResource, - $attrSetCollection, - $localeFormat, - $data - ); - $this->_productFactory = $productFactory; - } - /** * Add special attributes * diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 669dc21cf2938883d39969b73acbae99db996f3b..2d689887bea64c397045ce7691578d7c57297fb5 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-rule": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-shipping": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-reports": "0.1.0-alpha91", - "magento/module-catalog-rule": "0.1.0-alpha91", - "magento/module-widget": "0.1.0-alpha91", - "magento/module-cron": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-rule": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-shipping": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-reports": "0.1.0-alpha92", + "magento/module-catalog-rule": "0.1.0-alpha92", + "magento/module-widget": "0.1.0-alpha92", + "magento/module-cron": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_couponsgrid.xml b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_couponsgrid.xml index d1f08de7c76ea08ee18d897b76c75cceb3e5300e..cfd15fa7cfaaac042b6895bc74785e1b3901f307 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_couponsgrid.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_couponsgrid.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid" name="sales_rule_quote_edit_tab_coupons_grid"/> </container> </layout> 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 2894ca399ee60d79cd9c09de549cb8bde7130671..9e9c3db746269ba507b96d97e09461770dde6d9d 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setCanLoadExtJs"> <argument name="flag" xsi:type="string">1</argument> @@ -68,4 +68,4 @@ <referenceContainer name="content"> <block class="Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit" name="promo_quote_edit"/> </referenceContainer> -</layout> +</page> 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 f1ecb3c7649f26c73de30832666e474d10e32f43..398f30af323cbefc65822711f0fe921966db2d04 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\SalesRule\Block\Adminhtml\Promo\Quote" name="adminhtml.block.promo.quote.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.promo.quote.grid" as="grid"> @@ -118,4 +118,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Sendfriend/composer.json b/app/code/Magento/Sendfriend/composer.json index 81cc667f62ecb837b09b48a14799c9eec0c55271..1bfb4e8f4be8561a776f78ffb4eaf13dca59778e 100644 --- a/app/code/Magento/Sendfriend/composer.json +++ b/app/code/Magento/Sendfriend/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 5245d77da2222eab34614d2fbcaed5e16119c27b..84144e731cfed87b29cae1b8f8cfda90ff8be8bd 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 @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_one_column"/> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="page.main.title"> <action method="setPageTitle"> <argument name="title" translate="true" xsi:type="string">Email to a Friend</argument> @@ -33,4 +32,4 @@ <referenceContainer name="content"> <block class="Magento\Sendfriend\Block\Send" name="sendfriend.send" template="send.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index 422520ed3e1dc594ac6f04600bc121602ce5c69c..7fe4c0195908edac2192a278f601974d88331353 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -3,23 +3,23 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-contact": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-payment": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-contact": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-payment": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "ext-gd": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addcomment.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addcomment.xml index 10254db9dc4e89369545364ee75f554d4d526d09..06a1a48a1780c154c57d08f19b05748295d38f8e 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addcomment.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addcomment.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Shipping\Block\Adminhtml\View\Comments" name="shipment_comments"> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"/> </block> -</layout> +</page> 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 eafdbc0416c64f6da5e60eb7525fb1cf2fa42546..f188fb67003ff1d530417cacef3a7be83de0d034 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 @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Shipping\Block\Adminhtml\Order\Tracking\View" name="shipment_tracking" template="order/tracking/view.phtml"/> -</layout> +</page> 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 c6ff5db33ccf08cdd3274cc753d0b21d1eba8b89..83b1980020ebfc6d93b6edb003fd5d1190b3a50c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Shipping\Block\Adminhtml\Create" name="sales_shipment_create"> <block class="Magento\Shipping\Block\Adminhtml\Create\Form" name="form" template="create/form.phtml"> @@ -40,4 +40,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 eafdbc0416c64f6da5e60eb7525fb1cf2fa42546..f188fb67003ff1d530417cacef3a7be83de0d034 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 @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Shipping\Block\Adminhtml\Order\Tracking\View" name="shipment_tracking" template="order/tracking/view.phtml"/> -</layout> +</page> 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 b05e5cdf968739391adb48715cc953b0acb36da6..f414ddb56f4438a5776a40f45d8d9ea4a7f4182e 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Shipping\Block\Adminhtml\View" name="sales_shipment_view"> <block class="Magento\Shipping\Block\Adminhtml\View\Form" name="form" template="view/form.phtml"> @@ -42,4 +42,4 @@ </block> </block> </referenceContainer> -</layout> +</page> 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 c414e4902fd11dfd9ce5612b07752fc8cfdbc3aa..f63e419e686a7ddea28cc06ab76e4ef6cf9d14aa 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="form"> <block class="Magento\Shipping\Block\Adminhtml\Order\Tracking\Invoice" name="tracking" template="order/tracking.phtml"/> </referenceBlock> -</layout> +</page> 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 99e31de0180a5a6b1787933a0347bcacd3c9adab..35dcbc4ecd97f50d93a7972bec5769c6f9f4783a 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_tab_info"> <block class="Magento\Sales\Block\Adminhtml\Order\AbstractOrder" name="order_shipping_view" template="Magento_Shipping::order/view/info.phtml"/> </referenceBlock> -</layout> +</page> 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 7e391fa2452dbd22beaf8705d0be22f0c8e4b286..873f4a8b34a2087f232d42b1092931679c652d47 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/create/form.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/create/form.phtml @@ -70,37 +70,37 @@ </form> <?php echo $this->getChildHtml('shipment_packaging') ?> <script type="text/javascript"> -require(["jquery", "mage/mage", "prototype"], function(jQuery){ +require([ + "jquery", + "mage/mage", + "prototype" +], function(jQuery){ -//<![CDATA[ - document.observe("dom:loaded", function() { - setTimeout(function(){ - packaging.setConfirmPackagingCallback(function(){ - packaging.setParamsCreateLabelRequest($('edit_form').serialize(true)); - packaging.sendCreateLabelRequest(); - }); - packaging.setLabelCreatedCallback(function(response){ - setLocation("<?php echo $this->getUrl( - 'sales/order/view', - array('order_id' => $this->getShipment()->getOrderId()) - ); ?>"); - }); - packaging.setCancelCallback(function() { - packaging.cleanPackages(); - $('create_shipping_label').checked = false; - toggleCreateLabelCheckbox(); - }); - packaging.setItemQtyCallback(function(itemId){ - var item = $$('[name="shipment[items]['+itemId+']"]')[0]; - if (item && !isNaN(item.value)) { - return item.value; - } - }); - }, 500); - }); + setTimeout(function(){ + packaging.setConfirmPackagingCallback(function(){ + packaging.setParamsCreateLabelRequest($('edit_form').serialize(true)); + packaging.sendCreateLabelRequest(); + }); + packaging.setLabelCreatedCallback(function(response){ + setLocation("<?php echo $this->getUrl( + 'sales/order/view', + array('order_id' => $this->getShipment()->getOrderId()) + ); ?>"); + }); + packaging.setCancelCallback(function() { + packaging.cleanPackages(); + $('create_shipping_label').checked = false; + toggleCreateLabelCheckbox(); + }); + packaging.setItemQtyCallback(function(itemId){ + var item = $$('[name="shipment[items]['+itemId+']"]')[0]; + if (item && !isNaN(item.value)) { + return item.value; + } + }); + }, 500); jQuery('#edit_form').mage('form').mage('validation'); -//]]> }); </script> diff --git a/app/code/Magento/Shipping/view/adminhtml/templates/create/items.phtml b/app/code/Magento/Shipping/view/adminhtml/templates/create/items.phtml index 61983a27d42f96718aaceeaacd41d83337f1ca00..003cb9175249d76e02777c675b06763667280dfd 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/create/items.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/create/items.phtml @@ -88,7 +88,10 @@ </div> </div> <script type="text/javascript"> -require(["jquery", "prototype"], function(jQuery){ +require([ + "jquery", + "prototype" +], function(jQuery){ //<![CDATA[ var sendEmailCheckbox = $('send_email'); @@ -106,7 +109,7 @@ function bindSendEmail() { notifyCustomerCheckbox.disabled = true; } } -function toggleCreateLabelCheckbox() { +window.toggleCreateLabelCheckbox = function() { var checkbox = $('create_shipping_label'); var submitButton = checkbox.up('.order-totals').select('.submit-button span')[0]; if (checkbox.checked) { @@ -115,7 +118,7 @@ function toggleCreateLabelCheckbox() { submitButton.innerText = submitButton.innerText.replace(/\.\.\.$/, ''); } } -function submitShipment(btn) { +window.submitShipment = function(btn) { if (!validQtyItems()) { alert('<?php echo __('Invalid value(s) for Qty to Ship') ?>'); return; @@ -133,7 +136,7 @@ function submitShipment(btn) { jQuery('#edit_form').triggerHandler('save'); } } -function validQtyItems() { +window.validQtyItems = function() { var valid = true; $$('.qty-item').each(function(item) { var val = parseFloat(item.value); @@ -144,9 +147,6 @@ function validQtyItems() { return valid; } -window.validQtyItems = validQtyItems; -window.submitShipment = submitShipment; -window.toggleCreateLabelCheckbox = toggleCreateLabelCheckbox; window.bindSendEmail = bindSendEmail; window.shipmentCommentText = shipmentCommentText; diff --git a/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml b/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml index f3816a044e882851f10b0b2472681116b9fe2b0c..14dd4cf1abf223a966268771e5826759266327ad 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml @@ -29,18 +29,17 @@ $sizeSource = $this->getSourceSizeModel()->toOptionArray(); $girthEnabled = $this->isDisplayGirthValue() && $this->isGirthAllowed() ? 1 : 0; ?> <script type="text/javascript"> -require(["prototype", "Magento_Shipping/order/packaging"], function(){ +require([ + "prototype", + "Magento_Shipping/order/packaging" +], function(){ - //<![CDATA[ - document.observe("dom:loaded", function() { - packaging = new Packaging(<?php echo $this->getConfigDataJson() ?>); - packaging.changeContainerType($$('select[name=package_container]')[0]); - packaging.checkSizeAndGirthParameter( - $$('select[name=package_container]')[0], - <?php echo $girthEnabled; ?> - ); - }); - //]]> + packaging = new Packaging(<?php echo $this->getConfigDataJson() ?>); + packaging.changeContainerType($$('select[name=package_container]')[0]); + packaging.checkSizeAndGirthParameter( + $$('select[name=package_container]')[0], + <?php echo $girthEnabled; ?> + ); }); </script> diff --git a/app/code/Magento/Shipping/view/adminhtml/templates/view/form.phtml b/app/code/Magento/Shipping/view/adminhtml/templates/view/form.phtml index f2b8613d1da9ff16976b04d46e631235130a63e0..d5cb952cbe040a3a74f4ee492b464135fa178dde 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/view/form.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/view/form.phtml @@ -76,23 +76,21 @@ <div><?php echo $this->getChildHtml('shipment_tracking') ?></div> <?php echo $this->getChildHtml('shipment_packaging') ?> <script type="text/javascript"> -require(['prototype'], function(){ +require([ + 'prototype' +], function(){ - //<![CDATA[ - document.observe("dom:loaded", function() { - setTimeout(function(){ - packaging.setConfirmPackagingCallback(function(){ - packaging.sendCreateLabelRequest(); - }); - packaging.setLabelCreatedCallback(function(response){ - setLocation("<?php echo $this->getUrl( - 'adminhtml/order_shipment/view', - array('shipment_id' => $this->getShipment()->getId()) - ); ?>"); - }); - }, 500); - }); - //]]> + setTimeout(function(){ + packaging.setConfirmPackagingCallback(function(){ + packaging.sendCreateLabelRequest(); + }); + packaging.setLabelCreatedCallback(function(response){ + setLocation("<?php echo $this->getUrl( + 'adminhtml/order_shipment/view', + array('shipment_id' => $this->getShipment()->getId()) + ); ?>"); + }); + }, 500); }); </script> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_reorder.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_reorder.xml index 4b6e8b3e9018bb2ea71979178c57d3754819eb66..da76d9036b13f19dcd8a6ba19db69139074e9d1a 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_reorder.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_reorder.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="tracking/link.phtml"> <arguments> @@ -31,4 +31,4 @@ </arguments> </block> </referenceBlock> -</layout> \ No newline at end of file +</page> \ No newline at end of file diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_shipment.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_shipment.xml index db69af8095369f5fcbbe37bd16a8ffc2abb1a2e8..39b0a18f9ff99c5c5472256317c6e2fd86f0ce1e 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_shipment.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_shipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_shipment_renderers" /> <referenceContainer name="content"> <block class="Magento\Shipping\Block\Order\Shipment" name="sales.order.shipment" after="sales.order.info"> @@ -38,4 +38,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_view.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_view.xml index 4b6e8b3e9018bb2ea71979178c57d3754819eb66..da76d9036b13f19dcd8a6ba19db69139074e9d1a 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_view.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="tracking/link.phtml"> <arguments> @@ -31,4 +31,4 @@ </arguments> </block> </referenceBlock> -</layout> \ No newline at end of file +</page> \ No newline at end of file diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_order_reorder.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_order_reorder.xml index 4b6e8b3e9018bb2ea71979178c57d3754819eb66..da76d9036b13f19dcd8a6ba19db69139074e9d1a 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_order_reorder.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_order_reorder.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="tracking/link.phtml"> <arguments> @@ -31,4 +31,4 @@ </arguments> </block> </referenceBlock> -</layout> \ No newline at end of file +</page> \ No newline at end of file diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_order_shipment.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_order_shipment.xml index 93e203f6427964dba79f246ec4d414c1099499d6..bc854833e09e23ebe584e65b0f2a621e798096da 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_order_shipment.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_order_shipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="sales_order_shipment_renderers" /> <referenceContainer name="content"> <block class="Magento\Shipping\Block\Order\Shipment" name="sales.order.shipment" cacheable="false"> @@ -38,4 +38,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_order_view.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_order_view.xml index 4b6e8b3e9018bb2ea71979178c57d3754819eb66..da76d9036b13f19dcd8a6ba19db69139074e9d1a 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_order_view.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_order_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="tracking/link.phtml"> <arguments> @@ -31,4 +31,4 @@ </arguments> </block> </referenceBlock> -</layout> \ No newline at end of file +</page> \ No newline at end of file diff --git a/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml b/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml index fff7a36923c0e2c2f798a561e4ec41408470240a..bf0cc30487473c2a25eab91dbcd236603b6c49de 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="page_empty" /> +<page layout="empty" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Shipping\Block\Tracking\Popup" name="shipping.tracking.popup" template="tracking/popup.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index e96bf61d3d7c6e1bbbc7d3c3dad179e0dc9869c0..89b13529810fd2ef78c6e8fcbc29c154d8109c9d 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index.xml b/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index.xml index 37cba9b629944ca80b4522aeba846726ad7f79d9..9ec852fc95bb1ab0cb73b3b5266b5cfeb4d14134 100644 --- a/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index.xml +++ b/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="adminhtml_sitemap_index_grid_block"/> <referenceContainer name="content"> <block class="Magento\Sitemap\Block\Adminhtml\Sitemap" name="adminhtml.sitemap.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index_grid_block.xml b/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index_grid_block.xml index 4b1ae97207d3707ab9d4b13219d5aac1cb49a685..8d8b8f4e7d477dc7f9df5ce28c66d4521e044955 100644 --- a/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index_grid_block.xml +++ b/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index_grid_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.sitemap.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.sitemap.container.grid" as="grid"> <arguments> @@ -96,4 +96,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index e258117055980e8cea97b32bd80e27aaa0dcbbac..1ec619f7eeb9774bd024cf5fec10f5cceefebe96 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-index": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-index": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Tax/Service/V1/Collection/TaxRateCollection.php b/app/code/Magento/Tax/Service/V1/Collection/TaxRateCollection.php index 51723253e1576fca2c81f3a2686a69de84eca699..d98d973389ee29bddebc2555819ff8e32457e213 100644 --- a/app/code/Magento/Tax/Service/V1/Collection/TaxRateCollection.php +++ b/app/code/Magento/Tax/Service/V1/Collection/TaxRateCollection.php @@ -31,6 +31,7 @@ use Magento\Framework\Service\V1\Data\SearchCriteriaBuilder; use Magento\Tax\Model\Calculation\Rate\Converter; use Magento\Tax\Service\V1\TaxRateServiceInterface; use Magento\Tax\Service\V1\Data\TaxRate; +use Magento\Framework\Service\V1\Data\SortOrderBuilder; /** * Tax rate collection for a grid backed by Services @@ -55,15 +56,17 @@ class TaxRateCollection extends AbstractServiceCollection * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param TaxRateServiceInterface $rateService * @param Converter $rateConverter + * @param SortOrderBuilder $sortOrderBuilder */ public function __construct( EntityFactory $entityFactory, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, + SortOrderBuilder $sortOrderBuilder, TaxRateServiceInterface $rateService, Converter $rateConverter ) { - parent::__construct($entityFactory, $filterBuilder, $searchCriteriaBuilder); + parent::__construct($entityFactory, $filterBuilder, $searchCriteriaBuilder, $sortOrderBuilder); $this->rateService = $rateService; $this->rateConverter = $rateConverter; } diff --git a/app/code/Magento/Tax/Service/V1/Collection/TaxRuleCollection.php b/app/code/Magento/Tax/Service/V1/Collection/TaxRuleCollection.php index 46aa4d16183cc2e1e56a50a81b81b5baaf627758..ee563608238f8c92610b6fd329d28e02422dcd43 100644 --- a/app/code/Magento/Tax/Service/V1/Collection/TaxRuleCollection.php +++ b/app/code/Magento/Tax/Service/V1/Collection/TaxRuleCollection.php @@ -31,6 +31,7 @@ use Magento\Framework\Service\V1\Data\SearchCriteriaBuilder; use Magento\Tax\Model\Calculation\TaxRuleConverter; use Magento\Tax\Service\V1\TaxRuleServiceInterface; use Magento\Tax\Service\V1\Data\TaxRule; +use Magento\Framework\Service\V1\Data\SortOrderBuilder; /** * Tax rule collection for a grid backed by Services @@ -55,15 +56,17 @@ class TaxRuleCollection extends AbstractServiceCollection * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param TaxRuleServiceInterface $ruleService * @param TaxRuleConverter $ruleConverter + * @param SortOrderBuilder $sortOrderBuilder */ public function __construct( EntityFactory $entityFactory, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, + SortOrderBuilder $sortOrderBuilder, TaxRuleServiceInterface $ruleService, TaxRuleConverter $ruleConverter ) { - parent::__construct($entityFactory, $filterBuilder, $searchCriteriaBuilder); + parent::__construct($entityFactory, $filterBuilder, $searchCriteriaBuilder, $sortOrderBuilder); $this->ruleService = $ruleService; $this->ruleConverter = $ruleConverter; } diff --git a/app/code/Magento/Tax/Service/V1/TaxClassService.php b/app/code/Magento/Tax/Service/V1/TaxClassService.php index 4303b9f219410feb1751b4a4d12740aaef535b5d..17fead87ae02d6311dfe8018ce491076b6f27eed 100644 --- a/app/code/Magento/Tax/Service/V1/TaxClassService.php +++ b/app/code/Magento/Tax/Service/V1/TaxClassService.php @@ -39,6 +39,7 @@ use Magento\Tax\Service\V1\Data\TaxClassSearchResultsBuilder; use Magento\Tax\Service\V1\Data\TaxClass as TaxClassDataObject; use Magento\Tax\Service\V1\Data\TaxClassKey; use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\Service\V1\Data\SortOrder; /** * Tax class service. @@ -247,9 +248,13 @@ class TaxClassService implements TaxClassServiceInterface } $this->searchResultsBuilder->setTotalCount($collection->getSize()); $sortOrders = $searchCriteria->getSortOrders(); + /** @var SortOrder $sortOrder */ if ($sortOrders) { - foreach ($searchCriteria->getSortOrders() as $field => $direction) { - $collection->addOrder($field, $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); + foreach ($searchCriteria->getSortOrders() as $sortOrder) { + $collection->addOrder( + $sortOrder->getField(), + ($sortOrder->getDirection() == SearchCriteria::SORT_ASC) ? 'ASC' : 'DESC' + ); } } $collection->setCurPage($searchCriteria->getCurrentPage()); diff --git a/app/code/Magento/Tax/Service/V1/TaxRateService.php b/app/code/Magento/Tax/Service/V1/TaxRateService.php index b2ef9054f71eb7482b7cd9cf971c88a909091b38..8c3ff014ee0744b55ed0939adb6bdc94a3d5b101 100644 --- a/app/code/Magento/Tax/Service/V1/TaxRateService.php +++ b/app/code/Magento/Tax/Service/V1/TaxRateService.php @@ -24,6 +24,8 @@ namespace Magento\Tax\Service\V1; +use Magento\Directory\Model\CountryFactory; +use Magento\Directory\Model\RegionFactory; use Magento\Framework\Exception\InputException; use Magento\Framework\Model\Exception as ModelException; use Magento\Framework\Service\V1\Data\Search\FilterGroup; @@ -35,6 +37,7 @@ use Magento\Tax\Model\Calculation\RateRegistry; use Magento\Tax\Model\Resource\Calculation\Rate\Collection; use Magento\Tax\Service\V1\Data\TaxRate as TaxRateDataObject; use Magento\Tax\Service\V1\Data\TaxRateBuilder; +use Magento\Framework\Service\V1\Data\SortOrder; /** * Handles tax rate CRUD operations @@ -75,6 +78,16 @@ class TaxRateService implements TaxRateServiceInterface */ private $rateFactory; + /** + * @var \Magento\Directory\Model\CountryFactory + */ + protected $countryFactory; + + /** + * @var \Magento\Directory\Model\RegionFactory + */ + protected $regionFactory; + /** * Constructor * @@ -83,19 +96,25 @@ class TaxRateService implements TaxRateServiceInterface * @param RateRegistry $rateRegistry * @param Data\TaxRateSearchResultsBuilder $taxRateSearchResultsBuilder * @param RateFactory $rateFactory + * @param CountryFactory $countryFactory + * @param RegionFactory $regionFactory */ public function __construct( TaxRateBuilder $rateBuilder, Converter $converter, RateRegistry $rateRegistry, Data\TaxRateSearchResultsBuilder $taxRateSearchResultsBuilder, - RateFactory $rateFactory + RateFactory $rateFactory, + CountryFactory $countryFactory, + RegionFactory $regionFactory ) { $this->rateBuilder = $rateBuilder; $this->converter = $converter; $this->rateRegistry = $rateRegistry; $this->taxRateSearchResultsBuilder = $taxRateSearchResultsBuilder; $this->rateFactory = $rateFactory; + $this->countryFactory = $countryFactory; + $this->regionFactory = $regionFactory; } /** @@ -158,11 +177,12 @@ class TaxRateService implements TaxRateServiceInterface } $sortOrders = $searchCriteria->getSortOrders(); + /** @var SortOrder $sortOrder */ if ($sortOrders) { - foreach ($sortOrders as $field => $direction) { + foreach ($sortOrders as $sortOrder) { $collection->addOrder( - $this->translateField($field), - $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC' + $this->translateField($sortOrder->getField()), + ($sortOrder->getDirection() == SearchCriteria::SORT_ASC) ? 'ASC' : 'DESC' ); } } @@ -267,12 +287,24 @@ class TaxRateService implements TaxRateServiceInterface private function validate(TaxRateDataObject $taxRate) { $exception = new InputException(); - if (!\Zend_Validate::is(trim($taxRate->getCountryId()), 'NotEmpty')) { + + $countryCode = $taxRate->getCountryId(); + if (!\Zend_Validate::is($countryCode, 'NotEmpty')) { $exception->addError(InputException::REQUIRED_FIELD, ['fieldName' => 'country_id']); + } else if (!\Zend_Validate::is($this->countryFactory->create()->loadByCode($countryCode)->getId(), 'NotEmpty')) { + $exception->addError(InputException::INVALID_FIELD_VALUE, ['fieldName' => 'country_id', 'value' => $countryCode]); + } + + $regionCode = $taxRate->getRegionId(); + if (\Zend_Validate::is($regionCode, 'NotEmpty') && + !\Zend_Validate::is($this->regionFactory->create()->load($regionCode)->getId(), 'NotEmpty')) { + $exception->addError(InputException::INVALID_FIELD_VALUE, ['fieldName' => 'region_id', 'value' => $regionCode]); } - if (!\Zend_Validate::is(trim($taxRate->getPercentageRate()), 'NotEmpty')) { + + if (!\Zend_Validate::is($taxRate->getPercentageRate(), 'NotEmpty')) { $exception->addError(InputException::REQUIRED_FIELD, ['fieldName' => 'percentage_rate']); } + if (!\Zend_Validate::is(trim($taxRate->getCode()), 'NotEmpty')) { $exception->addError(InputException::REQUIRED_FIELD, ['fieldName' => 'code']); } diff --git a/app/code/Magento/Tax/Service/V1/TaxRuleService.php b/app/code/Magento/Tax/Service/V1/TaxRuleService.php index 468e2c728fbb0be75856786b71f78ec3a506d9c3..dc20b4eb17e2eca157163c9a380c2885f1a34615 100644 --- a/app/code/Magento/Tax/Service/V1/TaxRuleService.php +++ b/app/code/Magento/Tax/Service/V1/TaxRuleService.php @@ -39,6 +39,7 @@ use Magento\Tax\Model\Calculation\TaxRuleRegistry; use Magento\Tax\Model\Resource\Calculation\Rule\Collection; use Magento\Tax\Service\V1\Data\TaxRule; use Magento\Tax\Service\V1\Data\TaxRuleBuilder; +use Magento\Framework\Service\V1\Data\SortOrder; /** * TaxRuleService implementation. @@ -196,10 +197,13 @@ class TaxRuleService implements TaxRuleServiceInterface $this->taxRuleSearchResultsBuilder->setTotalCount($collection->getSize()); $sortOrders = $searchCriteria->getSortOrders(); + /** @var SortOrder $sortOrder */ if ($sortOrders) { - foreach ($sortOrders as $sortField => $direction) { - $sortField = $this->translateField($sortField); - $collection->addOrder($sortField, $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); + foreach ($sortOrders as $sortOrder) { + $collection->addOrder( + $this->translateField($sortOrder->getField()), + ($sortOrder->getDirection() == SearchCriteria::SORT_ASC) ? 'ASC' : 'DESC' + ); } } $collection->setCurPage($searchCriteria->getCurrentPage()); diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index 965f34bc6c6869d23c3d1867ffc1298229afd016..e7870a63e7aa516c290a28a2082f50f3955f7530 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -3,24 +3,24 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-shipping": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-reports": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-configurable-product": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-shipping": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-reports": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-configurable-product": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 b3909d69eb580319914779410561a6d26f307c0a..a727e22c4a6e2f8245a39b97793076d1790fa75a 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.tax.rate.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.tax.rate.grid" as="grid"> <arguments> @@ -107,4 +107,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 c87d7d8dfb1693167ae022c044ee00c26530acc6..db2c8d3bcb6577c626702e15c6c32616e2815058 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="tax_rate_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.tax.rate.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 c87d7d8dfb1693167ae022c044ee00c26530acc6..db2c8d3bcb6577c626702e15c6c32616e2815058 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="tax_rate_block"/> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.tax.rate.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> -</layout> +</page> 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 5475db241a5ceb8d176c19af2eb8453160558de8..a75f37afab875a7df9e2fb0fb508d783b4b761db 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="tax_rate_block"/> <referenceContainer name="content"> <block class="Magento\Tax\Block\Adminhtml\Rate\Toolbar\Add" name="adminhtml.tax.rate.container"/> </referenceContainer> -</layout> +</page> 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 92263d40e7567823236f6666a8dfa38fb17f3672..2febdb049fe381d2655645efd540e080ff767729 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.block.tax.rule.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.tax.rule.grid" as="grid"> <arguments> @@ -111,4 +111,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 d871569d3e2ef6be37f14ec49140a2611c598ede..59185d8a3696a941a5a8ba3a61f2a7beaa557694 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Script" name="magento-tax-js-bootstrap-js"> <arguments> @@ -47,4 +47,4 @@ <block class="Magento\Tax\Block\Adminhtml\Rate\Form" name="tax-rate-form" template="rule/rate/form.phtml"/> <block class="Magento\Tax\Block\Adminhtml\Rate\ImportExport" name="tax-rate-importExport" template="importExport.phtml"/> </referenceContainer> -</layout> +</page> 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 7ad624d47551c05ae39a765635390a2646b243e6..fe1b33ac63a79933ccdbf0a34c90a638e6295f01 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="tax_rule_block"/> <referenceContainer name="content"> <block class="Magento\Tax\Block\Adminhtml\Rule" name="adminhtml.block.tax.rule.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Tax/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Tax/view/base/layout/catalog_product_prices.xml index fdecd4bc1b228004be313a43e66e41c166b52b17..28f07d0436d556700183f6f68dd7f64872285c9d 100644 --- a/app/code/Magento/Tax/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Tax/view/base/layout/catalog_product_prices.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="default" xsi:type="array"> @@ -58,4 +58,4 @@ </argument> </arguments> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml index 58f761eb8bfd72d5e146323f593ffd720e42bdaf..4a7c05da9b69e937201385093cdcf94e61347f65 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="minicart"> <block class="Magento\Tax\Block\Item\Price\Renderer" name="checkout.cart.item.price.sidebar" template="Magento_Tax::checkout/cart/item/price/sidebar.phtml"/> </referenceBlock> -</layout> +</page> 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 f0228cef99661c01b23d133c24628478f6c4cdae..3c829978e10ef1716a3e3d28d0c03be2e1d1c5ce 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="minicart"> <block class="Magento\Tax\Block\Checkout\Cart\Sidebar\Totals" name="checkout.cart.minicart.totals" template="Magento_Tax::checkout/cart/minicart/totals.phtml"/> </referenceBlock> -</layout> +</page> 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 704ad0daf234a7b4b34ce4fbf7a557d5a28c2740..25a44a7eb4e36126535c1110c91ef8da9c4c17ca 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 @@ -23,8 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Tax\Block\Item\Price\Renderer" name="checkout.item.price.unit" template="Magento_Tax::item/price/unit.phtml"/> <block class="Magento\Tax\Block\Item\Price\Renderer" name="checkout.item.price.row" template="Magento_Tax::item/price/row.phtml"/> -</layout> - +</page> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml index 60ff63f42601c9e3d7c42c0138963802db25195e..da72a8d91a78db3c19aa20b92528d64a64fcf10c 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Tax\Block\Checkout\Shipping\Price" name="checkout.shipping.price" as="shipping.price" template="Magento_Tax::checkout/shipping/price.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Theme/Block/Html/Body.php b/app/code/Magento/Theme/Block/Html/Body.php new file mode 100644 index 0000000000000000000000000000000000000000..4fe82bdf15944c4f928a0c6b5574708382fb4a9b --- /dev/null +++ b/app/code/Magento/Theme/Block/Html/Body.php @@ -0,0 +1,65 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Theme\Block\Html; + +use \Magento\Framework\View\Element\AbstractBlock; + +/** + * Temporary block to replace some logic from root block + */ +class Body extends AbstractBlock +{ + /** + * @var \Magento\Framework\View\Page\Config + */ + protected $pageConfig; + + /** + * Construct + * + * @param \Magento\Framework\View\Element\Context $context + * @param \Magento\Framework\View\Page\Config $pageConfig + * @param array $data + */ + public function __construct( + \Magento\Framework\View\Element\Context $context, + \Magento\Framework\View\Page\Config $pageConfig, + array $data = array() + ) { + $this->pageConfig = $pageConfig; + parent::__construct($context, $data); + } + + /** + * Add body class to page configuration api + * + * @param string $bodyClass + * @return $this + */ + public function addBodyClass($bodyClass) + { + $this->pageConfig->addBodyClass($bodyClass); + return $this; + } +} diff --git a/app/code/Magento/Theme/Block/Html/Title.php b/app/code/Magento/Theme/Block/Html/Title.php index ff7d1a358365bbf30f9f6bc250d88ebe6fb78ab0..ebf789c77fdd33f12012001129fedf781e9971c4 100644 --- a/app/code/Magento/Theme/Block/Html/Title.php +++ b/app/code/Magento/Theme/Block/Html/Title.php @@ -23,6 +23,8 @@ */ namespace Magento\Theme\Block\Html; +use Magento\Framework\View\Element\Template; + /** * Html page title block */ @@ -35,6 +37,25 @@ class Title extends \Magento\Framework\View\Element\Template */ protected $_pageTitle; + /** + * @var \Magento\Framework\View\Page\Config + */ + protected $pageConfig; + + /** + * @param Template\Context $context + * @param \Magento\Framework\View\Page\Config $pageConfig + * @param array $data + */ + public function __construct( + Template\Context $context, + \Magento\Framework\View\Page\Config $pageConfig, + array $data = array() + ) { + $this->pageConfig = $pageConfig; + parent::__construct($context, $data); + } + /** * Provide own page title or pick it from Head Block * @@ -57,5 +78,7 @@ class Title extends \Magento\Framework\View\Element\Template public function setPageTitle($pageTitle) { $this->_pageTitle = $pageTitle; + $this->pageConfig->setTitle($pageTitle); + return $this; } } diff --git a/app/code/Magento/Theme/Helper/Layout.php b/app/code/Magento/Theme/Helper/Layout.php deleted file mode 100644 index e510d26d30cb3e1673933808c9d93365fe3f26f1..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/Helper/Layout.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Theme\Helper; - -class Layout extends \Magento\Framework\App\Helper\AbstractHelper -{ - /** - * @var \Magento\Framework\View\LayoutInterface - */ - protected $_layout; - - /** - * @var \Magento\Theme\Model\Layout\Config - */ - protected $_config; - - /** - * @param \Magento\Framework\App\Helper\Context $context - * @param \Magento\Theme\Model\Layout\Config $config - * @param \Magento\Framework\View\LayoutInterface $layout - */ - public function __construct( - \Magento\Framework\App\Helper\Context $context, - \Magento\Theme\Model\Layout\Config $config, - \Magento\Framework\View\LayoutInterface $layout - ) { - $this->_layout = $layout; - $this->_config = $config; - parent::__construct($context); - } - - /** - * Apply page layout handle - * - * @param string $pageLayout - * @return \Magento\Theme\Helper\Layout - */ - public function applyHandle($pageLayout) - { - $pageLayout = $this->_config->getPageLayout($pageLayout); - - if (!$pageLayout) { - return $this; - } - - $this->_layout->getUpdate()->addHandle($pageLayout->getLayoutHandle()); - - return $this; - } - - /** - * Apply page layout template - * (for old design packages) - * - * @param string $pageLayout - * @return \Magento\Theme\Helper\Layout - */ - public function applyTemplate($pageLayout = null) - { - if ($pageLayout === null) { - $pageLayout = $this->getCurrentPageLayout(); - } else { - $pageLayout = $this->_config->getPageLayout($pageLayout); - } - - if (!$pageLayout) { - return $this; - } - - if ($this->_layout->getBlock('root') && !$this->_layout->getBlock('root')->getIsHandle()) { - // If not applied handle - $this->_layout->getBlock('root')->setTemplate($pageLayout->getTemplate()); - } - - return $this; - } - - /** - * Retrieve current applied page layout - * - * @return \Magento\Framework\Object|boolean - */ - public function getCurrentPageLayout() - { - if ($this->_layout->getBlock('root') && $this->_layout->getBlock('root')->getLayoutCode()) { - return $this->_config->getPageLayout($this->_layout->getBlock('root')->getLayoutCode()); - } - - // All loaded handles - $handles = $this->_layout->getUpdate()->getHandles(); - // Handles used in page layouts - $pageLayoutHandles = $this->_config->getPageLayoutHandles(); - // Applied page layout handles - $appliedHandles = array_intersect($handles, $pageLayoutHandles); - - if (empty($appliedHandles)) { - return false; - } - - $currentHandle = array_pop($appliedHandles); - - $layoutCode = array_search($currentHandle, $pageLayoutHandles, true); - - return $this->_config->getPageLayout($layoutCode); - } -} diff --git a/app/code/Magento/Theme/Model/Layout/Config.php b/app/code/Magento/Theme/Model/Layout/Config.php index 1f62680ef40187ca77897338e5c3782bba13c969..c14f79ab54495851d77646d510af813d354e366b 100644 --- a/app/code/Magento/Theme/Model/Layout/Config.php +++ b/app/code/Magento/Theme/Model/Layout/Config.php @@ -1,7 +1,5 @@ <?php /** - * Page layout config model - * * Magento * * NOTICE OF LICENSE @@ -25,6 +23,9 @@ */ namespace Magento\Theme\Model\Layout; +/** + * Page layout config model + */ class Config { /** @@ -32,7 +33,7 @@ class Config * * @var array */ - protected $_pageLayouts = null; + protected $_pageLayouts; /** @var \Magento\Framework\Config\DataInterface */ protected $_dataStorage; @@ -102,7 +103,7 @@ class Config $handles = array(); foreach ($this->getPageLayouts() as $layout) { - $handles[$layout->getCode()] = $layout->getLayoutHandle(); + $handles[$layout->getCode()] = $layout->getCode(); } return $handles; diff --git a/app/code/Magento/Theme/Model/Layout/Config/Converter.php b/app/code/Magento/Theme/Model/Layout/Config/Converter.php index 6f96babb529cf681829c8c55f1a830c1c4ebb066..cb25ae014b35bf300c50f7547858efad38b34209 100644 --- a/app/code/Magento/Theme/Model/Layout/Config/Converter.php +++ b/app/code/Magento/Theme/Model/Layout/Config/Converter.php @@ -35,21 +35,16 @@ class Converter implements \Magento\Framework\Config\ConverterInterface $pageLayouts = array(); $xpath = new \DOMXPath($source); - $defaultLayout = $xpath->query('/page_layouts/layouts')->item(0)->getAttribute('default'); - /** @var $layout DOMNode */ - foreach ($xpath->query('/page_layouts/layouts/layout') as $layout) { + foreach ($xpath->query('/page_layouts/layout') as $layout) { $layoutAttributes = $layout->attributes; $id = $layoutAttributes->getNamedItem('id')->nodeValue; $pageLayouts[$id]['code'] = $id; - $pageLayouts[$id]['is_default'] = $defaultLayout === $id ? 1 : 0; /** @var $layoutSubNode DOMNode */ foreach ($layout->childNodes as $layoutSubNode) { switch ($layoutSubNode->nodeName) { case 'label': - case 'template': - case 'layout_handle': $pageLayouts[$id][$layoutSubNode->nodeName] = $layoutSubNode->nodeValue; break; default: diff --git a/app/code/Magento/Theme/Model/Layout/Config/Reader.php b/app/code/Magento/Theme/Model/Layout/Config/Reader.php index c2be6bfd9a71c93d650b6fc4433494c2f0c59e04..6c6a20a7cf9b805092dc4157d48c7d61dd50fd8e 100644 --- a/app/code/Magento/Theme/Model/Layout/Config/Reader.php +++ b/app/code/Magento/Theme/Model/Layout/Config/Reader.php @@ -1,7 +1,5 @@ <?php /** - * Page layout config reader - * * Magento * * NOTICE OF LICENSE @@ -25,6 +23,9 @@ */ namespace Magento\Theme\Model\Layout\Config; +/** + * Page layout config reader + */ class Reader extends \Magento\Framework\Config\Reader\Filesystem { /** @@ -32,5 +33,5 @@ class Reader extends \Magento\Framework\Config\Reader\Filesystem * * @var array */ - protected $_idAttributes = array('/page_layouts/layouts/layout' => 'id'); + protected $_idAttributes = array('/page_layouts/layout' => 'id'); } diff --git a/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php b/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php index c5aba62193bcada31d23109074220ef349420aae..1d3350dc01e399a312faba2449ddb0f290fea4e3 100644 --- a/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php +++ b/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php @@ -25,6 +25,8 @@ */ namespace Magento\Theme\Model\Layout\Config; +use Magento\Framework\App\Filesystem; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -32,22 +34,15 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface * * @var string */ - protected $_schema = null; + protected $_schema; /** - * Path to corresponding XSD file with validation rules for separate config files - * - * @var string + * @param \Magento\Framework\App\Filesystem $appFilesystem */ - protected $_perFileSchema = null; - - /** - * @param \Magento\Framework\Module\Dir\Reader $moduleReader - */ - public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) + public function __construct(Filesystem $appFilesystem) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Theme') . '/page_layouts.xsd'; - $this->_perFileSchema = $moduleReader->getModuleDir('etc', 'Magento_Theme') . '/page_layouts_file.xsd'; + $this->_schema = $appFilesystem->getPath(Filesystem::LIB_INTERNAL) + . '/Magento/Framework/View/PageLayout/etc/layouts.xsd'; } /** @@ -67,6 +62,6 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getPerFileSchema() { - return $this->_perFileSchema; + return $this->_schema; } } diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index 4fe9b958cc444f8bae5896186e7c0db42fddc2bd..52a8f435b0d876bc32621dea7423116c4d0fdd42 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-translation": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-translation": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Theme/etc/di.xml b/app/code/Magento/Theme/etc/di.xml index 8e15a13552e34dd372c7db417c1b7a1d1a1bfe0d..ef96fbd1caf631259dc112b48ec7b20707c82374 100644 --- a/app/code/Magento/Theme/etc/di.xml +++ b/app/code/Magento/Theme/etc/di.xml @@ -40,7 +40,7 @@ </type> <type name="Magento\Theme\Model\Layout\Config\Reader"> <arguments> - <argument name="fileName" xsi:type="string">page_layouts.xml</argument> + <argument name="fileName" xsi:type="string">layouts.xml</argument> <argument name="converter" xsi:type="object">Magento\Theme\Model\Layout\Config\Converter</argument> <argument name="schemaLocator" xsi:type="object">Magento\Theme\Model\Layout\Config\SchemaLocator</argument> </arguments> diff --git a/app/code/Magento/Theme/etc/page_layouts.xml b/app/code/Magento/Theme/etc/page_layouts.xml deleted file mode 100644 index f04ee21ba1d07d64861f697313b4c8711c991ec8..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/etc/page_layouts.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./page_layouts.xsd"> - <layouts default="one_column"> - <layout id="empty"> - <label translate="true">Empty</label> - <template>empty.phtml</template> - <layout_handle>page_empty</layout_handle> - </layout> - <layout id="one_column"> - <label translate="true">1 column</label> - <template>1column.phtml</template> - <layout_handle>page_one_column</layout_handle> - </layout> - <layout id="two_columns_left"> - <label translate="true">2 columns with left bar</label> - <template>2columns-left.phtml</template> - <layout_handle>page_two_columns_left</layout_handle> - </layout> - <layout id="two_columns_right"> - <label translate="true">2 columns with right bar</label> - <template>2columns-right.phtml</template> - <layout_handle>page_two_columns_right</layout_handle> - </layout> - <layout id="three_columns"> - <label translate="true">3 columns</label> - <template>3columns.phtml</template> - <layout_handle>page_three_columns</layout_handle> - </layout> - </layouts> -</page_layouts> diff --git a/app/code/Magento/Theme/etc/page_layouts_file.xsd b/app/code/Magento/Theme/etc/page_layouts_file.xsd deleted file mode 100644 index cb0af1c94e660de9460769f08d3f7a19a10cf5d7..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/etc/page_layouts_file.xsd +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="page_layouts"> - <xs:annotation> - <xs:documentation> - The root node for page layouts - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence minOccurs="0"> - <xs:element name="layouts" type="layoutsType" /> - </xs:sequence> - </xs:complexType> - </xs:element> - - <xs:complexType name="layoutsType"> - <xs:annotation> - <xs:documentation> - The containing element for a list of layouts - </xs:documentation> - </xs:annotation> - <xs:sequence minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" type="layoutType" /> - </xs:sequence> - <xs:attribute name="default" use="optional" type="xs:string" /> - </xs:complexType> - - <xs:complexType name="layoutType"> - <xs:annotation> - <xs:documentation> - The definition of a layout, with a label, template and layout handle - </xs:documentation> - </xs:annotation> - <xs:all> - <xs:element name="label" type="translatableType" minOccurs="0" /> - <xs:element name="template" type="xs:string" minOccurs="0" /> - <xs:element name="layout_handle" type="xs:string" minOccurs="0" /> - </xs:all> - <xs:attribute name="id" type="xs:ID" use="required" /> - </xs:complexType> - - <xs:complexType name="translatableType"> - <xs:simpleContent> - <xs:extension base="xs:string"> - <xs:attribute name="translate" use="optional" fixed="true" type="xs:boolean" /> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - -</xs:schema> diff --git a/app/code/Magento/Theme/view/adminhtml/layout/admin-1column.xml b/app/code/Magento/Theme/view/adminhtml/layout/admin-1column.xml new file mode 100644 index 0000000000000000000000000000000000000000..553178f7cda95ea0018badaf5aa1642999ebfd11 --- /dev/null +++ b/app/code/Magento/Theme/view/adminhtml/layout/admin-1column.xml @@ -0,0 +1,60 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <container name="root"> + <container name="backend.page"> + <container name="page.wrapper" as="page_wrapper" htmlTag="div" htmlClass="page-wrapper"> + <container name="notification.window" as="notification_window"/> + <container name="global.notices" as="global_notices"/> + <container name="page.header.wrapper" as="page_header_wrapper" htmlTag="div" htmlClass="page-header-wrapper"> + <container name="header" htmlTag="header" htmlClass="page-header"/> + </container> + <container name="page.menu" as="page.menu"/> + <container name="notifications" as="notifications" after="page.menu"/> + <container name="page.breadcrumbs" as="page.breadcrumbs"/> + + <container name="page.formkey" as="page.formkey"/> + <container name="page.js.translate" as="page.js.translate"/> + + <container name="page.content" as="page_content" htmlTag="section" htmlId="anchor-content" htmlClass="page-content"> + <container name="main.top" as="main-top" label="main-top"/> + <container name="messages.wrapper" as="messages.wrapper" htmlTag="div" htmlId="messages" htmlClass="messages"> + <container name="page.messages" as="page.messages"/> + </container> + <container name="page.main.actions" as="page_main_actions" htmlTag="div" htmlClass="page-main-actions"/> + <container name="page.main.container" as="page_main_container" htmlId="page:main-container" htmlTag="div" htmlClass="col-1-layout"> + <container name="content" as="content"/> + </container> + </container> + <container name="js" as="js" label="JavaScript"/> + <container name="page.footer.wrapper" as="page_footer_wrapper" htmlTag="div" htmlClass="page-footer-wrapper"> + <container name="footer" htmlTag="footer" htmlClass="page-footer"/> + </container> + </container> + <container name="before.body.end" as="before_body_end" label="Before Body End"/> + </container> + </container> +</layout> diff --git a/app/code/Magento/Theme/view/adminhtml/layout/admin-2columns-left.xml b/app/code/Magento/Theme/view/adminhtml/layout/admin-2columns-left.xml new file mode 100644 index 0000000000000000000000000000000000000000..97dbcaa0e3f9ddec2c3b843bc019b8a7501e2e78 --- /dev/null +++ b/app/code/Magento/Theme/view/adminhtml/layout/admin-2columns-left.xml @@ -0,0 +1,65 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <container name="root"> + <container name="backend.page"> + <container name="page.wrapper" as="page_wrapper" htmlTag="div" htmlClass="page-wrapper"> + <container name="notification.window" as="notification_window"/> + <container name="global.notices" as="global_notices"/> + <container name="page.header.wrapper" as="page_header_wrapper" htmlTag="div" htmlClass="page-header-wrapper"> + <container name="header" htmlTag="header" htmlClass="page-header"/> + </container> + <container name="page.menu" as="page.menu"/> + <container name="notifications" as="notifications" after="page.menu"/> + <container name="page.breadcrumbs" as="page.breadcrumbs"/> + + <container name="page.formkey" as="page.formkey"/> + <container name="page.js.translate" as="page.js.translate"/> + + <container name="page.content" as="page_content" htmlTag="section" htmlId="anchor-content" htmlClass="page-content"> + <container name="main.top" as="main-top" label="main-top"/> + <container name="messages.wrapper" as="messages.wrapper" htmlTag="div" htmlId="messages" htmlClass="messages"> + <container name="page.messages" as="page.messages"/> + </container> + <container name="page.main.actions" as="page_main_actions" htmlTag="div" htmlClass="page-main-actions"/> + <container name="page.main.container" as="page_main_container" htmlId="page:main-container" htmlTag="div" htmlClass="col-2-left-layout"> + <container name="main.col" as="main-col" htmlId="container" htmlTag="div" htmlClass="main-col"> + <container name="content" as="content"/> + </container> + <container name="side.col" as="side-col" htmlId="page:left" htmlTag="div" htmlClass="side-col"> + <container name="left" as="left"/> + </container> + </container> + </container> + <container name="js" as="js" label="JavaScript"/> + <container name="page.footer.wrapper" as="page_footer_wrapper" htmlTag="div"> + <container name="footer" htmlTag="footer" htmlClass="page-footer"/> + </container> + </container> + <container name="before.body.end" as="before_body_end" label="Before Body End"/> + </container> + </container> +</layout> diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_block.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_block.xml index b736a4b1278efcc797609e050ed1db5adacf7b4c..90a9a27060e3916da720854a6a2565042b6b50b2 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_block.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="design_theme"> <block class="Magento\Backend\Block\Widget\Grid" name="theme.grid" as="grid"> <arguments> @@ -80,4 +80,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 35616ec217ea3d56fe5589ec85429f520cb1eef1..90c87ce86687a8eb081e19ad3c0f623a58105104 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setCanLoadExtJs"> <argument name="flag" xsi:type="string">1</argument> @@ -80,4 +80,4 @@ </action> </block> </referenceContainer> -</layout> +</page> 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 71c18a32cc175484775a5aac52a0628605f23190..8b5fb420653bb60ce2e0785886b37f48665b112d 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_design_theme_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="design_theme" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="design_theme" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 8bed3a41c5c39a1a68f58527f7864712f93e430f..9ced30268d93e9c11ef83d2d58ee155253e80743 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_design_theme_block"/> <referenceContainer name="content"> <block class="Magento\Theme\Block\Adminhtml\System\Design\Theme" name="design_theme"/> </referenceContainer> -</layout> +</page> 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 27b72b9dbea907afd720fc0e8718485741bb3a6f..e9ad75a02c28996940a18f6c659a9610966d18ed 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 @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Theme\Block\Adminhtml\Wysiwyg\Files\Content\Files" name="wysiwyg_files.files" template="browser/content/files.phtml" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Theme\Block\Adminhtml\Wysiwyg\Files\Content\Files" name="wysiwyg_files.files" template="browser/content/files.phtml"/> + </container> </layout> 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 f1630a502ef08b077b41fcf8583081802c613935..32769a0aa4c1e6b81671fe151d0febe819ef4dde 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <remove name="footer"/> <remove name="head"/> <referenceContainer name="left"> @@ -34,4 +34,4 @@ <block class="Magento\Theme\Block\Adminhtml\Wysiwyg\Files\Content\Uploader" name="wysiwyg_files.uploader" template="browser/content/uploader.phtml"/> </block> </referenceContainer> -</layout> +</page> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts.xml b/app/code/Magento/Theme/view/adminhtml/layouts.xml similarity index 72% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts.xml rename to app/code/Magento/Theme/view/adminhtml/layouts.xml index c40f99c0ce0690d577efda1accd7a8b05c06d7cc..e1c4b92ebc679af8d42b04f49c2370392cb1e82d 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts.xml +++ b/app/code/Magento/Theme/view/adminhtml/layouts.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Magento @@ -23,13 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> - <layouts default="empty"> - <layout id="empty"> - <label translate="true">Empty</label> - <template>empty.phtml</template> - <layout_handle>page_empty</layout_handle> - </layout> - </layouts> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> + <layout id="admin-1column"> + <label translate="true">Admin 1column</label> + </layout> + <layout id="admin-2columns-left"> + <label translate="true">Admin 1column</label> + </layout> </page_layouts> diff --git a/app/code/Magento/Theme/view/frontend/layout/page_two_columns_left.xml b/app/code/Magento/Theme/view/base/layout/empty.xml similarity index 52% rename from app/code/Magento/Theme/view/frontend/layout/page_two_columns_left.xml rename to app/code/Magento/Theme/view/base/layout/empty.xml index 4c3d5bbdc3e0c45aa73815ced8574d959cb0e263..cf6f0a936eda3fa1f5cd28e2ce5470508d237a69 100644 --- a/app/code/Magento/Theme/view/frontend/layout/page_two_columns_left.xml +++ b/app/code/Magento/Theme/view/base/layout/empty.xml @@ -23,17 +23,19 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All Two-Column Layout Pages (Left Column)" design_abstraction="page_layout"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">2columns-left.phtml</argument> - </action> - <!-- Mark root page block that template is applied --> - <action method="setIsHandle"> - <argument name="applied" xsi:type="string">1</argument> - </action> - <action method="setLayoutCode"> - <argument name="name" xsi:type="string">two_columns_left</argument> - </action> - </referenceBlock> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <container name="root"> + <container name="after.body.start" as="after.body.start" label="Page Top"/> + <container name="page.wrapper" as="page_wrapper" htmlTag="div" htmlClass="page-wrapper"> + <container name="global.notices" as="global_notices"/> + <container name="main.content" htmlTag="section" htmlId="maincontent" htmlClass="page main"> + <container name="columns.top" label="Before Main Columns"/> + <container name="columns" htmlTag="div" htmlClass="columns"> + <container name="main" label="Main Content Container" htmlTag="div" htmlClass="column main"/> + </container> + </container> + <container name="page.bottom" as="page_bottom" label="Before Page Footer Container" htmlTag="div" htmlClass="page bottom"/> + <container name="before.body.end" as="before_body_end" label="Page Bottom"/> + </container> + </container> </layout> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts.xml b/app/code/Magento/Theme/view/base/layouts.xml similarity index 74% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts.xml rename to app/code/Magento/Theme/view/base/layouts.xml index 54c7fcba28409cfc512a12d2c8455649a6b52679..65833576a546bb6fd5220ddd382ffa92cc6c688b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts.xml +++ b/app/code/Magento/Theme/view/base/layouts.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Magento @@ -23,12 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> - <layouts default="bad_ref"> - <layout id="empty"> - <template>empty.phtml</template> - <layout_handle>page_empty</layout_handle> - </layout> - </layouts> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> + <layout id="empty"> + <label translate="true">Empty</label> + </layout> </page_layouts> diff --git a/app/code/Magento/Theme/view/base/templates/root.phtml b/app/code/Magento/Theme/view/base/templates/root.phtml new file mode 100644 index 0000000000000000000000000000000000000000..3308150a6f58a92b1dabe7270bace3865ac92528 --- /dev/null +++ b/app/code/Magento/Theme/view/base/templates/root.phtml @@ -0,0 +1,39 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<!doctype html> +<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $htmlAttributes ?>> +<head> + <meta charset="utf-8"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> + <?php echo $headContent ?> +</head> +<body data-container="body" data-mage-init='{"loaderAjax": {}, "loader": {}}'<?php + echo !empty($bodyClasses) ? ' class="' . $bodyClasses . '"' : ''; + echo !empty($bodyAttributes) ? $bodyAttributes : ''; +?>> +<?php echo $layoutContent ?> +</body> +</html> diff --git a/app/code/Magento/Theme/view/frontend/layout/page_empty.xml b/app/code/Magento/Theme/view/frontend/layout/1column.xml similarity index 65% rename from app/code/Magento/Theme/view/frontend/layout/page_empty.xml rename to app/code/Magento/Theme/view/frontend/layout/1column.xml index c3e50215fa850403ce0467e2e8a01abd89483150..ed74cfccf932cb5c4f9152c204d3f2a944f0be4a 100644 --- a/app/code/Magento/Theme/view/frontend/layout/page_empty.xml +++ b/app/code/Magento/Theme/view/frontend/layout/1column.xml @@ -23,17 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All Empty Layout Pages" design_abstraction="page_layout"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">empty.phtml</argument> - </action> - <!-- Mark root page block that template is applied --> - <action method="setIsHandle"> - <argument name="applied" xsi:type="string">1</argument> - </action> - <action method="setLayoutCode"> - <argument name="name" xsi:type="string">empty</argument> - </action> - </referenceBlock> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="empty"/> + <referenceContainer name="page.wrapper"> + <container name="header.container" as="header_container" label="Page Header Container" htmlTag="header" htmlClass="page-header" after="global.notices"/> + <container name="page.top" as="page_top" label="After Page Header" after="header.container"/> + <container name="footer" label="Page Footer" htmlTag="div" htmlClass="footer content" after="page.bottom" before="before.body.end"/> + </referenceContainer> </layout> diff --git a/app/code/Magento/Theme/view/frontend/layout/2columns-left.xml b/app/code/Magento/Theme/view/frontend/layout/2columns-left.xml new file mode 100644 index 0000000000000000000000000000000000000000..04c62860a2d49143b56592a2fb2e6239908cdb38 --- /dev/null +++ b/app/code/Magento/Theme/view/frontend/layout/2columns-left.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="1column"/> + <referenceContainer name="columns"> + <container name="div.sidebar.main" htmlTag="div" htmlClass="sidebar sidebar-main" after="main"> + <container name="sidebar.main" as="sidebar_main" label="Sidebar Main"/> + </container> + </referenceContainer> +</layout> diff --git a/app/code/Magento/Theme/view/frontend/layout/2columns-right.xml b/app/code/Magento/Theme/view/frontend/layout/2columns-right.xml new file mode 100644 index 0000000000000000000000000000000000000000..0eb12f519a481f11db33fdd1e896488a5969c5f0 --- /dev/null +++ b/app/code/Magento/Theme/view/frontend/layout/2columns-right.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="1column"/> + <referenceContainer name="columns"> + <container name="div.sidebar.additional" htmlTag="div" htmlClass="sidebar sidebar-additional" after="main"> + <container name="sidebar.additional" as="sidebar_additional" label="Sidebar Additional"/> + </container> + </referenceContainer> +</layout> diff --git a/app/code/Magento/Theme/view/frontend/layout/3columns.xml b/app/code/Magento/Theme/view/frontend/layout/3columns.xml new file mode 100644 index 0000000000000000000000000000000000000000..d42c7a1de69c53cc6c0914972b5ef0a82b3dca85 --- /dev/null +++ b/app/code/Magento/Theme/view/frontend/layout/3columns.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="2columns-left"/> + <referenceContainer name="columns"> + <container name="div.sidebar.additional" htmlTag="div" htmlClass="sidebar sidebar-additional" after="div.sidebar.main"> + <container name="sidebar.additional" as="sidebar_additional" label="Sidebar Additional"/> + </container> + </referenceContainer> +</layout> diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml index 9da2f24aaa6b5e708a0d7012443d935c81b7b37a..92aabd50f3134fdcece280a87a3b67d2c0ca0f9f 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -23,83 +23,84 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Theme\Block\Html" name="root" output="1" template="3columns.phtml"> - <block class="Magento\Theme\Block\Html\Head" name="head" as="head"> - <block class="Magento\Framework\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme::js/cookie.phtml"/> +<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <!-- Temporary solution --> + <block class="Magento\Theme\Block\Html\Head" name="head" as="head" before="-"> + <block class="Magento\Framework\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme::js/cookie.phtml"/> + </block> + <block class="Magento\Theme\Block\Html\Body" name="body.class"/> + <referenceBlock name="top.links"> + <block class="Magento\Theme\Block\Html\Header" name="header" as="header" before="-"> + <arguments> + <argument name="show_part" xsi:type="string">welcome</argument> + </arguments> </block> - <container name="after_body_start" as="after_body_start" label="Page Top"> - <block class="Magento\Theme\Block\Html\Notices" name="global_notices" template="html/notices.phtml"/> - </container> - <container name="header-container" label="Page Header Container" as="header_container" htmlTag="header" htmlClass="page-header"> - <container name="header.panel" label="Page Header Panel" htmlTag="div" htmlClass="panel header"> - <block class="Magento\Framework\View\Element\Template" name="skip_to_content" template="Magento_Theme::html/skip.phtml"> - <arguments> - <argument name="target" xsi:type="string">maincontent</argument> - <argument name="label" translate="true" xsi:type="string">Skip to content</argument> - </arguments> - </block> - <block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/> - </container> - <container name="header-wrapper" label="Page Header" as="header-wrapper" htmlTag="div" htmlClass="header content"> - <block class="Magento\Theme\Block\Html\Header" name="logo"> - <arguments> - <argument name="show_part" xsi:type="string">logo</argument> - </arguments> - </block> - <block class="Magento\Framework\View\Element\Html\Links" name="top.links"> - <arguments> - <argument name="css_class" xsi:type="string">header links</argument> - </arguments> - </block> - </container> - </container> - <referenceBlock name="top.links"> - <block class="Magento\Theme\Block\Html\Header" name="header" as="header" before="-"> + </referenceBlock> + + <referenceContainer name="after.body.start"> + <block class="Magento\Theme\Block\Html\Notices" name="global_notices" template="html/notices.phtml"/> + </referenceContainer> + + <referenceContainer name="header.container"> + <container name="header.panel" label="Page Header Panel" htmlTag="div" htmlClass="panel header"> + <block class="Magento\Framework\View\Element\Template" name="skip_to_content" template="Magento_Theme::html/skip.phtml"> <arguments> - <argument name="show_part" xsi:type="string">welcome</argument> + <argument name="target" xsi:type="string">maincontent</argument> + <argument name="label" translate="true" xsi:type="string">Skip to content</argument> </arguments> </block> - </referenceBlock> - <container name="page_top" as="page_top" label="After Page Header"> - <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml" ttl="3600"/> - <container name="top.container" as="topContainer" label="After Page Header Top" htmlTag="div" htmlClass="top-container"/> - <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> - </container> - <container name="columns.top" label="Before Main Columns" as="columns_top"> - <block class="Magento\Theme\Block\Html\Title" name="page.main.title" template="html/title.phtml"/> - <container name="page.messages" label="invisible" htmlTag="div" htmlClass="page messages"> - <block class="Magento\Framework\View\Element\Messages" name="global_messages" as="global_messages"/> - <block class="Magento\Framework\View\Element\Messages" name="messages" as="messages"/> - </container> + <block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/> </container> - <container name="main" as="main" label="Main Content Container" htmlTag="div" htmlClass="column main"> - <container name="content.top" label="Main Content Top"/> - <container name="content" label="Main Content Area"/> - <container name="content.aside" label="Main Content Aside"/> - <container name="content.bottom" label="Main Content Bottom"/> + <container name="header-wrapper" label="Page Header" as="header-wrapper" htmlTag="div" htmlClass="header content"> + <block class="Magento\Theme\Block\Html\Header" name="logo"> + <arguments> + <argument name="show_part" xsi:type="string">logo</argument> + </arguments> + </block> + <block class="Magento\Framework\View\Element\Html\Links" name="top.links"> + <arguments> + <argument name="css_class" xsi:type="string">header links</argument> + </arguments> + </block> </container> - <container name="sidebar.main" as="sidebar_main" label="Sidebar Main"/> - <container name="sidebar.additional" as="sidebar_additional" label="Sidebar Additional"/> - <container name="page.bottom.container" as="page_bottom" label="Before Page Footer Container" htmlTag="div" htmlClass="page bottom"> - <container name="page.bottom" label="Before Page Footer" htmlTag="div" htmlClass="content"/> + </referenceContainer> + + <referenceContainer name="page.top"> + <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml" ttl="3600"/> + <container name="top.container" as="topContainer" label="After Page Header Top" htmlTag="div" htmlClass="top-container"/> + <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> + </referenceContainer> + <referenceContainer name="columns.top"> + <block class="Magento\Theme\Block\Html\Title" name="page.main.title" template="html/title.phtml"/> + <container name="page.messages" label="invisible" htmlTag="div" htmlClass="page messages"> + <block class="Magento\Framework\View\Element\Messages" name="global_messages" as="global_messages"/> + <block class="Magento\Framework\View\Element\Messages" name="messages" as="messages"/> </container> - <container name="footer-container" as="footer" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer"> - <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content"> - <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/> - <block class="Magento\Framework\View\Element\Html\Links" name="footer_links"> - <arguments> - <argument name="css_class" xsi:type="string">footer links</argument> - </arguments> - </block> - <block class="Magento\Theme\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/> - <block class="Magento\Framework\View\Element\Template" name="report.bugs" template="Magento_Theme::html/bugreport.phtml" /> - </container> + </referenceContainer> + <referenceContainer name="main"> + <container name="content.top" label="Main Content Top"/> + <container name="content" label="Main Content Area"/> + <container name="content.aside" label="Main Content Aside"/> + <container name="content.bottom" label="Main Content Bottom"/> + </referenceContainer> + <referenceContainer name="page.bottom.container"> + <container name="page.bottom" label="Before Page Footer" htmlTag="div" htmlClass="content"/> + </referenceContainer> + <referenceContainer name="footer-container"> + <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content"> + <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/> + <block class="Magento\Framework\View\Element\Html\Links" name="footer_links"> + <arguments> + <argument name="css_class" xsi:type="string">footer links</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/> + <block class="Magento\Framework\View\Element\Template" name="report.bugs" template="Magento_Theme::html/bugreport.phtml" /> </container> - <container name="before_body_end" as="before_body_end" label="Page Bottom"/> - </block> + </referenceContainer> + <update handle="default_head_blocks"/> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\FormKey" name="formkey"/> </referenceContainer> -</layout> +</page> 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 772166e988867eaf10a7419c2a5f1341b20c5892..02fcae5ac2950dc01226b3a9cb87e8d5bc7ed9e0 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Template" name="theme_page_head_components" template="Magento_Theme::js/components.phtml"/> </referenceBlock> @@ -60,4 +60,4 @@ <block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Theme::js/components.phtml"/> </referenceBlock> -</layout> +</page> 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 cf99036b45b21ece4b30a3cb1c760e52bdfed5b8..0d65420649a1954d935d73653a744ed4b853a401 100644 --- a/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml +++ b/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Theme/view/frontend/layout/page_one_column.xml b/app/code/Magento/Theme/view/frontend/layout/page_one_column.xml deleted file mode 100644 index 8c1b5ce260b5ba1200cb801f752121f20532dfb6..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/view/frontend/layout/page_one_column.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All One-Column Layout Pages" design_abstraction="page_layout"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - <!-- Mark root page block that template is applied --> - <action method="setIsHandle"> - <argument name="applied" xsi:type="string">1</argument> - </action> - <action method="setLayoutCode"> - <argument name="name" xsi:type="string">one_column</argument> - </action> - </referenceBlock> -</layout> diff --git a/app/code/Magento/Theme/view/frontend/layout/page_three_columns.xml b/app/code/Magento/Theme/view/frontend/layout/page_three_columns.xml deleted file mode 100644 index 1d011bcee7d2ba18ab8f6937be3cea9fb3046f73..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/view/frontend/layout/page_three_columns.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All Three-Column Layout Pages" design_abstraction="page_layout"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">3columns.phtml</argument> - </action> - <!-- Mark root page block that template is applied --> - <action method="setIsHandle"> - <argument name="applied" xsi:type="string">1</argument> - </action> - <action method="setLayoutCode"> - <argument name="name" xsi:type="string">three_columns</argument> - </action> - </referenceBlock> -</layout> diff --git a/app/code/Magento/Theme/view/frontend/layout/page_two_columns_right.xml b/app/code/Magento/Theme/view/frontend/layout/page_two_columns_right.xml deleted file mode 100644 index 1ac34f9413fab800f53300bd0ea12bcf80cbf940..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/view/frontend/layout/page_two_columns_right.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" label="All Two-Column Layout Pages (Right Column)" design_abstraction="page_layout"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">2columns-right.phtml</argument> - </action> - <!-- Mark root page block that template is applied --> - <action method="setIsHandle"> - <argument name="applied" xsi:type="string">1</argument> - </action> - <action method="setLayoutCode"> - <argument name="name" xsi:type="string">two_columns_right</argument> - </action> - </referenceBlock> -</layout> diff --git a/app/code/Magento/Theme/view/frontend/layout/print.xml b/app/code/Magento/Theme/view/frontend/layout/print.xml index a804c6c21a0418a2d9867cc4e6083278053f66d1..510a30bedce4e1c53b3344312c4ecf7603cea4f4 100644 --- a/app/code/Magento/Theme/view/frontend/layout/print.xml +++ b/app/code/Magento/Theme/view/frontend/layout/print.xml @@ -23,17 +23,19 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Theme\Block\Html" name="root" output="1" template="print.phtml"> - <block class="Magento\Theme\Block\Html\Head" name="head" as="head"/> - <container name="after_body_start" as="after_body_start" label="Page Top"/> - <container name="main" as="main" label="Main Content Container" htmlTag="div" htmlClass="column main"> - <container name="content.top" label="Main Content Top"/> - <container name="content" label="Main Content Area"/> - <container name="content.aside" label="Main Content Aside"/> - <container name="content.bottom" label="Main Content Bottom"/> - </container> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Theme\Block\Html" template="print.phtml"> + <block class="Magento\Theme\Block\Html\Head" name="head" as="head"/> + <container name="after_body_start" as="after_body_start" label="Page Top"/> + <container name="main" as="main" label="Main Content Container" htmlTag="div" htmlClass="column main"> + <container name="content.top" label="Main Content Top"/> + <container name="content" label="Main Content Area"/> + <container name="content.aside" label="Main Content Aside"/> + <container name="content.bottom" label="Main Content Bottom"/> + </container> + </block> + </container> <update handle="default_head_blocks"/> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="css-print-css"> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts_partial.xml b/app/code/Magento/Theme/view/frontend/layouts.xml similarity index 61% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts_partial.xml rename to app/code/Magento/Theme/view/frontend/layouts.xml index bcbe4fd68dc20f7b0885f2ccde427265ded1145d..962e4694eee38cd220674b8fefc160fd53902a70 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts_partial.xml +++ b/app/code/Magento/Theme/view/frontend/layouts.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Magento @@ -23,20 +23,17 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Theme/etc/page_layouts_file.xsd"> - <layouts default="one"> - <layout id="one"> - <template>empty.phtml</template> - <layout_handle>page_empty</layout_handle> - </layout> - <layout id="two"> - <label translate="true">Empty</label> - <layout_handle>page_empty</layout_handle> - </layout> - <layout id="three"> - <label translate="true">Empty</label> - <template>empty.phtml</template> - </layout> - </layouts> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> + <layout id="1column"> + <label translate="true">1 column</label> + </layout> + <layout id="2columns-left"> + <label translate="true">2 columns with left bar</label> + </layout> + <layout id="2columns-right"> + <label translate="true">2 columns with right bar</label> + </layout> + <layout id="3columns"> + <label translate="true">3 columns</label> + </layout> </page_layouts> diff --git a/app/code/Magento/Theme/view/frontend/templates/1column.phtml b/app/code/Magento/Theme/view/frontend/templates/1column.phtml deleted file mode 100644 index c84a48ccb6340e2b666dfe9d0e92f8b35c69df84..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/view/frontend/templates/1column.phtml +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Template for \Magento\Theme\Block\Html - */ -$bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; -?> -<!doctype html> -<html lang="<?php echo $this->getLang() ?>" class="no-js"> -<head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> - <?php echo $this->getChildHtml('head') ?> -</head> -<body class="layout-1<?php echo $bodyCss ?>" - data-container="body" - <?php echo $this->getAddAttribute() ?> - data-mage-init='{"loaderAjax": {}, "loader": {}}'> - <?php echo $this->getChildHtml('after_body_start') ?> - <div class="page-wrapper"> - <?php echo $this->getChildHtml('global_notices') ?> - <?php echo $this->getChildHtml('header_container') ?> - <?php echo $this->getChildHtml('page_top') ?> - <section id="maincontent" class="page main"> - <?php echo $this->getChildHtml('columns_top') ?> - <div class="columns"> - <?php echo $this->getChildHtml('main') ?> - </div> - </section> - <?php echo $this->getChildHtml('page_bottom') ?> - - <?php echo $this->getChildHtml('footer') ?> - - <?php echo $this->getChildHtml('before_body_end') ?> - </div> - <?php echo $this->getAbsoluteFooter() ?> -</body> -</html> diff --git a/app/code/Magento/Theme/view/frontend/templates/2columns-left.phtml b/app/code/Magento/Theme/view/frontend/templates/2columns-left.phtml deleted file mode 100644 index 9cb8a2a99b5e92e69aa4a907865193f6fcc534f1..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/view/frontend/templates/2columns-left.phtml +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Template for \Magento\Theme\Block\Html - */ -$bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; -?> -<!doctype html> -<html lang="<?php echo $this->getLang() ?>" class="no-js"> -<head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> - <?php echo $this->getChildHtml('head') ?> -</head> -<body class="layout-2-left<?php echo $bodyCss ?>" - data-container="body" - <?php echo $this->getAddAttribute(); ?> - data-mage-init='{"loaderAjax": {}, "loader": {}}'> - <?php echo $this->getChildHtml('after_body_start') ?> - <div class="page-wrapper"> - <?php echo $this->getChildHtml('global_notices') ?> - <?php echo $this->getChildHtml('header_container') ?> - <?php echo $this->getChildHtml('page_top') ?> - <section id="maincontent" class="page main"> - <?php echo $this->getChildHtml('columns_top') ?> - <div class="columns"> - <?php - echo $this->getChildHtml('main'); - // Inside of <php> to avoid spaces between tags - echo '<div class="sidebar sidebar-main">'; - echo $this->getChildHtml('sidebar_main'); - echo '</div>'; - echo '<div class="sidebar sidebar-additional">'; - echo $this->getChildHtml('sidebar_additional'); - echo '</div>'; - ?> - </div> - </section> - <?php echo $this->getChildHtml('page_bottom') ?> - - <?php echo $this->getChildHtml('footer') ?> - - <?php echo $this->getChildHtml('before_body_end') ?> - </div> - <?php echo $this->getAbsoluteFooter() ?> -</body> -</html> diff --git a/app/code/Magento/Theme/view/frontend/templates/2columns-right.phtml b/app/code/Magento/Theme/view/frontend/templates/2columns-right.phtml deleted file mode 100644 index 3426b62b1255538ce6af7a6a31fabb17c71ed3c4..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/view/frontend/templates/2columns-right.phtml +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Template for \Magento\Theme\Block\Html - */ -$bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; -?> -<!doctype html> -<html lang="<?php echo $this->getLang() ?>" class="no-js"> -<head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> - <?php echo $this->getChildHtml('head') ?> -</head> -<body class="layout-2-right<?php echo $bodyCss ?>" - data-container="body" - <?php echo $this->getAddAttribute() ?> - data-mage-init='{"loaderAjax": {}, "loader": {}}'> - <?php echo $this->getChildHtml('after_body_start') ?> - <div class="page-wrapper"> - <?php echo $this->getChildHtml('global_notices') ?> - <?php echo $this->getChildHtml('header_container') ?> - <?php echo $this->getChildHtml('page_top') ?> - <section id="maincontent" class="page main"> - <?php echo $this->getChildHtml('columns_top') ?> - <div class="columns"> - <?php - echo $this->getChildHtml('main'); - // Inside of <php> to avoid spaces between tags - echo '<div class="sidebar sidebar-main">'; - echo $this->getChildHtml('sidebar_main'); - echo '</div>'; - echo '<div class="sidebar sidebar-additional">'; - echo $this->getChildHtml('sidebar_additional'); - echo '</div>'; - ?> - </div> - </section> - <?php echo $this->getChildHtml('page_bottom') ?> - - <?php echo $this->getChildHtml('footer') ?> - - <?php echo $this->getChildHtml('before_body_end') ?> - </div> - <?php echo $this->getAbsoluteFooter() ?> -</body> -</html> diff --git a/app/code/Magento/Theme/view/frontend/templates/3columns.phtml b/app/code/Magento/Theme/view/frontend/templates/3columns.phtml deleted file mode 100644 index 2f14747bc4fa8b840f76bf06d93766f7ddadc06f..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/view/frontend/templates/3columns.phtml +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Template for \Magento\Theme\Block\Html - */ -$bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; -?> -<!doctype html> -<html lang="<?php echo $this->getLang() ?>" class="no-js"> -<head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> - <?php echo $this->getChildHtml('head') ?> -</head> -<body class="layout-3<?php echo $bodyCss ?>" - data-container="body" - <?php echo $this->getAddAttribute() ?> - data-mage-init='{"loaderAjax": {}, "loader": {}}'> - <?php echo $this->getChildHtml('after_body_start') ?> - <div class="page-wrapper"> - <?php echo $this->getChildHtml('global_notices') ?> - <?php echo $this->getChildHtml('header_container') ?> - <?php echo $this->getChildHtml('page_top') ?> - <section id="maincontent" class="page main"> - <?php echo $this->getChildHtml('columns_top') ?> - <div class="columns"> - <?php - echo $this->getChildHtml('main'); - // Inside of <php> to avoid spaces between tags - echo '<div class="sidebar sidebar-main">'; - echo $this->getChildHtml('sidebar_main'); - echo '</div>'; - echo '<div class="sidebar sidebar-additional">'; - echo $this->getChildHtml('sidebar_additional'); - echo '</div>'; - ?> - </div> - </section> - <?php echo $this->getChildHtml('page_bottom') ?> - - <?php echo $this->getChildHtml('footer') ?> - - <?php echo $this->getChildHtml('before_body_end') ?> - </div> - <?php echo $this->getAbsoluteFooter() ?> -</body> -</html> diff --git a/app/code/Magento/Theme/view/frontend/templates/empty.phtml b/app/code/Magento/Theme/view/frontend/templates/empty.phtml deleted file mode 100644 index 37e49474ad02cc4cfbfed27b040d29bd74f25cb6..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/view/frontend/templates/empty.phtml +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Template for \Magento\Theme\Block\Html - */ -$bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; -?> -<!doctype html> -<html lang="<?php echo $this->getLang() ?>" class="no-js"> -<head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> - <?php echo $this->getChildHtml('head') ?> -</head> -<body class="page-empty<?php echo $bodyCss ?>" - data-container="body" - <?php echo $this->getAddAttribute() ?> - data-mage-init='{"loaderAjax": {}, "loader": {}}'> - <?php echo $this->getChildHtml('after_body_start') ?> - <div class="page-wrapper"> - <?php echo $this->getChildHtml('global_notices') ?> - <section id="maincontent" class="page main"> - <?php echo $this->getChildHtml('columns_top') ?> - <div class="columns"> - <?php echo $this->getChildHtml('main') ?> - </div> - </section> - <?php echo $this->getChildHtml('page_bottom') ?> - <?php echo $this->getChildHtml('before_body_end') ?> - </div> - <?php echo $this->getAbsoluteFooter() ?> -</body> -</html> diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index b15810ed78a48bf961f2ddc3f53c1422e4cd0807..7b89e76b425d10f14e7e64ca4f058735216e1f13 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha91", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha92", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index e22b920d2edb176d3bc05fca0386cfae92630f58..7e1cdf0adfd7d335af2aa7002feb8b49af1d3b52 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-shipping": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-shipping": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Ups/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Ups/view/adminhtml/layout/adminhtml_system_config_edit.xml index d34012054a1909f2bb2118bbc1c9a8d70bfdfc70..86940f0f4e1ee8d0c4359631e43cfc00a69e5eac 100644 --- a/app/code/Magento/Ups/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Ups/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="js"> <block class="Magento\Ups\Block\Backend\System\CarrierConfig" template="system/shipping/carrier_config.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/UrlRedirect/composer.json b/app/code/Magento/UrlRedirect/composer.json index 619f506112066464ce79a3b7ca87071ccdecc9d4..01da2de0e8e80aecf6db35c75d058c02fe8eaf61 100644 --- a/app/code/Magento/UrlRedirect/composer.json +++ b/app/code/Magento/UrlRedirect/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-install": "0.1.0-alpha91", - "magento/module-store": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91" + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-install": "0.1.0-alpha92", + "magento/module-store": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/UrlRedirect/view/adminhtml/layout/adminhtml_urlredirect_index.xml b/app/code/Magento/UrlRedirect/view/adminhtml/layout/adminhtml_urlredirect_index.xml index 6fc0be6b9568fe91470f7552423960da8c70939e..166d657a9242795d9eda78278b44ce957185756a 100644 --- a/app/code/Magento/UrlRedirect/view/adminhtml/layout/adminhtml_urlredirect_index.xml +++ b/app/code/Magento/UrlRedirect/view/adminhtml/layout/adminhtml_urlredirect_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\UrlRedirect\Block\GridContainer" name="adminhtml.block.urlredirect.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.urlredirect.grid" as="grid"> @@ -107,4 +107,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index e609b938b0cf6f59eea5ec8c9e1eca06f0782849..673c72448680386f43aaee9bf2f46a434025e707 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-store": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-store": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/User/Block/User/Edit.php b/app/code/Magento/User/Block/User/Edit.php index 9d8f5b6fde645d6ce03884f484132a609b20e703..8ec8fe8ba448644200e946cd0c0ae4637ef10be3 100644 --- a/app/code/Magento/User/Block/User/Edit.php +++ b/app/code/Magento/User/Block/User/Edit.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\User\Block\User; /** @@ -66,6 +67,22 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container $this->buttonList->update('save', 'label', __('Save User')); $this->buttonList->update('delete', 'label', __('Delete User')); + + $objId = $this->getRequest()->getParam($this->_objectId); + + if (!empty($objId)) { + $deleteConfirmMsg = __("Are you sure you want to revoke the user\'s tokens?"); + $this->addButton( + 'invalidate', + array( + 'label' => __('Force Sign-In'), + 'class' => 'invalidate-token', + 'onclick' => 'deleteConfirm(\'' . $deleteConfirmMsg . '\', \'' . $this->getInvalidateUrl() . '\')', + ) + ); + } + + } /** @@ -90,4 +107,14 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container { return $this->getUrl('adminhtml/*/validate', array('_current' => true)); } + + /** + * Return invalidate url for edit form + * + * @return string + */ + public function getInvalidateUrl() + { + return $this->getUrl('adminhtml/*/invalidatetoken', array('_current' => true)); + } } diff --git a/app/code/Magento/User/Controller/Adminhtml/User/InvalidateToken.php b/app/code/Magento/User/Controller/Adminhtml/User/InvalidateToken.php new file mode 100644 index 0000000000000000000000000000000000000000..f4b10c5f9e14dfd864465d2bd66350f9a7a44a9d --- /dev/null +++ b/app/code/Magento/User/Controller/Adminhtml/User/InvalidateToken.php @@ -0,0 +1,55 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\User\Controller\Adminhtml\User; + +/** + * Class InvalidateToken - used to invalidate/revoke all authentication tokens for a specific user. + */ +class InvalidateToken extends \Magento\User\Controller\Adminhtml\User +{ + /** + * @return void + */ + public function execute() + { + if ($userId = $this->getRequest()->getParam('user_id')) { + /** @var \Magento\Integration\Service\V1\TokenService $tokenService */ + $tokenService = $this->_objectManager->get('\Magento\Integration\Service\V1\TokenService'); + try { + $tokenService->revokeAdminAccessToken($userId); + $this->messageManager->addSuccess(__('You have revoked the user\'s tokens.')); + $this->_redirect('adminhtml/*/edit', array('user_id' => $userId)); + return; + } catch (\Exception $e) { + $this->messageManager->addError($e->getMessage()); + $this->_redirect('adminhtml/*/edit', array('user_id' => $userId)); + return; + } + } + $this->messageManager->addError(__('We can\'t find a user to revoke.')); + $this->_redirect('adminhtml/*'); + } +} diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index 05bd790e0d313f4103d61424e1f350f9a47ba388..38febed7db2f07228633d0db9038c07e4fefed39 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-authorization": "0.1.0-alpha91", - "magento/module-store": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-integration": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-authorization": "0.1.0-alpha92", + "magento/module-store": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-integration": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 2064d7fc2a4aff4f826ae2f8a1b338419da55e91..2ab8e7525cace212cdd2b97a805a876028b2bfc3 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Backend\Block\Template" name="content" template="Magento_User::admin/forgotpassword.phtml"> <block class="Magento\Backend\Block\Page\Copyright" name="copyright" as="copyright"/> <container name="form.additional.info" label="Form Additional Info"/> 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 ea3330419597552457fb2b3bcf50cb7841d82f5f..1f26bd9b7bd67f5824a62a70056a7f91ceea9554 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="form.buttons"> <block class="Magento\Backend\Block\Template" name="adminhtml_auth_login_forgotpassword" template="Magento_User::admin/forgotpassword_url.phtml"/> </referenceContainer> -</layout> +</page> 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 d0f22c4bdbe6c06d4c2f0b158be2ceddf1b61f37..cebde3d72b61449ea7f4d4dbb05efad841907ee1 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\Backend\Block\Template" name="content" template="Magento_User::admin/resetforgottenpassword.phtml"> <block class="Magento\Backend\Block\Page\Copyright" name="copyright" as="copyright"/> </block> 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 8380e66d40325fd06bbdf19d5886aeace2609216..198620633b6448bc42828ec68ac059e5748aaffb 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="left"> <block class="Magento\User\Block\User\Edit\Tabs" name="adminhtml.user.edit.tabs"/> </referenceContainer> @@ -33,4 +33,4 @@ <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" name="adminhtml.user.roles.grid.js" template="Magento_User::user/roles_grid_js.phtml"/> </referenceContainer> -</layout> +</page> 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 d6057e5573110d6013d22596913c62f24a231bfb..22fdd889c7fc7a986894fd79ceded2fcf66942e6 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.user.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.user.grid" as="grid"> <arguments> @@ -114,4 +114,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 0ade06f8378dccc013af08ee5aee1fa9a336fc9b..70772199347a5636a546c080b55acf22b2838636 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 @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="adminhtml_user_grid_block"/> <referenceContainer name="content"> <block class="Magento\User\Block\User" name="adminhtml.user.grid.container"/> </referenceContainer> -</layout> +</page> 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 8c03b530f6d3f8310d152f2aeaf70a97aa2320d5..68a5d3a0be281d5b4b3d533a30ce76fb49d4244f 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="left"> <block class="Magento\User\Block\Role\Edit" name="adminhtml.user.editroles"> <block class="Magento\User\Block\Role\Tab\Edit" name="adminhtml.user.tab.rolesedit"/> @@ -38,4 +38,4 @@ <block class="Magento\Backend\Block\Template" name="adminhtml.user.roles.users.grid.js" template="Magento_User::role/users_grid_js.phtml"/> <block class="Magento\User\Block\Buttons" name="adminhtml.user.role.buttons" template="role/info.phtml"/> </referenceContainer> -</layout> +</page> 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 eaccc255397af693c5d1548e1788984d3e753202..0bdfa4d00256f6f0f78f29a734e13b7e735b39dd 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\User\Block\Role\Grid\User" name="adminhtml.user.role.grid.user"/> </container> </layout> 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 636830d28370644460ef8502cb4d4be33705bbf4..01bd6679b4add6bcd6df018fb8d8d2431df85262 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.user.role.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.role.grid" as="grid"> <arguments> @@ -66,4 +66,4 @@ </block> </block> </referenceBlock> -</layout> +</page> 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 aa64ec5efdb5b2f0bfa73716335017fdc78b61af..4770bb50e334f49de172c9ab0f23b13b790012a6 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 @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="formkey"/> <update handle="adminhtml_user_role_grid_block"/> <referenceContainer name="content"> <block class="Magento\User\Block\Role" name="adminhtml.user.role.container"/> </referenceContainer> -</layout> +</page> 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 e90185977269abadc1dca9f1abec55dd973b394b..553f8a1bc869dd5761c3aec36cf59342c8075c03 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_user_role_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.user.role.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.user.role.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 7804bcd392ad4ebb2d5f95ebe1f9459ec04eb397..7bedfc9365ad17b131664d6766d3ff2026481374 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 @@ -23,8 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_user_grid_block"/> - <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.user.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.user.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> + </container> </layout> 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 8eba09845d106bf37a0b6198a5878661ba30c114..3ce4700f3e112d10a2c1d7a594b95b2dad9bf5f7 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 @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <container name="root" label="Root" output="1"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root" label="Root"> <block class="Magento\User\Block\User\Edit\Tab\Roles" name="adminhtml.user.rolesgrid"/> </container> </layout> diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index b52ac78c7cbcf25d0f505757e1bf6fcd345460c1..68f8e2d434025949e4c62347a8e2fc245d5e5776 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-shipping": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-shipping": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php b/app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php index 6ce8b04c2a7d7d04181b915d07f20d2be730db3c..824887091673dbe12e1340ec8fbfc6c0f5855bb3 100644 --- a/app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php +++ b/app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php @@ -164,8 +164,8 @@ class ServiceArgsSerializer if ($isArrayType && isset($value['item'])) { $value = $this->_removeSoapItemNode($value); } - if ($this->_typeProcessor->isTypeSimple($type)) { - $result = $this->_typeProcessor->processSimpleType($value, $type); + if ($this->_typeProcessor->isTypeSimple($type) || $this->_typeProcessor->isTypeAny($type)) { + $result = $this->_typeProcessor->processSimpleAndAnyType($value, $type); } else { /** Complex type or array of complex types */ if ($isArrayType) { diff --git a/app/code/Magento/Webapi/Model/Authorization/TokenUserContext.php b/app/code/Magento/Webapi/Model/Authorization/TokenUserContext.php index 8d3b60ac1503adf2d1739e7d682a7745b07e199c..9952bf11372b67fd0b73f6b1fc9b54d3313a80f3 100644 --- a/app/code/Magento/Webapi/Model/Authorization/TokenUserContext.php +++ b/app/code/Magento/Webapi/Model/Authorization/TokenUserContext.php @@ -132,7 +132,7 @@ class TokenUserContext implements UserContextInterface $bearerToken = $headerPieces[1]; $token = $this->tokenFactory->create()->loadByToken($bearerToken); - if (!$token->getId()) { + if (!$token->getId() || $token->getRevoked()) { $this->isRequestProcessed = true; return; } diff --git a/app/code/Magento/Webapi/Model/Config/ClassReflector/TypeProcessor.php b/app/code/Magento/Webapi/Model/Config/ClassReflector/TypeProcessor.php index a3414861f6fa64718db4922735acda150449bee4..46ec6fa7a867d92b78e112cb9c49595559bc440f 100644 --- a/app/code/Magento/Webapi/Model/Config/ClassReflector/TypeProcessor.php +++ b/app/code/Magento/Webapi/Model/Config/ClassReflector/TypeProcessor.php @@ -30,6 +30,26 @@ use Zend\Code\Reflection\ClassReflection; */ class TypeProcessor { + /**#@+ + * Pre-normalized type constants + */ + const STRING_TYPE = 'str'; + const INT_TYPE = 'integer'; + const BOOLEAN_TYPE = 'bool'; + const ANY_TYPE = 'mixed'; + /**#@-*/ + + /**#@+ + * Normalized type constants + */ + const NORMALIZED_STRING_TYPE = 'string'; + const NORMALIZED_INT_TYPE = 'int'; + const NORMALIZED_FLOAT_TYPE = 'float'; + const NORMALIZED_DOUBLE_TYPE = 'double'; + const NORMALIZED_BOOLEAN_TYPE = 'boolean'; + const NORMALIZED_ANY_TYPE = 'anyType'; + /**#@-*/ + /** * Array of types data. * <pre>array( @@ -114,7 +134,7 @@ class TypeProcessor public function process($type) { $typeName = $this->normalizeType($type); - if (!$this->isTypeSimple($typeName)) { + if (!$this->isTypeSimple($typeName) && !$this->isTypeAny($typeName)) { $typeSimple = $this->getArrayItemType($type); if (!(class_exists($typeSimple) || interface_exists($typeSimple))) { throw new \LogicException( @@ -286,9 +306,10 @@ class TypeProcessor public function normalizeType($type) { $normalizationMap = array( - 'str' => 'string', - 'integer' => 'int', - 'bool' => 'boolean', + self::STRING_TYPE => self::NORMALIZED_STRING_TYPE, + self::INT_TYPE => self::NORMALIZED_INT_TYPE, + self::BOOLEAN_TYPE => self::NORMALIZED_BOOLEAN_TYPE, + self::ANY_TYPE => self::NORMALIZED_ANY_TYPE ); return is_string($type) && isset($normalizationMap[$type]) ? $normalizationMap[$type] : $type; @@ -307,7 +328,32 @@ class TypeProcessor $type = $this->getArrayItemType($type); } - return in_array($type, array('string', 'int', 'float', 'double', 'boolean')); + return in_array( + $type, + array( + self::NORMALIZED_STRING_TYPE, + self::NORMALIZED_INT_TYPE, + self::NORMALIZED_FLOAT_TYPE, + self::NORMALIZED_DOUBLE_TYPE, + self::NORMALIZED_BOOLEAN_TYPE + ) + ); + } + + /** + * Check if given type is any type. + * + * @param string $type + * @return bool + */ + public function isTypeAny($type) + { + $type = $this->normalizeType($type); + if ($this->isArrayType($type)) { + $type = $this->getArrayItemType($type); + } + + return ($type == self::NORMALIZED_ANY_TYPE); } /** @@ -386,14 +432,14 @@ class TypeProcessor } /** - * Convert the value to the requested simple type + * Convert the value to the requested simple or any type * * @param int|string|float|int[]|string[]|float[] $value * @param string $type Convert given value to the this simple type * @return int|string|float|int[]|string[]|float[] Return the value which is converted to type * @throws \Magento\Webapi\Exception */ - public function processSimpleType($value, $type) + public function processSimpleAndAnyType($value, $type) { $invalidTypeMsg = 'Invalid type for value :"%s". Expected Type: "%s".'; if ($this->isArrayType($type) && is_array($value)) { @@ -404,7 +450,7 @@ class TypeProcessor } } } elseif (!$this->isArrayType($type) && !is_array($value)) { - if (!settype($value, $type)) { + if ($type !== self::ANY_TYPE && !settype($value, $type)) { throw new \Magento\Webapi\Exception(sprintf($invalidTypeMsg, $value, $type)); } } else { diff --git a/app/code/Magento/Webapi/Model/Soap/Wsdl/ComplexTypeStrategy.php b/app/code/Magento/Webapi/Model/Soap/Wsdl/ComplexTypeStrategy.php index 79bf1da83769064a6004964486acb2ece8deeda1..5cf87b1c11cdb417492fd583fea57e0018578b8f 100644 --- a/app/code/Magento/Webapi/Model/Soap/Wsdl/ComplexTypeStrategy.php +++ b/app/code/Magento/Webapi/Model/Soap/Wsdl/ComplexTypeStrategy.php @@ -157,7 +157,7 @@ class ComplexTypeStrategy extends AbstractComplexTypeStrategy $element->setAttribute('minOccurs', $isRequired ? 1 : 0); $maxOccurs = isset($parameterData['isArray']) && $parameterData['isArray'] ? 'unbounded' : 1; $element->setAttribute('maxOccurs', $maxOccurs); - if ($this->_typeProcessor->isTypeSimple($parameterType)) { + if ($this->_typeProcessor->isTypeSimple($parameterType) || $this->_typeProcessor->isTypeAny($parameterType)) { $typeNs = Wsdl::XSD_NS; } else { $typeNs = Wsdl::TYPES_NS; @@ -177,7 +177,7 @@ class ComplexTypeStrategy extends AbstractComplexTypeStrategy { $arrayItemType = $this->_typeProcessor->getArrayItemType($type); $arrayTypeName = $this->_typeProcessor->translateArrayTypeName($type); - if (!$this->_typeProcessor->isTypeSimple($arrayItemType)) { + if (!$this->_typeProcessor->isTypeSimple($arrayItemType) && !$this->_typeProcessor->isTypeAny($arrayItemType)) { $this->addComplexType($arrayItemType, $callInfo); } $arrayTypeParameters = array( diff --git a/app/code/Magento/Webapi/Model/Soap/Wsdl/Generator.php b/app/code/Magento/Webapi/Model/Soap/Wsdl/Generator.php index 027a5e93445a3b63e0e86c2e04f07453c8f1d400..65a822617d95e8546f231a9b915728f75fc29c0a 100644 --- a/app/code/Magento/Webapi/Model/Soap/Wsdl/Generator.php +++ b/app/code/Magento/Webapi/Model/Soap/Wsdl/Generator.php @@ -378,7 +378,9 @@ class Generator $direction = ($direction == 'in') ? 'requiredInput' : 'returned'; foreach ($interfaceData['parameters'] as $parameterData) { $parameterType = $parameterData['type']; - if (!$this->_typeProcessor->isTypeSimple($parameterType)) { + if (!$this->_typeProcessor->isTypeSimple($parameterType) + && !$this->_typeProcessor->isTypeAny($parameterType) + ) { $operation = $this->getOperationName($serviceName, $methodName); if ($parameterData['required']) { $condition = ($direction == 'requiredInput') ? 'yes' : 'always'; diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index d9f70c2a1ee994ada7b76f76ce2e36231bfb0209..49b014ad840fb065267d9cb21ffb0de28ab71083 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-authorization": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-integration": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-user": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-authorization": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-integration": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-user": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_activate_permissions_webapi.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_activate_permissions_webapi.xml index b52df86536206c458c0f016102b052eb6267108c..79e82d20f7e6ee11d097811a3b03f6f5e70e12a5 100644 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_activate_permissions_webapi.xml +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_activate_permissions_webapi.xml @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="integration.activate.permissions.tabs"> <block class="Magento\Webapi\Block\Adminhtml\Integration\Activate\Permissions\Tab\Webapi" name="integration_activate_permissions_tabs_webapi" template="integration/activate/permissions/tab/webapi.phtml"/> <action method="addTab"> @@ -33,4 +33,4 @@ <argument name="block" xsi:type="string">integration_activate_permissions_tabs_webapi</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml index 852ae2eb40da8557004dda54f1f9031722ddf8c7..6ee27aed2d21de103ec9905ddc1ddc637c6b449a 100644 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="editor"/> <referenceBlock name="integration_edit_tabs"> <block class="Magento\Webapi\Block\Adminhtml\Integration\Edit\Tab\Webapi" name="integration_edit_tab_webapi" template="Magento_Webapi::resourcetree.phtml"/> @@ -42,4 +42,4 @@ <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" name="adminhtml.integration.webapi.tree.js" template="Magento_User::user/roles_grid_js.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index 8566ab317d28181dad542a5b1f399aaecbc2d56e..b1fee54436b1468886c4ee85cd2bc31646417da1 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-tax": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-directory": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-eav": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-bundle": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-tax": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-directory": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-eav": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-bundle": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ 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 eee24c2800d6da83a776e4d034494e76942fb4d3..7b19936de3fd9e77e6d74d6ebd87858892c49a8c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 eee24c2800d6da83a776e4d034494e76942fb4d3..7b19936de3fd9e77e6d74d6ebd87858892c49a8c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 eee24c2800d6da83a776e4d034494e76942fb4d3..7b19936de3fd9e77e6d74d6ebd87858892c49a8c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 d4a03372a04f45968b0f12d19509b3f70bf43df8..a0414af18012f77452d9afa5d73a58dcd6737bb2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 d4a03372a04f45968b0f12d19509b3f70bf43df8..a0414af18012f77452d9afa5d73a58dcd6737bb2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 d4a03372a04f45968b0f12d19509b3f70bf43df8..a0414af18012f77452d9afa5d73a58dcd6737bb2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 ef888abe192e7870f548c982945b1d26cdaa7b9f..be8fab59b6db4ffb30b788618a464ebaa6d8fd4b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 51ab2f6f07df30ed61ef82d2a227999db66145d6..d7806df1d40b0cbfbb6da5c40885326f1d875705 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="default" xsi:type="array"> @@ -38,4 +38,4 @@ </argument> </arguments> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Weee/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml b/app/code/Magento/Weee/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml index c3d94a8bd2afe0956e2c62dcf53754ee4f1c07ca..d35990e84859881705dec85194a09af9d6088d02 100644 --- a/app/code/Magento/Weee/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml +++ b/app/code/Magento/Weee/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="minicart"> <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.cart.item.price.sidebar" template="Magento_Weee::checkout/cart/item/price/sidebar.phtml"/> </referenceBlock> -</layout> +</page> 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 4daf41e0d7224ac2aba37a7517072263c629902b..aa5efb0e7e06c23d34ee692a4fd5bc91b3cba370 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 @@ -23,12 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.item.price.unit" template="Magento_Weee::item/price/unit.phtml"/> <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.item.price.row" template="Magento_Weee::item/price/row.phtml"/> <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.excl" template="checkout/onepage/review/item/price/unit_excl_tax.phtml"/> <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.incl" template="checkout/onepage/review/item/price/unit_incl_tax.phtml"/> <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.rowtotal.excl" template="checkout/onepage/review/item/price/row_excl_tax.phtml"/> <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.rowtotal.incl" template="checkout/onepage/review/item/price/row_incl_tax.phtml"/> -</layout> +</page> diff --git a/app/code/Magento/Weee/view/frontend/layout/default.xml b/app/code/Magento/Weee/view/frontend/layout/default.xml index 71cabb7fa136c77677faa0490abac321c1a3393b..c0883d3b2bcfa440ba50efac470e0aef1e9b4c74 100644 --- a/app/code/Magento/Weee/view/frontend/layout/default.xml +++ b/app/code/Magento/Weee/view/frontend/layout/default.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"></referenceBlock> -</layout> +</page> 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 eee24c2800d6da83a776e4d034494e76942fb4d3..7b19936de3fd9e77e6d74d6ebd87858892c49a8c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 d4a03372a04f45968b0f12d19509b3f70bf43df8..a0414af18012f77452d9afa5d73a58dcd6737bb2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 ef888abe192e7870f548c982945b1d26cdaa7b9f..be8fab59b6db4ffb30b788618a464ebaa6d8fd4b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 eee24c2800d6da83a776e4d034494e76942fb4d3..7b19936de3fd9e77e6d74d6ebd87858892c49a8c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 d4a03372a04f45968b0f12d19509b3f70bf43df8..a0414af18012f77452d9afa5d73a58dcd6737bb2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 ef888abe192e7870f548c982945b1d26cdaa7b9f..be8fab59b6db4ffb30b788618a464ebaa6d8fd4b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 eee24c2800d6da83a776e4d034494e76942fb4d3..7b19936de3fd9e77e6d74d6ebd87858892c49a8c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 d4a03372a04f45968b0f12d19509b3f70bf43df8..a0414af18012f77452d9afa5d73a58dcd6737bb2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 ef888abe192e7870f548c982945b1d26cdaa7b9f..be8fab59b6db4ffb30b788618a464ebaa6d8fd4b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 eee24c2800d6da83a776e4d034494e76942fb4d3..7b19936de3fd9e77e6d74d6ebd87858892c49a8c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 d4a03372a04f45968b0f12d19509b3f70bf43df8..a0414af18012f77452d9afa5d73a58dcd6737bb2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 ef888abe192e7870f548c982945b1d26cdaa7b9f..be8fab59b6db4ffb30b788618a464ebaa6d8fd4b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 eee24c2800d6da83a776e4d034494e76942fb4d3..7b19936de3fd9e77e6d74d6ebd87858892c49a8c 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 d4a03372a04f45968b0f12d19509b3f70bf43df8..a0414af18012f77452d9afa5d73a58dcd6737bb2 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> 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 ef888abe192e7870f548c982945b1d26cdaa7b9f..be8fab59b6db4ffb30b788618a464ebaa6d8fd4b 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 @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> <action method="setBeforeCondition"> @@ -31,4 +31,4 @@ </action> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php index cbe5c051962c59c031a20f33dd9fd56f31333785..e252d872b5c537c9d001197c62ebd3e9385d7909 100644 --- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php +++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php @@ -34,7 +34,7 @@ class LoadOptions extends \Magento\Backend\App\Action public function execute() { try { - $this->_view->loadLayout('empty'); + $this->_view->loadLayout(); if ($paramsJson = $this->getRequest()->getParam('widget')) { $request = $this->_objectManager->get('Magento\Core\Helper\Data')->jsonDecode($paramsJson); if (is_array($request)) { diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index 547554a1b9c0a8282efad2119a35e50df36b21ad..ebd458e2e265c79c05b4be64b298249ce0d0c3d9 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-cms": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-cms": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_index.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_index.xml index 88a5127307073e5100dba9aef48af27415775fbb..b43cab82290d37659d50e5536e627f929e84f5f7 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_index.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_index.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Widget\Block\Adminhtml\Widget" name="wysiwyg_widget" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Widget\Block\Adminhtml\Widget" name="wysiwyg_widget"/> + </container> </layout> diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_block.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_block.xml index 87d5ee2854b601990e26ddf39d0f1073d84653f4..d3989d5bdf62302188ab8428f1048f0e18b385ca 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_block.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_block.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="adminhtml.widget.instance.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.widget.instance.grid" as="grid"> <arguments> @@ -82,4 +82,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml index c07b0ad0e7334cff2a0e84b896fe884e5f5c1179..ccc6739ceee632d4de720b154a1faacac54ac6ff 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page layout="admin-2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head"> <action method="setCanLoadExtJs"> <argument name="flag" xsi:type="string">1</argument> @@ -69,4 +69,4 @@ <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" template="Magento_Widget::instance/js.phtml" name="widget_instance_js"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_index.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_index.xml index 25c2edc8b6411a35e1c26b5305d265a364259d4f..ff2f267544acb4741a6bec6fd1209ce85c14db8a 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_index.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_index.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="adminhtml_widget_instance_block"/> <referenceContainer name="content"> <block class="Magento\Widget\Block\Adminhtml\Widget\Instance" name="adminhtml.widget.instance.grid.container"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml index 08eae29fcf63bde9377e00ba5e7bc5213eed5cbd..ebc59d347f86192a9fb3b0e7d4d7acb2369eb7fa 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Widget\Block\Adminhtml\Widget\Options" name="wysiwyg_widget.options" output="1"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Widget\Block\Adminhtml\Widget\Options" name="wysiwyg_widget.options"/> + </container> </layout> diff --git a/app/code/Magento/Widget/view/frontend/layout/default.xml b/app/code/Magento/Widget/view/frontend/layout/default.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/Widget/view/frontend/layout/default.xml +++ b/app/code/Magento/Widget/view/frontend/layout/default.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/Widget/view/frontend/layout/print.xml b/app/code/Magento/Widget/view/frontend/layout/print.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/Widget/view/frontend/layout/print.xml +++ b/app/code/Magento/Widget/view/frontend/layout/print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/Rss/Block/Wishlist.php b/app/code/Magento/Wishlist/Block/Rss.php similarity index 98% rename from app/code/Magento/Rss/Block/Wishlist.php rename to app/code/Magento/Wishlist/Block/Rss.php index 0a846ab7373d5374516dc2bc20478bbe4f714f1c..e07b25c14f6a91b82c3c09a6aa308bb249c27686 100644 --- a/app/code/Magento/Rss/Block/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Rss.php @@ -21,14 +21,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Rss\Block; +namespace Magento\Wishlist\Block; /** * Customer Shared Wishlist Rss Block * * @author Magento Core Team <core@magentocommerce.com> */ -class Wishlist extends \Magento\Wishlist\Block\AbstractBlock +class Rss extends \Magento\Wishlist\Block\AbstractBlock { /** * Default MAP renderer type diff --git a/app/code/Magento/Wishlist/Controller/Index/Rss.php b/app/code/Magento/Wishlist/Controller/Index/Rss.php new file mode 100644 index 0000000000000000000000000000000000000000..4cac8d716a8e869070b3ed8095b7270821cc602c --- /dev/null +++ b/app/code/Magento/Wishlist/Controller/Index/Rss.php @@ -0,0 +1,108 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Wishlist\Controller\Index; + +use Magento\Wishlist\Controller\IndexInterface; +use Magento\Framework\App\Action; + +class Rss extends Action\Action implements IndexInterface +{ + /** + * @var \Magento\Framework\App\Config\ScopeConfigInterface + */ + protected $scopeConfig; + + /** + * @var \Magento\Wishlist\Controller\WishlistProviderInterface + */ + protected $wishlistProvider; + + /** + * @var \Magento\Customer\Model\Session + */ + protected $customerSession; + + /** + * @var \Magento\Wishlist\Helper\Rss + */ + protected $rssWishlistHelper; + + /** + * @var \Magento\Rss\Helper\DataFactory + */ + protected $rssHelperFactory; + + /** + * @param Action\Context $context + * @param \Magento\Customer\Model\Session $customerSession + * @param \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Wishlist\Helper\Rss $rssWishlitHelper + * @param \Magento\Rss\Helper\DataFactory $rssHelperFactory + */ + public function __construct( + Action\Context $context, + \Magento\Customer\Model\Session $customerSession, + \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Wishlist\Helper\Rss $rssWishlitHelper, + \Magento\Rss\Helper\DataFactory $rssHelperFactory + ) { + $this->customerSession = $customerSession; + $this->wishlistProvider = $wishlistProvider; + $this->scopeConfig = $scopeConfig; + $this->rssWishlistHelper = $rssWishlitHelper; + $this->rssHelperFactory = $rssHelperFactory; + parent::__construct($context); + } + + /** + * Wishlist rss feed action + * Show all public wishlists and private wishlists that belong to current user + * + * @return void + */ + public function execute() + { + if (!$this->rssWishlistHelper->isRssAllow()) { + $this->_forward('noroute'); + return; + } + /** @var \Magento\Wishlist\Model\Wishlist $wishlist */ + $wishlist = $this->wishlistProvider->getWishlist(); + if ($wishlist && ($wishlist->getVisibility() + || $this->customerSession->authenticate($this) + && $wishlist->getCustomerId() == $this->rssWishlistHelper->getCustomer()->getId()) + ) { + $this->getResponse()->setHeader('Content-Type', 'text/xml; charset=UTF-8'); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); + return; + } + /** @var \Magento\Rss\Helper\Data $rssHelper */ + $rssHelper = $this->rssHelperFactory->create(); + $rssHelper->sendEmptyRssFeed($this->getResponse()); + } +} diff --git a/app/code/Magento/Wishlist/Helper/Data.php b/app/code/Magento/Wishlist/Helper/Data.php index f26539233ffa0b56e4fb302b6f5a1c883cc51b78..eb8a6bad771ffe7b3bf1dd4626140d656ba0016d 100644 --- a/app/code/Magento/Wishlist/Helper/Data.php +++ b/app/code/Magento/Wishlist/Helper/Data.php @@ -503,17 +503,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper if ($wishlistId) { $params['wishlist_id'] = $wishlistId; } - return $this->_getUrl('rss/index/wishlist', $params); - } - - /** - * Is allow RSS - * - * @return bool - */ - public function isRssAllow() - { - return $this->_scopeConfig->isSetFlag('rss/wishlist/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); + return $this->_getUrl('wishlist/index/rss', $params); } /** diff --git a/app/code/Magento/Rss/Helper/WishlistRss.php b/app/code/Magento/Wishlist/Helper/Rss.php similarity index 92% rename from app/code/Magento/Rss/Helper/WishlistRss.php rename to app/code/Magento/Wishlist/Helper/Rss.php index 27c465f1dce5d68a174ee5924fbfa68a027f8f0c..5ebeb5e9bae2222c5e32062ec84d2bb511f69a08 100644 --- a/app/code/Magento/Rss/Helper/WishlistRss.php +++ b/app/code/Magento/Wishlist/Helper/Rss.php @@ -22,9 +22,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Rss\Helper; +namespace Magento\Wishlist\Helper; -class WishlistRss extends \Magento\Wishlist\Helper\Data +class Rss extends \Magento\Wishlist\Helper\Data { /** * @var \Magento\Customer\Service\V1\Data\Customer @@ -120,4 +120,15 @@ class WishlistRss extends \Magento\Wishlist\Helper\Data return $this->_customer; } + + /** + * Is allow RSS + * + * @return bool + */ + public function isRssAllow() + { + return $this->_moduleManager->isEnabled('Magento_Rss') + && $this->_scopeConfig->isSetFlag('rss/wishlist/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); + } } diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index b1235d7a0aaaf24a0a0a955bbdfdc9fa30b6a9fc..3158f34b60cafa2142fa13fa2a78119b8e7b09f4 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -3,24 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha91", - "magento/module-customer": "0.1.0-alpha91", - "magento/module-catalog": "0.1.0-alpha91", - "magento/module-core": "0.1.0-alpha91", - "magento/module-checkout": "0.1.0-alpha91", - "magento/module-theme": "0.1.0-alpha91", - "magento/module-catalog-inventory": "0.1.0-alpha91", - "magento/module-backend": "0.1.0-alpha91", - "magento/module-bundle": "0.1.0-alpha91", - "magento/module-sales": "0.1.0-alpha91", - "magento/module-grouped-product": "0.1.0-alpha91", - "magento/module-configurable-product": "0.1.0-alpha91", - "magento/module-downloadable": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha92", + "magento/module-customer": "0.1.0-alpha92", + "magento/module-catalog": "0.1.0-alpha92", + "magento/module-core": "0.1.0-alpha92", + "magento/module-checkout": "0.1.0-alpha92", + "magento/module-theme": "0.1.0-alpha92", + "magento/module-catalog-inventory": "0.1.0-alpha92", + "magento/module-rss": "0.1.0-alpha92", + "magento/module-backend": "0.1.0-alpha92", + "magento/module-bundle": "0.1.0-alpha92", + "magento/module-sales": "0.1.0-alpha92", + "magento/module-grouped-product": "0.1.0-alpha92", + "magento/module-configurable-product": "0.1.0-alpha92", + "magento/module-downloadable": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/code/Magento/Wishlist/etc/adminhtml/system.xml b/app/code/Magento/Wishlist/etc/adminhtml/system.xml index 0cb7ddb862ee01a2854bfe7c59659bee5aa940c7..42cb15fa07b46bed4287ca54fdc6686e87e8da53 100644 --- a/app/code/Magento/Wishlist/etc/adminhtml/system.xml +++ b/app/code/Magento/Wishlist/etc/adminhtml/system.xml @@ -65,5 +65,14 @@ </field> </group> </section> + <section id="rss"> + <group id="wishlist" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> + <label>Wishlist</label> + <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> + <label>Enable RSS</label> + <source_model>Magento\Backend\Model\Config\Source\Enabledisable</source_model> + </field> + </group> + </section> </system> </config> diff --git a/app/code/Magento/Wishlist/etc/di.xml b/app/code/Magento/Wishlist/etc/di.xml index 91f5e8d05a1ff87d6adead2331883f1079be304c..9c210b5cb70218e307b4b65412b310920dc9522a 100644 --- a/app/code/Magento/Wishlist/etc/di.xml +++ b/app/code/Magento/Wishlist/etc/di.xml @@ -39,4 +39,14 @@ <type name="Magento\Wishlist\Controller\IndexInterface"> <plugin name="authentication" type="\Magento\Wishlist\Controller\Index\Plugin" sortOrder="10"/> </type> + <virtualType name="Magento\Wishlist\Block\Context" type="Magento\Catalog\Block\Product\Context"> + <arguments> + <argument name="wishlistHelper" xsi:type="object">Magento\Wishlist\Helper\Rss</argument> + </arguments> + </virtualType> + <type name="Magento\Wishlist\Block\Rss"> + <arguments> + <argument name="context" xsi:type="object">Magento\Wishlist\Block\Context</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Wishlist/etc/module.xml b/app/code/Magento/Wishlist/etc/module.xml index b2d43717cc4d2de66da38bfa70ffab025fd2c8ff..2714347a3a0f1937f3998e60342583dbd420bb8a 100644 --- a/app/code/Magento/Wishlist/etc/module.xml +++ b/app/code/Magento/Wishlist/etc/module.xml @@ -39,6 +39,7 @@ <module name="Magento_CatalogInventory"/> <module name="Magento_Backend"/> <module name="Magento_Bundle" type="soft"/> + <module name="Magento_Rss"/> <module name="Magento_Sales"/> <module name="Magento_GroupedProduct"/> <module name="Magento_ConfigurableProduct" type="soft"/> diff --git a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml index e7b5cebc5d0ae3f93e8fea439ec485aa880113c1..31b489744e0848590f0e5b5606f12e80c38bc433 100644 --- a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml @@ -23,108 +23,110 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Backend\Block\Widget\Grid" name="customer.wishlist.edit.tab" output="1"> - <arguments> - <argument name="dataSource" xsi:type="object">Magento\Wishlist\Model\Resource\Item\Collection\Grid</argument> - <argument name="id" xsi:type="string">wishlistGrid</argument> - <argument name="use_ajax" xsi:type="string">true</argument> - <argument name="default_sort" xsi:type="string">added_at</argument> - <argument name="grid_url" xsi:type="url" path="*/*/wishlist"> - <param name="_current">1</param> - </argument> - <argument name="product_configuration_helpers" xsi:type="array"> - <item name="default" xsi:type="string">Magento\Catalog\Helper\Product\Configuration</item> - </argument> - </arguments> - <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="customer.wishlist.edit.tab.columnSet"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Backend\Block\Widget\Grid" name="customer.wishlist.edit.tab"> <arguments> - <argument name="rowUrl" xsi:type="array"> - <item name="path" xsi:type="string">catalog/product/edit</item> - <item name="extraParamsTemplate" xsi:type="array"> - <item name="id" xsi:type="string">getProductId</item> - </item> + <argument name="dataSource" xsi:type="object">Magento\Wishlist\Model\Resource\Item\Collection\Grid</argument> + <argument name="id" xsi:type="string">wishlistGrid</argument> + <argument name="use_ajax" xsi:type="string">true</argument> + <argument name="default_sort" xsi:type="string">added_at</argument> + <argument name="grid_url" xsi:type="url" path="*/*/wishlist"> + <param name="_current">1</param> + </argument> + <argument name="product_configuration_helpers" xsi:type="array"> + <item name="default" xsi:type="string">Magento\Catalog\Helper\Product\Configuration</item> </argument> - <argument name="empty_text" xsi:type="string" translate="true">No Items Found</argument> </arguments> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="product_name"> - <arguments> - <argument name="header" xsi:type="string" translate="true">Product</argument> - <argument name="id" xsi:type="string">product_name</argument> - <argument name="index" xsi:type="string">product_name</argument> - <argument name="renderer" xsi:type="string">Magento\Customer\Block\Adminhtml\Edit\Tab\View\Grid\Renderer\Item</argument> - <argument name="column_css_class" xsi:type="string">col-name</argument> - <argument name="header_css_class" xsi:type="string">col-name</argument> - </arguments> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="description"> - <arguments> - <argument name="header" xsi:type="string" translate="true">User description</argument> - <argument name="index" xsi:type="string">description</argument> - <argument name="id" xsi:type="string">description</argument> - <argument name="renderer" xsi:type="string">Magento\Customer\Block\Adminhtml\Edit\Tab\Wishlist\Grid\Renderer\Description</argument> - </arguments> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="qty"> - <arguments> - <argument name="header" xsi:type="string" translate="true">Quantity</argument> - <argument name="index" xsi:type="string">qty</argument> - <argument name="type" xsi:type="string">number</argument> - <argument name="id" xsi:type="string">qty</argument> - </arguments> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Column\Multistore" as="store"> - <arguments> - <argument name="header" xsi:type="string" translate="true">Add Locale</argument> - <argument name="index" xsi:type="string">store_id</argument> - <argument name="type" xsi:type="string">store</argument> - </arguments> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="added_at"> - <arguments> - <argument name="header" xsi:type="string" translate="true">Add Date</argument> - <argument name="index" xsi:type="string">added_at</argument> - <argument name="gmtoffset" xsi:type="string">1</argument> - <argument name="type" xsi:type="string">date</argument> - <argument name="id" xsi:type="string">added_at</argument> - </arguments> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="days"> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="customer.wishlist.edit.tab.columnSet"> <arguments> - <argument name="header" xsi:type="string" translate="true">Days in Wish List</argument> - <argument name="index" xsi:type="string">days_in_wishlist</argument> - <argument name="type" xsi:type="string">number</argument> - <argument name="id" xsi:type="string">days</argument> + <argument name="rowUrl" xsi:type="array"> + <item name="path" xsi:type="string">catalog/product/edit</item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="id" xsi:type="string">getProductId</item> + </item> + </argument> + <argument name="empty_text" xsi:type="string" translate="true">No Items Found</argument> </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="product_name"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Product</argument> + <argument name="id" xsi:type="string">product_name</argument> + <argument name="index" xsi:type="string">product_name</argument> + <argument name="renderer" xsi:type="string">Magento\Customer\Block\Adminhtml\Edit\Tab\View\Grid\Renderer\Item</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="description"> + <arguments> + <argument name="header" xsi:type="string" translate="true">User description</argument> + <argument name="index" xsi:type="string">description</argument> + <argument name="id" xsi:type="string">description</argument> + <argument name="renderer" xsi:type="string">Magento\Customer\Block\Adminhtml\Edit\Tab\Wishlist\Grid\Renderer\Description</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="qty"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Quantity</argument> + <argument name="index" xsi:type="string">qty</argument> + <argument name="type" xsi:type="string">number</argument> + <argument name="id" xsi:type="string">qty</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column\Multistore" as="store"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Add Locale</argument> + <argument name="index" xsi:type="string">store_id</argument> + <argument name="type" xsi:type="string">store</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="added_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Add Date</argument> + <argument name="index" xsi:type="string">added_at</argument> + <argument name="gmtoffset" xsi:type="string">1</argument> + <argument name="type" xsi:type="string">date</argument> + <argument name="id" xsi:type="string">added_at</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="days"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Days in Wish List</argument> + <argument name="index" xsi:type="string">days_in_wishlist</argument> + <argument name="type" xsi:type="string">number</argument> + <argument name="id" xsi:type="string">days</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="action"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Action</argument> + <argument name="index" xsi:type="string">wishlist_item_id</argument> + <argument name="renderer" xsi:type="string">Magento\Customer\Block\Adminhtml\Grid\Renderer\Multiaction</argument> + <argument name="sortable" xsi:type="string">0</argument> + <argument name="filter" xsi:type="string">0</argument> + <argument name="actions" xsi:type="array"> + <item name="configure" xsi:type="array"> + <item name="caption" xsi:type="string" translate="true">Configure</item> + <item name="url" xsi:type="string">javascript:void(0)</item> + <item name="process" xsi:type="string">configurable</item> + <item name="control_object" xsi:type="string">wishlistControl</item> + </item> + <item name="delete" xsi:type="array"> + <item name="caption" xsi:type="string" translate="true">Delete</item> + <item name="url" xsi:type="string">#</item> + <item name="onclick" xsi:type="string">return wishlistControl.removeItem($wishlist_item_id);</item> + </item> + </argument> + </arguments> + </block> </block> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="action"> + <block class="Magento\Framework\View\Element\Template" as="grid.js"> <arguments> - <argument name="header" xsi:type="string" translate="true">Action</argument> - <argument name="index" xsi:type="string">wishlist_item_id</argument> - <argument name="renderer" xsi:type="string">Magento\Customer\Block\Adminhtml\Grid\Renderer\Multiaction</argument> - <argument name="sortable" xsi:type="string">0</argument> - <argument name="filter" xsi:type="string">0</argument> - <argument name="actions" xsi:type="array"> - <item name="configure" xsi:type="array"> - <item name="caption" xsi:type="string" translate="true">Configure</item> - <item name="url" xsi:type="string">javascript:void(0)</item> - <item name="process" xsi:type="string">configurable</item> - <item name="control_object" xsi:type="string">wishlistControl</item> - </item> - <item name="delete" xsi:type="array"> - <item name="caption" xsi:type="string" translate="true">Delete</item> - <item name="url" xsi:type="string">#</item> - <item name="onclick" xsi:type="string">return wishlistControl.removeItem($wishlist_item_id);</item> - </item> - </argument> + <argument name="js_object_name" xsi:type="string">wishlistGridJsObject</argument> + <argument name="template" xsi:type="string">Magento_Wishlist::customer/edit/tab/wishlist.phtml</argument> </arguments> </block> </block> - <block class="Magento\Framework\View\Element\Template" as="grid.js"> - <arguments> - <argument name="js_object_name" xsi:type="string">wishlistGridJsObject</argument> - <argument name="template" xsi:type="string">Magento_Wishlist::customer/edit/tab/wishlist.phtml</argument> - </arguments> - </block> - </block> + </container> </layout> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Wishlist/view/frontend/layout/catalog_category_view.xml index 0366b7b42098e3d93ed770369b98509c500187a7..7eded3289074cc72a304e322fa8d903f591d28fd 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/catalog_category_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Core\Block\RequireCookie" name="require-cookie" template="Magento_Core::require_cookie.phtml"> <arguments> @@ -33,4 +33,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml index 0366b7b42098e3d93ed770369b98509c500187a7..7eded3289074cc72a304e322fa8d903f591d28fd 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Core\Block\RequireCookie" name="require-cookie" template="Magento_Core::require_cookie.phtml"> <arguments> @@ -33,4 +33,4 @@ </arguments> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml b/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml index 5e90d3293991796893308cd798ab2ab49c824485..d079d8f85c6e939bf9bd7a00f326491846d0afe3 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="wishlist/general/active" name="customer-account-navigation-wish-list-link"> <arguments> @@ -32,4 +32,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/default.xml b/app/code/Magento/Wishlist/view/frontend/layout/default.xml index 41b2f3a8a329bc2a7636aeeacfd3f54b8e46b834..5f65bd6a72b9273fbb79eda0cba39c08ed4fa867 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/default.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="wishlist_page_head_components" template="Magento_Wishlist::js/components.phtml"/> </referenceBlock> @@ -33,4 +33,4 @@ <referenceContainer name="sidebar.additional"> <block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml index ab5b35d7429923b4631a6a616635073437f5f004..9c29f45c2c0d4fa398e7b6c441fb32865075152a 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="catalog_product_view"/> <referenceContainer name="product.info.main"> <block class="Magento\Wishlist\Block\Item\Configure" name="product.info.addto" as="addto" template="Magento_Wishlist::item/configure/addto.phtml"/> @@ -36,4 +36,4 @@ <argument name="element" xsi:type="string">product.info.addtocart.additional</argument> </action> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml index ea3f602e1c656fcfcac7a30513a3633ce96ee91b..a46c5707481188cafbba670c212437dd240f8f43 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="root"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> + <referenceBlock name="body.class"> <action method="addBodyClass"> <argument name="value" xsi:type="string">type-bundle</argument> </action> @@ -74,4 +74,4 @@ <container name="product.info.bundle.extra" after="product.info.bundle" as="product_type_data_extra" label="Product Extra Info"/> <block class="Magento\Catalog\Block\Product\View" name="customize.button" as="customize_button" template="Magento_Bundle::catalog/product/view/customize.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml index 7f1375379d7c029971be2f3afbd64c68f474537a..16a3daa2b226a1535273a1378d62dab4dd6ec688 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml @@ -23,12 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="wishlist_product_view_head_components" template="Magento_Wishlist::js/components.phtml"/> <block class="Magento\Framework\View\Element\Js\Components" name="configurableproduct_product_view_head_components" template="Magento_ConfigurableProduct::js/components.phtml"/> </referenceBlock> - <referenceBlock name="root"> + <referenceBlock name="body.class"> <action method="addBodyClass"> <argument name="value" xsi:type="string">type-configurable</argument> </action> @@ -40,4 +40,4 @@ <referenceBlock name="product.info.options.wrapper"> <block class="Magento\ConfigurableProduct\Block\Product\View\Type\Configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="product/view/type/options/configurable.phtml"/> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_downloadable.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_downloadable.xml index 69d5d249d2a91a3c035a5814e9a57155422d3172..f687d7aff12100aeb5a3bc43e25a1177b037f649 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_downloadable.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_downloadable.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="wishlist_product_view_head_components" template="Magento_Wishlist::js/components.phtml"/> <block class="Magento\Framework\View\Element\Js\Components" name="downloadable_page_head_components" template="Magento_Downloadable::js/components.phtml"/> @@ -45,4 +45,4 @@ </block> </block> </referenceBlock> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml index 7e1d8e3dfa17bac542222319005743afd1ba7f45..c90b9a49ba267296f8edf2a1312fd9925d3e9f02 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="product.info.form.content"> <block class="Magento\GroupedProduct\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="product/view/type/grouped.phtml"/> <container name="product.info.grouped.extra" after="product.info.grouped" before="product.info.grouped" as="product_type_data_extra" label="Product Extra Info"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml index 1f8e6ac9bf70f11b12eb0033ce24e15abc35089b..28642f37db44e030bf7ebfb129a8ff85eff6a391 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"/> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"/> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml index ffa262e76caf63a3855b3a923d4a10f18e2d3ad6..8eea8ecf041f281781e48781daa20ec93c289d36 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="wishlist_head_components" template="Magento_Wishlist::js/components.phtml"/> @@ -69,4 +69,4 @@ </container> </block> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_index_wishlist.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_rss.xml similarity index 82% rename from app/code/Magento/Rss/view/frontend/layout/rss_index_wishlist.xml rename to app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_rss.xml index 434dfb0c660e624063f3826602a88b54b9553677..eef27d07ac2e8a053610301068e0d34af6c9dd15 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_index_wishlist.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_rss.xml @@ -23,6 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Rss\Block\Wishlist" name="rss.wishlist" output="1" cacheable="false" /> -</layout> \ No newline at end of file +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_generic.xsd"> + <container name="root"> + <block class="Magento\Wishlist\Block\Rss" name="rss.wishlist" cacheable="false"/> + </container> +</layout> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml index ea40884e750e1958beccdac8ee67f6daa63cfe01..664ce5c229a7d8eb67be1c25545dd7b2340a1e24 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Wishlist\Block\Customer\Sharing" name="wishlist.sharing" template="sharing.phtml"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml index c60238fb7d85b87265f45e7055e738e652f13d74..4926a752ea146771fa8cf2ef2e5a99fb8a623be0 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/page.xsd"> <referenceContainer name="content"> <block class="Magento\Wishlist\Block\Share\Wishlist" name="customer.wishlist" template="shared.phtml" cacheable="false"/> </referenceContainer> -</layout> +</page> diff --git a/app/code/Magento/Wishlist/view/frontend/templates/sharing.phtml b/app/code/Magento/Wishlist/view/frontend/templates/sharing.phtml index 3ae939681817f8f1305d4d3c45e5d62612b30697..8a62ab39cef156afe6226af09a2bedea51cf2216 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/sharing.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/sharing.phtml @@ -45,7 +45,7 @@ <textarea id="message" name="message" cols="60" rows="5"><?php echo $this->getEnteredData('message') ?></textarea> </div> </div> - <?php if($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow()): ?> + <?php if($this->helper('Magento\Wishlist\Helper\Rss')->isRssAllow()): ?> <div class="field choice rss"> <input type="checkbox" name="rss_url" id="rss_url" value="1" title="<?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?>" class="checkbox"> <label class="label" for="rss_url"> diff --git a/app/code/Magento/Wishlist/view/frontend/templates/view.phtml b/app/code/Magento/Wishlist/view/frontend/templates/view.phtml index 0818726eb128f4ec39bfe8593f5efaaf3efccba1..9b18af283ce73339ec8b98c05e71f65ecb032011 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/view.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/view.phtml @@ -25,7 +25,7 @@ ?> <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> - <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow() && $this->hasWishlistItems()): ?> + <?php if ($this->helper('Magento\Wishlist\Helper\Rss')->isRssAllow() && $this->hasWishlistItems()): ?> <a href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getRssUrl($this->getWishlistInstance()->getId()); ?>" class="action rss wishlist"> <span><?php echo __('RSS Feed') ?></span> </a> diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml b/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml index 8fd44f9188e01c278907ba7335d6259cd4a33e7a..1396fa1842e9975a85c8b7cd8abecc149bf1efcf 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="mui-reset-css"> <arguments> @@ -90,4 +90,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 9d0746de0d3c570a83f61f4c659c062d453a5780..9309de8d7a418f084199635f8adcbe97cc2fec30 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/design/adminhtml/Magento/backend/theme.xml b/app/design/adminhtml/Magento/backend/theme.xml index e1241b1f7e112e78745818fd0b8a4d466b1c26d0..9956b848f4702b430addb514ed7b938dcea39603 100644 --- a/app/design/adminhtml/Magento/backend/theme.xml +++ b/app/design/adminhtml/Magento/backend/theme.xml @@ -24,5 +24,5 @@ --> <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Magento 2 backend</title> - <version>0.1.0-alpha91</version> + <version>0.1.0-alpha92</version> </theme> diff --git a/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less index 9a9d1525db97ecf3cb943e7ef73f908933e67b93..4b7645a1abbbdd9cf303a97d2669d06a2654b5b6 100644 --- a/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less @@ -130,9 +130,9 @@ .product-options-wrapper, .product-options-bottom, .block-bundle-summary { - .layout-2-left &, - .layout-2-right &, - .layout-3 & { + .page-layout-2column-left &, + .page-layout-2column-right &, + .page-layout-3column & { width: 48%; } } diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/layout/catalog_product_view.xml b/app/design/frontend/Magento/blank/Magento_Catalog/layout/catalog_product_view.xml index 6f19ae1a64bf336f56639f9af5ef36761bf11a5d..4bd5699de1b6d0384b41bd099aad8a8c4361f8c9 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/layout/catalog_product_view.xml +++ b/app/design/frontend/Magento/blank/Magento_Catalog/layout/catalog_product_view.xml @@ -23,8 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> <move element="page.main.title" destination="product.info.main" before="-"/> <move element="product.info.media" destination="content" before="product.info.main" /> -</layout> +</page> diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less index 687a2d2ed31ce36e2e272c756bc0ab59be66d399..9069515b799cc3f02bce5cc466931f4069e6ee60 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less @@ -448,7 +448,7 @@ .product.media { float: left; } - .layout-1 { + .page-layout-1column { .product-info-main { width: 40%; } @@ -456,9 +456,9 @@ width: 57%; } } - .layout-2-left, - .layout-2-right, - .layout-3 { + .page-layout-2columns-left, + .page-layout-2columns-right, + .page-layout-3columns { .product-info-main { width: 48%; } diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_cart_index.xml b/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_cart_index.xml index ee7e15122e2320acf90e620d9eb76ea944a331f0..8c3c76241837b3beb24fac8bbf892c354fc75a5c 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_cart_index.xml +++ b/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_cart_index.xml @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> - <update handle="page_one_column" /> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> <referenceContainer name="checkout.cart.items"> <container name="checkout.cart.container" label="invisible" htmlTag="div" htmlClass="cart-container" before="-"> <container name="cart.summary" label="Cart Summary Container" htmlTag="div" htmlClass="cart-summary" after="-"> @@ -49,4 +48,4 @@ <move element="checkout.cart.coupon" destination="cart.summary" /> <move element="checkout.cart.totals" destination="cart.summary"/> <move element="checkout.cart.methods.bottom" destination="cart.summary"/> -</layout> +</page> diff --git a/app/design/frontend/Magento/blank/Magento_Customer/layout/customer_account.xml b/app/design/frontend/Magento/blank/Magento_Customer/layout/customer_account.xml index a31dca5a264ced21d5436f0d7613db049fa4965b..aaaa5b6157d0a0c16d643023843cdb31d28af3a6 100644 --- a/app/design/frontend/Magento/blank/Magento_Customer/layout/customer_account.xml +++ b/app/design/frontend/Magento/blank/Magento_Customer/layout/customer_account.xml @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> - <update handle="page_two_columns_left"/> - <referenceBlock name="root"> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> + <referenceBlock name="body.class"> <action method="addBodyClass"> <argument name="class" xsi:type="string">account</argument> </action> @@ -61,4 +60,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/module.less index a8d69d856e6d76489d03f4aef4bdb810069d3ca7..f96d322cf8c0d829c0e205e7a6706208c8d809a5 100644 --- a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/module.less @@ -342,7 +342,7 @@ } // My account - .account.layout-2-left { + .account.page-layout-2column-left { .sidebar-main, .sidebar-additional { width: 22.3%; diff --git a/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml b/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml index cf89503fff6aa698849f08e0b8e09c8e53d5ac7a..7fdd07f52255bd6263692272cee0deea0b729995 100644 --- a/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml +++ b/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml @@ -21,11 +21,11 @@ * * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -*/ + */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> - <referenceContainer name="header-container"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> + <referenceContainer name="header.container"> <container name="header.panel.wrapper" htmlClass="panel wrapper" htmlTag="div" before="-" /> </referenceContainer> <move element="header.panel" destination="header.panel.wrapper" /> @@ -33,7 +33,7 @@ <move element="catalog.topnav" destination="store.menu" before="-" /> - <referenceContainer name="page_top"> + <referenceContainer name="page.top"> <block class="Magento\Framework\View\Element\Template" name="navigation.sections" before="-" template="Magento_Theme::html/sections.phtml"> <arguments> <argument name="group_name" xsi:type="string">navigation-sections</argument> @@ -44,7 +44,7 @@ <argument name="title" translate="true" xsi:type="string">Menu</argument> </arguments> </block> - <block class="Magento\Framework\View\Element\Text" name="store.links" group="navigation-sections" output="1"> + <block class="Magento\Framework\View\Element\Text" name="store.links" group="navigation-sections"> <arguments> <argument name="title" translate="true" xsi:type="string">Account</argument> <argument name="use_force" xsi:type="boolean">true</argument> @@ -68,4 +68,4 @@ </block> </block> </referenceContainer> -</layout> +</page> diff --git a/app/design/frontend/Magento/blank/Magento_Theme/layout/default_head_blocks.xml b/app/design/frontend/Magento/blank/Magento_Theme/layout/default_head_blocks.xml index 7b503b96d50467842c34e050f63b9dc9fbab7bc0..56cd6b240af2278dfcc1fb38fb53236b1e20a9b3 100644 --- a/app/design/frontend/Magento/blank/Magento_Theme/layout/default_head_blocks.xml +++ b/app/design/frontend/Magento/blank/Magento_Theme/layout/default_head_blocks.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Core/etc/page.xsd"> <referenceBlock name="head"> <block class="Magento\Theme\Block\Html\Head\Css" name="css-styles-css"> <arguments> @@ -31,4 +31,4 @@ </arguments> </block> </referenceBlock> -</layout> +</page> diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index 755c77f48ac960d052c3ffc707e053b36c548195..e7005b4400b0c3a6d430894d831c06789a63fb29 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/design/frontend/Magento/blank/theme.xml b/app/design/frontend/Magento/blank/theme.xml index 6c89ce8a33f3e92b74fdf2ebf938a9adaa93b12b..53d9e5ba7fd5eab3cc3257366dff24c92accc54f 100644 --- a/app/design/frontend/Magento/blank/theme.xml +++ b/app/design/frontend/Magento/blank/theme.xml @@ -24,7 +24,7 @@ --> <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Magento Blank</title> - <version>0.1.0-alpha91</version> + <version>0.1.0-alpha92</version> <media> <preview_image>media/preview.jpg</preview_image> </media> diff --git a/app/design/frontend/Magento/blank/web/css/source/layout.less b/app/design/frontend/Magento/blank/web/css/source/layout.less index 18434676bc6a6b4217460eb7b64641c6889b5f66..915763854a14809e75c9ecbc8125e4fbdf27bc94 100644 --- a/app/design/frontend/Magento/blank/web/css/source/layout.less +++ b/app/design/frontend/Magento/blank/web/css/source/layout.less @@ -95,7 +95,7 @@ &:extend(.add-box-sizing-desktop all); } - .layout-2-right .sidebar-main { + .page-layout-2column-right .sidebar-main { padding-right: 0; padding-left: @layout-column-main-sidebar-offset; } @@ -107,7 +107,7 @@ &:extend(.add-box-sizing-desktop all); } - .layout-2-left { + .page-layout-2column-left { .sidebar-additional { padding-right: @layout-column-additional-sidebar-offset; padding-left: 0; diff --git a/app/design/frontend/Magento/plushe/composer.json b/app/design/frontend/Magento/plushe/composer.json index 72363cea6328c3c2b086bf18263bc80ca1b0b31d..c8b3ce1d3d2297f15593b4436817e5df9fd4a18b 100644 --- a/app/design/frontend/Magento/plushe/composer.json +++ b/app/design/frontend/Magento/plushe/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/theme-frontend-blank": "0.1.0-alpha91", - "magento/framework": "0.1.0-alpha91", + "magento/theme-frontend-blank": "0.1.0-alpha92", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "extra": { "map": [ [ diff --git a/app/design/frontend/Magento/plushe/theme.xml b/app/design/frontend/Magento/plushe/theme.xml index 566974dc62e6aab5d1db8dc4332cfbe74514c1e7..c0b39a9f3764df1254c7cb1de977aeb53836e766 100644 --- a/app/design/frontend/Magento/plushe/theme.xml +++ b/app/design/frontend/Magento/plushe/theme.xml @@ -24,7 +24,7 @@ --> <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Magento Plushe</title> - <version>0.1.0-alpha91</version> + <version>0.1.0-alpha92</version> <parent>Magento/blank</parent> <media> <preview_image>media/preview.jpg</preview_image> diff --git a/app/design/install/Magento/basic/theme.xml b/app/design/install/Magento/basic/theme.xml index 24d35b0131b064f5a5c5efc6393d40977a637fbb..42cb97ca0009280337493a9b94eae5959948775f 100644 --- a/app/design/install/Magento/basic/theme.xml +++ b/app/design/install/Magento/basic/theme.xml @@ -24,5 +24,5 @@ --> <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Magento Basic</title> - <version>0.1.0-alpha91</version> + <version>0.1.0-alpha92</version> </theme> diff --git a/app/etc/di.xml b/app/etc/di.xml index 7ac6f2a8fe909cc578bfc21335c3ac2ae05d999b..c6ef9807ad5779746b17ed8e59c06e4dc86179bb 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -89,6 +89,7 @@ <preference for="Magento\Framework\Mview\View\SubscriptionInterface" type="Magento\Framework\Mview\View\Subscription" /> <preference for="Magento\Framework\Mview\View\ChangelogInterface" type="Magento\Framework\Mview\View\Changelog" /> <preference for="Magento\Framework\View\Design\FileResolution\Fallback\CacheDataInterface" type="Magento\Framework\View\Design\FileResolution\Fallback\CacheData\Flat"/> + <preference for="Magento\Framework\Service\Data\AttributeMetadataBuilderInterface" type="Magento\Framework\Service\Data\AttributeMetadataBuilder"/> <type name="Magento\Framework\Model\Context"> <arguments> <argument name="actionValidator" xsi:type="object">Magento\Framework\Model\ActionValidator\RemoveAction\Proxy</argument> diff --git a/app/i18n/magento/de_de/composer.json b/app/i18n/magento/de_de/composer.json index a1e261976da7ddf1f770fa4fb88a7eae94f07a49..cfafe951a37bc72797fb941b555fd87bccae64a0 100644 --- a/app/i18n/magento/de_de/composer.json +++ b/app/i18n/magento/de_de/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-de_de", "description": "German (Germany) language", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/en_us/composer.json b/app/i18n/magento/en_us/composer.json index 86d92fb28c57fd9714d5d9ac7e65de6fa5c970b2..c1de5ebb5dec63807d25e17c052e26436a67ef1b 100644 --- a/app/i18n/magento/en_us/composer.json +++ b/app/i18n/magento/en_us/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-en_us", "description": "English (United States) language", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/es_es/composer.json b/app/i18n/magento/es_es/composer.json index 06ff6c531706327e8b9ad9590cc65b4ac93a8f38..35110dd92adbd8266fb0aad99d6b03582e308676 100644 --- a/app/i18n/magento/es_es/composer.json +++ b/app/i18n/magento/es_es/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-es_es", "description": "Spanish (Spain) language", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/fr_fr/composer.json b/app/i18n/magento/fr_fr/composer.json index 9abad4a014cbcb7ef61c019a5e7868816210a2ab..e4ac4b9d6c8a92a981dbf4a30a84d07820ede1f0 100644 --- a/app/i18n/magento/fr_fr/composer.json +++ b/app/i18n/magento/fr_fr/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-fr_fr", "description": "French (France) language", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/nl_nl/composer.json b/app/i18n/magento/nl_nl/composer.json index d18687dd182a7f41e7b9bb51331bde5ec26fc11f..b04200d1f4ac5e8ba3ff0e0782bb8621f4282189 100644 --- a/app/i18n/magento/nl_nl/composer.json +++ b/app/i18n/magento/nl_nl/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-nl_nl", "description": "Dutch (Netherlands) language", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/pt_br/composer.json b/app/i18n/magento/pt_br/composer.json index 5c27edf02a0365f4d2f2c4eb846a69a632ad1e09..b8e98a3a222fcdfe8fe9facdb35a89082b3e9b55 100644 --- a/app/i18n/magento/pt_br/composer.json +++ b/app/i18n/magento/pt_br/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-pt_br", "description": "Portuguese (Brazil) language", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/zh_cn/composer.json b/app/i18n/magento/zh_cn/composer.json index 3484087c8d12bdeba665c8e4878624188b93f819..033e6ee477e751a83f45cd7ed52103341e101a1b 100644 --- a/app/i18n/magento/zh_cn/composer.json +++ b/app/i18n/magento/zh_cn/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-zh_cn", "description": "Chinese (China) language", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { - "magento/framework": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha92", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/composer.json b/composer.json index 5a5756d06fbdc3cafca320de701d75c10151a9c0..b1284d44e3600f5fd5079f8623b0080a957c796d 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/project-community-edition", "description": "Magento project (Community Edition)", "type": "project", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { "php": "~5.4.11|~5.5.0" }, diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/OptgroupselectElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/OptgroupselectElement.php new file mode 100644 index 0000000000000000000000000000000000000000..b5b343dedc355f0a6fabdc945aef0efe69e4ae2e --- /dev/null +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/OptgroupselectElement.php @@ -0,0 +1,74 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Mtf\Client\Driver\Selenium\Element; + +use Mtf\Client\Driver\Selenium\Element; + +/** + * Class OptgroupselectElement + * Typified element class for option group selectors + */ +class OptgroupselectElement extends SelectElement +{ + /** + * Option group selector + * + * @var string + */ + protected $optGroup = 'optgroup[option[contains(.,"%s")]]'; + + /** + * Get the value of form element + * + * @return string + */ + public function getValue() + { + $this->_eventManager->dispatchEvent(['get_value'], [(string)$this->_locator]); + $selectedLabel = trim($this->_getWrappedElement()->selectedLabel()); + $value = trim( + $this->_getWrappedElement()->byXPath(sprintf($this->optGroup, $selectedLabel))->attribute('label'), + chr(0xC2) . chr(0xA0) + ); + $value .= '/' . $selectedLabel; + return $value; + } + + /** + * Select value in dropdown which has option groups + * + * @param string $value + * @return void + */ + public function setValue($value) + { + $this->_eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); + list($group, $option) = explode('/', $value); + $optionLocator = ".//optgroup[@label='$group']/option[contains(text(), '$option')]"; + $criteria = new \PHPUnit_Extensions_Selenium2TestCase_ElementCriteria('xpath'); + $criteria->value($optionLocator); + $this->_getWrappedElement(true)->selectOptionByCriteria($criteria); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminCache.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.php similarity index 58% rename from dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminCache.php rename to dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.php index e04fb92fce7ed8b7d7b4059561070924150667c6..96bdbf2f867eb06077f44cf8b5f06ca8dd559304 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminCache.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.php @@ -22,67 +22,49 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Backend\Test\Page; +namespace Magento\Backend\Test\Page\Adminhtml; -use Mtf\Page\Page; -use Mtf\Factory\Factory; -use Mtf\Client\Element\Locator; +use Mtf\Page\BackendPage; /** * Class AdminCache * Cache Management page - * */ -class AdminCache extends Page +class AdminCache extends BackendPage { /** * URL part for cache management page */ const MCA = 'admin/cache/'; - /** - * Cache actions block - * - * @var string - */ - protected $cacheBlock = 'div.page-actions'; - - /** - * Global messages block - * - * @var string - */ - protected $messagesBlock = '#messages .messages'; + protected $_blocks = [ + 'messagesBlock' => [ + 'name' => 'messagesBlock', + 'class' => 'Magento\Core\Test\Block\Messages', + 'locator' => '#messages .messages', + 'strategy' => 'css selector', + ], + 'actionsBlock' => [ + 'name' => 'actionsBlock', + 'class' => 'Magento\Backend\Test\Block\Cache', + 'locator' => 'div.page-actions', + 'strategy' => 'css selector', + ], + ]; /** - * Constructor + * @return \Magento\Core\Test\Block\Messages */ - protected function _init() + public function getMessagesBlock() { - $this->_url = $_ENV['app_backend_url'] . self::MCA; + return $this->getBlockInstance('messagesBlock'); } /** - * Get cache actions block - * * @return \Magento\Backend\Test\Block\Cache */ public function getActionsBlock() { - return Factory::getBlockFactory()->getMagentoBackendCache( - $this->_browser->find($this->cacheBlock, Locator::SELECTOR_CSS) - ); - } - - /** - * Get messages block - * - * @return \Magento\Core\Test\Block\Messages - */ - public function getMessagesBlock() - { - return Factory::getBlockFactory()->getMagentoCoreMessages( - $this->_browser->find($this->messagesBlock, Locator::SELECTOR_CSS) - ); + return $this->getBlockInstance('actionsBlock'); } } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.xml new file mode 100644 index 0000000000000000000000000000000000000000..662b61b1d2652aff7b323d59b34eff4b3c4895a2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page mca="admin/cache/"> + <block> + <name>messagesBlock</name> + <class>Magento\Core\Test\Block\Messages</class> + <locator>#messages .messages</locator> + <strategy>css selector</strategy> + </block> + <block> + <name>actionsBlock</name> + <class>Magento\Backend\Test\Block\Cache</class> + <locator>div.page-actions</locator> + <strategy>css selector</strategy> + </block> +</page> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php index 5608bd54009a22a93272ce0df156dacfaf94cf6c..90f488e4163275e8006864ddc2852ba1a655de0a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php @@ -61,6 +61,7 @@ class CreateProductAttributeEntityTest extends Injectable CatalogProductAttributeNew $attributeNew, CatalogAttributeSet $productTemplate ) { + $this->markTestIncomplete('MAGETWO-27282'); //Precondition $productTemplate->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php index 5b449eaf42e9aef8a4b0e3812d59ae93890e7b9f..c3f616e28986a88b070926655758c2e826371c38 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php @@ -69,6 +69,7 @@ class UpdateProductAttributeEntityTest extends Injectable CatalogProductAttributeIndex $attributeIndex, CatalogProductAttributeNew $attributeNew ) { + $this->markTestIncomplete('MAGETWO-27282'); //Precondition $productTemplate->persist(); $productAttributeOriginal->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.php index d7a4d90841c6bfd15b19087bbd7092a6e09ced4c..cf4e695c761687789665e57935102ec08e80b0d4 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.php @@ -37,7 +37,7 @@ class CheckoutCart extends FrontendPage 'cartBlock' => [ 'name' => 'cartBlock', 'class' => 'Magento\Checkout\Test\Block\Cart', - 'locator' => '//div[contains(@class, "cart-container")]', + 'locator' => '//div[contains(@class, "column main")]', 'strategy' => 'xpath', ], 'messagesBlock' => [ diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml index db32d6943bec3e20502088d6e6c5ed17841e318b..a44b211c9d4e46e5b632d2805d6fd626d4961cf4 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml @@ -27,7 +27,7 @@ <block> <name>cartBlock</name> <class>Magento\Checkout\Test\Block\Cart</class> - <locator>//div[contains(@class, "cart-container")]</locator> + <locator>//div[contains(@class, "column main")]</locator> <strategy>xpath</strategy> </block> <block> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsPage/Curl.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsPage/Curl.php index d3721660c4f859c2383501621d7283223aef66d5..c348ea65ba8750bb0d50c3724313baea58369f55 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsPage/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsPage/Curl.php @@ -50,11 +50,11 @@ class Curl extends Conditions implements CmsPageInterface 'store_id' => [ 'All Store Views' => 0, ], - 'root_template' => [ - '1 column' => 'one_column', - '2 columns with left bar' => 'two_columns_left', - '2 columns with right bar' => 'two_columns_right', - '3 columns' => 'three_columns' + 'page_layout' => [ + '1 column' => '1column', + '2 columns with left bar' => '2columns-left', + '2 columns with right bar' => '2columns-right', + '3 columns' => '3columns' ], 'under_version_control' => [ 'Yes' => 1, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.php index f1001498cf7b64231182e9b3e0ee98b77f498415..16117453912cec358fe59fdb4766eba4c730a26a 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.php @@ -18,7 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @spi * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -99,8 +98,6 @@ class CustomerAccountIndex extends FrontendPage } /** - * Get Account Menu Block - * * @return \Magento\Customer\Test\Block\Account\Links */ public function getAccountMenuBlock() @@ -109,8 +106,6 @@ class CustomerAccountIndex extends FrontendPage } /** - * Get Account Info Block - * * @return \Magento\Customer\Test\Block\Account\Dashboard\Info */ public function getInfoBlock() @@ -119,8 +114,6 @@ class CustomerAccountIndex extends FrontendPage } /** - * Get compare products block - * * @return \Magento\Catalog\Test\Block\Product\Compare\Sidebar */ public function getCompareProductsBlock() diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Indexer/Fulltext.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Review/Products/Grid.php similarity index 53% rename from app/code/Magento/CatalogSearch/Model/Resource/Indexer/Fulltext.php rename to dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Review/Products/Grid.php index 26489a70566d4b8d8b1d956caec256a498b5bb0b..73edfa3eed287cb562e6c5acbae72236aed1fffe 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Indexer/Fulltext.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Review/Products/Grid.php @@ -21,42 +21,33 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\CatalogSearch\Model\Resource\Indexer; + +namespace Magento\Reports\Test\Block\Adminhtml\Review\Products; + +use Mtf\Client\Element\Locator; +use Magento\Backend\Test\Block\Widget\Grid as AbstractGrid; /** - * CatalogSearch fulltext indexer resource model - * - * @author Magento Core Team <core@magentocommerce.com> + * Class Grid + * Product Reviews Report grid */ -class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb +class Grid extends AbstractGrid { /** - * Initialize connection and define catalog product table as main table + * Search product reviews report row selector * - * @return void + * @var string */ - protected function _construct() - { - $this->_init('catalogsearch_fulltext', 'product_id'); - } + protected $searchRow = '//tr[td[contains(.,"%s")]]'; /** - * Retrieve product relations by children + * Open product review report * - * @param int|array $childIds - * @return array + * @param string $name + * @return void */ - public function getRelationsByChild($childIds) + public function openReview($name) { - $write = $this->_getWriteAdapter(); - $select = $write->select()->from( - $this->getTable('catalog_product_relation'), - 'parent_id' - )->where( - 'child_id IN(?)', - $childIds - ); - - return $write->fetchCol($select); + $this->_rootElement->find(sprintf($this->searchRow, $name), Locator::SELECTOR_XPATH)->click(); } } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php new file mode 100644 index 0000000000000000000000000000000000000000..848d5b621764f3bc1524a817a0d2de93a36b8640 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php @@ -0,0 +1,81 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Constraint; + +use Mtf\Constraint\AbstractConstraint; +use Magento\Review\Test\Fixture\ReviewInjectable; +use Magento\Review\Test\Page\Adminhtml\ReviewIndex; +use Magento\Reports\Test\Page\Adminhtml\ProductReportReview; +use Magento\Review\Test\Constraint\AssertProductReviewInGrid; + +/** + * Class AssertProductReviewIsVisibleInGrid + * Assert that review is visible in review grid for select product + */ +class AssertProductReviewIsAvailableForProduct extends AbstractConstraint +{ + /** + * Constraint severeness + * + * @var string + */ + protected $severeness = 'low'; + + /** + * Assert that review is visible in review grid for select product + * + * @param ReviewIndex $reviewIndex + * @param ReviewInjectable $review + * @param ProductReportReview $productReportReview + * @param AssertProductReviewInGrid $assertProductReviewInGrid + * @return void + */ + public function processAssert( + ReviewIndex $reviewIndex, + ReviewInjectable $review, + ProductReportReview $productReportReview, + AssertProductReviewInGrid $assertProductReviewInGrid + ) { + $productReportReview->open(); + $product = $review->getDataFieldConfig('entity_id')['source']->getEntity(); + $productReportReview->getGridBlock()->openReview($product->getName()); + unset($assertProductReviewInGrid->filter['visible_in']); + $filter = $assertProductReviewInGrid->prepareFilter($product, $review, ''); + \PHPUnit_Framework_Assert::assertTrue( + $reviewIndex->getReviewGrid()->isRowVisible($filter, false), + 'Review for ' . $product->getName() . ' product is not visible in reports grid.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Review is visible in review grid for select product.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..4435773be24fa77d22fa8dfba8eeaccc452f9cea --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php @@ -0,0 +1,70 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Constraint; + +use Mtf\Constraint\AbstractConstraint; +use Magento\Review\Test\Fixture\ReviewInjectable; +use Magento\Reports\Test\Page\Adminhtml\ProductReportReview; + +/** + * Class AssertProductReviewReportIsVisibleInGrid + * Assert that Product Review Report is visible in reports grid + */ +class AssertProductReviewReportIsVisibleInGrid extends AbstractConstraint +{ + /** + * Constraint severeness + * + * @var string + */ + protected $severeness = 'low'; + + /** + * Assert that Product Review Report is visible in reports grid + * + * @param ProductReportReview $productReportReview + * @param ReviewInjectable $review + * @return void + */ + public function processAssert(ProductReportReview $productReportReview, ReviewInjectable $review) + { + $productReportReview->open(); + $name = $review->getDataFieldConfig('entity_id')['source']->getEntity()->getName(); + \PHPUnit_Framework_Assert::assertTrue( + $productReportReview->getGridBlock()->isRowVisible(['title' => $name], false), + 'Review for ' . $name . ' product is not visible in reports grid.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Product Review Report is visible in reports grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportReview.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportReview.php new file mode 100644 index 0000000000000000000000000000000000000000..454e98353f34479ef2ff170b20cf3f4486cd77ba --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportReview.php @@ -0,0 +1,56 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Page\Adminhtml; + +use Mtf\Page\BackendPage; + +/** + * Class ProductReportReview + * Product reviews report page + */ +class ProductReportReview extends BackendPage +{ + const MCA = 'reports/report_review/product'; + + /** + * @var array + */ + protected $_blocks = [ + 'gridBlock' => [ + 'name' => 'gridBlock', + 'class' => 'Magento\Reports\Test\Block\Adminhtml\Review\Products\Grid', + 'locator' => '#gridProducts', + 'strategy' => 'css selector', + ], + ]; + + /** + * @return \Magento\Reports\Test\Block\Adminhtml\Review\Products\Grid + */ + public function getGridBlock() + { + return $this->getBlockInstance('gridBlock'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportReview.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportReview.xml new file mode 100644 index 0000000000000000000000000000000000000000..b6e09a94ffe9addd098c4d4cd20a76e1a8e3db1e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportReview.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page mca="reports/report_review/product" > + <block> + <name>gridBlock</name> + <class>Magento\Reports\Test\Block\Adminhtml\Review\Products\Grid</class> + <locator>#gridProducts</locator> + <strategy>css selector</strategy> + </block> +</page> diff --git a/app/code/Magento/Rss/Controller/Index/Wishlist.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.php similarity index 51% rename from app/code/Magento/Rss/Controller/Index/Wishlist.php rename to dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.php index b501034bea2d9027597ef182a08257e0d0682ae3..4f798f8c921ae543d386a2eec0bdbffa0414f35f 100644 --- a/app/code/Magento/Rss/Controller/Index/Wishlist.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.php @@ -1,6 +1,5 @@ <?php /** - * * Magento * * NOTICE OF LICENSE @@ -22,30 +21,38 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Rss\Controller\Index; -class Wishlist extends Nofeed +namespace Magento\Reports\Test\TestCase; + +use Mtf\TestCase\Injectable; +use Magento\Review\Test\Fixture\ReviewInjectable; + +/** + * Test Creation for ProductReviewReportEntity + * + * Preconditions: + * 1. Create simple product + * 2. Create review for this product + * + * Test Flow: + * 1. Login as admin + * 2. Navigate to the Reports>Reviews>By Products + * 3. Perform appropriate assertions. + * + * @group Reports_(MX) + * @ZephyrId MAGETWO-27223 + */ +class ProductReviewReportEntityTest extends Injectable { /** - * Wishlist rss feed action - * Show all public wishlists and private wishlists that belong to current user + * Creation product review report entity * + * @param ReviewInjectable $review * @return void */ - public function execute() + public function test(ReviewInjectable $review) { - if ($this->_scopeConfig->getValue('rss/wishlist/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) { - $wishlist = $this->_wishlistHelper->getWishlist(); - if ($wishlist && ($wishlist->getVisibility() - || $this->_objectManager->get('Magento\Customer\Model\Session')->authenticate($this) - && $wishlist->getCustomerId() == $this->_wishlistHelper->getCustomer()->getId()) - ) { - $this->getResponse()->setHeader('Content-Type', 'text/xml; charset=UTF-8'); - $this->_view->loadLayout(false); - $this->_view->renderLayout(); - return; - } - } - parent::execute(); + // Preconditions + $review->persist(); } } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest/test.csv new file mode 100644 index 0000000000000000000000000000000000000000..30d89349eb4026f3b3868166494dabc6a7739f05 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest/test.csv @@ -0,0 +1,2 @@ +"review/dataSet";"constraint" +"frontend_review";"assertProductReviewReportIsVisibleInGrid, assertProductReviewIsAvailableForProduct" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/constraint.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/constraint.xml index 8145a448500f112a65b6d21f4edfaf4a0985efcf..7786ddb57a74b3dbdd1378757f385650836f5254 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/constraint.xml @@ -33,4 +33,10 @@ <assertLowStockProductInGrid module="Magento_Reports"> <severeness>low</severeness> </assertLowStockProductInGrid> + <assertProductReviewReportIsVisibleInGrid module="Magento_Reports"> + <severeness>low</severeness> + </assertProductReviewReportIsVisibleInGrid> + <assertProductReviewIsAvailableForProduct module="Magento_Reports"> + <severeness>low</severeness> + </assertProductReviewIsAvailableForProduct> </constraint> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/page.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/page.xml index 54b687f57376d579ae8bee2037ff36686c94dde6..e5538d8e6911d4d5ddbc4a1cd83122b4e5455967 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/page.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/page.xml @@ -34,4 +34,9 @@ <area>adminhtml</area> <class>Magento\Reports\Test\Page\Adminhtml\ProductLowStock</class> </productLowStock> + <productReportReview> + <mca>reports/report_review/product</mca> + <area>adminhtml</area> + <class>Magento\Reports\Test\Page\Adminhtml\ProductReportReview</class> + </productReportReview> </page> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php index 67e214f693c12e16f06f56fd96871bef2fcd9832..eb6492e483f2d6339315af54459f6e489f4a5273 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php @@ -46,7 +46,7 @@ class AssertProductReviewInGrid extends AbstractConstraint * * @var array */ - protected $filter = [ + public $filter = [ 'review_id', 'status' => 'status_id', 'title', @@ -95,7 +95,7 @@ class AssertProductReviewInGrid extends AbstractConstraint * @param string $gridStatus * @return array */ - protected function prepareFilter(FixtureInterface $product, ReviewInjectable $review, $gridStatus) + public function prepareFilter(FixtureInterface $product, ReviewInjectable $review, $gridStatus) { $filter = []; foreach ($this->filter as $key => $item) { diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/SessionTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Sharing.php similarity index 56% rename from dev/tests/unit/testsuite/Magento/Backend/Model/SessionTest.php rename to dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Sharing.php index 00a936d0dce643b1b6f3028010c9c21212fd6f0e..5d19d013521ca6a599ba9076dfc7ba39c77941c9 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/SessionTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Sharing.php @@ -21,31 +21,43 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Backend\Model; -class SessionTest extends \PHPUnit_Framework_TestCase +namespace Magento\Wishlist\Test\Block\Customer; + +use Mtf\Block\Form; + +/** + * Class Sharing + * Sharing wishlist form + */ +class Sharing extends Form { /** - * @var bool + * Share Wishlist button selector + * + * @var string */ - public static $sessionStart = false; + protected $shareWishlist = '[type="submit"]'; /** - * @var bool + * Click Share Wishlist + * + * @return void */ - public static $registerShutdownFunction = false; + public function shareWishlist() + { + $this->_rootElement->find($this->shareWishlist)->click(); + } /** - * @covers Magento\Backend\Model\Session::__construct - * @runInSeparateProcess + * Fill Sharing Information form + * + * @param array $sharingInfo + * @return void */ - public function testConstructor() + public function fillForm(array $sharingInfo) { - $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - require_once __DIR__ . '/../../_files/session_backend_mock.php'; - $requestMock = $helper->getObject('Magento\Framework\App\Request\Http'); - $helper->getObject('Magento\Backend\Model\Session', array('request' => $requestMock)); - $this->assertTrue(self::$sessionStart); - $this->assertTrue(self::$registerShutdownFunction); + $mapping = $this->dataMapping($sharingInfo); + $this->_fill($mapping); } } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Sharing.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Sharing.xml new file mode 100644 index 0000000000000000000000000000000000000000..84887a8391a44565b835345480508e01c12a935e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Sharing.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<mapping strict="0"> + <fields> + <emails> + <input>textarea</input> + </emails> + <message> + <input>textarea</input> + </message> + </fields> +</mapping> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Wishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Wishlist.php new file mode 100644 index 0000000000000000000000000000000000000000..7e59d1c591bbdc09e300680522efbb90114b3b8c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Customer/Wishlist.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Wishlist\Test\Block\Customer; + +use Mtf\Block\Block; + +/** + * Class Wishlist + * Wish list details block in "My account" + */ +class Wishlist extends Block +{ + /** + * "Share Wish List" button selector + * + * @var string + */ + protected $shareWishList = '[name="save_and_share"]'; + + /** + * Click button "Share Wish List" + * + * @return void + */ + public function clickShareWishList() + { + $this->_rootElement->find($this->shareWishList)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php new file mode 100644 index 0000000000000000000000000000000000000000..bac0022125d292c44eca13a6e560bb032f6a6711 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php @@ -0,0 +1,72 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Wishlist\Test\Constraint; + +use Mtf\Constraint\AbstractConstraint; +use Magento\Wishlist\Test\Page\WishlistIndex; + +/** + * Class AssertWishlistShareMessage + * Assert that after share wishlist successful message appears + */ +class AssertWishlistShareMessage extends AbstractConstraint +{ + /** + * Success wishlist share message + */ + const SUCCESS_MESSAGE = 'Your wish list has been shared.'; + + /** + * Constraint severeness + * + * @var string + */ + protected $severeness = 'low'; + + /** + * Assert that success message is displayed after wishlist has been shared + * + * @param WishlistIndex $wishlistIndex + * @return void + */ + public function processAssert(WishlistIndex $wishlistIndex) + { + \PHPUnit_Framework_Assert::assertEquals( + self::SUCCESS_MESSAGE, + $wishlistIndex->getMessagesBlock()->getSuccessMessages(), + 'Wrong success message is displayed.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Wishlist success share message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistIndex.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistIndex.php index cc9b3901e748f52f9a772942956ddda3b86c84dd..f8229bea6e062db159dc579a59b0c3202436fed2 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistIndex.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistIndex.php @@ -31,7 +31,7 @@ use Mtf\Page\FrontendPage; */ class WishlistIndex extends FrontendPage { - const MCA = 'wishlist/index/index'; + const MCA = 'wishlist/index'; protected $_blocks = [ 'messagesBlock' => [ @@ -40,6 +40,12 @@ class WishlistIndex extends FrontendPage 'locator' => '.messages', 'strategy' => 'css selector', ], + 'wishlistBlock' => [ + 'name' => 'wishlistBlock', + 'class' => 'Magento\Wishlist\Test\Block\Customer\Wishlist', + 'locator' => '#wishlist-view-form', + 'strategy' => 'css selector', + ], ]; /** @@ -49,4 +55,12 @@ class WishlistIndex extends FrontendPage { return $this->getBlockInstance('messagesBlock'); } + + /** + * @return \Magento\Wishlist\Test\Block\Customer\Wishlist + */ + public function getWishlistBlock() + { + return $this->getBlockInstance('wishlistBlock'); + } } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistIndex.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistIndex.xml index 78e32fd83754367529017dfe9073ac608dde2ce0..531f552e2307f3a819020eddd9aeee9e6e32f497 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistIndex.xml @@ -23,11 +23,17 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<page mca="wishlist/index/index" > +<page mca="wishlist/index" > <block> <name>messagesBlock</name> <class>Magento\Core\Test\Block\Messages</class> <locator>.messages</locator> <strategy>css selector</strategy> </block> + <block> + <name>wishlistBlock</name> + <class>Magento\Wishlist\Test\Block\Customer\Wishlist</class> + <locator>#wishlist-view-form</locator> + <strategy>css selector</strategy> + </block> </page> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistShare.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistShare.php new file mode 100644 index 0000000000000000000000000000000000000000..036ccb64210d9243a3806dd4e8b7ea1a94556c77 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistShare.php @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Wishlist\Test\Page; + +use Mtf\Page\FrontendPage; + +/** + * Class WishlistShare + */ +class WishlistShare extends FrontendPage +{ + const MCA = 'wishlist/index/share'; + + protected $_blocks = [ + 'sharingInfoForm' => [ + 'name' => 'sharingInfoForm', + 'class' => 'Magento\Wishlist\Test\Block\Customer\Sharing', + 'locator' => '.wishlist.share', + 'strategy' => 'css selector', + ], + ]; + + /** + * @return \Magento\Wishlist\Test\Block\Customer\Sharing + */ + public function getSharingInfoForm() + { + return $this->getBlockInstance('sharingInfoForm'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistShare.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistShare.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe202bece90ded7ddc0c90f6de75049aba1307c2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Page/WishlistShare.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page mca="wishlist/index/share" > + <block> + <name>sharingInfoForm</name> + <class>Magento\Wishlist\Test\Block\Customer\Sharing</class> + <locator>.wishlist.share</locator> + <strategy>css selector</strategy> + </block> +</page> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..19dcbed29dea9857eabcc26b80aa07a876a405d3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php @@ -0,0 +1,200 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Wishlist\Test\TestCase; + +use Mtf\TestCase\Injectable; +use Magento\Cms\Test\Page\CmsIndex; +use Magento\Customer\Test\Page\CustomerAccountLogin; +use Magento\Customer\Test\Page\CustomerAccountIndex; +use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Catalog\Test\Page\Product\CatalogProductView; +use Magento\Customer\Test\Page\CustomerAccountLogout; +use Magento\Wishlist\Test\Page\WishlistIndex; +use Magento\Wishlist\Test\Page\WishlistShare; + +/** + * Test Creation for ShareWishlistEntity + * + * Preconditions: + * 1. Create Customer Account + * 2. Create product + * + * Test Flow: + * 1. Login to frontend as a Customer + * 2. Add product to Wish List + * 3. Click "Share Wish List" button + * 4. Fill in all data according to data set + * 5. Click "Share Wishlist" button + * 6. Perform all assertions + * + * @group Wishlist_(CS) + * @ZephyrId MAGETWO-23394 + */ +class ShareWishlistEntityTest extends Injectable +{ + /** + * Cms index page + * + * @var CmsIndex + */ + protected $cmsIndex; + + /** + * Customer login page + * + * @var CustomerAccountLogin + */ + protected $customerAccountLogin; + + /** + * Customer account index page + * + * @var CustomerAccountIndex + */ + protected $customerAccountIndex; + + /** + * Product view page + * + * @var CatalogProductView + */ + protected $catalogProductView; + + /** + * Page CustomerAccountLogout + * + * @var CustomerAccountLogout + */ + protected $customerAccountLogout; + + /** + * Wishlist index page + * + * @var WishlistIndex + */ + protected $wishlistIndex; + + /** + * Wishlist share page + * + * @var WishlistShare + */ + protected $wishlistShare; + + /** + * Prepare data + * + * @param CustomerInjectable $customer + * @param CatalogProductSimple $product + * @return array + */ + public function __prepare( + CustomerInjectable $customer, + CatalogProductSimple $product + ) { + $customer->persist(); + $product->persist(); + + return [ + 'customer' => $customer, + 'product' => $product + ]; + } + + /** + * Injection data + * + * @param CmsIndex $cmsIndex + * @param CustomerAccountLogin $customerAccountLogin + * @param CustomerAccountIndex $customerAccountIndex + * @param CustomerAccountLogout $customerAccountLogout + * @param CatalogProductView $catalogProductView + * @param WishlistIndex $wishlistIndex + * @param WishlistShare $wishlistShare + * @return void + */ + public function __inject( + CmsIndex $cmsIndex, + CustomerAccountLogin $customerAccountLogin, + CustomerAccountIndex $customerAccountIndex, + CustomerAccountLogout $customerAccountLogout, + CatalogProductView $catalogProductView, + WishlistIndex $wishlistIndex, + WishlistShare $wishlistShare + ) { + $this->cmsIndex = $cmsIndex; + $this->customerAccountLogin = $customerAccountLogin; + $this->customerAccountIndex = $customerAccountIndex; + $this->customerAccountLogout = $customerAccountLogout; + $this->catalogProductView = $catalogProductView; + $this->wishlistIndex = $wishlistIndex; + $this->wishlistShare = $wishlistShare; + } + + /** + * Share wish list + * + * @param CustomerInjectable $customer + * @param CatalogProductSimple $product + * @param array $sharingInfo + * @return void + */ + public function test(CustomerInjectable $customer, CatalogProductSimple $product, $sharingInfo) + { + //Steps + $this->loginCustomer($customer); + $this->catalogProductView->init($product); + $this->catalogProductView->open()->getViewBlock()->addToWishlist(); + $this->wishlistIndex->getWishlistBlock()->clickShareWishList(); + $this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo); + $this->wishlistShare->getSharingInfoForm()->shareWishlist(); + } + + /** + * Login customer + * + * @param CustomerInjectable $customer + * @return void + */ + protected function loginCustomer(CustomerInjectable $customer) + { + $this->cmsIndex->open(); + if (!$this->cmsIndex->getLinksBlock()->isLinkVisible('Log Out')) { + $this->cmsIndex->getLinksBlock()->openLink("Log In"); + $this->customerAccountLogin->getLoginBlock()->login($customer); + } + } + + /** + * Log out after test + * + * @return void + */ + public function tearDown() + { + $this->customerAccountLogout->open(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest/test.csv new file mode 100644 index 0000000000000000000000000000000000000000..c1779843d888fe82ba452b1ef55468722722ced2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest/test.csv @@ -0,0 +1,2 @@ +"sharingInfo/emails";"sharingInfo/message";"constraint" +"JohnDoe123456789@example.com,JohnDoe987654321@example.com,JohnDoe123456abc@example.com";"Sharing message.";"assertWishlistShareMessage" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/global/constraint.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/global/constraint.xml new file mode 100644 index 0000000000000000000000000000000000000000..4d3295a76480bf5000dc9c49e06fd77a59811873 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/global/constraint.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<constraint> + <assertWishlistShareMessage module="Magento_Wishlist"> + <severeness>low</severeness> + </assertWishlistShareMessage> +</constraint> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/global/page.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/global/page.xml index afc4c9a81166aceb4b65b1edb93586907e9eb033..edab446efe1f073300077e5439680151b0318c21 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/global/page.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/global/page.xml @@ -25,7 +25,11 @@ --> <page> <wishlistIndex> - <mca>wishlist/index/index</mca> + <mca>wishlist/index</mca> <class>Magento\Wishlist\Test\Page\WishlistIndex</class> </wishlistIndex> + <wishlistShare> + <mca>wishlist/index/share</mca> + <class>Magento\Wishlist\Test\Page\WishlistShare</class> + </wishlistShare> </page> diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php index 935887b760571b56248f23c9fe9fa8313ee5d2c1..cc407facec018bbc1eafecdffe54a3ad6f691457 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php +++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php @@ -74,7 +74,7 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase ); $filesystem = $this->_objectManager->get('Magento\Framework\App\Filesystem'); - $modulesDir = $filesystem->getPath(\Magento\Framework\App\Filesystem::MODULES_DIR); + $modulesDir = $filesystem->getPath($this->getDirectoryConstant()); $this->_schemaFile = $modulesDir . $this->_getXsdPath(); } } @@ -109,13 +109,10 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase $this->markTestSkipped('There are no xml files in the system for this test.'); } // have the file resolver return all relevant xml files - $this->_fileResolverMock->expects( - $this->any() - )->method( - 'get' - )->will( - $this->returnValue($this->getXmlConfigFiles()) - ); + $this->_fileResolverMock->expects($this->any()) + ->method('get') + ->will($this->returnValue($this->getXmlConfigFiles())); + try { // this will merge all xml files and validate them $this->_reader->read('global'); @@ -150,17 +147,21 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase public function getXmlConfigFiles() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $directory = $objectManager->get( - 'Magento\Framework\App\Filesystem' - )->getDirectoryRead( - \Magento\Framework\App\Filesystem::MODULES_DIR - ); - return $objectManager->get( - '\Magento\Framework\Config\FileIteratorFactory' - )->create( - $directory, - $directory->search($this->_getConfigFilePathGlob()) - ); + $directory = $objectManager->get('Magento\Framework\App\Filesystem') + ->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); + + return $objectManager->get('\Magento\Framework\Config\FileIteratorFactory') + ->create($directory, $directory->search($this->_getConfigFilePathGlob())); + } + + /** + * Returns directory (modules, library internal stc.) constant which contains XSD file + * + * @return string + */ + protected function getDirectoryConstant() + { + return \Magento\Framework\App\Filesystem::MODULES_DIR; } /** diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php index 6459c5e26ce55645f018a7ad878165492dcbc173..7ef54d562f66ea7dbdd11615819924a3aa066ff6 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php @@ -157,6 +157,7 @@ class AuthTest extends \Magento\TestFramework\TestCase\AbstractController /** * @covers \Magento\Backend\Controller\Adminhtml\Auth\DeniedJson::execute + * @covers \Magento\Backend\Controller\Adminhtml\Auth\DeniedJson::_getDeniedJson * @magentoDbIsolation enabled */ public function testDeniedJsonAction() @@ -176,6 +177,7 @@ class AuthTest extends \Magento\TestFramework\TestCase\AbstractController /** * @covers \Magento\Backend\Controller\Adminhtml\Auth\DeniedIframe::execute + * @covers \Magento\Backend\Controller\Adminhtml\Auth\DeniedIframe::_getDeniedIframe * @magentoDbIsolation enabled */ public function testDeniedIframeAction() diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php index 0facb5042610db13618427fa2b711baff57a37cc..b0ec2d72b3dff45e7de3f80e02dea13f6089e47a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php @@ -127,26 +127,4 @@ class ProductTest extends \Magento\Backend\Utility\Controller '"Save & Duplicate" button isn\'t present on Edit Product page' ); } - - /** - * Assure that no DDL operations, like table truncation, are executed in transaction during search results reset. - * - * @magentoDataFixture Magento/Catalog/_files/product_simple.php - */ - public function testMassStatusAction() - { - $this->dispatch( - '/backend/catalog/product/massStatus/store/0/?product=1&massaction_prepare_key=product&status=0' - ); - /** @var $objectManager \Magento\TestFramework\ObjectManager */ - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $processCollection \Magento\Index\Model\Resource\Process\Collection */ - $processCollection = $objectManager->get('Magento\Index\Model\Resource\Process\Collection'); - $processCollection = $processCollection->addEventsStats()->addFilter('indexer_code', 'catalogsearch_fulltext'); - $process = $processCollection->getLastItem(); - /** @var $eventCollection \Magento\Index\Model\Resource\Event\Collection */ - $eventCollection = $objectManager->get('Magento\Index\Model\Resource\Event\Collection'); - $eventCollection->addProcessFilter($process); - $this->assertNull($eventCollection->getLastItem()->getData('process_event_status')); - } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php index a455cca28cd7cc5bbc3273ba47046613649f2c28..12ba98a6d3d5a6a18757af52824dbc0ead79408f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php @@ -43,34 +43,34 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected $_layout; + /** + * @var \Magento\TestFramework\Helper\Bootstrap + */ + protected $objectManager; + protected function setUp() { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); - $objectManager->get('Magento\Framework\App\Http\Context') + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + $this->objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); + $this->objectManager->get('Magento\Framework\App\Http\Context') ->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, false, false); - $objectManager->get('Magento\Framework\View\DesignInterface') + $this->objectManager->get('Magento\Framework\View\DesignInterface') ->setDefaultDesignTheme(); - $this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Catalog\Helper\Product\View'); - $request = $objectManager->get('Magento\TestFramework\Request'); + $this->_helper = $this->objectManager->get('Magento\Catalog\Helper\Product\View'); + $request = $this->objectManager->get('Magento\TestFramework\Request'); $request->setRouteName('catalog')->setControllerName('product')->setActionName('view'); $arguments = array( 'request' => $request, - 'response' => \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\TestFramework\Response' - ) + 'response' => $this->objectManager->get('Magento\TestFramework\Response') ); - $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Action\Context', - $arguments - ); - $this->_controller = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + $context = $this->objectManager->create('Magento\Framework\App\Action\Context', $arguments); + $this->_controller = $this->objectManager->create( 'Magento\Catalog\Controller\Product', array('context' => $context) ); - $this->_layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + $this->_layout = $this->objectManager->get( 'Magento\Framework\View\LayoutInterface' ); } @@ -80,9 +80,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected function tearDown() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Catalog\Model\Session' - )->unsLastViewedProductId(); + $this->objectManager->get('Magento\Catalog\Model\Session')->unsLastViewedProductId(); $this->_controller = null; $this->_helper = null; } @@ -95,18 +93,23 @@ class ViewTest extends \PHPUnit_Framework_TestCase { $uniqid = uniqid(); /** @var $product \Magento\Catalog\Model\Product */ - $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + $product = $this->objectManager->create( 'Magento\Catalog\Model\Product' ); $product->setTypeId(\Magento\Catalog\Model\Product\Type::DEFAULT_TYPE)->setId(99)->setUrlKey($uniqid); /** @var $objectManager \Magento\TestFramework\ObjectManager */ - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager = $this->objectManager; $objectManager->get('Magento\Framework\Registry')->register('product', $product); $this->_helper->initProductLayout($product, $this->_controller); - $rootBlock = $this->_layout->getBlock('root'); - $this->assertInstanceOf('Magento\Theme\Block\Html', $rootBlock); - $this->assertContains("product-{$uniqid}", $rootBlock->getBodyClass()); + + /** @var \Magento\Framework\View\Page\Config $pageConfig */ + $pageConfig = $this->objectManager->get('Magento\Framework\View\Page\Config'); + $bodyClass = $pageConfig->getElementAttribute( + \Magento\Framework\View\Page\Config::ELEMENT_TYPE_BODY, + 'classes' + ); + $this->assertContains("product-{$uniqid}", $bodyClass); $handles = $this->_layout->getUpdate()->getHandles(); $this->assertContains('catalog_product_view_type_simple', $handles); } @@ -122,7 +125,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase $this->assertNotEmpty($this->_controller->getResponse()->getBody()); $this->assertEquals( 10, - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + $this->objectManager->get( 'Magento\Catalog\Model\Session' )->getLastViewedProductId() ); @@ -134,7 +137,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ public function testPrepareAndRenderWrongController() { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager = $this->objectManager; $controller = $objectManager->create('Magento\Catalog\Controller\Product'); $this->_helper->prepareAndRender(10, $controller); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/Category/MetadataServiceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/Category/MetadataServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5e92632195844b0c7c3f0e829040ae908c6e27cd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/Category/MetadataServiceTest.php @@ -0,0 +1,63 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Service\V1\Category; + +class MetadataServiceTest extends \PHPUnit_Framework_TestCase +{ + /** @var MetadataServiceInterface */ + private $_service; + + protected function setUp() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager->configure( + [ + 'Magento\Framework\Service\Config\Reader' => [ + 'arguments' => [ + 'fileResolver' => ['instance' => 'Magento\Customer\Service\V1\FileResolverStub'] + ] + ] + ] + ); + $this->_service = $objectManager->create('Magento\Catalog\Service\V1\Category\MetadataServiceInterface'); + } + + public function testGetCustomAttributesMetadata() + { + $customAttributesMetadata = $this->_service->getCustomAttributesMetadata(); + $this->assertCount(32, $customAttributesMetadata, "Invalid number of attributes returned."); + $configAttributeCode = 'category_attribute_2'; + $configAttributeFound = false; + foreach ($customAttributesMetadata as $attribute) { + if ($attribute->getAttributeCode() == $configAttributeCode) { + $configAttributeFound = true; + break; + } + } + if (!$configAttributeFound) { + $this->fail("Custom attribute declared in the config not found."); + } + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/FileResolverStub.php b/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/FileResolverStub.php new file mode 100644 index 0000000000000000000000000000000000000000..5f58f07e187051ffa619a151b891f0fb8af4ba9e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/FileResolverStub.php @@ -0,0 +1,45 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Service\V1; + +class FileResolverStub implements \Magento\Framework\Config\FileResolverInterface +{ + /** + * {@inheritdoc} + */ + public function get($filename, $scope) + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $readDirectory = $objectManager->create( + 'Magento\Framework\Filesystem\Directory\Read', + [ + 'config' => ['path' => realpath(__DIR__ . '/../../_files/etc')], + 'driver' => $objectManager->create('Magento\Framework\Filesystem\Driver\File') + ] + ); + $paths = ['data_object.xml']; + return new \Magento\Framework\Config\FileIterator($readDirectory, $paths); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/Product/MetadataServiceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/Product/MetadataServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5c6bbf01133d0db8c917d4f6a158d27e92a55b4c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Service/V1/Product/MetadataServiceTest.php @@ -0,0 +1,62 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Service\V1\Product; + +class MetadataServiceTest extends \PHPUnit_Framework_TestCase +{ + /** @var MetadataServiceInterface */ + private $_service; + + protected function setUp() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager->configure( + [ + 'Magento\Framework\Service\Config\Reader' => [ + 'arguments' => [ + 'fileResolver' => ['instance' => 'Magento\Customer\Service\V1\FileResolverStub'] + ] + ] + ] + ); + $this->_service = $objectManager->create('Magento\Catalog\Service\V1\Product\MetadataServiceInterface'); + } + + public function testGetCustomAttributesMetadata() + { + $customAttributesMetadata = $this->_service->getCustomAttributesMetadata(); + $configAttributeCode = 'stock_item'; + $configAttributeFound = false; + foreach ($customAttributesMetadata as $attribute) { + if ($attribute->getAttributeCode() == $configAttributeCode) { + $configAttributeFound = true; + break; + } + } + if (!$configAttributeFound) { + $this->fail("Custom attribute declared in the config not found."); + } + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/etc/data_object.xml b/dev/tests/integration/testsuite/Magento/Catalog/_files/etc/data_object.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2069f0d8a4264efa3d63e104e8159c7efa58264 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/etc/data_object.xml @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Service/etc/data_object.xsd"> + <custom_attributes for="Magento\Tax\Service\V1\Data\TaxRate"> + </custom_attributes> + <custom_attributes for="Magento\Catalog\Service\V1\Data\Product"> + <attribute code="stock_item" type="Magento\CatalogInventory\Service\Data\V1\StockItem" /> + </custom_attributes> + <custom_attributes for="Magento\Catalog\Service\V1\Data\Category"> + <attribute code="category_attribute_1" type="Magento\Catalog\Service\V1\Data\CategoryAttributeType1" /> + <attribute code="category_attribute_2" type="Magento\Catalog\Service\V1\Data\CategoryAttributeType2" /> + </custom_attributes> + <custom_attributes for="Magento\Customer\Service\V1\Data\Customer"> + <attribute code="customer_attribute_1" type="Magento\Customer\Service\V1\Data\CustomerAttributeType1" /> + <attribute code="customer_attribute_2" type="Magento\Customer\Service\V1\Data\CustomerAttributeType2" /> + </custom_attributes> + <custom_attributes for="Magento\Customer\Service\V1\Data\Address"> + <attribute code="address_attribute_1" type="Magento\Customer\Service\V1\Data\AddressAttributeType1" /> + <attribute code="address_attribute_2" type="Magento\Customer\Service\V1\Data\AddressAttributeType2" /> + </custom_attributes> +</config> diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d2c340f69f85431f4dc3213fbce2e00eb93b0362 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php @@ -0,0 +1,217 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer; + +/** + * @magentoDataFixture Magento/CatalogSearch/_files/indexer_fulltext.php + */ +class FulltextTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Indexer\Model\IndexerInterface + */ + protected $indexer; + + /** + * @var \Magento\CatalogSearch\Model\Resource\Fulltext\Engine + */ + protected $engine; + + /** + * @var \Magento\CatalogSearch\Model\Resource\Fulltext + */ + protected $resourceFulltext; + + /** + * @var \Magento\CatalogSearch\Model\Fulltext + */ + protected $fulltext; + + /** + * @var \Magento\CatalogSearch\Model\QueryFactory + */ + protected $queryFactory; + + /** + * @var \Magento\Catalog\Model\Product + */ + protected $productFirst; + + /** + * @var \Magento\Catalog\Model\Product + */ + protected $productSecond; + + protected function setUp() + { + /** @var \Magento\Indexer\Model\IndexerInterface indexer */ + $this->indexer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Indexer\Model\Indexer' + ); + $this->indexer->load('catalogsearch_fulltext'); + + $this->engine = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\CatalogSearch\Model\Resource\Fulltext\Engine' + ); + + $this->resourceFulltext = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\CatalogSearch\Model\Resource\Fulltext' + ); + + $this->fulltext = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\CatalogSearch\Model\Fulltext' + ); + + $this->queryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\CatalogSearch\Model\QueryFactory' + ); + + $this->productFirst = $this->getProductBySku('fulltext-1'); + $this->productSecond = $this->getProductBySku('fulltext-2'); + } + + public function testReindexAll() + { + $this->engine->cleanIndex(); + + $this->indexer->reindexAll(); + + $products = $this->search('Simple Product First'); + $this->assertCount(1, $products); + $this->assertEquals($this->productFirst->getId(), $products[0]->getId()); + + $products = $this->search('Simple Product'); + $this->assertCount(2, $products); + $this->assertEquals($this->productFirst->getId(), $products[0]->getId()); + $this->assertEquals($this->productSecond->getId(), $products[1]->getId()); + } + + /** + * @depends testReindexAll + */ + public function testReindexRowAfterEdit() + { + $this->productFirst->setData('name', 'Simple Product Third'); + $this->productFirst->save(); + + $products = $this->search('Simple Product First'); + $this->assertCount(0, $products); + + $products = $this->search('Simple Product Third'); + $this->assertCount(1, $products); + $this->assertEquals($this->productFirst->getId(), $products[0]->getId()); + + $products = $this->search('Simple Product'); + $this->assertCount(2, $products); + $this->assertEquals($this->productFirst->getId(), $products[0]->getId()); + $this->assertEquals($this->productSecond->getId(), $products[1]->getId()); + } + + /** + * @depends testReindexRowAfterEdit + */ + public function testReindexRowAfterMassAction() + { + $productIds = [ + $this->productFirst->getId(), + $this->productSecond->getId(), + ]; + $attrData = [ + 'name' => 'Simple Product Common', + ]; + + /** @var \Magento\Catalog\Model\Product\Action $action */ + $action = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\Catalog\Model\Product\Action' + ); + $action->updateAttributes($productIds, $attrData, 1); + + $products = $this->search('Simple Product First'); + $this->assertCount(0, $products); + + $products = $this->search('Simple Product Second'); + $this->assertCount(0, $products); + + $products = $this->search('Simple Product Third'); + $this->assertCount(0, $products); + + $products = $this->search('Simple Product Common'); + $this->assertCount(2, $products); + $this->assertEquals($this->productFirst->getId(), $products[0]->getId()); + $this->assertEquals($this->productSecond->getId(), $products[1]->getId()); + + $products = $this->search('Simple Product'); + $this->assertCount(2, $products); + $this->assertEquals($this->productFirst->getId(), $products[0]->getId()); + $this->assertEquals($this->productSecond->getId(), $products[1]->getId()); + } + + /** + * @depends testReindexRowAfterMassAction + * @magentoAppArea adminhtml + */ + public function testReindexRowAfterDelete() + { + $this->productSecond->delete(); + + $products = $this->search('Simple Product Common'); + $this->assertCount(1, $products); + $this->assertEquals($this->productFirst->getId(), $products[0]->getId()); + } + + /** + * Search the text and return result collection + * + * @param string $text + * @return \Magento\Catalog\Model\Product[] + */ + protected function search($text) + { + $this->resourceFulltext->resetSearchResults(); + $query = $this->queryFactory->create(); + $query->setQueryText($text)->prepare(); + $this->resourceFulltext->prepareResult($this->fulltext, $text, $query); + $query->getResultCollection(); + $products = []; + foreach ($query->getResultCollection() as $product) { + $products[] = $product; + } + return $products; + } + + /** + * Return product by SKU + * + * @param string $sku + * @return \Magento\Catalog\Model\Product + */ + protected function getProductBySku($sku) + { + /** @var \Magento\Catalog\Model\Product $product */ + $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\Catalog\Model\Product' + ); + return $product->loadByAttribute('sku', $sku); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/indexer_fulltext.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/indexer_fulltext.php new file mode 100644 index 0000000000000000000000000000000000000000..be6ff88532fbaf82518fa7c425ffd4ccbfdab6a6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/indexer_fulltext.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $category \Magento\Catalog\Model\Category */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +/** @var $productFirst \Magento\Catalog\Model\Product */ +$productFirst = $objectManager->create('Magento\Catalog\Model\Product'); +$productFirst->setTypeId('simple') + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Simple Product First') + ->setSku('fulltext-1') + ->setPrice(10) + ->setMetaTitle('first meta title') + ->setMetaKeyword('first meta keyword') + ->setMetaDescription('first meta description') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 0]) + ->save(); + +/** @var $productFirst \Magento\Catalog\Model\Product */ +$productSecond = $objectManager->create('Magento\Catalog\Model\Product'); +$productSecond->setTypeId('simple') + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Simple Product Second') + ->setSku('fulltext-2') + ->setPrice(20) + ->setMetaTitle('second meta title') + ->setMetaKeyword('second meta keyword') + ->setMetaDescription('second meta description') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 0]) + ->save(); + diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_address.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_address.php index 77a38ad0058625136bb180cd83355ace2941482e..cad9db21408846a41753ec36f41e6ff424e8a8b7 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_address.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_address.php @@ -26,22 +26,21 @@ require __DIR__ . '/../../Customer/_files/customer.php'; require __DIR__ . '/../../Customer/_files/customer_address.php'; require __DIR__ . '/../../../Magento/Catalog/_files/products.php'; +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Sales\Model\Quote\Address $quoteShippingAddress */ -$quoteShippingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Quote\Address' -); +$quoteShippingAddress = $objectManager->create('Magento\Sales\Model\Quote\Address'); + /** @var \Magento\Customer\Service\V1\CustomerAddressServiceInterface $addressService */ -$addressService = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Customer\Service\V1\CustomerAddressServiceInterface' -); +$addressService = $objectManager->create('Magento\Customer\Service\V1\CustomerAddressServiceInterface'); $quoteShippingAddress->importCustomerAddressData($addressService->getAddress(1)); /** @var \Magento\Sales\Model\Quote $quote */ -$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Quote'); +$quote = $objectManager->create('Magento\Sales\Model\Quote'); $quote->setStoreId( 1 )->setIsActive( - false + true )->setIsMultiShipping( false )->assignCustomerWithAddressChange( diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_coupon_saved.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_coupon_saved.php new file mode 100644 index 0000000000000000000000000000000000000000..58f15d186123154547cbf466da388931869107e1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_coupon_saved.php @@ -0,0 +1,38 @@ +<?php +/** + * Save quote_with_coupon fixture + * + * The quote is not saved inside the original fixture. It is later saved inside child fixtures, but along with some + * additional data which may break some tests. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +require __DIR__ . '/../../Checkout/_files/discount_10percent.php'; + +require 'quote_with_address_saved.php'; + +$salesRule = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\SalesRule\Model\Rule'); +$salesRule->load('Test Coupon', 'name'); +$couponCode = $salesRule->getCouponCode(); + +$quote->setCouponCode(trim($couponCode)); +$quote->collectTotals()->save(); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_coupon_saved_rollback.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_coupon_saved_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..737862cf0d0f28aeb281cb6c613706c3b5a6d7a1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_coupon_saved_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Rollback for quote_with_coupon_saved.php fixture. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $objectManager \Magento\TestFramework\ObjectManager */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +$quote = $objectManager->create('\Magento\Sales\Model\Quote'); +$quote->load('test_order_1', 'reserved_order_id')->delete(); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_payment_saved.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_payment_saved.php new file mode 100644 index 0000000000000000000000000000000000000000..8f90504cfa01132cf4669c594db7a62d465cfd70 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_payment_saved.php @@ -0,0 +1,45 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +require 'quote_with_address.php'; + +$quote->setReservedOrderId( + 'test_order_1_with_payment' +); + +$paymentDetails = [ + 'transaction_id' => 100500, + 'consumer_key' => '123123q' +]; + +$quote->getPayment() + ->setMethod('checkmo') + ->setPoNumber('poNumber') + ->setCcOwner('tester') + ->setCcType('visa') + ->setCcExpYear(2014) + ->setCcExpMonth(1) + ->setAdditionalData(serialize($paymentDetails)); + +$quote->collectTotals()->save(); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_payment_saved_rollback.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_payment_saved_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..c7cc0c885d915c14ab881156025e08bb8fe71c53 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_payment_saved_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Rollback for quote_with_payment_saved.php fixture. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $objectManager \Magento\TestFramework\ObjectManager */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +$quote = $objectManager->create('\Magento\Sales\Model\Quote'); +$quote->load('test_order_1_with_payment', 'reserved_order_id')->delete(); \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_shipping_method.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_shipping_method.php new file mode 100644 index 0000000000000000000000000000000000000000..e721552e166a4d2e350b4d6d2df0e1122354eac9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_shipping_method.php @@ -0,0 +1,38 @@ +<?php +/** + * Quote with simple product, shipping, billing addresses and shipping method fixture + * + * The quote is not saved inside the original fixture. It is later saved inside child fixtures, but along with some + * additional data which may break some tests. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +require 'quote_with_address_saved.php'; + +$quote->load('test_order_1', 'reserved_order_id'); +$shippingAddress = $quote->getShippingAddress(); +$shippingAddress->setShippingMethod('flatrate_flatrate') + ->setShippingDescription('Flat Rate - Fixed') + ->setShippingAmount(10.0) + ->setBaseShippingAmount(12.0) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_shipping_method_rollback.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_shipping_method_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..a082e3df4822c3d190e06f186b35d29ddab5da6f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_shipping_method_rollback.php @@ -0,0 +1,26 @@ +<?php +/** + * Rollback for quote_with_shipping_method.php fixture. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +require 'quote_with_address_saved_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_saved.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_saved.php new file mode 100644 index 0000000000000000000000000000000000000000..97f0b90520c4800ca6ef4b850510e369cd5ce0b1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_saved.php @@ -0,0 +1,44 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +require 'simple_product.php'; + +/** @var \Magento\Sales\Model\Quote $quote */ +$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Quote'); +$quote->setStoreId( + 1 + )->setIsActive( + true + )->setIsMultiShipping( + false + )->setReservedOrderId( + 'test_order_with_simple_product_without_address' + )->setEmail( + 'store@example.com' + )->addProduct( + $product->load($product->getId()), + 1 + ); + +$quote->collectTotals()->save(); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_saved_rollback.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_saved_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..348a8b1c5a63e5f7c77960043ddd9862d6db6338 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_saved_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Rollback for quote_with_payment_saved.php fixture. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $objectManager \Magento\TestFramework\ObjectManager */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +$quote = $objectManager->create('\Magento\Sales\Model\Quote'); +$quote->load('test_order_with_simple_product_without_address', 'reserved_order_id')->delete(); \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_and_address.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_and_address.php index 78d04202118f9671439b17f63adb5d9408971578..eb13eeb2d4b00d299655020b82da22621b682ad5 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_and_address.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_and_address.php @@ -40,7 +40,7 @@ $quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Ma $quote->setStoreId( 1 )->setIsActive( - false + true )->setIsMultiShipping( false )->assignCustomerWithAddressChange( diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved.php new file mode 100644 index 0000000000000000000000000000000000000000..59ec5bcd1b7e6f631a4b7dc2fcbc3ef80e7f4d74 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved.php @@ -0,0 +1,39 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +require __DIR__ . '/../../../Magento/Catalog/_files/product_virtual.php'; + +/** @var \Magento\Sales\Model\Quote $quote */ +$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Quote'); +$quote->setStoreId(1) + ->setIsActive(true) + ->setIsMultiShipping(false) + ->setReservedOrderId('test_order_with_virtual_product_without_address') + ->setEmail('store@example.com') + ->addProduct( + $product->load($product->getId()), + 1 + ); + +$quote->collectTotals()->save(); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved_rollback.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..7e6e7e03f14edda60dfc45f6b5986becad99131a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Rollback for quote_with_payment_saved.php fixture. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $objectManager \Magento\TestFramework\ObjectManager */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +$quote = $objectManager->create('\Magento\Sales\Model\Quote'); +$quote->load('test_order_with_virtual_product_without_address', 'reserved_order_id')->delete(); \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_active_with_html_content.php b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_active_with_html_content.php new file mode 100644 index 0000000000000000000000000000000000000000..2611c5b397c94fb2ec9b5e7d5b1e78409f2d8dec --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_active_with_html_content.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var $agreement \Magento\CheckoutAgreements\Model\Agreement */ +$agreement = $objectManager->create('Magento\CheckoutAgreements\Model\Agreement'); +$agreement->setData(array( + 'name' => 'Checkout Agreement (active)', + 'content' => 'Checkout agreement content: <b>HTML</b>', + 'content_height' => '200px', + 'checkbox_text' => 'Checkout agreement checkbox text.', + 'is_active' => true, + 'is_html' => true, + 'stores' => array(0, 1), +)); +$agreement->save(); diff --git a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_active_with_html_content_rollback.php b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_active_with_html_content_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..6c56b3fc30ab820dd1419ecee3007a04d77f2251 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_active_with_html_content_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var $agreement \Magento\CheckoutAgreements\Model\Agreement */ +$agreement = $objectManager->create('Magento\CheckoutAgreements\Model\Agreement'); +$agreement->load('Checkout Agreement (active)', 'name'); +if ($agreement->getId()) { + $agreement->delete(); +} diff --git a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content.php b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content.php new file mode 100644 index 0000000000000000000000000000000000000000..71a885f9a3cfb76b2cb69242e61eaa8adf051d37 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var $agreement \Magento\CheckoutAgreements\Model\Agreement */ +$agreement = $objectManager->create('Magento\CheckoutAgreements\Model\Agreement'); +$agreement->setData(array( + 'name' => 'Checkout Agreement (inactive)', + 'content' => 'Checkout agreement content: TEXT', + 'content_height' => '200px', + 'checkbox_text' => 'Checkout agreement checkbox text.', + 'is_active' => false, + 'is_html' => false, + 'stores' => array(0, 1), +)); +$agreement->save(); diff --git a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content_rollback.php b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..fcc4af67c6be6cc23dd560e2eb8a81a7a4e76299 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content_rollback.php @@ -0,0 +1,31 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var $agreement \Magento\CheckoutAgreements\Model\Agreement */ +$agreement = $objectManager->create('Magento\CheckoutAgreements\Model\Agreement'); +$agreement->load('Checkout Agreement (inactive)', 'name'); +if ($agreement->getId()) { + $agreement->delete(); +} diff --git a/dev/tests/integration/testsuite/Magento/Cms/_files/pages.php b/dev/tests/integration/testsuite/Magento/Cms/_files/pages.php index d64cb623d98df06e3ef90bfbd170e6a93569d90d..a52ce66b314a0971e7872bc678198e0818add1eb 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/_files/pages.php +++ b/dev/tests/integration/testsuite/Magento/Cms/_files/pages.php @@ -29,7 +29,7 @@ $page->setTitle('Cms Page 100') ->setStores(array(0)) ->setIsActive(1) ->setContent('<h1>Cms Page 100 Title</h1>') - ->setRootTemplate('one_column') + ->setPageLayout('1column') ->save(); $page = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Cms\Model\Page'); @@ -38,6 +38,6 @@ $page->setTitle('Cms Page Design Blank') ->setStores(array(0)) ->setIsActive(1) ->setContent('<h1>Cms Page Design Blank Title</h1>') - ->setRootTemplate('one_column') + ->setPageLayout('1column') ->setCustomTheme('Magento/blank') ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/GroupTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/GroupTest.php index 9028621344a2e051ef97cd01e88bdf1268123e96..1b703fc5931fe99b7a1d11dad6e6a1c19e43fe74 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/GroupTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/GroupTest.php @@ -58,7 +58,7 @@ class GroupTest extends \PHPUnit_Framework_TestCase $metadataService = Bootstrap::getObjectManager()->get( 'Magento\Customer\Service\V1\CustomerMetadataServiceInterface' ); - $autoGroupAttribute = $metadataService->getCustomerAttributeMetadata('disable_auto_group_change'); + $autoGroupAttribute = $metadataService->getAttributeMetadata('disable_auto_group_change'); $this->groupRenderer->setDisableAutoGroupChangeAttribute($autoGroupAttribute); $html = $this->groupRenderer->render($this->groupElement); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/NameTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/NameTest.php index 3178011b94cd6501dd04a2efd61ee316bd15662d..f584a191e4c36346010ea95d864dcff1eed8cff5 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/NameTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/NameTest.php @@ -44,6 +44,9 @@ class NameTest extends \PHPUnit_Framework_TestCase ); } + /** + * @magentoAppIsolation enabled + */ public function testToHtmlSimpleName() { /** @var \Magento\Customer\Service\V1\Data\CustomerBuilder $customerBuilder */ @@ -64,6 +67,7 @@ class NameTest extends \PHPUnit_Framework_TestCase } /** + * @magentoAppIsolation enabled * @magentoDataFixture Magento/Customer/_files/attribute_user_fullname.php */ public function testToHtmlFancyName() diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/TaxvatTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/TaxvatTest.php index 6dc8e3a41338d8a859aba3dd5ac0ce195ef98311..ae1c4fec817d65d2e69ffa43bb41d423a0e902a5 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/TaxvatTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/TaxvatTest.php @@ -30,6 +30,9 @@ namespace Magento\Customer\Block\Widget; */ class TaxvatTest extends \PHPUnit_Framework_TestCase { + /** + * @magentoAppIsolation enabled + */ public function testToHtml() { /** @var \Magento\Customer\Block\Widget\Taxvat $block */ @@ -42,6 +45,7 @@ class TaxvatTest extends \PHPUnit_Framework_TestCase } /** + * @magentoAppIsolation enabled * @magentoDbIsolation enabled */ public function testToHtmlRequired() diff --git a/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php b/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php index 831ebe30dc0a63663ab3222a92643280c842a0f6..e7070aa93bb9db0d410d1ad6c9c1ed5d50ab689a 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php @@ -86,9 +86,9 @@ class ViewTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValueMap( array( - array('customer', 'prefix', $isPrefixAllowed ? $visibleAttribute : $invisibleAttribute), - array('customer', 'middlename', $isMiddleNameAllowed ? $visibleAttribute : $invisibleAttribute), - array('customer', 'suffix', $isSuffixAllowed ? $visibleAttribute : $invisibleAttribute) + array('prefix', $isPrefixAllowed ? $visibleAttribute : $invisibleAttribute), + array('middlename', $isMiddleNameAllowed ? $visibleAttribute : $invisibleAttribute), + array('suffix', $isSuffixAllowed ? $visibleAttribute : $invisibleAttribute) ) ) ); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormTest.php index a74671b8dd0d4b4aa5590c39e50984f0e3704d21..4957e585c773ec8a8b66293a63ded0d6accdf4da 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormTest.php @@ -103,12 +103,18 @@ class FormTest extends \PHPUnit_Framework_TestCase unset($this->_expected['suffix']); } + /** + * @magentoAppIsolation enabled + */ public function testCompactData() { $attributeValues = $this->_form->compactData($this->_form->extractData($this->_request)); $this->assertEquals($this->_expected, $attributeValues); } + /** + * @magentoAppIsolation enabled + */ public function testGetAttributes() { $expectedAttributes = array( @@ -131,12 +137,16 @@ class FormTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expectedAttributes, array_keys($this->_form->getAttributes())); } + /** + * @magentoAppIsolation enabled + */ public function testGetSystemAttributes() { $this->assertCount(15, $this->_form->getSystemAttributes()); } /** + * @magentoAppIsolation enabled * @magentoDataFixture Magento/Customer/_files/attribute_user_defined_address.php */ public function testGetUserAttributes() @@ -145,6 +155,9 @@ class FormTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expectedAttributes, array_keys($this->_form->getUserAttributes())); } + /** + * @magentoAppIsolation enabled + */ public function testRestoreData() { $attributeValues = $this->_form->restoreData($this->_form->extractData($this->_request)); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceTest.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..83d41be208c69fbba90a4eaee6acd70f21d4a51d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceTest.php @@ -0,0 +1,107 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Customer\Service\V1; + +use Magento\Framework\Exception\NoSuchEntityException; + +class AddressMetadataServiceTest extends \PHPUnit_Framework_TestCase +{ + /** @var CustomerAccountServiceInterface */ + private $_customerAccountService; + + /** @var AddressMetadataServiceInterface */ + private $_service; + + protected function setUp() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager->configure( + [ + 'Magento\Framework\Service\Config\Reader' => [ + 'arguments' => [ + 'fileResolver' => ['instance' => 'Magento\Customer\Service\V1\FileResolverStub'] + ] + ] + ] + ); + $this->_customerAccountService = $objectManager->create( + 'Magento\Customer\Service\V1\CustomerAccountServiceInterface' + ); + $this->_service = $objectManager->create('Magento\Customer\Service\V1\AddressMetadataServiceInterface'); + } + + public function testGetCustomAttributesMetadata() + { + $customAttributesMetadata = $this->_service->getCustomAttributesMetadata(); + $this->assertCount(2, $customAttributesMetadata, "Invalid number of attributes returned."); + $configAttributeCode = 'address_attribute_1'; + $configAttributeFound = false; + foreach ($customAttributesMetadata as $attribute) { + if ($attribute->getAttributeCode() == $configAttributeCode) { + $configAttributeFound = true; + break; + } + } + if (!$configAttributeFound) { + $this->fail("Custom attribute declared in the config not found."); + } + } + + public function testGetAddressAttributeMetadata() + { + $vatValidMetadata = $this->_service->getAttributeMetadata('vat_is_valid'); + + $this->assertNotNull($vatValidMetadata); + $this->assertEquals('vat_is_valid', $vatValidMetadata->getAttributeCode()); + $this->assertEquals('text', $vatValidMetadata->getFrontendInput()); + $this->assertEquals('VAT number validity', $vatValidMetadata->getStoreLabel()); + } + + public function testGetAddressAttributeMetadataNoSuchEntity() + { + try { + $this->_service->getAttributeMetadata('1'); + $this->fail('Expected exception not thrown.'); + } catch (NoSuchEntityException $e) { + $this->assertEquals( + 'No such entity with entityType = customer_address, attributeCode = 1', + $e->getMessage() + ); + } + } + + public function testGetAttributes() + { + $formAttributesMetadata = $this->_service->getAttributes('customer_address_edit'); + $this->assertCount(15, $formAttributesMetadata, "Invalid number of attributes for the specified form."); + + /** Check some fields of one attribute metadata */ + $attributeMetadata = $formAttributesMetadata['company']; + $this->assertInstanceOf('Magento\Customer\Service\V1\Data\Eav\AttributeMetadata', $attributeMetadata); + $this->assertEquals('company', $attributeMetadata->getAttributeCode(), 'Attribute code is invalid'); + $this->assertNotEmpty($attributeMetadata->getValidationRules(), 'Validation rules are not set'); + $this->assertEquals('varchar', $attributeMetadata->getBackendType(), 'Backend type is invalid'); + $this->assertEquals('Company', $attributeMetadata->getFrontendLabel(), 'Frontend label is invalid'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php index c4a41810b75f59426dec6d3768379bc4ad659395..b1789d88c20f4c974c72e9d2d190b29c6f55f7a2 100755 --- a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php @@ -28,7 +28,6 @@ namespace Magento\Customer\Service\V1; use Magento\Customer\Service\V1; use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Service\V1\Data\FilterBuilder; use Magento\Framework\Service\V1\Data\SearchCriteria; use Magento\TestFramework\Helper\Bootstrap; @@ -1274,9 +1273,13 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ->setValue('First%') ->create(); $searchBuilder->addFilter([$firstnameFilter]); - // Search ascending order - $searchBuilder->addSortOrder('lastname', SearchCriteria::SORT_ASC); + $sortOrderBuilder = $this->_objectManager->create('\Magento\Framework\Service\V1\Data\SortOrderBuilder'); + $sortOrder = $sortOrderBuilder + ->setField('lastname') + ->setDirection(SearchCriteria::SORT_ASC) + ->create(); + $searchBuilder->addSortOrder($sortOrder); $searchResults = $this->_customerAccountService->searchCustomers($searchBuilder->create()); $this->assertEquals(3, $searchResults->getTotalCount()); $this->assertEquals('Lastname', $searchResults->getItems()[0]->getCustomer()->getLastname()); @@ -1284,7 +1287,11 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->assertEquals('Lastname3', $searchResults->getItems()[2]->getCustomer()->getLastname()); // Search descending order - $searchBuilder->addSortOrder('lastname', SearchCriteria::SORT_DESC); + $sortOrder = $sortOrderBuilder + ->setField('lastname') + ->setDirection(SearchCriteria::SORT_DESC) + ->create(); + $searchBuilder->addSortOrder($sortOrder); $searchResults = $this->_customerAccountService->searchCustomers($searchBuilder->create()); $this->assertEquals('Lastname3', $searchResults->getItems()[0]->getCustomer()->getLastname()); $this->assertEquals('Lastname2', $searchResults->getItems()[1]->getCustomer()->getLastname()); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php index 00a949f77295a6551119b2c0f7171469784ddb3d..f17a7144a65f56097a0e89d8f8a72a9051b28248 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php @@ -1,7 +1,5 @@ <?php /** - * Integration test for service layer \Magento\Customer\Service\Eav\AttributeMetadataV1 - * * Magento * * NOTICE OF LICENSE @@ -23,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1; use Magento\Framework\Exception\NoSuchEntityException; @@ -38,22 +37,35 @@ class CustomerMetadataServiceTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager->configure( + [ + 'Magento\Framework\Service\Config\Reader' => [ + 'arguments' => [ + 'fileResolver' => ['instance' => 'Magento\Customer\Service\V1\FileResolverStub'] + ] + ] + ] + ); $this->_customerAccountService = $objectManager->create( 'Magento\Customer\Service\V1\CustomerAccountServiceInterface' ); $this->_service = $objectManager->create('Magento\Customer\Service\V1\CustomerMetadataServiceInterface'); } - public function testGetAttributeMetadataNoSuchEntity() + public function testGetCustomAttributesMetadata() { - try { - $this->_service->getAttributeMetadata('customer_address', '1'); - $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $e) { - $this->assertEquals( - 'No such entity with entityType = customer_address, attributeCode = 1', - $e->getMessage() - ); + $customAttributesMetadata = $this->_service->getCustomAttributesMetadata(); + $this->assertCount(3, $customAttributesMetadata, "Invalid number of attributes returned."); + $configAttributeCode = 'customer_attribute_1'; + $configAttributeFound = false; + foreach ($customAttributesMetadata as $attribute) { + if ($attribute->getAttributeCode() == $configAttributeCode) { + $configAttributeFound = true; + break; + } + } + if (!$configAttributeFound) { + $this->fail("Custom attribute declared in the config not found."); } } @@ -88,7 +100,7 @@ class CustomerMetadataServiceTest extends \PHPUnit_Framework_TestCase foreach ($attributes as $attributeCode => $attributeValue) { $this->assertNotNull($attributeCode); $this->assertNotNull($attributeValue); - $attributeMetadata = $this->_service->getCustomerAttributeMetadata($attributeCode); + $attributeMetadata = $this->_service->getAttributeMetadata($attributeCode); $attrMetadataCode = $attributeMetadata->getAttributeCode(); $this->assertSame($attributeCode, $attrMetadataCode); if (($key = array_search($attrMetadataCode, $expectAttrsWOutVals)) !== false) { @@ -110,33 +122,24 @@ class CustomerMetadataServiceTest extends \PHPUnit_Framework_TestCase public function testGetCustomerAttributeMetadataNoSuchEntity() { try { - $this->_service->getCustomerAttributeMetadata('20'); + $this->_service->getAttributeMetadata('20'); $this->fail('Expected exception not thrown.'); } catch (NoSuchEntityException $e) { $this->assertEquals('No such entity with entityType = customer, attributeCode = 20', $e->getMessage()); } } - public function testGetAddressAttributeMetadata() + public function testGetAttributes() { - $vatValidMetadata = $this->_service->getAddressAttributeMetadata('vat_is_valid'); + $formAttributesMetadata = $this->_service->getAttributes('adminhtml_customer'); + $this->assertCount(14, $formAttributesMetadata, "Invalid number of attributes for the specified form."); - $this->assertNotNull($vatValidMetadata); - $this->assertEquals('vat_is_valid', $vatValidMetadata->getAttributeCode()); - $this->assertEquals('text', $vatValidMetadata->getFrontendInput()); - $this->assertEquals('VAT number validity', $vatValidMetadata->getStoreLabel()); - } - - public function testGetAddressAttributeMetadataNoSuchEntity() - { - try { - $this->_service->getAddressAttributeMetadata('1'); - $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $e) { - $this->assertEquals( - 'No such entity with entityType = customer_address, attributeCode = 1', - $e->getMessage() - ); - } + /** Check some fields of one attribute metadata */ + $attributeMetadata = $formAttributesMetadata['firstname']; + $this->assertInstanceOf('Magento\Customer\Service\V1\Data\Eav\AttributeMetadata', $attributeMetadata); + $this->assertEquals('firstname', $attributeMetadata->getAttributeCode(), 'Attribute code is invalid'); + $this->assertNotEmpty($attributeMetadata->getValidationRules(), 'Validation rules are not set'); + $this->assertEquals('1', $attributeMetadata->isSystem(), '"Is system" field value is invalid'); + $this->assertEquals('40', $attributeMetadata->getSortOrder(), 'Sort order is invalid'); } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/Data/AddressBuilderTest.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/Data/AddressBuilderTest.php deleted file mode 100644 index 2447c5df747de1a756f5934c97cdbe23c694a786..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/Data/AddressBuilderTest.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Customer\Service\V1\Data; - -use Magento\TestFramework\Helper\Bootstrap; - -class AddressBuilderTest extends \PHPUnit_Framework_TestCase -{ - /** @var \Magento\Customer\Service\V1\Data\AddressBuilder */ - protected $_addressBuilder; - - protected function setUp() - { - $this->_addressBuilder = Bootstrap::getObjectManager()->create( - 'Magento\Customer\Service\V1\Data\AddressBuilder' - ); - parent::setUp(); - } - - /** - * Two custom attributes are created, one for customer and another for customer address. - * - * Attribute related to customer address should be returned only. - * - * @magentoDataFixture Magento/Customer/_files/attribute_user_defined_address.php - * @magentoDataFixture Magento/Customer/_files/attribute_user_defined_customer.php - */ - public function testGetCustomAttributesCodes() - { - $userDefinedAttributeCode = 'address_user_attribute'; - $attributeCodes = $this->_addressBuilder->getCustomAttributesCodes(); - $expectedAttributes = [$userDefinedAttributeCode]; - $this->assertEquals($expectedAttributes, $attributeCodes, 'Custom attribute codes list is invalid.'); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/Data/CustomerBuilderTest.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/Data/CustomerBuilderTest.php deleted file mode 100644 index 3114ead3d20114c9d4b6def2dd012e869cb45671..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/Data/CustomerBuilderTest.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Customer\Service\V1\Data; - -use Magento\TestFramework\Helper\Bootstrap; - -class CustomerBuilderTest extends \PHPUnit_Framework_TestCase -{ - /** @var \Magento\Customer\Service\V1\Data\CustomerBuilder */ - protected $_customerBuilder; - - protected function setUp() - { - $this->_customerBuilder = Bootstrap::getObjectManager()->create( - 'Magento\Customer\Service\V1\Data\CustomerBuilder' - ); - parent::setUp(); - } - - /** - * Two custom attributes are created, one for customer and another for customer address. - * - * Attribute related to customer should be returned only. - * - * @magentoDataFixture Magento/Customer/_files/attribute_user_defined_address.php - * @magentoDataFixture Magento/Customer/_files/attribute_user_defined_customer.php - */ - public function testGetCustomAttributesCodes() - { - $userDefinedAttributeCode = FIXTURE_ATTRIBUTE_USER_DEFINED_CUSTOMER_NAME; - $attributeCodes = $this->_customerBuilder->getCustomAttributesCodes(); - $expectedAttributes = array( - 'disable_auto_group_change', - $userDefinedAttributeCode - ); - $this->assertEquals($expectedAttributes, $attributeCodes, 'Custom attribute codes list is invalid.'); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/FileResolverStub.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/FileResolverStub.php new file mode 100644 index 0000000000000000000000000000000000000000..f93865f29ccb2c70121f49eea393c78576ebd4a5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/FileResolverStub.php @@ -0,0 +1,45 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +class FileResolverStub implements \Magento\Framework\Config\FileResolverInterface +{ + /** + * {@inheritdoc} + */ + public function get($filename, $scope) + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $readDirectory = $objectManager->create( + 'Magento\Framework\Filesystem\Directory\Read', + [ + 'config' => ['path' => realpath(__DIR__ . '/../../_files/etc')], + 'driver' => $objectManager->create('Magento\Framework\Filesystem\Driver\File') + ] + ); + $paths = ['data_object.xml']; + return new \Magento\Framework\Config\FileIterator($readDirectory, $paths); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/etc/data_object.xml b/dev/tests/integration/testsuite/Magento/Customer/_files/etc/data_object.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2069f0d8a4264efa3d63e104e8159c7efa58264 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/etc/data_object.xml @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Service/etc/data_object.xsd"> + <custom_attributes for="Magento\Tax\Service\V1\Data\TaxRate"> + </custom_attributes> + <custom_attributes for="Magento\Catalog\Service\V1\Data\Product"> + <attribute code="stock_item" type="Magento\CatalogInventory\Service\Data\V1\StockItem" /> + </custom_attributes> + <custom_attributes for="Magento\Catalog\Service\V1\Data\Category"> + <attribute code="category_attribute_1" type="Magento\Catalog\Service\V1\Data\CategoryAttributeType1" /> + <attribute code="category_attribute_2" type="Magento\Catalog\Service\V1\Data\CategoryAttributeType2" /> + </custom_attributes> + <custom_attributes for="Magento\Customer\Service\V1\Data\Customer"> + <attribute code="customer_attribute_1" type="Magento\Customer\Service\V1\Data\CustomerAttributeType1" /> + <attribute code="customer_attribute_2" type="Magento\Customer\Service\V1\Data\CustomerAttributeType2" /> + </custom_attributes> + <custom_attributes for="Magento\Customer\Service\V1\Data\Address"> + <attribute code="address_attribute_1" type="Magento\Customer\Service\V1\Data\AddressAttributeType1" /> + <attribute code="address_attribute_2" type="Magento\Customer\Service\V1\Data\AddressAttributeType2" /> + </custom_attributes> +</config> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Service/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Framework/Service/Config/ReaderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..42c11f0b0877833491aa952df334e38e023bfaba --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Service/Config/ReaderTest.php @@ -0,0 +1,108 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Framework\Service\Config; + +/** + * Tests for \Magento\Framework\Service\Config\Reader + */ +class ReaderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\Service\Config\Reader + */ + protected $_model; + + /** + * @var array + */ + protected $_fileList; + + /** + * @var \Magento\Framework\App\Arguments\FileResolver\Primary + */ + protected $_fileResolverMock; + + /** + * @var \Magento\Framework\App\Arguments\ValidationState + */ + protected $_validationState; + + /** + * @var \Magento\Framework\Service\Config\SchemaLocator + */ + protected $_schemaLocator; + + /** + * @var \Magento\Framework\Service\Config\Converter + */ + protected $_converter; + + protected function setUp() + { + $fixturePath = realpath(__DIR__ . '/_files') . '/'; + $this->_fileList = array( + file_get_contents($fixturePath . 'config_one.xml'), + file_get_contents($fixturePath . 'config_two.xml') + ); + + $this->_fileResolverMock = $this->getMockBuilder('Magento\Framework\App\Arguments\FileResolver\Primary') + ->disableOriginalConstructor() + ->setMethods(['get']) + ->getMock(); + $this->_fileResolverMock->expects($this->once()) + ->method('get') + ->will($this->returnValue($this->_fileList)); + + $this->_converter = new \Magento\Framework\Service\Config\Converter(); + + $this->_validationState = new \Magento\Framework\App\Arguments\ValidationState( + \Magento\Framework\App\State::MODE_DEFAULT + ); + $this->_schemaLocator = new \Magento\Framework\Service\Config\SchemaLocator(); + } + + public function testMerge() + { + $model = new \Magento\Framework\Service\Config\Reader( + $this->_fileResolverMock, + $this->_converter, + $this->_schemaLocator, + $this->_validationState + ); + + $expectedArray = [ + 'Magento\Tax\Service\V1\Data\TaxRate' => [], + 'Magento\Catalog\Service\Data\V1\Product' => [ + 'stock_item' => "Magento\CatalogInventory\Service\Data\V1\StockItem" + ], + 'Magento\Customer\Service\V1\Data\Customer' => [ + 'custom_1' => "Magento\Customer\Service\V1\Data\CustomerCustom", + 'custom_2' => "Magento\CustomerExtra\Service\V1\Data\CustomerCustom22", + 'custom_3' => "Magento\Customer\Service\V1\Data\CustomerCustom3" + ] + ]; + + $this->assertEquals($expectedArray, $model->read('global')); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/Service/Config/_files/config_one.xml b/dev/tests/integration/testsuite/Magento/Framework/Service/Config/_files/config_one.xml new file mode 100644 index 0000000000000000000000000000000000000000..47ce633618dbd583e4a2438b7c04f0fa35a7c0e3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Service/Config/_files/config_one.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Service/etc/data_object.xsd"> + <custom_attributes for="Magento\Tax\Service\V1\Data\TaxRate"> + </custom_attributes> + <custom_attributes for="Magento\Catalog\Service\Data\V1\Product"> + <attribute code="stock_item" type="Magento\CatalogInventory\Service\Data\V1\StockItem" /> + </custom_attributes> + <custom_attributes for="Magento\Customer\Service\V1\Data\Customer"> + <attribute code="custom_1" type="Magento\Customer\Service\V1\Data\CustomerCustom" /> + <attribute code="custom_2" type="Magento\CustomerExtra\Service\V1\Data\CustomerCustom21" /> + </custom_attributes> +</config> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Service/Config/_files/config_two.xml b/dev/tests/integration/testsuite/Magento/Framework/Service/Config/_files/config_two.xml new file mode 100644 index 0000000000000000000000000000000000000000..631537acba3306efe2265163ce24c6f7b1f7bceb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Service/Config/_files/config_two.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Service/etc/data_object.xsd"> + <custom_attributes for="Magento\Customer\Service\V1\Data\Customer"> + <attribute code="custom_2" type="Magento\CustomerExtra\Service\V1\Data\CustomerCustom22" /> + <attribute code="custom_3" type="Magento\Customer\Service\V1\Data\CustomerCustom3" /> + </custom_attributes> +</config> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_one.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_one.xml index 06875e6d25da4bd770aa6eca6a3a14f507a63b97..b2cd1ef670be2f3353fb5b0a0abbd2280d40c9ea 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_one.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_one.xml @@ -23,10 +23,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Core/etc/page.xsd"> <block class="Magento\Framework\View\Element\Text" name="some_text_block"> <action method="setText"> <text>Some Default Text</text> </action> </block> -</layout> +</page> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_three.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_three.xml index 6ba0ffa58091758e19017f4a015c9b7852643497..8195fce7186775a7feb91451c84a6f4a4d632c68 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_three.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_three.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Handle Three" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page label="Handle Three" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Core/etc/page.xsd"> <update handle="handle_one"/> -</layout> +</page> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_two.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_two.xml index 32b910b0d98961df0dd81b4a9c8fc7d782b7c292..b821e8f34841901ce3671572c5f9f12dc1962ead 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_two.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_two.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Handle Two" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page label="Handle Two" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Core/etc/page.xsd"> <update handle="handle_one"/> <referenceBlock name="some_text_block"> <action method="setText"> <text>Some Custom Text</text> </action> </referenceBlock> -</layout> +</page> diff --git a/dev/tests/integration/testsuite/Magento/Rss/Controller/IndexTest.php b/dev/tests/integration/testsuite/Magento/Rss/Controller/IndexTest.php index 0b19c082d996406f30730a592ee6b0fd23170ff7..a8294d1f69890bf3ce85fd4005c55f9b786cd568 100644 --- a/dev/tests/integration/testsuite/Magento/Rss/Controller/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Rss/Controller/IndexTest.php @@ -47,27 +47,4 @@ class IndexTest extends \Magento\TestFramework\TestCase\AbstractController $this->assertHeaderPcre('Status', '/404/'); $this->assertHeaderPcre('Content-Type', '/text\/plain/'); } - - /** - * @magentoConfigFixture current_store rss/wishlist/active 1 - * @magentoDataFixture Magento/Wishlist/_files/wishlist.php - * @magentoAppIsolation enabled - */ - public function testWishlistAction() - { - $wishlist = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Wishlist\Model\Wishlist' - ); - $wishlist->load('fixture_unique_code', 'sharing_code'); - $this->getRequest()->setParam('wishlist_id', $wishlist->getId())->setParam('data', base64_encode('1')); - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Customer\Model\Session'); - $service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Customer\Service\V1\CustomerAccountService' - ); - $customer = $service->authenticate('customer@example.com', 'password'); - $session->setCustomerDataAsLoggedIn($customer); - - $this->dispatch('rss/index/wishlist'); - $this->assertContains('<![CDATA[Simple Product]]>', $this->getResponse()->getBody()); - } } diff --git a/dev/tests/integration/testsuite/Magento/Tax/Controller/Adminhtml/RateTest.php b/dev/tests/integration/testsuite/Magento/Tax/Controller/Adminhtml/RateTest.php index 72eeca4c82989b678e0d987de13fad6dc9cc4b88..2bfbf66228dc665089c3f31b5ab6753bb5e9ec6e 100644 --- a/dev/tests/integration/testsuite/Magento/Tax/Controller/Adminhtml/RateTest.php +++ b/dev/tests/integration/testsuite/Magento/Tax/Controller/Adminhtml/RateTest.php @@ -64,7 +64,7 @@ class RateTest extends \Magento\Backend\Utility\Controller public function ajaxSaveActionDataProvider() { - $postData = array('rate' => '10', 'tax_country_id' => 'US', 'tax_region_id' => '0'); + $postData = array('rate' => '10', 'tax_country_id' => 'US', 'tax_region_id' => '1'); return array( array( $postData + array( diff --git a/dev/tests/integration/testsuite/Magento/Tax/Service/V1/TaxRateServiceTest.php b/dev/tests/integration/testsuite/Magento/Tax/Service/V1/TaxRateServiceTest.php index 4584a87934006e8a607f57c209a15fdf03a2f560..7e06b90f575d339469f0939e94ce14a9dd1bd4e3 100644 --- a/dev/tests/integration/testsuite/Magento/Tax/Service/V1/TaxRateServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Tax/Service/V1/TaxRateServiceTest.php @@ -60,12 +60,24 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase */ private $taxRateFixtureFactory; + /** + * @var \Magento\Directory\Model\CountryFactory + */ + private $countryFactory; + + /** + * @var \Magento\Directory\Model\RegionFactory + */ + private $regionFactory; + protected function setUp() { $this->objectManager = Bootstrap::getObjectManager(); $this->taxRateService = $this->objectManager->get('Magento\Tax\Service\V1\TaxRateServiceInterface'); $this->taxRateBuilder = $this->objectManager->create('Magento\Tax\Service\V1\Data\TaxRateBuilder'); $this->taxRateFixtureFactory = new TaxRuleFixtureFactory(); + $this->countryFactory = $this->objectManager->create('Magento\Directory\Model\CountryFactory'); + $this->regionFactory = $this->objectManager->create('Magento\Directory\Model\RegionFactory'); } /** @@ -86,7 +98,7 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase $taxRateServiceData = $this->taxRateService->createTaxRate($taxRate); //Assertions - $this->assertInstanceOf('\Magento\Tax\Service\V1\Data\TaxRate', $taxRateServiceData); + $this->assertInstanceOf('Magento\Tax\Service\V1\Data\TaxRate', $taxRateServiceData); $this->assertEquals($taxData['country_id'], $taxRateServiceData->getCountryId()); $this->assertEquals($taxData['region_id'], $taxRateServiceData->getRegionId()); $this->assertEquals($taxData['percentage_rate'], $taxRateServiceData->getPercentageRate()); @@ -104,7 +116,7 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase */ public function testCreateTaxRateWithTitles() { - $store = $this->objectManager->get('\Magento\Store\Model\Store'); + $store = $this->objectManager->get('Magento\Store\Model\Store'); $store->load('test', 'code'); $taxData = [ @@ -126,7 +138,7 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase $taxRateServiceData = $this->taxRateService->createTaxRate($taxRate); //Assertions - $this->assertInstanceOf('\Magento\Tax\Service\V1\Data\TaxRate', $taxRateServiceData); + $this->assertInstanceOf('Magento\Tax\Service\V1\Data\TaxRate', $taxRateServiceData); $this->assertEquals($taxData['country_id'], $taxRateServiceData->getCountryId()); $this->assertEquals($taxData['region_id'], $taxRateServiceData->getRegionId()); $this->assertEquals($taxData['percentage_rate'], $taxRateServiceData->getPercentageRate()); @@ -200,30 +212,30 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase */ public function testCreateTaxRateWithExceptionMessages($dataArray, $errorMessages) { - $expectedErrorMessages = [ - 'country_id is a required field.', - 'percentage_rate is a required field.', - 'code is a required field.' - ]; - $expectedErrorMessages = array_merge($expectedErrorMessages, $errorMessages); $taxRate = $this->taxRateBuilder->populateWithArray($dataArray)->create(); try { $this->taxRateService->createTaxRate($taxRate); } catch (InputException $exception) { $errors = $exception->getErrors(); foreach ($errors as $key => $error) { - $this->assertEquals($expectedErrorMessages[$key], $error->getMessage()); + $this->assertEquals($errorMessages[$key], $error->getMessage()); } throw $exception; } } + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ public function createDataProvider() { return [ 'invalidZipRange' => [ ['zip_range' => ['from' => 'from', 'to' => 'to']], 'error' => [ + 'country_id is a required field.', + 'percentage_rate is a required field.', + 'code is a required field.', 'Invalid value of "from" provided for the zip_from field.', 'Invalid value of "to" provided for the zip_to field.' ] @@ -231,22 +243,88 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase 'emptyZipRange' => [ ['zip_range' => ['from' => '', 'to' => '']], 'error' => [ + 'country_id is a required field.', + 'percentage_rate is a required field.', + 'code is a required field.', 'Invalid value of "" provided for the zip_from field.', 'Invalid value of "" provided for the zip_to field.' ] ], 'empty' => [ [], - 'error' => ['postcode is a required field.'] + 'error' => [ + 'country_id is a required field.', + 'percentage_rate is a required field.', + 'code is a required field.', + 'postcode is a required field.' + ] ], 'zipRangeAndPostcode' => [ ['postcode' => 78727, 'zip_range' => ['from' => 78765, 'to' => 78780]], - 'error' => [] + 'error' => [ + 'country_id is a required field.', + 'percentage_rate is a required field.', + 'code is a required field.' + ] ], 'higherRange' => [ ['zip_range' => ['from' => 78780, 'to' => 78765]], - 'error' => ['Range To should be equal or greater than Range From.'] + 'error' => [ + 'country_id is a required field.', + 'percentage_rate is a required field.', + 'code is a required field.', + 'Range To should be equal or greater than Range From.' + ] + ], + 'invalidCountry' => [ + ['country_id' => 'XX'], + 'error' => [ + 'Invalid value of "XX" provided for the country_id field.', + 'percentage_rate is a required field.', + 'code is a required field.', + 'postcode is a required field.' + ] + ], + 'invalidCountry2' => [ + ['country_id' => ' '], + 'error' => [ + 'country_id is a required field.', + 'percentage_rate is a required field.', + 'code is a required field.', + 'postcode is a required field.' + ] + ], + 'invalidRegion1' => [ + ['region_id' => '-'], + 'error' => [ + 'country_id is a required field.', + 'Invalid value of "-" provided for the region_id field.', + 'percentage_rate is a required field.', + 'code is a required field.', + 'postcode is a required field.' + ] + ], + 'spaceRegion' => [ + ['region_id' => ' '], + 'error' => [ + 'country_id is a required field.', + 'percentage_rate is a required field.', + 'code is a required field.', + 'postcode is a required field.' + ] + ], + 'emptyPercentageRate' => [ + ['country_id' => 'US', + 'region_id' => '8', + 'percentage_rate' => '', + 'code' => 'US-CA-*-Rate' . rand(), + 'zip_range' => ['from' => 78765, 'to' => 78780] + ], + 'error' => [ + 'percentage_rate is a required field.' + ] ] + ]; } @@ -472,7 +550,7 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase public function searchTaxRatesDataProvider() { - $filterBuilder = Bootstrap::getObjectManager()->create('\Magento\Framework\Service\V1\Data\FilterBuilder'); + $filterBuilder = Bootstrap::getObjectManager()->create('Magento\Framework\Service\V1\Data\FilterBuilder'); return [ 'eq' => [ diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php index 0cd7b84a545a45dcd76524c4bf91f9e34da088cb..b791b54d2f003ecccfd7c61a32b35ddb0d2c47fc 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php @@ -27,6 +27,16 @@ namespace Magento\Test\Integrity\Modular; class ThemeConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfigFiles { + /** + * Returns directory (modules, library internal stc.) constant which contains XSD file + * + * @return string + */ + protected function getDirectoryConstant() + { + return \Magento\Framework\App\Filesystem::LIB_INTERNAL; + } + /** * Returns the reader class name that will be instantiated via ObjectManager * @@ -46,16 +56,16 @@ class ThemeConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfi */ protected function _getConfigFilePathGlob() { - return '/*/*/etc/page_layouts.xml'; + return '/*/*/view/*/layouts.xml'; } /** - * Returns a path to the per file XSD file, relative to the modules directory. + * Returns a path to the per file XSD file, relative to the library directory. * * @return string */ protected function _getXsdPath() { - return '/Magento/Theme/etc/page_layouts_file.xsd'; + return '/Magento/Framework/View/PageLayout/etc/layouts.xsd'; } } diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php index 143a4162e5266f142f355e2cb9e41dd8b79f9e6e..a286d6a63eceb713a4eddbc68687297c1c7475d4 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php @@ -59,16 +59,10 @@ class ReaderTest extends \PHPUnit_Framework_TestCase 'empty' => array( 'label' => 'Empty', 'code' => 'empty', - 'template' => 'empty.phtml', - 'layout_handle' => 'page_empty', - 'is_default' => '0' ), - 'one_column' => array( + '1column' => array( 'label' => '1 column', - 'code' => 'one_column', - 'template' => '1column.phtml', - 'layout_handle' => 'page_one_column', - 'is_default' => '1' + 'code' => '1column', ) ); $this->assertEquals($expected, $result); @@ -87,23 +81,14 @@ class ReaderTest extends \PHPUnit_Framework_TestCase 'empty' => array( 'label' => 'Empty', 'code' => 'empty', - 'template' => 'empty.phtml', - 'layout_handle' => 'page_empty', - 'is_default' => '0' ), - 'one_column' => array( + '1column' => array( 'label' => '1 column modified', - 'code' => 'one_column', - 'template' => '1column.phtml', - 'layout_handle' => 'page_one_column', - 'is_default' => '1' + 'code' => '1column', ), - 'two_columns_left' => array( + '2columns-left' => array( 'label' => '2 columns with left bar', - 'code' => 'two_columns_left', - 'template' => '2columns-left.phtml', - 'layout_handle' => 'page_two_columns_left', - 'is_default' => '0' + 'code' => '2columns-left', ) ); $this->assertEquals($expected, $result); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php index 6ad1a0e38eac16a7c342263279d816c73090b31a..0acbbd6bfee6bad1c3d5f6e4ff83d80e939f5fae 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php @@ -38,17 +38,22 @@ class ConfigTest extends \PHPUnit_Framework_TestCase /** @var $cache \Magento\Framework\App\Cache */ $cache = $objectManager->create('Magento\Framework\App\Cache'); $cache->clean(); - $fileResolverMock = $this->getMockBuilder( - 'Magento\Framework\Config\FileResolverInterface' - )->disableOriginalConstructor()->getMock(); $configFile = file_get_contents(__DIR__ . '/_files/page_layouts.xml'); - $fileResolverMock->expects($this->any())->method('get')->will($this->returnValue(array($configFile))); + $fileResolverMock = $this->getMockBuilder('Magento\Framework\Config\FileResolverInterface') + ->disableOriginalConstructor() + ->getMock(); + $fileResolverMock->expects($this->any()) + ->method('get') + ->will($this->returnValue(array($configFile))); $reader = $objectManager->create( 'Magento\Theme\Model\Layout\Config\Reader', array('fileResolver' => $fileResolverMock) ); - $data = $objectManager->create('Magento\Theme\Model\Layout\Config\Data', array('reader' => $reader)); - $this->_model = $objectManager->create('Magento\Theme\Model\Layout\Config', array('dataStorage' => $data)); + $dataStorage = $objectManager->create('Magento\Theme\Model\Layout\Config\Data', array('reader' => $reader)); + $this->_model = $objectManager->create( + 'Magento\Theme\Model\Layout\Config', + array('dataStorage' => $dataStorage) + ); } public function testGetPageLayouts() @@ -56,20 +61,14 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $empty = array( 'label' => 'Empty', 'code' => 'empty', - 'template' => 'empty.phtml', - 'layout_handle' => 'page_empty', - 'is_default' => '0' ); $oneColumn = array( 'label' => '1 column', - 'code' => 'one_column', - 'template' => '1column.phtml', - 'layout_handle' => 'page_one_column', - 'is_default' => '1' + 'code' => '1column', ); $result = $this->_model->getPageLayouts(); $this->assertEquals($empty, $result['empty']->getData()); - $this->assertEquals($oneColumn, $result['one_column']->getData()); + $this->assertEquals($oneColumn, $result['1column']->getData()); } public function testGetPageLayout() @@ -77,9 +76,6 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $empty = array( 'label' => 'Empty', 'code' => 'empty', - 'template' => 'empty.phtml', - 'layout_handle' => 'page_empty', - 'is_default' => '0' ); $this->assertEquals($empty, $this->_model->getPageLayout('empty')->getData()); $this->assertFalse($this->_model->getPageLayout('unknownLayoutCode')); @@ -87,7 +83,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function testGetPageLayoutHandles() { - $expected = array('empty' => 'page_empty', 'one_column' => 'page_one_column'); + $expected = array('empty' => 'empty', '1column' => '1column'); $this->assertEquals($expected, $this->_model->getPageLayoutHandles()); } } diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml index 7eb139c3a66b5cde68ea1ffb082cc885a0f0634e..bd00859fb6cf59fb812983fd4a9f4902720982df 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml @@ -23,18 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> - <layouts default="one_column"> - <layout id="empty"> - <label translate="true">Empty</label> - <template>empty.phtml</template> - <layout_handle>page_empty</layout_handle> - </layout> - <layout id="one_column"> - <label translate="true">1 column</label> - <template>1column.phtml</template> - <layout_handle>page_one_column</layout_handle> - </layout> - </layouts> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> + <layout id="empty"> + <label translate="true">Empty</label> + </layout> + <layout id="1column"> + <label translate="true">1 column</label> + </layout> </page_layouts> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml index 2e779233ce3936cc9e5fbd7fa826ee9cac942648..1f7e69d3c98651e09b83fb2d78c1ce64b2b88ea9 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml @@ -23,18 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> - <layouts default="one_column"> - <layout id="one_column"> - <label translate="true">1 column modified</label> - <template>1column.phtml</template> - <layout_handle>page_one_column</layout_handle> - </layout> - <layout id="two_columns_left"> - <label translate="true">2 columns with left bar</label> - <template>2columns-left.phtml</template> - <layout_handle>page_two_columns_left</layout_handle> - </layout> - </layouts> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> + <layout id="1column"> + <label translate="true">1 column modified</label> + </layout> + <layout id="2columns-left"> + <label translate="true">2 columns with left bar</label> + </layout> </page_layouts> diff --git a/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/AuthTest.php b/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/AuthTest.php index f61c085906b8fd7133f71ce9690f910cea7cf528..35d339c7eb9a27b5219673b0c9bed3ff5875b7ab 100644 --- a/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/AuthTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/AuthTest.php @@ -63,6 +63,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller * Test reset password action * * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::_validateResetPasswordLinkToken * @magentoDataFixture Magento/User/_files/dummy_user.php */ public function testResetPasswordAction() @@ -91,6 +92,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller /** * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::_validateResetPasswordLinkToken */ public function testResetPasswordActionWithDummyToken() { @@ -105,7 +107,8 @@ class AuthTest extends \Magento\Backend\Utility\Controller /** * @dataProvider resetPasswordDataProvider - * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPasswordPost::execute + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPasswordPost::_validateResetPasswordLinkToken * @magentoDataFixture Magento/User/_files/dummy_user.php */ public function testResetPasswordPostAction($password, $passwordConfirmation, $isPasswordChanged) @@ -177,7 +180,8 @@ class AuthTest extends \Magento\Backend\Utility\Controller } /** - * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPasswordPost::execute + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPasswordPost::_validateResetPasswordLinkToken * @magentoDataFixture Magento/User/_files/dummy_user.php */ public function testResetPasswordPostActionWithDummyToken() @@ -198,7 +202,8 @@ class AuthTest extends \Magento\Backend\Utility\Controller } /** - * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPasswordPost::execute + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPasswordPost::_validateResetPasswordLinkToken * @magentoDataFixture Magento/User/_files/dummy_user.php */ public function testResetPasswordPostActionWithInvalidPassword() diff --git a/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/User/InvalidateTokenTest.php b/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/User/InvalidateTokenTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c3ea6e96a155573972ebca8e08b68fa4f72267a5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/User/InvalidateTokenTest.php @@ -0,0 +1,130 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\User\Controller\Adminhtml\User; + +use Magento\Framework\Message\MessageInterface; +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Test class for Magento\User\Controller\Adminhtml\User\InvalidateToken. + */ +class InvalidateTokenTest extends \Magento\Backend\Utility\Controller +{ + /** + * @magentoDataFixture Magento/User/_files/user_with_role.php + */ + public function testInvalidateSingleToken() + { + /** @var \Magento\Integration\Service\V1\TokenService $tokenService */ + $tokenService = Bootstrap::getObjectManager()->get('Magento\Integration\Service\V1\TokenService'); + /** @var \Magento\Integration\Model\Oauth\Token $tokenModel */ + $tokenModel = Bootstrap::getObjectManager()->get('Magento\Integration\Model\Oauth\Token'); + /** @var \Magento\User\Model\User $userModel */ + $userModel = Bootstrap::getObjectManager()->get('Magento\User\Model\User'); + + $adminUserNameFromFixture = 'adminUser'; + $tokenService->createAdminAccessToken( + $adminUserNameFromFixture, + \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + ); + $adminUserId = $userModel->loadByUsername($adminUserNameFromFixture)->getId(); + + // invalidate token + $this->getRequest()->setParam('user_id', $adminUserId); + $this->dispatch('backend/admin/user/invalidateToken'); + $token = $tokenModel->loadByAdminId($adminUserId); + $this->assertEquals(1, $token->getRevoked()); + } + + /** + * @magentoDataFixture Magento/User/_files/user_with_role.php + */ + public function testInvalidateMultipleTokens() + { + /** @var \Magento\Integration\Service\V1\TokenService $tokenService */ + $tokenService = Bootstrap::getObjectManager()->get('Magento\Integration\Service\V1\TokenService'); + /** @var \Magento\User\Model\User $userModel */ + $userModel = Bootstrap::getObjectManager()->get('Magento\User\Model\User'); + + $adminUserNameFromFixture = 'adminUser'; + $tokenService->createAdminAccessToken( + $adminUserNameFromFixture, + \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + ); + + $tokenService->createAdminAccessToken( + $adminUserNameFromFixture, + \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + ); + + $adminUserId = $userModel->loadByUsername($adminUserNameFromFixture)->getId(); + + // invalidate tokens + $this->getRequest()->setParam('user_id', $adminUserId); + $this->dispatch('backend/admin/user/invalidateToken'); + foreach ($tokenService->tokenModelCollectionFactory->create()->addFilterByAdminId($adminUserId) as $token) { + $this->assertEquals(1, $token->getRevoked()); + } + } + + /** + * @magentoDataFixture Magento/User/_files/user_with_role.php + */ + public function testInvalidateToken_NoTokens() + { + /** @var \Magento\User\Model\User $userModel */ + $userModel = Bootstrap::getObjectManager()->get('Magento\User\Model\User'); + $adminUserNameFromFixture = 'adminUser'; + $adminUserId = $userModel->loadByUsername($adminUserNameFromFixture)->getId(); + // invalidate token + $this->getRequest()->setParam('user_id', $adminUserId); + $this->dispatch('backend/admin/user/invalidateToken'); + $this->assertSessionMessages( + $this->equalTo(['This user has no tokens.']), + MessageInterface::TYPE_ERROR + ); + } + + public function testInvalidateToken_NoUser() + { + $this->dispatch('backend/admin/user/invalidateToken'); + $this->assertSessionMessages( + $this->equalTo(['We can\'t find a user to revoke.']), + MessageInterface::TYPE_ERROR + ); + } + + public function testInvalidateToken_InvalidUser() + { + $adminUserId = 999; + // invalidate token + $this->getRequest()->setParam('user_id', $adminUserId); + $this->dispatch('backend/admin/user/invalidateToken'); + $this->assertSessionMessages( + $this->equalTo(['This user has no tokens.']), + MessageInterface::TYPE_ERROR + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Rss/Block/WishlistTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Block/RssTest.php similarity index 92% rename from dev/tests/integration/testsuite/Magento/Rss/Block/WishlistTest.php rename to dev/tests/integration/testsuite/Magento/Wishlist/Block/RssTest.php index 3afaa180f24efaf7ff36776e1d864a06b965c2ea..db434525c81347ca4dfe66411ef0c8e64f280f5e 100644 --- a/dev/tests/integration/testsuite/Magento/Rss/Block/WishlistTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Block/RssTest.php @@ -22,9 +22,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Rss\Block; +namespace Magento\Wishlist\Block; -class WishlistTest extends \PHPUnit_Framework_TestCase +class RssTest extends \PHPUnit_Framework_TestCase { /** * @var \Magento\Customer\Model\Session @@ -68,7 +68,7 @@ class WishlistTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Helper\Context $contextHelper */ $contextHelper = $this->_objectManager->create('Magento\Framework\App\Helper\Context'); - $wishlistHelper = $this->_objectManager->create('Magento\Rss\Helper\WishlistRss', + $wishlistHelper = $this->_objectManager->create('Magento\Wishlist\Helper\Rss', [ 'context' => $contextHelper, 'customerSession' => $this->_customerSession @@ -77,7 +77,7 @@ class WishlistTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Catalog\Block\Product\Context $context */ $contextBlock = $this->_objectManager->create( - 'Magento\Rss\Block\Context', + 'Magento\Wishlist\Block\Context', [ 'request' => $contextHelper->getRequest(), 'wishlistHelper' => $wishlistHelper @@ -88,8 +88,8 @@ class WishlistTest extends \PHPUnit_Framework_TestCase $request->setParam('wishlist_id', $wishlist->getId()); $request->setParam('data', $this->_coreData->urlEncode($fixtureCustomerId)); - /** @var \Magento\Rss\Block\Wishlist $block */ - $block = $this->_objectManager->create('Magento\Rss\Block\Wishlist', + /** @var \Magento\Wishlist\Block\Rss $block */ + $block = $this->_objectManager->create('Magento\Wishlist\Block\Rss', [ 'context' => $contextBlock ] @@ -105,4 +105,3 @@ class WishlistTest extends \PHPUnit_Framework_TestCase $this->assertStringMatchesFormat($expectedSting, $block->toHtml()); } } - \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php index 4076938f01ceafb24af8e68318618cb1c66490d0..652b3935e0378dcdd9ec39bffdb46d84f8cc6998 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php @@ -129,6 +129,29 @@ class IndexTest extends \Magento\TestFramework\TestCase\AbstractController ); } + /** + * @magentoConfigFixture current_store rss/wishlist/active 1 + * @magentoDataFixture Magento/Wishlist/_files/wishlist.php + * @magentoAppIsolation enabled + */ + public function testRssAction() + { + $wishlist = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Wishlist\Model\Wishlist' + ); + $wishlist->load('fixture_unique_code', 'sharing_code'); + $this->getRequest()->setParam('wishlist_id', $wishlist->getId())->setParam('data', base64_encode('1')); + $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Customer\Model\Session'); + $service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Customer\Service\V1\CustomerAccountService' + ); + $customer = $service->authenticate('customer@example.com', 'password'); + $session->setCustomerDataAsLoggedIn($customer); + + $this->dispatch('wishlist/index/rss'); + $this->assertContains('<![CDATA[Simple Product]]>', $this->getResponse()->getBody()); + } + /** * @magentoDataFixture Magento/Wishlist/_files/wishlist.php */ diff --git a/dev/tests/integration/testsuite/Magento/Rss/Helper/WishlistRssTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Helper/RssTest.php similarity index 96% rename from dev/tests/integration/testsuite/Magento/Rss/Helper/WishlistRssTest.php rename to dev/tests/integration/testsuite/Magento/Wishlist/Helper/RssTest.php index 9edcd649eb70ec290f3cb47b48f3cee827738058..fdcfe14ab230ce079862457e7cda2b90eade7956 100644 --- a/dev/tests/integration/testsuite/Magento/Rss/Helper/WishlistRssTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Helper/RssTest.php @@ -22,9 +22,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Rss\Helper; +namespace Magento\Wishlist\Helper; -class WishlistRssTest extends \PHPUnit_Framework_TestCase +class RssTest extends \PHPUnit_Framework_TestCase { /** * @var \Magento\Customer\Model\Session @@ -49,7 +49,7 @@ class WishlistRssTest extends \PHPUnit_Framework_TestCase protected $_contextHelper; /** - * @var \Magento\Rss\Helper\WishlistRss + * @var \Magento\Wishlist\Helper\Rss */ protected $_wishlistHelper; @@ -70,7 +70,7 @@ class WishlistRssTest extends \PHPUnit_Framework_TestCase $request = $this->_contextHelper->getRequest(); $request->setParam('data', $this->_coreData->urlEncode($this->_fixtureCustomerId)); - $this->_wishlistHelper = $this->_objectManager->create('Magento\Rss\Helper\WishlistRss', + $this->_wishlistHelper = $this->_objectManager->create('Magento\Wishlist\Helper\Rss', [ 'context' => $this->_contextHelper, 'customerSession' => $this->_customerSession @@ -126,4 +126,3 @@ class WishlistRssTest extends \PHPUnit_Framework_TestCase $this->assertEquals($wishlist, $this->_wishlistHelper->getWishlist()); } } - \ No newline at end of file diff --git a/dev/tests/performance/testsuite/advanced_search.jmx b/dev/tests/performance/testsuite/advanced_search.jmx index afa22c73e42d058127d18ece89e550c1148d2945..d0a8e910e1616815d0ab299876f85a4c13d4b630 100644 --- a/dev/tests/performance/testsuite/advanced_search.jmx +++ b/dev/tests/performance/testsuite/advanced_search.jmx @@ -189,7 +189,7 @@ <hashTree/> <XPathAssertion guiclass="XPathAssertionGui" testclass="XPathAssertion" testname="Assertion: Product Found" enabled="true"> <boolProp name="XPath.negate">false</boolProp> - <stringProp name="XPath.xpath">//img[@class="photo image"]</stringProp> + <stringProp name="XPath.xpath">//img[@class="product-image-photo"]</stringProp> <boolProp name="XPath.validate">false</boolProp> <boolProp name="XPath.whitespace">false</boolProp> <boolProp name="XPath.tolerant">true</boolProp> diff --git a/dev/tests/performance/testsuite/fixtures/catalog_100k_products.php b/dev/tests/performance/testsuite/fixtures/catalog_100k_products.php index 99f57417c43796bbdc9e41f339238289423849ba..abd31f42c4611e20371e5f4b74191dfe38fcda19 100644 --- a/dev/tests/performance/testsuite/fixtures/catalog_100k_products.php +++ b/dev/tests/performance/testsuite/fixtures/catalog_100k_products.php @@ -36,7 +36,7 @@ $pattern = array( 'price' => 10, 'visibility' => \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH, 'status' => \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED, - 'tax_class_id' => 0, + 'tax_class_id' => 2, // actually it saves without stock data, but by default system won't show on the frontend products out of stock 'is_in_stock' => 1, diff --git a/dev/tests/performance/testsuite/fixtures/catalog_200_categories_80k_products.php b/dev/tests/performance/testsuite/fixtures/catalog_200_categories_80k_products.php index 5e400f9ad4f1b0bfab39ca38987a942f1bc289db..d96a51a0ee1ad70e69d135ae71bbefcdfbafe5e1 100644 --- a/dev/tests/performance/testsuite/fixtures/catalog_200_categories_80k_products.php +++ b/dev/tests/performance/testsuite/fixtures/catalog_200_categories_80k_products.php @@ -96,7 +96,7 @@ $pattern = array( 'price' => 10, 'visibility' => \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH, 'status' => \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED, - 'tax_class_id' => 0, + 'tax_class_id' => 2, 'is_in_stock' => 1, 'qty' => 100500, 'use_config_min_qty' => '1', diff --git a/dev/tests/performance/testsuite/fixtures/catalog_category.php b/dev/tests/performance/testsuite/fixtures/catalog_category.php index ffbe531a126aeefb95606fcd6d5a18f221e3e7eb..d08fe44dfa87f2391ec521e59cd3d7356950e7a5 100644 --- a/dev/tests/performance/testsuite/fixtures/catalog_category.php +++ b/dev/tests/performance/testsuite/fixtures/catalog_category.php @@ -81,7 +81,7 @@ $product->setTypeId( )->setStatus( \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED )->setTaxClassId( - 0 + 2 )->save(); $stockItem = $this->getObjectManager()->create('Magento\CatalogInventory\Model\Stock\Item'); diff --git a/dev/tests/performance/testsuite/fixtures/catalog_product.php b/dev/tests/performance/testsuite/fixtures/catalog_product.php index b77a5010d80a5b1a3c3a0fab64ab653b55fa057d..18dc8dfa716e57da354e7d4b358fa262711caf6b 100644 --- a/dev/tests/performance/testsuite/fixtures/catalog_product.php +++ b/dev/tests/performance/testsuite/fixtures/catalog_product.php @@ -67,7 +67,7 @@ $product->setTypeId( )->setStatus( \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED )->setTaxClassId( - 0 + 2 )->save(); $stockItem = $this->getObjectManager()->create('Magento\CatalogInventory\Model\Stock\Item'); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/HandlesTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/HandlesTest.php index 442cf404796941ee4623533df20c351c4da5c94f..57c8c1af5f62612a7e07ab8ded879155e4d93813 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/HandlesTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/HandlesTest.php @@ -91,23 +91,4 @@ class HandlesTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Utility\Files::init()->getLayoutFiles() ); } - - public function testLayoutFormat() - { - $invoker = new \Magento\TestFramework\Utility\AggregateInvoker($this); - $invoker( - /** - * Test format of a layout file using XSD - * - * @param string $layoutFile - */ - function ($layoutFile) { - $schemaFile = BP . '/app/code/Magento/Core/etc/layout_single.xsd'; - $domLayout = new \Magento\Framework\Config\Dom(file_get_contents($layoutFile)); - $result = $domLayout->validate($schemaFile, $errors); - $this->assertTrue($result, print_r($errors, true)); - }, - \Magento\TestFramework\Utility\Files::init()->getLayoutFiles() - ); - } } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/Config/ReferentialTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/Config/ReferentialTest.php deleted file mode 100644 index 0c4c611c4e0b47ed3f2f73cf5eb732f18062c222..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/Config/ReferentialTest.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php -/** - * Validates that page_layouts references exsiting templates - * - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Test\Integrity\Magento\Theme\Config; - -class ReferentialTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var array string[] $_templates Array of templates referenced from page_layouts - */ - protected static $_templates; - - /** @var array all exsisting template files in the system */ - protected static $_templateFileNames = array(); - - public static function setUpBeforeClass() - { - self::_populateTemplatesReferences(); - self::_populateTemplateFiles(); - } - - /** - * Gathers all templates from page_layouts files - */ - private static function _populateTemplatesReferences() - { - /** - * @var array string[] $configFiles - */ - $configFiles = \Magento\TestFramework\Utility\Files::init()->getConfigFiles( - 'page_layouts.xml', - array(), - false - ); - /** - * @var string $file - */ - foreach ($configFiles as $file) { - /** - * @var \DOMDocument $dom - */ - $dom = new \DOMDocument(); - $dom->loadXML(file_get_contents($file)); - - $xpath = new \DOMXPath($dom); - foreach ($xpath->query('/page_layouts/layouts/layout') as $layout) { - foreach ($layout->childNodes as $layoutSubNode) { - if ($layoutSubNode->nodeName == 'template') { - self::$_templates[] = $layoutSubNode->nodeValue; - } - } - } - } - } - - /** - * Gathers all tmplate file names - */ - private static function _populateTemplateFiles() - { - $filesPaths = \Magento\TestFramework\Utility\Files::init()->getPhpFiles(false, false, true, false); - foreach ($filesPaths as $filePath) { - $filePathArray = explode('/', $filePath); - $fileName = array_pop($filePathArray); - if (!in_array($fileName, self::$_templateFileNames)) { - self::$_templateFileNames[] = $fileName; - } - } - } - - public function testTemplateExists() - { - $missing = array(); - foreach (self::$_templates as $templateName) { - if (!in_array($templateName, self::$_templateFileNames)) { - $missing[] = $templateName; - } - } - if (!empty($missing)) { - $message = sprintf( - "These templates filenames used in page_layouts.xml doesn't correspond to any real template file: %s", - implode(', ', $missing) - ); - $this->fail($message); - } - } -} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/ConfigTest.php deleted file mode 100644 index d781f0720c1b6cfcc372fc7f228548b59e33d85d..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/ConfigTest.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php -/** - * Test page_layouts.xsd and xml files - * - * Fined "page_layouts.xml" files in code tree and validate them. Also verify schema fails on an invalid xml and - * passes on a valid xml - * - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Test\Integrity\Magento\Theme; - -class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig -{ - public function testFileSchemaUsingInvalidXml($expectedErrors = null) - { - $expectedErrors = array("Element 'layout': The attribute 'id' is required but missing."); - parent::testFileSchemaUsingInvalidXml($expectedErrors); - } - - public function testSchemaUsingInvalidXml($expectedErrors = null) - { - $expectedErrors = array( - "Element 'layouts': No match found for key-sequence ['bad_ref'] of keyref 'layout-ref'.", - "Element 'layout': Missing child element(s). Expected is ( label )." - ); - parent::testSchemaUsingInvalidXml($expectedErrors); - } - - public function testSchemaUsingPartialXml($expectedErrors = null) - { - $expectedErrors = array( - "Element 'layout': Missing child element(s). Expected is ( label ).", - "Element 'layout': Missing child element(s). Expected is ( template ).", - "Element 'layout': Missing child element(s). Expected is ( layout_handle )." - ); - parent::testSchemaUsingPartialXml($expectedErrors); - } - - /** - * Returns the name of the XSD file to be used to validate the XML - * - * @return string - */ - protected function _getXsd() - { - return '/app/code/Magento/Theme/etc/page_layouts.xsd'; - } - - /** - * The location of a single valid complete xml file - * - * @return string - */ - protected function _getKnownValidXml() - { - return __DIR__ . '/_files/valid_page_layouts.xml'; - } - - /** - * The location of a single known invalid complete xml file - * - * @return string - */ - protected function _getKnownInvalidXml() - { - return __DIR__ . '/_files/invalid_page_layouts.xml'; - } - - /** - * The location of a single known valid partial xml file - * - * @return string - */ - protected function _getKnownValidPartialXml() - { - return __DIR__ . '/_files/valid_page_layouts_partial.xml'; - } - - /** - * Returns the name of the XSD file to be used to validate partial XML - * - * @return string - */ - protected function _getFileXsd() - { - return '/app/code/Magento/Theme/etc/page_layouts_file.xsd'; - } - - /** - * The location of a single known invalid partial xml file - * - * @return string - */ - protected function _getKnownInvalidPartialXml() - { - return __DIR__ . '/_files/invalid_page_layouts_partial.xml'; - } - - /** - * Returns the name of the xml files to validate - * - * @return string - */ - protected function _getXmlName() - { - return 'page_layouts.xml'; - } -} diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteLayoutLocationTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteLayoutLocationTest.php deleted file mode 100644 index cc09c23e9ef367a67152c7e0890de98762ea4a50..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteLayoutLocationTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Tests to verify, that there are no layout files in the folders, where they were before been broken down per handle - */ -namespace Magento\Test\Legacy; - -class ObsoleteLayoutLocationTest extends \PHPUnit_Framework_TestCase -{ - public function testObsoleteLayoutLocation() - { - $invoker = new \Magento\TestFramework\Utility\AggregateInvoker($this); - $invoker( - /** - * @param string $location - */ - function ($location) { - $files = glob($location . '/*.xml'); - $layoutFiles = array(); - foreach ($files as $file) { - if (strpos(file_get_contents($file), '<layout') !== false) { - $layoutFiles[] = $file; - } - } - $this->assertEmpty($layoutFiles, 'Obsolete layout files found: ' . implode(', ', $layoutFiles)); - }, - self::obsoleteLayoutLocationDataProvider() - ); - } - - /** - * @return array - */ - public static function obsoleteLayoutLocationDataProvider() - { - $root = \Magento\TestFramework\Utility\Files::init()->getPathToSource(); - $modulePaths = glob("{$root}/app/code/*/*/view/*"); - $themePaths = glob("{$root}/app/design/*/*/*"); - $merged = array_merge($modulePaths, $themePaths); - - return \Magento\TestFramework\Utility\Files::composeDataSets($merged); - } -} diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 9cae16d7795d61eee251d8d4180b9685120f82c2..8944cce44cff923904336532ad19ecfeb9f7c184 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -2732,4 +2732,8 @@ return array( 'Magento\CatalogImportExport\Model\Import\Product\Type\Grouped', 'Magento\GroupedImportExport\Model\Import\Product\Type\Grouped' ], + ['Magento\Catalog\Model\Observer\Reindex'], + ['Magento\CatalogSearch\Model\Fulltext\Observer'], + ['Magento\CatalogSearch\Model\Resource\Indexer\Fulltext'], + ['\Magento\Theme\Helper\Layout'], ); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index 46a5a6a397ba9bbadcfee04ab9862291ac22044b..e0e2739668006221199eb343fa7ed37b7e6373b0 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -1815,4 +1815,96 @@ return array( ['sendEmail', 'Magento\Sales\Model\Order\Shipment'], ['sendUpdateEmail', 'Magento\Sales\Model\Order\Shipment'], ['_getEmails', 'Magento\Sales\Model\Order\Shipment'], + ['rebuildIndex', 'Magento\CatalogSearch\Model\Fulltext', 'Magento\CatalogSearch\Model\Indexer\Fulltext::execute'], + ['cleanIndex', 'Magento\CatalogSearch\Model\Fulltext'], + ['setAllowTableChanges', 'Magento\CatalogSearch\Model\Fulltext'], + ['updateCategoryIndex', 'Magento\CatalogSearch\Model\Fulltext'], + [ + 'rebuildIndex', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::rebuildIndex' + ], + [ + '_rebuildStoreIndex', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::rebuildStoreIndex' + ], + [ + '_getSearchableProducts', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getSearchableProducts' + ], + [ + 'cleanIndex', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::cleanIndex' + ], + [ + 'getEavConfig', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getEavConfig' + ], + [ + '_getSearchableAttributes', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getSearchableAttributes' + ], + [ + '_getSearchableAttribute', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getSearchableAttribute' + ], + [ + '_unifyField', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::unifyField' + ], + [ + '_getProductAttributes', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getProductAttributes' + ], + [ + '_getProductTypeInstance', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getProductTypeInstance' + ], + [ + '_getProductChildIds', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getProductChildIds' + ], + [ + '_getProductEmulator', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getProductEmulator' + ], + [ + '_prepareProductIndex', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::prepareProductIndex' + ], + [ + '_getAttributeValue', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getAttributeValue' + ], + [ + '_saveProductIndex', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + ], + [ + '_saveProductIndexes', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::saveProductIndexes' + ], + [ + '_getStoreDate', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::getStoreDate' + ], + [ + 'updateCategoryIndex', + 'Magento\CatalogSearch\Model\Resource\Fulltext', + ], ); diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt index 7edeaf58e05f432d4a421ca232b2221f9870b14b..ed363829ee7b8b923ab1c2a1efcbb58ce59965c8 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt @@ -26,7 +26,6 @@ app/code/Magento/Catalog/Model/Product/Type.php app/code/Magento/Catalog/Model/ProductOptions app/code/Magento/Catalog/Model/ProductTypes app/code/Magento/Catalog/Model/Plugin -app/code/Magento/Catalog/Model/Observer/Reindex.php app/code/Magento/Catalog/Service app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php app/code/Magento/Centinel/Model/State/Jcb.php diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/ExtendedTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/ExtendedTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0066a93745637dc8e3b0574b42d25f21cfdab0da --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/ExtendedTest.php @@ -0,0 +1,67 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Test class for \Magento\Backend\Model\Url + */ +namespace Magento\Backend\Block\Widget\Grid; + +class ExtendedTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $_objectManager; + + protected function setUp() + { + $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + } + + public function testPrepareLoadedCollection() + { + $request = $this->getMock('Magento\Framework\App\Request\Http', array('has'), array(), '', false); + $request->expects($this->any())->method('has')->will($this->returnValue(null)); + + $columnSet = $this->getMock('\Magento\Backend\Block\Widget\Grid\ColumnSet', array(), array(), '', false); + $layout = $this->getMock('Magento\Framework\View\Layout', array(), array(), '', false); + $layout->expects($this->any())->method('getChildName')->will($this->returnValue('grid.columnSet')); + $layout->expects($this->any())->method('getBlock')->will($this->returnValue($columnSet)); + + $collection = $this->getMock('\Magento\Framework\Data\Collection', array(), array(), '', false); + $collection->expects($this->atLeastOnce())->method('isLoaded')->will($this->returnValue(true)); + $collection->expects($this->atLeastOnce())->method('clear'); + $collection->expects($this->atLeastOnce())->method('load'); + + + /** @var \Magento\Backend\Block\Widget\Grid\Extended $block */ + $block = $this->_objectManager->getObject( + 'Magento\Backend\Block\Widget\Grid\Extended', + array('request' => $request, 'layout' => $layout) + ); + + $block->setCollection($collection); + $block->getPreparedCollection(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/GridTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/GridTest.php index 2d2cb16e4988132b7d00520b575033c70ea40836..b29d98755389dfb614c01c5e76b29cc9bae61879 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/GridTest.php @@ -59,9 +59,7 @@ class GridTest extends \PHPUnit_Framework_TestCase $urlBuilderMock->expects($this->any())->method('getUrl')->will($this->returnValue('some_url')); - $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - - $block = $helper->getObject( + $block = $this->_objectManager->getObject( 'Magento\Backend\Block\Widget\Grid', array('storeManager' => $storeManagerMock, 'urlModel' => $urlMock, 'urlBuilder' => $urlBuilderMock) ); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/ViewTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/ViewTest.php index 1d17bd32b4d64a45addbcee65473cc95c7cf1f92..9e11b57cf50a064bc1223ed4727bfadbbdb039a4 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/ViewTest.php @@ -38,18 +38,40 @@ class ViewTest extends \PHPUnit_Framework_TestCase protected function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $aclFilter = $this->getMock('Magento\Backend\Model\Layout\Filter\Acl', array(), array(), '', false); - $this->_layoutMock = $this->getMock('Magento\Framework\View\Layout', array(), array(), '', false); - $layoutProcessor = $this->getMock('Magento\Framework\View\Layout\ProcessorInterface'); + $aclFilter = $this->getMock('Magento\Backend\Model\Layout\Filter\Acl', [], [], '', false); + $this->_layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $layoutProcessor = $this->getMock('Magento\Core\Model\Layout\Merge', [], [], '', false); + $configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $node = new \Magento\Framework\Simplexml\Element('<node/>'); $this->_layoutMock->expects($this->once())->method('getNode')->will($this->returnValue($node)); $this->_layoutMock->expects($this->any())->method('getUpdate')->will($this->returnValue($layoutProcessor)); + + $resultPage = $this->getMockBuilder('Magento\Framework\View\Result\Page') + ->disableOriginalConstructor() + ->setMethods(['getLayout', 'getDefaultLayoutHandle', 'getConfig']) + ->getMock(); + $resultPage->expects($this->any()) + ->method('getConfig') + ->will($this->returnValue($configMock)); + $resultPage->expects($this->atLeastOnce()) + ->method('getLayout') + ->will($this->returnValue($this->_layoutMock)); + $pageFactory = $this->getMockBuilder('Magento\Framework\View\Result\PageFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $pageFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($resultPage)); + $this->_view = $helper->getObject( 'Magento\Backend\Model\View', array( 'aclFilter' => $aclFilter, 'layout' => $this->_layoutMock, - 'request' => $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false) + 'request' => $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false), + 'pageFactory' => $pageFactory ) ); } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Category/ViewTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Category/ViewTest.php index 7452d0e3d2e5eeb6798163cc5dc8c5e285317a8f..73a8d6c998421f15a6af360a7e96b9ca4abcb1ac 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Category/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Category/ViewTest.php @@ -112,6 +112,11 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected $action; + /** + * @var \Magento\Framework\View\Page\Config + */ + protected $pageConfig; + public function setUp() { $this->request = $this->getMock('Magento\Framework\App\RequestInterface'); @@ -124,8 +129,18 @@ class ViewTest extends \PHPUnit_Framework_TestCase $this->update = $this->getMock('Magento\Framework\View\Layout\ProcessorInterface'); $this->layout = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); $this->layout->expects($this->any())->method('getUpdate')->will($this->returnValue($this->update)); + + $this->pageConfig = $this->getMockBuilder('Magento\Framework\View\Page\Config') + ->disableOriginalConstructor()->getMock(); + $this->pageConfig->expects($this->any())->method('addBodyClass')->will($this->returnSelf()); + + $this->page = $this->getMockBuilder('Magento\Framework\View\Page') + ->setMethods(['getConfig', 'initLayout'])->disableOriginalConstructor()->getMock(); + $this->page->expects($this->any())->method('getConfig')->will($this->returnValue($this->pageConfig)); + $this->view = $this->getMock('Magento\Framework\App\ViewInterface'); $this->view->expects($this->any())->method('getLayout')->will($this->returnValue($this->layout)); + $this->view->expects($this->any())->method('getPage')->will($this->returnValue($this->page)); $this->context = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); $this->context->expects($this->any())->method('getRequest')->will($this->returnValue($this->request)); @@ -179,8 +194,6 @@ class ViewTest extends \PHPUnit_Framework_TestCase $this->catalogDesign->expects($this->any())->method('getDesignSettings')->will($this->returnValue($settings)); - $this->layoutHelper->expects($this->once())->method('applyHandle')->with($pageLayout); - $this->action->execute(); } } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Source/LayoutTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Source/LayoutTest.php index ff0936ba8e6d1eae0a52fa56a63ed5374f04a4fb..7ef3369ad645dfe04e9d087dbb2469fe174201b8 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Source/LayoutTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Source/LayoutTest.php @@ -46,24 +46,30 @@ class LayoutTest extends \PHPUnit_Framework_TestCase $this->model = $helper->getObject( '\Magento\Catalog\Model\Category\Attribute\Source\Layout', [ - 'pageSourceLayout' => $this->getMockedLayout() + 'pageLayoutBuilder' => $this->getMockedPageLayoutBuilder() ] ); } /** - * @return \Magento\Theme\Model\Layout\Source\Layout + * @return \Magento\Core\Model\PageLayout\Config\Builder */ - private function getMockedLayout() + private function getMockedPageLayoutBuilder() { - $mockBuilder = $this->getMockBuilder('\Magento\Theme\Model\Layout\Source\Layout'); - $mockBuilder->disableOriginalConstructor(); - $mock = $mockBuilder->getMock(); - - $mock->expects($this->any()) + $mockPageLayoutConfig = $this->getMockBuilder('Magento\Framework\View\PageLayout\Config') + ->disableOriginalConstructor() + ->getMock(); + $mockPageLayoutConfig->expects($this->any()) ->method('toOptionArray') ->will($this->returnValue($this->testArray)); - return $mock; + $mockPageLayoutBuilder = $this->getMockBuilder('Magento\Core\Model\PageLayout\Config\Builder') + ->disableOriginalConstructor() + ->getMock(); + $mockPageLayoutBuilder->expects($this->once()) + ->method('getPageLayoutsConfig') + ->will($this->returnValue($mockPageLayoutConfig)); + + return $mockPageLayoutBuilder; } -} \ No newline at end of file +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Observer/ReindexTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Observer/ReindexTest.php deleted file mode 100644 index c97bd4df12ec4a7e1d0311bb357eb85c7edcf3ae..0000000000000000000000000000000000000000 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Observer/ReindexTest.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Test for Catalog Observer Reindex - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Catalog\Model\Observer; - -class ReindexTest extends \PHPUnit_Framework_TestCase -{ - /** - * Positive test for fulltext reindex - */ - public function testFulltextReindex() - { - $affectedProduct = array(1, 2, 3); - - $fulltextReindex = $this->getMock( - 'Magento\CatalogSearch\Model\Resource\Fulltext', - array('rebuildIndex', '__wakeup'), - array(), - '', - false - ); - $fulltextReindex->expects( - $this->once() - )->method( - 'rebuildIndex' - )->with( - $this->logicalOr($this->equalTo(null), $this->equalTo($affectedProduct)) - ); - - $objectManager = $this->getMock( - 'Magento\Framework\ObjectManager\ObjectManager', - array('get'), - array(), - '', - false - ); - $objectManager->expects( - $this->once() - )->method( - 'get' - )->with( - 'Magento\CatalogSearch\Model\Resource\Fulltext' - )->will( - $this->returnValue($fulltextReindex) - ); - - $observer = new \Magento\Framework\Event\Observer( - array('data_object' => new \Magento\Framework\Object(array('affected_product_ids' => $affectedProduct))) - ); - - /** @var $objectManager \Magento\Framework\ObjectManager */ - $object = new \Magento\Catalog\Model\Observer\Reindex($objectManager); - $this->assertInstanceOf('Magento\Catalog\Model\Observer\Reindex', $object->fulltextReindex($observer)); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Source/LayoutTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Source/LayoutTest.php index a8dc938f62d429a75082bf1ab8b20679ad489359..1a3b6b379c639409a2936b53653c3ded3c6e5fef 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Source/LayoutTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Source/LayoutTest.php @@ -34,26 +34,20 @@ class LayoutTest extends \PHPUnit_Framework_TestCase /** @var ObjectManagerHelper */ protected $objectManagerHelper; - /** @var \Magento\Theme\Model\Layout\Source\Layout|\PHPUnit_Framework_MockObject_MockObject */ - protected $layoutSourceModel; + /** @var \Magento\Core\Model\PageLayout\Config\Builder|\PHPUnit_Framework_MockObject_MockObject */ + protected $pageLayoutBuilder; protected function setUp() { - $this->layoutSourceModel = $this->getMock( - 'Magento\Theme\Model\Layout\Source\Layout', - array( - 'toOptionArray' - ), - array(), - '', - false - ); + $this->pageLayoutBuilder = $this->getMockBuilder('Magento\Core\Model\PageLayout\Config\Builder') + ->disableOriginalConstructor() + ->getMock(); $this->objectManagerHelper = new ObjectManagerHelper($this); $this->layoutModel = $this->objectManagerHelper->getObject( 'Magento\Catalog\Model\Product\Attribute\Source\Layout', array( - 'pageSourceLayout' => $this->layoutSourceModel + 'pageLayoutBuilder' => $this->pageLayoutBuilder ) ); } @@ -64,8 +58,17 @@ class LayoutTest extends \PHPUnit_Framework_TestCase '0' => array('value' => '', 'label' => 'No layout updates'), '1' => array('value' => 'option_value', 'label' => 'option_label') ); - $this->layoutSourceModel->expects($this->once())->method('toOptionArray') - ->will($this->returnValue(array('0' => $expectedOptions['1']))); + $mockPageLayoutConfig = $this->getMockBuilder('Magento\Framework\View\PageLayout\Config') + ->disableOriginalConstructor() + ->getMock(); + $mockPageLayoutConfig->expects($this->any()) + ->method('toOptionArray') + ->will($this->returnValue(['0' => $expectedOptions['1']])); + + $this->pageLayoutBuilder->expects($this->once()) + ->method('getPageLayoutsConfig') + ->will($this->returnValue($mockPageLayoutConfig)); + $layoutOptions = $this->layoutModel->getAllOptions(); $this->assertEquals($expectedOptions, $layoutOptions); } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ImageTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ImageTest.php new file mode 100644 index 0000000000000000000000000000000000000000..924d39fe4818050e0f34cfa47e04cc2d94829015 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ImageTest.php @@ -0,0 +1,363 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Model\Product; + +use \Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; + +/** + * Class ImageTest + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class ImageTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Model\Product\Image + */ + protected $image; + + /** + * @var \Magento\Framework\Model\Context|\PHPUnit_Framework_MockObject_MockObject + */ + protected $context; + + /** + * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject + */ + protected $registry; + + /** + * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManager; + + /** + * @var \Magento\Catalog\Model\Product\Media\Config|\PHPUnit_Framework_MockObject_MockObject + */ + protected $config; + + /** + * @var \Magento\Core\Helper\File\Storage\Database|\PHPUnit_Framework_MockObject_MockObject + */ + protected $coreFileHelper; + + /** + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + */ + protected $filesystem; + + /** + * @var \Magento\Framework\Image\Factory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $factory; + + /** + * @var \Magento\Framework\View\Asset\Repository|\PHPUnit_Framework_MockObject_MockObject + */ + protected $repository; + + /** + * @var \Magento\Framework\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject + */ + protected $fileSystem; + + /** + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $scopeConfigInterface; + + /** + * @var \Magento\Framework\Filesystem\Directory\WriteInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $mediaDirectory; + + protected function setUp() + { + $this->context = $this->getMock('Magento\Framework\Model\Context', [], [], '', false); + $this->registry = $this->getMock('Magento\Framework\Registry'); + + $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManager') + ->disableOriginalConstructor() + ->setMethods(array('getStore', 'getWebsite'))->getMock(); + $store = $this->getMockBuilder('\Magento\Store\Model\Store')->disableOriginalConstructor() + ->setMethods(array('getId', '__sleep', '__wakeup', 'getBaseUrl'))->getMock(); + $store->expects($this->any())->method('getId')->will($this->returnValue(1)); + $store->expects($this->any())->method('getBaseUrl')->will($this->returnValue('http://magento.com/media/')); + $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store)); + + $this->config = $this->getMockBuilder('Magento\Catalog\Model\Product\Media\Config') + ->setMethods(['getBaseMediaPath'])->disableOriginalConstructor()->getMock(); + $this->config->expects($this->any())->method('getBaseMediaPath')->will($this->returnValue('catalog/product')); + $this->coreFileHelper = $this->getMockBuilder('Magento\Core\Helper\File\Storage\Database') + ->setMethods(['saveFile', 'deleteFolder'])->disableOriginalConstructor()->getMock(); + + $this->mediaDirectory = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\Write') + ->disableOriginalConstructor() + ->setMethods(['create', 'isFile', 'isExist', 'getAbsolutePath']) + ->getMock(); + $this->mediaDirectory->expects($this->once())->method('create')->will($this->returnValue(true)); + + $this->filesystem = $this->getMock('Magento\Framework\App\Filesystem', [], [], '', false); + $this->filesystem->expects($this->once())->method('getDirectoryWrite') + ->with(\Magento\Framework\App\Filesystem::MEDIA_DIR) + ->will($this->returnValue($this->mediaDirectory)); + $this->factory = $this->getMock('Magento\Framework\Image\Factory', [], [], '', false); + $this->repository = $this->getMock('Magento\Framework\View\Asset\Repository', [], [], '', false); + $this->fileSystem = $this->getMock('Magento\Framework\View\FileSystem', [], [], '', false); + $this->scopeConfigInterface = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); + + $objectManagerHelper = new ObjectManagerHelper($this); + $this->image = $objectManagerHelper->getObject( + 'Magento\Catalog\Model\Product\Image', + [ + 'registry' => $this->registry, + 'storeManager' => $this->storeManager, + 'catalogProductMediaConfig' => $this->config, + 'coreFileStorageDatabase' => $this->coreFileHelper, + 'filesystem' => $this->filesystem, + 'imageFactory' => $this->factory, + 'assetRepo' => $this->repository, + 'viewFileSystem' => $this->fileSystem, + 'scopeConfig' => $this->scopeConfigInterface + ] + ); + } + + public function testSetGetQuality() + { + $this->image->setQuality(100); + $this->assertEquals(100, $this->image->getQuality()); + } + + public function testSetGetKeepAspectRatio() + { + $result = $this->image->setKeepAspectRatio(true); + $this->assertSame($this->image, $result); + } + + public function testSetKeepFrame() + { + $result = $this->image->setKeepFrame(true); + $this->assertSame($this->image, $result); + } + + public function testSetKeepTransparency() + { + $result = $this->image->setKeepTransparency(true); + $this->assertSame($this->image, $result); + } + + public function testSetConstrainOnly() + { + $result = $this->image->setConstrainOnly(true); + $this->assertSame($this->image, $result); + } + + public function testSetBackgroundColor() + { + $result = $this->image->setBackgroundColor([0, 0, 0]); + $this->assertSame($this->image, $result); + } + + public function testSetSize() + { + $this->image->setSize('99xsadf'); + $this->assertEquals(99, $this->image->getWidth()); + $this->assertNull($this->image->getHeight()); + } + + public function testSetGetBaseFile() + { + $this->mediaDirectory->expects($this->any())->method('isFile')->will($this->returnValue(true)); + $this->mediaDirectory->expects($this->any())->method('isExist')->will($this->returnValue(true)); + $absolutePath = dirname(dirname(__DIR__)) . '/_files/catalog/product/somefile.png'; + $this->mediaDirectory->expects($this->any())->method('getAbsolutePath') + ->will($this->returnValue($absolutePath)); + $this->image->setBaseFile('/somefile.png'); + $this->assertEquals('catalog/product/somefile.png', $this->image->getBaseFile()); + $this->assertEquals( + 'catalog/product/cache/1//9df78eab33525d08d6e5fb8d27136e95/somefile.png', + $this->image->getNewFile() + ); + } + + public function testSetBaseNoSelectionFile() + { + $this->image->setBaseFile('/no_selection'); + $this->assertTrue($this->image->getNewFile()); + } + + public function testSetGetImageProcessor() + { + $imageProcessor = $this->getMockBuilder('Magento\Framework\Image')->disableOriginalConstructor() + ->getMock(); + $result = $this->image->setImageProcessor($imageProcessor); + $this->assertSame($this->image, $result); + $this->assertSame($imageProcessor, $this->image->getImageProcessor()); + } + + public function testResize() + { + $this->image->setWidth(100); + $this->image->setHeight(100); + $imageProcessor = $this->getMockBuilder('Magento\Framework\Image')->disableOriginalConstructor() + ->getMock(); + $imageProcessor->expects($this->once())->method('resize') + ->with($this->image->getWidth(), $this->image->getHeight())->will($this->returnValue(true)); + $this->image->setImageProcessor($imageProcessor); + $result = $this->image->resize(); + $this->assertSame($this->image, $result); + } + + public function testRotate() + { + $imageProcessor = $this->getMockBuilder('Magento\Framework\Image')->disableOriginalConstructor() + ->getMock(); + $imageProcessor->expects($this->once())->method('rotate')->with(90)->will($this->returnValue(true)); + $this->image->setImageProcessor($imageProcessor); + $result = $this->image->rotate(90); + $this->assertSame($this->image, $result); + } + + public function testSetAngle() + { + $result = $this->image->setAngle(90); + $this->assertSame($this->image, $result); + } + + public function testSetWatermark() + { + $website = $this->getMockBuilder('\Magento\Store\Model\Website')->disableOriginalConstructor() + ->setMethods(array('getId', '__sleep', '__wakeup'))->getMock(); + $website->expects($this->any())->method('getId')->will($this->returnValue(1)); + $this->storeManager->expects($this->any())->method('getWebsite')->will($this->returnValue($website)); + $this->mediaDirectory->expects($this->at(3))->method('isExist')->with('catalog/product/watermark//somefile.png') + ->will($this->returnValue(true)); + $absolutePath = dirname(dirname(__DIR__)) . '/_files/catalog/product/watermark/somefile.png'; + $this->mediaDirectory->expects($this->any())->method('getAbsolutePath') + ->with('catalog/product/watermark//somefile.png') + ->will($this->returnValue($absolutePath)); + + $imageProcessor = $this->getMockBuilder('Magento\Framework\Image')->disableOriginalConstructor() + ->setMethods(array( + 'keepAspectRatio', + 'keepFrame', + 'keepTransparency', + 'constrainOnly', + 'backgroundColor', + 'quality', + 'setWatermarkPosition', + 'setWatermarkImageOpacity', + 'setWatermarkWidth', + 'setWatermarkHeight', + 'watermark' + ))->getMock(); + $imageProcessor->expects($this->once())->method('setWatermarkPosition')->with('center') + ->will($this->returnValue(true)); + $imageProcessor->expects($this->once())->method('setWatermarkImageOpacity')->with(50) + ->will($this->returnValue(true)); + $imageProcessor->expects($this->once())->method('setWatermarkWidth')->with(100) + ->will($this->returnValue(true)); + $imageProcessor->expects($this->once())->method('setWatermarkHeight')->with(100) + ->will($this->returnValue(true)); + $this->image->setImageProcessor($imageProcessor); + + $result = $this->image->setWatermark( + '/somefile.png', + 'center', + array('width' => 100, 'height' => 100), + 100, + 100, + 50 + ); + $this->assertSame($this->image, $result); + } + + public function testSaveFile() + { + $imageProcessor = $this->getMockBuilder('Magento\Framework\Image')->disableOriginalConstructor()->getMock(); + $this->image->setImageProcessor($imageProcessor); + $this->coreFileHelper->expects($this->once())->method('saveFile')->will($this->returnValue(true)); + $absolutePath = dirname(dirname(__DIR__)) . '/_files/catalog/product/somefile.png'; + $this->mediaDirectory->expects($this->once())->method('getAbsolutePath') + ->will($this->returnValue($absolutePath)); + + $this->image->saveFile(); + } + + public function testSaveFileNoSelection() + { + $this->testSetBaseNoSelectionFile(); + $this->assertSame($this->image, $this->image->saveFile()); + } + + public function testGetUrl() + { + $this->testSetGetBaseFile(); + $url = $this->image->getUrl(); + $this->assertEquals( + 'http://magento.com/media/catalog/product/cache/1//9df78eab33525d08d6e5fb8d27136e95/somefile.png', + $url + ); + } + + public function testGetUrlNoSelection() + { + $this->testSetBaseNoSelectionFile(); + $this->repository->expects($this->once())->method('getUrl')->will($this->returnValue('someurl')); + $this->assertEquals('someurl', $this->image->getUrl()); + } + + public function testSetGetDestinationSubdir() + { + $this->image->setDestinationSubdir('somesubdir'); + $this->assertEquals('somesubdir', $this->image->getDestinationSubdir()); + } + + public function testIsCached() + { + $this->testSetGetBaseFile(); + $this->assertTrue($this->image->isCached()); + } + + public function testClearCache() + { + $this->coreFileHelper->expects($this->once())->method('deleteFolder')->will($this->returnValue(true)); + $this->image->clearCache(); + } + + public function testResizeWithoutSize() + { + $this->image->setHeight(null); + $this->image->setWidth(null); + $this->assertSame($this->image, $this->image->resize()); + } + + public function testGetImageProcessor() + { + $imageProcessor = $this->getMockBuilder('\Magento\Framework\Image')->disableOriginalConstructor()->getMock(); + $this->factory->expects($this->once())->method('create')->will($this->returnValue($imageProcessor)); + $this->assertSame($imageProcessor, $this->image->getImageProcessor()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/LinkTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/LinkTest.php new file mode 100644 index 0000000000000000000000000000000000000000..71a4f125ca0223b54dca02d6571647b778aa9f84 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/LinkTest.php @@ -0,0 +1,176 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Model\Product; + +class LinkTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Link + */ + protected $model; + + /** + * @var \Magento\Framework\Model\Resource\AbstractResource|\PHPUnit_Framework_MockObject_MockObject + */ + protected $resource; + + protected function setUp() + { + $linkCollection = $this->getMockBuilder( + 'Magento\Catalog\Model\Resource\Product\Link\Collection' + )->disableOriginalConstructor()->setMethods( + ['setLinkModel'] + )->getMock(); + $linkCollection->expects($this->any())->method('setLinkModel')->will($this->returnSelf()); + $linkCollectionFactory = $this->getMockBuilder( + 'Magento\Catalog\Model\Resource\Product\Link\CollectionFactory' + )->disableOriginalConstructor()->setMethods( + ['create'] + )->getMock(); + $linkCollectionFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($linkCollection)); + $productCollection = $this->getMockBuilder( + 'Magento\Catalog\Model\Resource\Product\Link\Product\Collection' + )->disableOriginalConstructor()->setMethods( + ['setLinkModel'] + )->getMock(); + $productCollection->expects($this->any())->method('setLinkModel')->will($this->returnSelf()); + $productCollectionFactory = $this->getMockBuilder( + 'Magento\Catalog\Model\Resource\Product\Link\Product\CollectionFactory' + )->disableOriginalConstructor()->setMethods( + ['create'] + )->getMock(); + $productCollectionFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($productCollection)); + + $this->resource = $this->getMock( + 'Magento\Framework\Model\Resource\AbstractResource', + [ + 'saveProductLinks', + 'getAttributeTypeTable', + 'getAttributesByType', + 'getTable', + '_getWriteAdapter', + '_getReadAdapter', + '_construct', + 'getIdFieldName' + ] + ); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\Catalog\Model\Product\Link', + ['linkCollectionFactory' => $linkCollectionFactory, 'productCollectionFactory' => $productCollectionFactory, + 'resource' => $this->resource] + ); + } + + public function testUseRelatedLinks() + { + $this->model->useRelatedLinks(); + $this->assertEquals(Link::LINK_TYPE_RELATED, $this->model->getData('link_type_id')); + } + + public function testUseUpSellLinks() + { + $this->model->useUpSellLinks(); + $this->assertEquals(Link::LINK_TYPE_UPSELL, $this->model->getData('link_type_id')); + } + + public function testUseCrossSellLinks() + { + $this->model->useCrossSellLinks(); + $this->assertEquals(Link::LINK_TYPE_CROSSSELL, $this->model->getData('link_type_id')); + } + + public function testGetAttributeTypeTable() + { + $prefix = 'catalog_product_link_attribute_'; + $attributeType = 'int'; + $attributeTypeTable = $prefix . $attributeType; + $this->resource + ->expects($this->any()) + ->method('getTable') + ->with($attributeTypeTable) + ->will($this->returnValue($attributeTypeTable)); + $this->resource + ->expects($this->any()) + ->method('getAttributeTypeTable') + ->with($attributeType) + ->will($this->returnValue($attributeTypeTable)); + $this->assertEquals($attributeTypeTable, $this->model->getAttributeTypeTable($attributeType)); + } + + public function testGetProductCollection() + { + $this->assertInstanceOf( + 'Magento\Catalog\Model\Resource\Product\Link\Product\Collection', + $this->model->getProductCollection() + ); + } + + public function testGetLinkCollection() + { + $this->assertInstanceOf( + 'Magento\Catalog\Model\Resource\Product\Link\Collection', + $this->model->getLinkCollection() + ); + } + + public function testGetAttributes() + { + $typeId = 1; + $linkAttributes = ['link_type_id' => 1, 'product_link_attribute_code' => 1, 'data_type' => 'int', 'id' => 1]; + $this->resource + ->expects($this->any())->method('getAttributesByType') + ->with($typeId) + ->will($this->returnValue($linkAttributes)); + $this->model->setData('link_type_id', $typeId); + $this->assertEquals($linkAttributes, $this->model->getAttributes()); + } + + public function testSaveProductRelations() + { + $data = [1]; + $typeId = 1; + $this->model->setData('link_type_id', $typeId); + $product = $this->getMockBuilder( + 'Magento\Catalog\Model\Product' + )->disableOriginalConstructor()->setMethods( + ['getRelatedLinkData', 'getUpSellLinkData', 'getCrossSellLinkData', '__wakeup'] + )->getMock(); + $product->expects($this->any())->method('getRelatedLinkData')->will($this->returnValue($data)); + $product->expects($this->any())->method('getUpSellLinkData')->will($this->returnValue($data)); + $product->expects($this->any())->method('getCrossSellLinkData')->will($this->returnValue($data)); + $map = [ + [$product, $data, Link::LINK_TYPE_RELATED, $this->resource], + [$product, $data, Link::LINK_TYPE_UPSELL, $this->resource], + [$product, $data, Link::LINK_TYPE_CROSSSELL, $this->resource], + ]; + $this->resource->expects($this->any())->method('saveProductLinks')->will($this->returnValueMap($map)); + $this->model->saveProductRelations($product); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/UrlTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/UrlTest.php index 7b32236d1c043e26e47fdc6ca7296919e0f635c5..3f440009fd954564a5949327472b7d59fcc127cc 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/UrlTest.php @@ -35,24 +35,77 @@ class UrlTest extends \PHPUnit_Framework_TestCase */ protected $filter; + /** + * @var \Magento\UrlRewrite\Model\UrlRewrite|\PHPUnit_Framework_MockObject_MockObject + */ + protected $urlRewrite; + + /** + * @var \Magento\Catalog\Helper\Category|\PHPUnit_Framework_MockObject_MockObject + */ + protected $catalogCategory; + + /** + * @var \Magento\Framework\Url|\PHPUnit_Framework_MockObject_MockObject + */ + protected $url; + + /** + * @var \Magento\Framework\Session\SidResolverInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $sidResolver; + protected function setUp() { $this->filter = $this->getMockBuilder( 'Magento\Framework\Filter\FilterManager' )->disableOriginalConstructor()->setMethods( - array('translitUrl') + ['translitUrl'] )->getMock(); $rewriteFactory = $this->getMockBuilder( 'Magento\UrlRewrite\Model\UrlRewriteFactory' )->disableOriginalConstructor()->setMethods( - array('create') + ['create'] + )->getMock(); + + $this->urlRewrite = $this->getMockBuilder( + 'Magento\UrlRewrite\Model\UrlRewrite' + )->disableOriginalConstructor()->setMethods( + ['setStoreId', 'getRequestPath', 'loadByIdPath', 'getId', '__wakeup'] )->getMock(); + $rewriteFactory->expects($this->once())->method('create')->will($this->returnValue($this->urlRewrite)); + + $this->catalogCategory = $this->getMockBuilder( + 'Magento\Catalog\Helper\Category' + )->disableOriginalConstructor()->setMethods( + ['getCategoryUrlPath'] + )->getMock(); + + $this->url = $this->getMockBuilder( + 'Magento\Framework\Url' + )->disableOriginalConstructor()->setMethods( + ['setScope', 'getUrl'] + )->getMock(); + + $this->sidResolver = $this->getMock('Magento\Framework\Session\SidResolverInterface'); + + $store = $this->getMock('Magento\Store\Model\Store', ['getId', '__wakeup'], [], '', false); + $store->expects($this->any())->method('getId')->will($this->returnValue(1)); + $storeManager = $this->getMockForAbstractClass('Magento\Store\Model\StoreManagerInterface'); + $storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store)); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->model = $objectManager->getObject( 'Magento\Catalog\Model\Product\Url', - array('urlRewriteFactory' => $rewriteFactory, 'filter' => $this->filter) + [ + 'urlRewriteFactory' => $rewriteFactory, + 'filter' => $this->filter, + 'catalogCategory' => $this->catalogCategory, + 'storeManager' => $storeManager, + 'url' => $this->url, + 'sidResolver' => $this->sidResolver, + ] ); } @@ -73,4 +126,192 @@ class UrlTest extends \PHPUnit_Framework_TestCase $this->assertEquals($resultString, $this->model->formatUrlKey($strIn)); } + + /** + * @expectedException \Magento\Framework\Model\Exception + * @expectedExceptionMessage Invalid category object supplied + */ + public function testGetUrlPath() + { + $urlPathProduct = '/some/url/path'; + $urlPathCategory = '/some/url/path/category'; + + $product = $this->getMockBuilder( + 'Magento\Catalog\Model\Product' + )->disableOriginalConstructor()->setMethods( + ['getData', '__wakeup'] + )->getMock(); + $product->expects($this->atLeastOnce()) + ->method('getData') + ->with('url_path') + ->will($this->returnValue($urlPathProduct)); + $category = $this->getMockBuilder( + 'Magento\Catalog\Model\Category' + )->disableOriginalConstructor()->setMethods( + ['getUrlPath', '__wakeup'] + )->getMock(); + $category->expects($this->atLeastOnce())->method('getUrlPath')->will($this->returnValue($urlPathCategory)); + $this->catalogCategory + ->expects($this->atLeastOnce()) + ->method('getCategoryUrlPath') + ->with($urlPathCategory) + ->will($this->returnValue($urlPathCategory)); + + $this->assertEquals($urlPathProduct, $this->model->getUrlPath($product)); + $this->assertEquals($urlPathCategory . '/' . $urlPathProduct, $this->model->getUrlPath($product, $category)); + $this->model->getUrlPath($product, 1); + } + + /** + * @dataProvider getUrlDataProvider + * @covers Magento\Catalog\Model\Product\Url::getUrl + * @covers Magento\Catalog\Model\Product\Url::getUrlInStore + * @covers Magento\Catalog\Model\Product\Url::getProductUrl + * + * @param $getUrlMethod + * @param $routePath + * @param $requestPathProduct + * @param $storeId + * @param $categoryId + * @param $routeParams + * @param $routeParamsUrl + * @param $entityId + * @param $idPath + * @param $requestPathUrlRewrite + * @param $productId + * @param $productUrlKey + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function testGetUrl( + $getUrlMethod, + $routePath, + $requestPathProduct, + $storeId, + $categoryId, + $routeParams, + $routeParamsUrl, + $entityId, + $idPath, + $requestPathUrlRewrite, + $productId, + $productUrlKey + ) { + $product = $this->getMockBuilder( + 'Magento\Catalog\Model\Product' + )->disableOriginalConstructor()->setMethods( + ['getStoreId', 'getEntityId', 'getId', 'getUrlKey', 'setRequestPath', 'hasUrlDataObject', 'getRequestPath', + 'getCategoryId', 'getDoNotUseCategoryId', '__wakeup'] + )->getMock(); + $product->expects($this->any())->method('getStoreId')->will($this->returnValue($storeId)); + $product->expects($this->any())->method('getCategoryId')->will($this->returnValue($categoryId)); + $product->expects($this->any())->method('getRequestPath')->will($this->returnValue($requestPathProduct)); + $product->expects($this->any())->method('getEntityId')->will($this->returnValue($entityId)); + $product->expects($this->any()) + ->method('setRequestPath') + ->with($requestPathUrlRewrite) + ->will($this->returnSelf()); + $product->expects($this->any())->method('getId')->will($this->returnValue($productId)); + $product->expects($this->any())->method('getUrlKey')->will($this->returnValue($productUrlKey)); + $this->url->expects($this->any())->method('setScope')->with($storeId)->will($this->returnSelf()); + $this->url->expects($this->any()) + ->method('getUrl') + ->with($routePath, $routeParamsUrl) + ->will($this->returnValue($requestPathProduct)); + $this->urlRewrite->expects($this->any())->method('setStoreId')->with($storeId)->will($this->returnSelf()); + $this->urlRewrite->expects($this->any())->method('loadByIdPath')->with($idPath)->will($this->returnSelf()); + $this->urlRewrite->expects($this->any())->method('getId')->will($this->returnSelf()); + $this->urlRewrite + ->expects($this->any()) + ->method('getRequestPath') + ->will($this->returnValue($requestPathUrlRewrite)); + + switch ($getUrlMethod) { + case 'getUrl': + $this->assertEquals($requestPathProduct, $this->model->getUrl($product, $routeParams)); + break; + case 'getUrlInStore': + $this->assertEquals($requestPathProduct, $this->model->getUrlInStore($product, $routeParams)); + break; + case 'getProductUrl': + $this->assertEquals($requestPathProduct, $this->model->getProductUrl($product, true)); + $this->sidResolver + ->expects($this->once()) + ->method('getUseSessionInUrl') + ->will($this->returnValue(true)); + $this->assertEquals($requestPathProduct, $this->model->getProductUrl($product, null)); + break; + } + } + + public function getUrlDataProvider() + { + return [ + [ + 'getUrl', + '', + '/product/url/path', + 1, + 1, + ['_scope' => 1], + ['_scope' => 1, '_direct' => '/product/url/path', '_query' => []], + null, + '', + null, + null, + null, + ], [ + 'getUrl', + '', + null, + 1, + 1, + ['_scope' => 1], + ['_scope' => 1, '_direct' => '/product_url_rewrite/url/path', '_query' => []], + 1, + 'product/1/1', + '/product_url_rewrite/url/path', + null, + null, + ], [ + 'getUrl', + 'catalog/product/view', + false, + 1, + 1, + ['_scope' => 1], + ['_scope' => 1, '_query' => [], 'id' => 1, 's' => 'urlKey', 'category' => 1], + null, + '', + null, + 1, + 'urlKey', + ], [ + 'getUrlInStore', + '', + '/product/url/path', + 1, + 1, + ['_scope' => 1], + ['_scope' => 1, '_direct' => '/product/url/path', '_query' => [], '_scope_to_url' => true], + null, + '', + null, + null, + null, + ], [ + 'getProductUrl', + '', + '/product/url/path', + 1, + 1, + [], + ['_direct' => '/product/url/path', '_query' => []], + null, + '', + null, + null, + null, + ] + ]; + } } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/Data/ProductBuilderTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/Data/ProductBuilderTest.php index e5d29627e33ab9cef139a212591d90e1340d26f9..f5919d237202db31edbdc9dfb4154bd45ee49dcd 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/Data/ProductBuilderTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/Data/ProductBuilderTest.php @@ -116,10 +116,4 @@ class ProductBuilderTest extends \PHPUnit_Framework_TestCase { $this->_productBuilder->$method(''); } - - public function testGetCustomAttributes() - { - $expectedAttributesCodes = ['attribute_code_1', 'attribute_code_2']; - $this->assertEquals($expectedAttributesCodes, $this->_productBuilder->getCustomAttributesCodes()); - } } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/Product/CustomOptions/WriteServiceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/Product/CustomOptions/WriteServiceTest.php index 9527f570afbbd9489bb4e398454eca1d6143dcca..f9a19fa8a9c09871b680ee4518bbf65a0c2cfce0 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/Product/CustomOptions/WriteServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/Product/CustomOptions/WriteServiceTest.php @@ -399,4 +399,17 @@ class WriteServiceTest extends \PHPUnit_Framework_TestCase $this->productMock->expects($this->once())->method('save')->will($this->throwException(new \Exception())); $this->writeService->add(self::PRODUCT_SKU, $optionData); } + + /** + * @expectedException \Magento\Framework\Exception\InputException + */ + public function testAddWithOptionId() + { + $optionData = $this->getMock('Magento\Catalog\Service\V1\Product\CustomOptions\Data\Option', [], [], '', false); + $optionData->expects($this->once())->method('getOptionId')->will($this->returnValue(10)); + $this->optionConverterMock + ->expects($this->never()) + ->method('convert'); + $this->writeService->add(self::PRODUCT_SKU, $optionData); + } } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/ProductServiceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/ProductServiceTest.php index e11b3df3dd5d6bcc38a992fa6f93066753b8643b..5a2b458add886237c0449dc7f30bde1e6c7d0f47 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/ProductServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Service/V1/ProductServiceTest.php @@ -24,8 +24,8 @@ namespace Magento\Catalog\Service\V1; +use Magento\Framework\Service\V1\Data\SearchCriteria; use Magento\Framework\Service\V1\Data\SearchCriteriaBuilder; -use Magento\Framework\Service\V1\Data\FilterBuilder; /** * Test for \Magento\Catalog\Service\V1\ProductService @@ -239,7 +239,12 @@ class ProductServiceTest extends \PHPUnit_Framework_TestCase $filterBuilder = $helper->getObject('\Magento\Framework\Service\V1\Data\FilterBuilder'); $filter = $filterBuilder->setField('price')->setValue('10.000')->setConditionType('eq')->create(); $this->_searchBuilder->addFilter([$filter]); - $this->_searchBuilder->addSortOrder('price', \Magento\Framework\Service\V1\Data\SearchCriteria::SORT_ASC); + $sortOrderBuilder = $helper->getObject('\Magento\Framework\Service\V1\Data\SortOrderBuilder'); + $sortOrder = $sortOrderBuilder + ->setField('price') + ->setDirection(SearchCriteria::SORT_ASC) + ->create(); + $this->_searchBuilder->addSortOrder($sortOrder); $this->_searchBuilder->setCurrentPage(1); $this->_searchBuilder->setPageSize(10); $productService->search($this->_searchBuilder->create()); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/_files/catalog/product/somefile.png b/dev/tests/unit/testsuite/Magento/Catalog/_files/catalog/product/somefile.png new file mode 100644 index 0000000000000000000000000000000000000000..50b15f6ec595b5c0bdaecf41ea9ee69b159b79e0 Binary files /dev/null and b/dev/tests/unit/testsuite/Magento/Catalog/_files/catalog/product/somefile.png differ diff --git a/dev/tests/unit/testsuite/Magento/Catalog/_files/catalog/product/watermark/somefile.png b/dev/tests/unit/testsuite/Magento/Catalog/_files/catalog/product/watermark/somefile.png new file mode 100644 index 0000000000000000000000000000000000000000..50b15f6ec595b5c0bdaecf41ea9ee69b159b79e0 Binary files /dev/null and b/dev/tests/unit/testsuite/Magento/Catalog/_files/catalog/product/watermark/somefile.png differ diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AttributeTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AttributeTest.php new file mode 100644 index 0000000000000000000000000000000000000000..3b63d00e22044f96914bd6087ef987692b649b4c --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AttributeTest.php @@ -0,0 +1,152 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin; + +class AttributeTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Indexer\Model\IndexerInterface + */ + protected $indexerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Resource\Attribute + */ + protected $subjectMock; + + /** + * @var Attribute + */ + protected $model; + + protected function setUp() + { + $this->subjectMock = $this->getMock('Magento\Catalog\Model\Resource\Attribute', [], [], '', false); + $this->indexerMock = $this->getMockForAbstractClass( + 'Magento\Indexer\Model\IndexerInterface', + [], + '', + false, + false, + true, + ['getId', 'getState', '__wakeup'] + ); + $this->model = new Attribute($this->indexerMock); + } + + /** + * @param bool $isObjectNew + * @param bool $isSearchableChanged + * @param int $invalidateCounter + * @return void + * @dataProvider aroundSaveDataProvider + */ + public function testAroundSave($isObjectNew, $isSearchableChanged, $invalidateCounter) + { + $attributeMock = $this->getMock( + '\Magento\Catalog\Model\Resource\Eav\Attribute', + ['dataHasChangedFor', 'isObjectNew', '__wakeup'], + [], + '', + false + ); + $attributeMock->expects($this->any()) + ->method('dataHasChangedFor') + ->with('is_searchable') + ->will($this->returnValue($isSearchableChanged)); + $attributeMock->expects($this->once())->method('isObjectNew')->will($this->returnValue($isObjectNew)); + + $closureMock = function (\Magento\Catalog\Model\Resource\Eav\Attribute $object) use ($attributeMock) { + $this->assertEquals($object, $attributeMock); + return $this->subjectMock; + }; + + $this->indexerMock->expects($this->exactly($invalidateCounter))->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->exactly($invalidateCounter))->method('invalidate'); + + $this->assertEquals( + $this->subjectMock, + $this->model->aroundSave($this->subjectMock, $closureMock, $attributeMock) + ); + } + + /** + * @return array + */ + public function aroundSaveDataProvider() + { + return [ + [false, false, 0], + [false, true, 1], + [true, false, 0], + [true, true, 0], + ]; + } + + /** + * @param bool $isObjectNew + * @param bool $isSearchable + * @param int $invalidateCounter + * @return void + * @dataProvider aroundDeleteDataProvider + */ + public function testAroundDelete($isObjectNew, $isSearchable, $invalidateCounter) + { + $attributeMock = $this->getMock( + '\Magento\Catalog\Model\Resource\Eav\Attribute', + ['getIsSearchable', 'isObjectNew', '__wakeup'], + [], + '', + false + ); + $attributeMock->expects($this->any())->method('getIsSearchable')->will($this->returnValue($isSearchable)); + $attributeMock->expects($this->once())->method('isObjectNew')->will($this->returnValue($isObjectNew)); + + $closureMock = function (\Magento\Catalog\Model\Resource\Eav\Attribute $object) use ($attributeMock) { + $this->assertEquals($object, $attributeMock); + return $this->subjectMock; + }; + + $this->indexerMock->expects($this->exactly($invalidateCounter))->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->exactly($invalidateCounter))->method('invalidate'); + + $this->assertEquals( + $this->subjectMock, + $this->model->aroundDelete($this->subjectMock, $closureMock, $attributeMock) + ); + } + + /** + * @return array + */ + public function aroundDeleteDataProvider() + { + return [ + [false, false, 0], + [false, true, 1], + [true, false, 0], + [true, true, 0], + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/ActionTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/ActionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..62262f4d2387d24afb3e6344c2741037102539c3 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/ActionTest.php @@ -0,0 +1,132 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product; + +use Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product\Action; + +class ActionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Indexer\Model\IndexerInterface + */ + protected $indexerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product\Action + */ + protected $subjectMock; + + /** + * @var Action + */ + protected $model; + + protected function setUp() + { + $this->subjectMock = $this->getMock('Magento\Catalog\Model\Product\Action', array(), array(), '', false); + + $this->indexerMock = $this->getMockForAbstractClass( + 'Magento\Indexer\Model\IndexerInterface', + array(), + '', + false, + false, + true, + array('getId', 'getState', '__wakeup') + ); + + $this->model = new Action($this->indexerMock); + } + + public function testAroundUpdateAttributesNonScheduled() + { + $this->indexerMock->expects($this->exactly(2))->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('isScheduled')->will($this->returnValue(false)); + $this->indexerMock->expects($this->once())->method('reindexList')->with(array(1, 2, 3)); + + $closureMock = function ($productIds, $attrData, $storeId) { + $this->assertEquals(array(1, 2, 3), $productIds); + $this->assertEquals(array(4, 5, 6), $attrData); + $this->assertEquals(1, $storeId); + return $this->subjectMock; + }; + + $this->assertEquals( + $this->subjectMock, + $this->model->aroundUpdateAttributes($this->subjectMock, $closureMock, array(1, 2, 3), array(4, 5, 6), 1) + ); + } + + public function testAroundUpdateAttributesScheduled() + { + $this->indexerMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('isScheduled')->will($this->returnValue(true)); + $this->indexerMock->expects($this->never())->method('reindexList'); + + $closureMock = function ($productIds, $attrData, $storeId) { + $this->assertEquals(array(1, 2, 3), $productIds); + $this->assertEquals(array(4, 5, 6), $attrData); + $this->assertEquals(1, $storeId); + return $this->subjectMock; + }; + + $this->assertEquals( + $this->subjectMock, + $this->model->aroundUpdateAttributes($this->subjectMock, $closureMock, array(1, 2, 3), array(4, 5, 6), 1) + ); + } + + public function testAroundUpdateWebsitesNonScheduled() + { + $this->indexerMock->expects($this->exactly(2))->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('isScheduled')->will($this->returnValue(false)); + $this->indexerMock->expects($this->once())->method('reindexList')->with(array(1, 2, 3)); + + $closureMock = function ($productIds, $websiteIds, $type) { + $this->assertEquals(array(1, 2, 3), $productIds); + $this->assertEquals(array(4, 5, 6), $websiteIds); + $this->assertEquals('type', $type); + return $this->subjectMock; + }; + + $this->model->aroundUpdateWebsites($this->subjectMock, $closureMock, array(1, 2, 3), array(4, 5, 6), 'type'); + } + + public function testAroundUpdateWebsitesScheduled() + { + $this->indexerMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('isScheduled')->will($this->returnValue(true)); + $this->indexerMock->expects($this->never())->method('reindexList'); + + $closureMock = function ($productIds, $websiteIds, $type) { + $this->assertEquals(array(1, 2, 3), $productIds); + $this->assertEquals(array(4, 5, 6), $websiteIds); + $this->assertEquals('type', $type); + return $this->subjectMock; + }; + + $this->model->aroundUpdateWebsites($this->subjectMock, $closureMock, array(1, 2, 3), array(4, 5, 6), 'type'); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/ProductTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/ProductTest.php new file mode 100644 index 0000000000000000000000000000000000000000..14f65c8d4e4fe093250e0ec1bf91e51f8c2bb86f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/ProductTest.php @@ -0,0 +1,106 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin; + +use Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product; + +class ProductTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Indexer\Model\IndexerInterface + */ + protected $indexerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product + */ + protected $subjectMock; + + /** + * @var Product + */ + protected $model; + + protected function setUp() + { + $this->subjectMock = $this->getMock('Magento\Catalog\Model\Product', array(), array(), '', false); + + $this->indexerMock = $this->getMockForAbstractClass( + 'Magento\Indexer\Model\IndexerInterface', + array(), + '', + false, + false, + true, + array('getId', 'getState', '__wakeup') + ); + + $this->model = new Product($this->indexerMock); + } + + public function testAfterSaveNonScheduled() + { + $this->indexerMock->expects($this->exactly(2))->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('isScheduled')->will($this->returnValue(false)); + $this->indexerMock->expects($this->once())->method('reindexRow')->with(1); + + $this->subjectMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + + $this->assertEquals($this->subjectMock, $this->model->afterSave($this->subjectMock)); + } + + public function testAfterSaveScheduled() + { + $this->indexerMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('isScheduled')->will($this->returnValue(true)); + $this->indexerMock->expects($this->never())->method('reindexRow'); + + $this->subjectMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + + $this->assertEquals($this->subjectMock, $this->model->afterSave($this->subjectMock)); + } + + public function testAfterDeleteNonScheduled() + { + $this->indexerMock->expects($this->exactly(2))->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('isScheduled')->will($this->returnValue(false)); + $this->indexerMock->expects($this->once())->method('reindexRow')->with(1); + + $this->subjectMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + + $this->assertEquals($this->subjectMock, $this->model->afterDelete($this->subjectMock)); + } + + public function testAfterDeleteScheduled() + { + $this->indexerMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('isScheduled')->will($this->returnValue(true)); + $this->indexerMock->expects($this->never())->method('reindexRow'); + + $this->subjectMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + + $this->assertEquals($this->subjectMock, $this->model->afterDelete($this->subjectMock)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php new file mode 100644 index 0000000000000000000000000000000000000000..cadbac0a0aaaa5380646d252878a079b8968c294 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php @@ -0,0 +1,120 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Store; + +class GroupTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Indexer\Model\IndexerInterface + */ + protected $indexerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Store\Model\Resource\Group + */ + protected $subjectMock; + + /** + * @var Group + */ + protected $model; + + protected function setUp() + { + $this->subjectMock = $this->getMock('Magento\Store\Model\Resource\Group', [], [], '', false); + $this->indexerMock = $this->getMockForAbstractClass( + 'Magento\Indexer\Model\IndexerInterface', + [], + '', + false, + false, + true, + ['getId', 'getState', '__wakeup'] + ); + $this->model = new Group($this->indexerMock); + } + + /** + * @param bool $isObjectNew + * @param bool $websiteChanged + * @param int $invalidateCounter + * @return void + * @dataProvider aroundSaveDataProvider + */ + public function testAroundSave($isObjectNew, $websiteChanged, $invalidateCounter) + { + $groupMock = $this->getMock( + 'Magento\Store\Model\Group', + ['dataHasChangedFor', 'isObjectNew', '__wakeup'], + [], + '', + false + ); + $groupMock->expects($this->any()) + ->method('dataHasChangedFor') + ->with('website_id') + ->will($this->returnValue($websiteChanged)); + $groupMock->expects($this->once())->method('isObjectNew')->will($this->returnValue($isObjectNew)); + + $closureMock = function (\Magento\Store\Model\Group $object) use ($groupMock) { + $this->assertEquals($object, $groupMock); + return $this->subjectMock; + }; + + $this->indexerMock->expects($this->exactly($invalidateCounter))->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->exactly($invalidateCounter))->method('invalidate'); + + $this->assertEquals( + $this->subjectMock, + $this->model->aroundSave($this->subjectMock, $closureMock, $groupMock) + ); + } + + /** + * @return array + */ + public function aroundSaveDataProvider() + { + return [ + [false, false, 0], + [false, true, 1], + [true, false, 0], + [true, true, 0], + ]; + } + + /** + * @return void + */ + public function testAfterDelete() + { + $this->indexerMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('invalidate'); + + $this->assertEquals( + $this->subjectMock, + $this->model->afterDelete($this->subjectMock, $this->subjectMock) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/ViewTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/ViewTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d8235f922d678079b954d871f4b36eb097b83418 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Store/ViewTest.php @@ -0,0 +1,113 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Store; + +class ViewTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Indexer\Model\IndexerInterface + */ + protected $indexerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Store\Model\Resource\Store + */ + protected $subjectMock; + + /** + * @var View + */ + protected $model; + + protected function setUp() + { + $this->subjectMock = $this->getMock('Magento\Store\Model\Resource\Store', [], [], '', false); + $this->indexerMock = $this->getMockForAbstractClass( + 'Magento\Indexer\Model\IndexerInterface', + [], + '', + false, + false, + true, + ['getId', 'getState', '__wakeup'] + ); + $this->model = new View($this->indexerMock); + } + + /** + * @param bool $isObjectNew + * @param int $invalidateCounter + * @return void + * @dataProvider aroundSaveDataProvider + */ + public function testAroundSave($isObjectNew, $invalidateCounter) + { + $viewMock = $this->getMock( + 'Magento\Store\Model\Store', + ['dataHasChangedFor', 'isObjectNew', '__wakeup'], + [], + '', + false + ); + $viewMock->expects($this->once())->method('isObjectNew')->will($this->returnValue($isObjectNew)); + + $closureMock = function (\Magento\Store\Model\Store $object) use ($viewMock) { + $this->assertEquals($object, $viewMock); + return $this->subjectMock; + }; + + $this->indexerMock->expects($this->exactly($invalidateCounter))->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->exactly($invalidateCounter))->method('invalidate'); + + $this->assertEquals( + $this->subjectMock, + $this->model->aroundSave($this->subjectMock, $closureMock, $viewMock) + ); + } + + /** + * @return array + */ + public function aroundSaveDataProvider() + { + return [ + [false, 0], + [true, 1], + ]; + } + + /** + * @return void + */ + public function testAfterDelete() + { + $this->indexerMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + $this->indexerMock->expects($this->once())->method('invalidate'); + + $this->assertEquals( + $this->subjectMock, + $this->model->afterDelete($this->subjectMock, $this->subjectMock) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php new file mode 100644 index 0000000000000000000000000000000000000000..2018abe258a6244c0ea7b088db16a3500d242754 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php @@ -0,0 +1,110 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CatalogSearch\Model\Indexer; + +class FulltextTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\CatalogSearch\Model\Indexer\Fulltext + */ + protected $model; + + /** + * @var \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\FullFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $fullMock; + + /** + * @var \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\RowsFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $rowsMock; + + /** + * @var \Magento\Indexer\Model\IndexerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $indexerMock; + + protected function setUp() + { + $this->fullMock = $this->getMock( + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\FullFactory', + array('create'), + array(), + '', + false + ); + + $this->rowsMock = $this->getMock( + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\RowsFactory', + array('create'), + array(), + '', + false + ); + + $this->indexerMock = $this->getMockForAbstractClass( + 'Magento\Indexer\Model\IndexerInterface', + array(), + '', + false, + false, + true, + array('getId', 'load', 'isInvalid', 'isWorking', '__wakeup') + ); + + $this->model = new \Magento\CatalogSearch\Model\Indexer\Fulltext( + $this->fullMock, + $this->rowsMock, + $this->indexerMock + ); + } + + public function testExecuteWithIndexer() + { + $ids = array(1, 2, 3); + + $this->indexerMock->expects( + $this->once() + )->method( + 'load' + )->with( + \Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID + )->will( + $this->returnSelf() + ); + + $rowMock = $this->getMock( + 'Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Rows', + array('reindex'), + array(), + '', + false + ); + $rowMock->expects($this->once())->method('reindex')->with($ids)->will($this->returnSelf()); + + $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); + + $this->model->execute($ids); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Address/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Address/ConverterTest.php index 69ebcdeb3247972f097dd67306030fc6cbf5b778..522667411a689e224115330632748f4145b5ed70 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Address/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Address/ConverterTest.php @@ -41,13 +41,25 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $addressBuilderMock; + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $metadataServiceMock; + protected function setUp() { $this->addressBuilderMock = $this->getMock( '\Magento\Checkout\Service\V1\Data\Cart\AddressBuilder', [], [], '', false ); - - $this->model = new Converter($this->addressBuilderMock); + $this->metadataServiceMock = $this + ->getMockBuilder('Magento\Customer\Service\V1\CustomerMetadataServiceInterface') + ->setMethods(['getCustomAttributesMetadata']) + ->getMockForAbstractClass(); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\Checkout\Service\V1\Address\Converter', + ['addressBuilder' => $this->addressBuilderMock, 'metadataService' => $this->metadataServiceMock] + ); } public function testConvertModelToDataObject() @@ -105,9 +117,11 @@ class ConverterTest extends \PHPUnit_Framework_TestCase Address::CUSTOM_ATTRIBUTES_KEY => [['attribute_code' => 'custom_field', 'value' => 'custom_value']] ]; - $this->addressBuilderMock->expects($this->any())->method('getCustomAttributesCodes')->will( - $this->returnValue(array('custom_field')) - ); + $this->metadataServiceMock + ->expects($this->any()) + ->method('getCustomAttributesMetadata') + ->will($this->returnValue([new \Magento\Framework\Object(['attribute_code' => 'custom_field'])])); + $this->addressBuilderMock->expects($this->once())->method('populateWithArray')->with($testData)->will( $this->returnValue($this->addressBuilderMock) ); diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Cart/PaymentMethod/BuilderTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Cart/PaymentMethod/BuilderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..12cf1ec8637f1f1f13f14209df55053d512097d9 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Cart/PaymentMethod/BuilderTest.php @@ -0,0 +1,102 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Cart\PaymentMethod; + +class BuilderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Builder + */ + protected $builder; + + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + protected function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->builder = $this->objectManager->getObject( + '\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Builder' + ); + } + + public function testBuildPaymentObject() + { + $paymentData = [ + 'method' => 'checkmo', + 'payment_details' => 'paymentDetailsTest' + ]; + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod', [], [], '', false); + $paymentMethodMock->expects($this->once())->method('__toArray')->will($this->returnValue($paymentData)); + $paymentMethodMock->expects($this->once()) + ->method('getPaymentDetails') + ->will($this->returnValue(['paymentDetailsTest'])); + + $paymentMock = $this->getMock('\Magento\Sales\Model\Quote\Payment', [], [], '', false); + $paymentMock->expects($this->once()) + ->method('importData') + ->with($this->contains('checkmo')) + ->will($this->returnSelf()); + + $quoteMock = $this->getMock('\Magento\Sales\Model\Quote', [], [], '', false); + $quoteMock->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock)); + + $this->assertEquals($paymentMock, $this->builder->build($paymentMethodMock, $quoteMock)); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage The requested Payment Method is not available. + */ + public function testBuildPaymentObjectThrowsExceptionIfPaymentMethodNotAvailable() + { + $paymentData = [ + 'method' => 'notAvailableMethod', + 'payment_details' => 'paymentDetailsTest' + ]; + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod', [], [], '', false); + $paymentMethodMock->expects($this->once())->method('__toArray')->will($this->returnValue($paymentData)); + $paymentMethodMock->expects($this->once()) + ->method('getPaymentDetails') + ->will($this->returnValue(['paymentDetailsTest'])); + + $paymentMock = $this->getMock('\Magento\Sales\Model\Quote\Payment', [], [], '', false); + $paymentMock->expects($this->once()) + ->method('importData') + ->with($this->contains('notAvailableMethod')) + ->will($this->throwException( + new \Magento\Framework\Exception\LocalizedException('The requested Payment Method is not available.')) + ); + + $quoteMock = $this->getMock('\Magento\Sales\Model\Quote', [], [], '', false); + $quoteMock->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock)); + + $this->assertEquals($paymentMock, $this->builder->build($paymentMethodMock, $quoteMock)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Cart/PaymentMethod/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Cart/PaymentMethod/ConverterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..854ba8643778c754b8877f6b68675f51ed968914 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Cart/PaymentMethod/ConverterTest.php @@ -0,0 +1,105 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Cart\PaymentMethod; + +use \Magento\Checkout\Service\V1\Data\Cart\PaymentMethod; + +class ConverterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Converter + */ + protected $converter; + + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $paymentMethodBuilderMock; + + protected function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->paymentMethodBuilderMock = $this->getMock( + '\Magento\Checkout\Service\V1\Data\Cart\PaymentMethodBuilder', [], [], '', false + ); + + $this->converter = $this->objectManager->getObject( + '\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Converter', + [ + 'builder' => $this->paymentMethodBuilderMock, + ] + ); + } + + public function testConvertQuotePaymentObjectToPaymentDataObject() + { + $paymentMock = $this->getMock('\Magento\Sales\Model\Quote\Payment', + [ + 'getMethod', 'getPoNumber', 'getCcOwner', 'getCcNumber', + 'getCcType', 'getCcExpYear', 'getCcExpMonth', 'getAdditionalData', '__wakeup' + ], + [], + '', + false + ); + $paymentMock->expects($this->once())->method('getMethod')->will($this->returnValue('checkmo')); + $paymentMock->expects($this->once())->method('getPoNumber')->will($this->returnValue(100)); + $paymentMock->expects($this->once())->method('getCcOwner')->will($this->returnValue('tester')); + $paymentMock->expects($this->once())->method('getCcNumber')->will($this->returnValue(100200300)); + $paymentMock->expects($this->once())->method('getCcType')->will($this->returnValue('visa')); + $paymentMock->expects($this->once())->method('getCcExpYear')->will($this->returnValue(2014)); + $paymentMock->expects($this->once())->method('getCcExpMonth')->will($this->returnValue(10)); + $paymentMock->expects($this->once())->method('getAdditionalData')->will($this->returnValue('test')); + + $data = [ + PaymentMethod::METHOD => 'checkmo', + PaymentMethod::PO_NUMBER => 100, + PaymentMethod::CC_OWNER => 'tester', + PaymentMethod::CC_NUMBER => 100200300, + PaymentMethod::CC_TYPE => 'visa', + PaymentMethod::CC_EXP_YEAR => 2014, + PaymentMethod::CC_EXP_MONTH => 10, + PaymentMethod::PAYMENT_DETAILS => 'test', + ]; + + $this->paymentMethodBuilderMock->expects($this->once()) + ->method('populateWithArray') + ->with($data) + ->will($this->returnSelf()); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\PaymentMethod', [], [], '', false); + + $this->paymentMethodBuilderMock->expects($this->once()) + ->method('create') + ->will($this->returnValue($paymentMethodMock)); + + $this->assertEquals($paymentMethodMock, $this->converter->toDataObject($paymentMock)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Coupon/ReadServiceTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Coupon/ReadServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b6a5e41231e2e6b6bc64354ff0264bdb160f9598 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Coupon/ReadServiceTest.php @@ -0,0 +1,97 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Coupon; + +use Magento\Checkout\Service\V1\Data\Cart\Coupon as Coupon; + +class ReadServiceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ReadService + */ + protected $service; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteLoaderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $couponBuilderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManagerMock; + + protected function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->quoteLoaderMock = $this->getMock('\Magento\Checkout\Service\V1\QuoteLoader', [], [], '', false); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->couponBuilderMock = $this->getMock( + '\Magento\Checkout\Service\V1\Data\Cart\CouponBuilder', [], [], '', false + ); + $this->service = $objectManager->getObject( + '\Magento\Checkout\Service\V1\Coupon\ReadService', + [ + 'quoteLoader' => $this->quoteLoaderMock, + 'couponBuilder' => $this->couponBuilderMock, + 'storeManager' => $this->storeManagerMock + ] + ); + } + + public function testGetCoupon() + { + $cartId = 11; + $storeId = 12; + $couponCode = 'test_coupon_code'; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $quoteMock = $this->getMock('\Magento\Sales\Model\Quote', ['getCouponCode', '__wakeup'], [], '', false); + $quoteMock->expects($this->any())->method('getCouponCode')->will($this->returnValue($couponCode)); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $data = [Coupon::COUPON_CODE => $couponCode]; + + $this->couponBuilderMock->expects($this->once()) + ->method('populateWithArray') + ->with($data) + ->will($this->returnSelf()); + $this->couponBuilderMock->expects($this->once())->method('create')->will($this->returnValue('couponCode')); + + $this->assertEquals('couponCode', $this->service->get($cartId)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Coupon/WriteServiceTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Coupon/WriteServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..30585e2f9b659088ac80b59d538119bca1c32400 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Coupon/WriteServiceTest.php @@ -0,0 +1,307 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Coupon; + +class WriteServiceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var WriteService + */ + protected $service; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteLoaderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $couponBuilderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $couponCodeDataMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteAddressMock; + + protected function setUp() + { + $objectManager =new \Magento\TestFramework\Helper\ObjectManager($this); + $this->quoteLoaderMock = $this->getMock('\Magento\Checkout\Service\V1\QuoteLoader', [], [], '', false); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->couponBuilderMock = + $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\CouponBuilder', [], [], '', false); + $this->storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $this->quoteMock = $this->getMock( + '\Magento\Sales\Model\Quote', + [ + 'getItemsCount', + 'setCouponCode', + 'collectTotals', + 'save', + 'getShippingAddress', + 'getCouponCode', + '__wakeup' + ], + [], + '', + false + ); + $this->couponCodeDataMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\Coupon', [], [], '', false); + $this->quoteAddressMock = $this->getMock( + '\Magento\Sales\Model\Quote\Address', + [ + 'setCollectShippingRates', + '__wakeup' + ], + [], + '', + false) + ; + $this->service = $objectManager->getObject( + 'Magento\Checkout\Service\V1\Coupon\WriteService', + [ + 'quoteLoader' => $this->quoteLoaderMock, + 'couponBuilder' => $this->couponBuilderMock, + 'storeManager' => $this->storeManagerMock + ] + ); + } + + /** + * @expectedException \Magento\Framework\Exception\NoSuchEntityException + * @expectedExceptionMessage Cart 33 doesn't contain products + */ + public function testSetWhenCartDoesNotContainsProducts() + { + $storeId = 10; + $cartId = 33; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(0)); + + $this->service->set($cartId, $this->couponCodeDataMock); + } + + /** + * @expectedException \Magento\Framework\Exception\CouldNotSaveException + * @expectedExceptionMessage Could not apply coupon code + */ + public function testSetWhenCouldNotApplyCoupon() + { + $storeId = 10; + $cartId = 33; + $couponCode = '153a-ABC'; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(12)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->quoteAddressMock)); + $this->quoteAddressMock->expects($this->once())->method('setCollectShippingRates')->with(true); + $this->couponCodeDataMock->expects($this->once()) + ->method('getCouponCode')->will($this->returnValue($couponCode)); + $this->quoteMock->expects($this->once())->method('setCouponCode')->with($couponCode); + $exceptionMessage = 'Could not apply coupon code'; + $exception = new \Magento\Framework\Exception\CouldNotDeleteException($exceptionMessage); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('save')->will($this->throwException($exception)); + + $this->service->set($cartId, $this->couponCodeDataMock); + } + + /** + * @expectedException \Magento\Framework\Exception\NoSuchEntityException + * @expectedExceptionMessage Coupon code is not valid + */ + public function testSetWhenCouponCodeIsInvalid() + { + $storeId = 10; + $cartId = 33; + $couponCode = '153a-ABC'; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(12)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->quoteAddressMock)); + $this->quoteAddressMock->expects($this->once())->method('setCollectShippingRates')->with(true); + $this->couponCodeDataMock->expects($this->once()) + ->method('getCouponCode')->will($this->returnValue($couponCode)); + $this->quoteMock->expects($this->once())->method('setCouponCode')->with($couponCode); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('save'); + $this->quoteMock->expects($this->once())->method('getCouponCode')->will($this->returnValue('invalidCoupon')); + + $this->service->set($cartId, $this->couponCodeDataMock); + } + + public function testSet() + { + $storeId = 10; + $cartId = 33; + $couponCode = '153a-ABC'; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(12)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->quoteAddressMock)); + $this->quoteAddressMock->expects($this->once())->method('setCollectShippingRates')->with(true); + $this->couponCodeDataMock->expects($this->once()) + ->method('getCouponCode')->will($this->returnValue($couponCode)); + $this->quoteMock->expects($this->once())->method('setCouponCode')->with($couponCode); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('save'); + $this->quoteMock->expects($this->once())->method('getCouponCode')->will($this->returnValue($couponCode)); + + $this->assertTrue($this->service->set($cartId, $this->couponCodeDataMock)); + } + + /** + * @expectedException \Magento\Framework\Exception\NoSuchEntityException + * @expectedExceptionMessage Cart 65 doesn't contain products + */ + public function testDeleteWhenCartDoesNotContainsProducts() + { + $storeId = 24; + $cartId = 65; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(0)); + $this->quoteMock->expects($this->never())->method('getShippingAddress'); + + $this->service->delete($cartId); + } + + /** + * @expectedException \Magento\Framework\Exception\CouldNotDeleteException + * @expectedExceptionMessage Could not delete coupon code + */ + public function testDeleteWhenCouldNotDeleteCoupon() + { + $storeId = 24; + $cartId = 65; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(12)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->quoteAddressMock)); + $this->quoteAddressMock->expects($this->once())->method('setCollectShippingRates')->with(true); + $this->quoteMock->expects($this->once())->method('setCouponCode')->with(''); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $exceptionMessage = 'Could not delete coupon code'; + $exception = new \Magento\Framework\Exception\CouldNotSaveException($exceptionMessage); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('save')->will($this->throwException($exception)); + + $this->service->delete($cartId); + } + + /** + * @expectedException \Magento\Framework\Exception\CouldNotDeleteException + * @expectedExceptionMessage Could not delete coupon code + */ + public function testDeleteWhenCouponIsNotEmpty() + { + $storeId = 24; + $cartId = 65; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(12)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->quoteAddressMock)); + $this->quoteAddressMock->expects($this->once())->method('setCollectShippingRates')->with(true); + $this->quoteMock->expects($this->once())->method('setCouponCode')->with(''); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('save'); + $this->quoteMock->expects($this->once())->method('getCouponCode')->will($this->returnValue('123_ABC')); + + $this->service->delete($cartId); + } + + public function testDelete() + { + $storeId = 24; + $cartId = 65; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(12)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->quoteAddressMock)); + $this->quoteAddressMock->expects($this->once())->method('setCollectShippingRates')->with(true); + $this->quoteMock->expects($this->once())->method('setCouponCode')->with(''); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('save'); + $this->quoteMock->expects($this->once())->method('getCouponCode')->will($this->returnValue('')); + + $this->assertTrue($this->service->delete($cartId)); + } +} + \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodConverterTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodConverterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..746adf0ee7fc1367d29306353b6db286c72e6821 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Data/Cart/ShippingMethodConverterTest.php @@ -0,0 +1,133 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\Cart; + +class ShippingMethodConverterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ShippingMethodConverter + */ + protected $converter; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $builderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $rateModelMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $currencyMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $shippingMethodMock; + + protected function setUp() + { + $objectManager =new \Magento\TestFramework\Helper\ObjectManager($this); + $this->builderMock = + $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\ShippingMethodBuilder', [], [], '', false); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->currencyMock = $this->getMock('\Magento\Directory\Model\Currency', [], [], '', false); + $this->shippingMethodMock = + $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\ShippingMethod', [], [], '', false); + $this->rateModelMock = $this->getMock('\Magento\Sales\Model\Quote\Address\Rate', + [ + 'getPrice', + 'getCarrier', + 'getMethod', + 'getCarrierTitle', + 'getMethodTitle', + '__wakeup', + ], + [], + '', + false); + $this->storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + + $this->converter = $objectManager->getObject( + 'Magento\Checkout\Service\V1\Data\Cart\ShippingMethodConverter', + [ + 'builder' => $this->builderMock, + 'storeManager' => $this->storeManagerMock, + ] + ); + } + + public function testModelToDataObject() + { + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once()) + ->method('getBaseCurrency') + ->will($this->returnValue($this->currencyMock)); + $data = [ + ShippingMethod::CARRIER_CODE => 'CARRIER_CODE', + ShippingMethod::METHOD_CODE => 'METHOD_CODE', + ShippingMethod::CARRIER_TITLE => 'CARRIER_TITLE', + ShippingMethod::METHOD_TITLE => 'METHOD_TITLE', + ShippingMethod::SHIPPING_AMOUNT => '100.12', + ShippingMethod::BASE_SHIPPING_AMOUNT => '90.12', + ShippingMethod::AVAILABLE => true, + ]; + + $this->rateModelMock->expects($this->once())->method('getCarrier')->will($this->returnValue('CARRIER_CODE')); + $this->rateModelMock->expects($this->once())->method('getMethod')->will($this->returnValue('METHOD_CODE')); + $this->rateModelMock->expects($this->any())->method('getPrice')->will($this->returnValue(90.12)); + $this->currencyMock->expects($this->once()) + ->method('convert')->with(90.12, 'USD')->will($this->returnValue(100.12)); + $this->rateModelMock->expects($this->once()) + ->method('getCarrierTitle')->will($this->returnValue('CARRIER_TITLE')); + $this->rateModelMock->expects($this->once()) + ->method('getMethodTitle')->will($this->returnValue('METHOD_TITLE')); + $this->builderMock->expects($this->once()) + ->method('populateWithArray')->with($data)->will($this->returnValue($this->builderMock)); + $this->builderMock->expects($this->once()) + ->method('create') + ->will($this->returnValue($this->shippingMethodMock)); + + $this->assertEquals( + $this->shippingMethodMock, + $this->converter->modelToDataObject($this->rateModelMock, 'USD') + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Data/PaymentMethod/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Data/PaymentMethod/ConverterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..27f65b8895d47f36398a205166da94d0c7d38f88 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Data/PaymentMethod/ConverterTest.php @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\Data\PaymentMethod; + +use \Magento\Checkout\Service\V1\Data\PaymentMethod; + +class ConverterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Converter + */ + protected $converter; + + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $paymentMethodBuilderMock; + + protected function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->paymentMethodBuilderMock = $this->getMock( + '\Magento\Checkout\Service\V1\Data\PaymentMethodBuilder', [], [], '', false + ); + + $this->converter = $this->objectManager->getObject( + '\Magento\Checkout\Service\V1\Data\PaymentMethod\Converter', + [ + 'builder' => $this->paymentMethodBuilderMock, + ] + ); + } + + public function testConvertQuotePaymentObjectToPaymentDataObject() + { + $methodMock = $this->getMock('\Magento\Payment\Model\Method\AbstractMethod', [], [], '', false); + $methodMock->expects($this->once())->method('getCode')->will($this->returnValue('paymentCode')); + $methodMock->expects($this->once())->method('getTitle')->will($this->returnValue('paymentTitle')); + + $data = [ + PaymentMethod::TITLE => 'paymentTitle', + PaymentMethod::CODE => 'paymentCode' + ]; + + $this->paymentMethodBuilderMock->expects($this->once()) + ->method('populateWithArray') + ->with($data) + ->will($this->returnSelf()); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\PaymentMethod', [], [], '', false); + + $this->paymentMethodBuilderMock->expects($this->once()) + ->method('create') + ->will($this->returnValue($paymentMethodMock)); + + $this->assertEquals($paymentMethodMock, $this->converter->toDataObject($methodMock)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/PaymentMethod/ReadServiceTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/PaymentMethod/ReadServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..15278615af603fb6a62a735e964eb369ae251310 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/PaymentMethod/ReadServiceTest.php @@ -0,0 +1,179 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\PaymentMethod; + +class ReadServiceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ReadService + */ + protected $service; + + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteLoaderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $paymentMethodConverterMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteMethodConverterMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $methodListMock; + + protected function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->quoteLoaderMock = $this->getMock('\Magento\Checkout\Service\V1\QuoteLoader', [], [], '', false); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->quoteMethodConverterMock = $this->getMock( + '\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Converter', [], [], '', false + ); + $this->paymentMethodConverterMock = $this->getMock( + '\Magento\Checkout\Service\V1\Data\PaymentMethod\Converter', [], [], '', false + ); + $this->methodListMock = $this->getMock('\Magento\Payment\Model\MethodList', [], [], '', false); + + $this->service = $this->objectManager->getObject( + '\Magento\Checkout\Service\V1\PaymentMethod\ReadService', + [ + 'quoteLoader' => $this->quoteLoaderMock, + 'storeManager' => $this->storeManagerMock, + 'quoteMethodConverter' => $this->quoteMethodConverterMock, + 'paymentMethodConverter' => $this->paymentMethodConverterMock, + 'methodList' => $this->methodListMock, + ] + ); + } + + public function testGetPaymentIfPaymentMethodNotSet() + { + $cartId = 11; + $storeId = 12; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $quoteMock = $this->getMock('\Magento\Sales\Model\Quote', [], [], '', false); + $paymentMock = $this->getMock('\Magento\Sales\Model\Quote\Payment', [], [], '', false); + $quoteMock->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock)); + $paymentMock->expects($this->once())->method('getId')->will($this->returnValue(null)); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $this->assertNull($this->service->getPayment($cartId)); + } + + public function testGetPaymentSuccess() + { + $cartId = 11; + $storeId = 12; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $paymentMock = $this->getMock('\Magento\Sales\Model\Quote\Payment', [], [], '', false); + $paymentMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + + $quoteMock = $this->getMock('\Magento\Sales\Model\Quote', [], [], '', false); + $quoteMock->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock)); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod', [], [], '', false); + + $this->quoteMethodConverterMock->expects($this->once()) + ->method('toDataObject') + ->with($paymentMock) + ->will($this->returnValue($paymentMethodMock)); + + $this->assertEquals($paymentMethodMock, $this->service->getPayment($cartId)); + } + + public function testGetList() + { + $cartId = 10; + $storeId = 12; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $quoteMock = $this->getMock('\Magento\Sales\Model\Quote', [], [], '', false); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $methodList = [ + $this->getMock('\Magento\Payment\Model\MethodInterface'), + $this->getMock('\Magento\Payment\Model\MethodInterface') + ]; + + $this->methodListMock->expects($this->once()) + ->method('getAvailableMethods') + ->with($quoteMock) + ->will($this->returnValue($methodList)); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\PaymentMethod', [], [], '', false); + + $this->paymentMethodConverterMock->expects($this->atLeastOnce()) + ->method('toDataObject') + ->will($this->returnValue($paymentMethodMock)); + + $expectedResult = [ + $this->getMock('\Magento\Checkout\Service\V1\Data\PaymentMethod', [], [], '', false), + $this->getMock('\Magento\Checkout\Service\V1\Data\PaymentMethod', [], [], '', false) + ]; + + $this->assertEquals($expectedResult, $this->service->getList($cartId)); + } +} + \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/PaymentMethod/WriteServiceTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/PaymentMethod/WriteServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..86888e9abc7c5f91e2287d025dd975d1e7ce922c --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/PaymentMethod/WriteServiceTest.php @@ -0,0 +1,353 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\PaymentMethod; + +class WriteServiceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var WriteService + */ + protected $service; + + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteLoaderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $paymentMethodBuilderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $methodListMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $validatorMock; + + protected function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->quoteLoaderMock = $this->getMock('\Magento\Checkout\Service\V1\QuoteLoader', [], [], '', false); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->paymentMethodBuilderMock = $this->getMock( + '\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Builder', [], [], '', false + ); + $this->methodListMock = $this->getMock('\Magento\Payment\Model\MethodList', [], [], '', false); + $this->validatorMock = $this->getMock('\Magento\Payment\Model\Checks\ZeroTotal', [], [], '', false); + + $this->service = $this->objectManager->getObject( + '\Magento\Checkout\Service\V1\PaymentMethod\WriteService', + [ + 'quoteLoader' => $this->quoteLoaderMock, + 'storeManager' => $this->storeManagerMock, + 'paymentMethodBuilder' => $this->paymentMethodBuilderMock, + 'methodList' => $this->methodListMock, + 'zeroTotalValidator' => $this->validatorMock, + ] + ); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Billing address is not set + */ + public function testSetVirtualQuotePaymentThrowsExceptionIfBillingAdressNotSet() + { + $cartId = 11; + $storeId = 12; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $paymentsCollectionMock = $this->getMock( + '\Magento\Eav\Model\Entity\Collection\AbstractCollection', [], [], '', false + ); + + $quoteMock = $this->getMock('\Magento\Sales\Model\Quote', [], [], '', false); + $quoteMock->expects($this->any()) + ->method('getPaymentsCollection') + ->will($this->returnValue($paymentsCollectionMock)); + $quoteMock->expects($this->any())->method('isVirtual')->will($this->returnValue(true)); + + $billingAddressMock = $this->getMock('\Magento\Sales\Model\Quote\Address', [], [], '', false); + $quoteMock->expects($this->any())->method('getBillingAddress')->will($this->returnValue($billingAddressMock)); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod', [], [], '', false); + + $this->service->set($paymentMethodMock, $cartId); + } + + public function testSetVirtualQuotePaymentSuccess() + { + $cartId = 11; + $storeId = 12; + $paymentId = 13; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $paymentsCollectionMock = $this->getMock( + '\Magento\Eav\Model\Entity\Collection\AbstractCollection', [], [], '', false + ); + + $quoteMock = $this->getMock( + '\Magento\Sales\Model\Quote', + [ + 'setTotalsCollectedFlag', '__wakeup', 'getPaymentsCollection', 'getPayment', + 'getItemsCollection', 'isVirtual', 'getBillingAddress', 'collectTotals' + ], [], '', false + ); + $quoteMock->expects($this->any()) + ->method('getPaymentsCollection') + ->will($this->returnValue($paymentsCollectionMock)); + $quoteMock->expects($this->any())->method('isVirtual')->will($this->returnValue(true)); + + $billingAddressMock = + $this->getMock('\Magento\Sales\Model\Quote\Address', ['getCountryId', '__wakeup'], [], '', false); + $billingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(1)); + $quoteMock->expects($this->any())->method('getBillingAddress')->will($this->returnValue($billingAddressMock)); + + $quoteMock->expects($this->once())->method('setTotalsCollectedFlag')->will($this->returnSelf()); + $quoteMock->expects($this->once())->method('collectTotals')->will($this->returnSelf()); + + $paymentMock = $this->getMock('Magento\Sales\Model\Quote\Payment', [], [], '', false); + $paymentMock->expects($this->once())->method('getId')->will($this->returnValue($paymentId)); + + $methodMock = $this->getMockForAbstractClass( + '\Magento\Payment\Model\Method\AbstractMethod', [], '', false, false + ); + + $paymentMock->expects($this->once())->method('getMethodInstance')->will($this->returnValue($methodMock)); + + $quoteMock->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock)); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod', [], [], '', false); + $this->validatorMock->expects($this->once())->method('isApplicable') + ->with($methodMock, $quoteMock)->will($this->returnValue(true)); + + $this->paymentMethodBuilderMock->expects($this->once()) + ->method('build') + ->with($paymentMethodMock, $quoteMock) + ->will($this->returnValue($paymentMock)); + + $this->assertEquals($paymentId, $this->service->set($paymentMethodMock, $cartId)); + } + + /** + * @expectedException \Magento\Framework\Exception\State\InvalidTransitionException + * @expectedExceptionMessage The requested Payment Method is not available. + */ + public function testSetVirtualQuotePaymentFail() + { + $cartId = 11; + $storeId = 12; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $paymentsCollectionMock = $this->getMock( + '\Magento\Eav\Model\Entity\Collection\AbstractCollection', [], [], '', false + ); + + $quoteMock = $this->getMock( + '\Magento\Sales\Model\Quote', + [ + 'setTotalsCollectedFlag', '__wakeup', 'getPaymentsCollection', 'getPayment', + 'getItemsCollection', 'isVirtual', 'getBillingAddress', 'collectTotals' + ], [], '', false + ); + $quoteMock->expects($this->any()) + ->method('getPaymentsCollection') + ->will($this->returnValue($paymentsCollectionMock)); + $quoteMock->expects($this->any())->method('isVirtual')->will($this->returnValue(true)); + + $billingAddressMock = + $this->getMock('\Magento\Sales\Model\Quote\Address', ['getCountryId', '__wakeup'], [], '', false); + $billingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(1)); + $quoteMock->expects($this->any())->method('getBillingAddress')->will($this->returnValue($billingAddressMock)); + + $quoteMock->expects($this->never())->method('setTotalsCollectedFlag'); + $quoteMock->expects($this->never())->method('collectTotals'); + + $paymentMock = $this->getMock('Magento\Sales\Model\Quote\Payment', [], [], '', false); + $paymentMock->expects($this->never())->method('getId'); + + $methodMock = $this->getMockForAbstractClass( + '\Magento\Payment\Model\Method\AbstractMethod', [], '', false, false + ); + + + $paymentMock->expects($this->once())->method('getMethodInstance')->will($this->returnValue($methodMock)); + + $quoteMock->expects($this->never())->method('getPayment'); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod', [], [], '', false); + $this->validatorMock->expects($this->once())->method('isApplicable') + ->with($methodMock, $quoteMock)->will($this->returnValue(false)); + + $this->paymentMethodBuilderMock->expects($this->once()) + ->method('build') + ->with($paymentMethodMock, $quoteMock) + ->will($this->returnValue($paymentMock)); + + $this->service->set($paymentMethodMock, $cartId); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Shipping address is not set + */ + public function testSetNotVirtualQuotePaymentThrowsExceptionIfShippingAddressNotSet() + { + $cartId = 11; + $storeId = 12; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $quoteMock = $this->getMock( + '\Magento\Sales\Model\Quote', + ['__wakeup', 'getPaymentsCollection', 'isVirtual', 'getShippingAddress'], [], '', false + ); + + $paymentsCollectionMock = $this->getMock( + '\Magento\Eav\Model\Entity\Collection\AbstractCollection', [], [], '', false + ); + + $quoteMock->expects($this->any()) + ->method('getPaymentsCollection') + ->will($this->returnValue($paymentsCollectionMock)); + $quoteMock->expects($this->any())->method('isVirtual')->will($this->returnValue(false)); + $quoteMock->expects($this->any()) + ->method('getShippingAddress') + ->will($this->returnValue($this->getMock('\Magento\Sales\Model\Quote\Address', [], [], '', false))); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod', [], [], '', false); + $paymentMock = $this->getMock('Magento\Sales\Model\Quote\Payment', [], [], '', false); + + $this->paymentMethodBuilderMock->expects($this->once()) + ->method('build') + ->with($paymentMethodMock, $quoteMock) + ->will($this->returnValue($paymentMock)); + + $this->service->set($paymentMethodMock, $cartId); + } + + public function testSetNotVirtualQuotePaymentSuccess() + { + $cartId = 11; + $storeId = 12; + $paymentId = 13; + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock)); + + $paymentsCollectionMock = $this->getMock( + '\Magento\Eav\Model\Entity\Collection\AbstractCollection', [], [], '', false + ); + + $quoteMock = $this->getMock( + '\Magento\Sales\Model\Quote', + [ + 'setTotalsCollectedFlag', '__wakeup', 'getPaymentsCollection', 'getPayment', + 'getItemsCollection', 'isVirtual', 'getShippingAddress', 'collectTotals' + ], [], '', false + ); + $quoteMock->expects($this->any()) + ->method('getPaymentsCollection') + ->will($this->returnValue($paymentsCollectionMock)); + $quoteMock->expects($this->any())->method('isVirtual')->will($this->returnValue(false)); + + $shippingAddressMock = + $this->getMock('\Magento\Sales\Model\Quote\Address', ['getCountryId', '__wakeup'], [], '', false); + $shippingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(1)); + $quoteMock->expects($this->any())->method('getShippingAddress')->will($this->returnValue($shippingAddressMock)); + + $quoteMock->expects($this->once())->method('setTotalsCollectedFlag')->will($this->returnSelf()); + $quoteMock->expects($this->once())->method('collectTotals')->will($this->returnSelf()); + + $paymentMock = $this->getMock('Magento\Sales\Model\Quote\Payment', [], [], '', false); + $paymentMock->expects($this->once())->method('getId')->will($this->returnValue($paymentId)); + + $methodMock = $this->getMockForAbstractClass( + '\Magento\Payment\Model\Method\AbstractMethod', [], '', false, false + ); + $paymentMock->expects($this->once())->method('getMethodInstance')->will($this->returnValue($methodMock)); + $this->validatorMock->expects($this->once())->method('isApplicable') + ->with($methodMock, $quoteMock)->will($this->returnValue(true)); + + $quoteMock->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock)); + + $this->quoteLoaderMock->expects($this->once()) + ->method('load') + ->with($cartId, $storeId) + ->will($this->returnValue($quoteMock)); + + $paymentMethodMock = $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\PaymentMethod', [], [], '', false); + + $this->paymentMethodBuilderMock->expects($this->once()) + ->method('build') + ->with($paymentMethodMock, $quoteMock) + ->will($this->returnValue($paymentMock)); + + $this->assertEquals($paymentId, $this->service->set($paymentMethodMock, $cartId)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/QuoteLoaderTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/QuoteLoaderTest.php index 68e2bd150cd71a33dc777a045206f29e85949a02..50e3eb8b9f7177ed01fc66c227f8e6aa1db39791 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/QuoteLoaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/QuoteLoaderTest.php @@ -46,7 +46,13 @@ class QuoteLoaderTest extends \PHPUnit_Framework_TestCase { $this->quoteFactoryMock = $this->getMock('\Magento\Sales\Model\QuoteFactory', ['create'], [], '', false); $this->quoteMock = - $this->getMock('\Magento\Sales\Model\Quote', ['setStoreId', 'load', 'getId', '__wakeup'], [], '', false); + $this->getMock( + '\Magento\Sales\Model\Quote', + ['setStoreId', 'load', 'getId', '__wakeup', 'getIsActive'], + [], + '', + false + ); $this->quoteLoader = new QuoteLoader($this->quoteFactoryMock); } @@ -59,6 +65,7 @@ class QuoteLoaderTest extends \PHPUnit_Framework_TestCase ->method('setStoreId')->with($storeId)->will($this->returnValue($this->quoteMock)); $this->quoteMock->expects($this->once())->method('load')->with($cartId); $this->quoteMock->expects($this->once())->method('getId')->will($this->returnValue(33)); + $this->quoteMock->expects($this->once())->method('getIsActive')->will($this->returnValue(true)); $this->assertEquals($this->quoteMock, $this->quoteLoader->load($cartId, $storeId)); } diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/ShippingMethod/ReadServiceTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/ShippingMethod/ReadServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ebcf79294b9cba95016034493f9c5ab643eeb87a --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/ShippingMethod/ReadServiceTest.php @@ -0,0 +1,304 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\ShippingMethod; + +use \Magento\Checkout\Service\V1\Data\Cart\ShippingMethod; +use \Magento\TestFramework\Helper\ObjectManager; + +class ReadServiceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ReadService + */ + protected $service; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteLoaderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $shippingAddressMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $methodBuilderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $converterMock; + + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + protected function setUp() + { + $this->objectManager = new ObjectManager($this); + $this->quoteLoaderMock = $this->getMock('\Magento\Checkout\Service\V1\QuoteLoader', [], [], '', false); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->methodBuilderMock = + $this->getMock('\Magento\Checkout\Service\V1\Data\Cart\ShippingMethodBuilder', [], [], '', false); + $this->storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $this->quoteMock = $this->getMock( + '\Magento\Sales\Model\Quote', + [ + 'getShippingAddress', + 'isVirtual', + 'getItemsCount', + 'getQuoteCurrencyCode', + '__wakeup', + ], + [], + '', + false + ); + $this->shippingAddressMock = $this->getMock( + '\Magento\Sales\Model\Quote\Address', + [ + 'getCountryId', + 'getShippingMethod', + 'getShippingDescription', + 'getShippingAmount', + 'getBaseShippingAmount', + 'getGroupedAllShippingRates', + 'collectShippingRates', + '__wakeup', + ], + [], + '', + false + ); + $this->converterMock = $this->getMock( + '\Magento\Checkout\Service\V1\Data\Cart\ShippingMethodConverter', + [], + [], + '', + false + ); + + $this->service = $this->objectManager->getObject( + '\Magento\Checkout\Service\V1\ShippingMethod\ReadService', + [ + 'quoteLoader' => $this->quoteLoaderMock, + 'storeManager' => $this->storeManagerMock, + 'methodBuilder' => $this->methodBuilderMock, + 'converter' => $this->converterMock, + ] + ); + } + + /** + * @expectedException \Magento\Framework\Exception\StateException + * @expectedExceptionMessage Shipping address not set. + */ + public function testGetMethodWhenShippingAddressIsNotSet() + { + $storeId = 12; + $cartId = 666; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(null)); + + $this->assertNull($this->service->getMethod($cartId)); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Line "WrongShippingMethod" doesn't contain delimiter _ + */ + public function testGetMethodWhenShippingMethodIsInvalid() + { + $storeId = 12; + $cartId = 884; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(34)); + $this->shippingAddressMock->expects($this->exactly(2)) + ->method('getShippingMethod') + ->will($this->returnValue('WrongShippingMethod')); + + $this->assertNull($this->service->getMethod($cartId)); + } + + public function testGetMethod() + { + $storeId = 12; + $cartId = 666; + $countryId = 1; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->any()) + ->method('getCountryId')->will($this->returnValue($countryId)); + $this->shippingAddressMock->expects($this->any()) + ->method('getShippingMethod')->will($this->returnValue('one_two')); + $this->shippingAddressMock->expects($this->once()) + ->method('getShippingDescription')->will($this->returnValue('carrier - method')); + $this->shippingAddressMock->expects($this->once()) + ->method('getShippingAmount')->will($this->returnValue(123.56)); + $this->shippingAddressMock->expects($this->once()) + ->method('getBaseShippingAmount')->will($this->returnValue(100.06)); + $output = [ + ShippingMethod::CARRIER_CODE => 'one', + ShippingMethod::METHOD_CODE => 'two', + ShippingMethod::CARRIER_TITLE => 'carrier', + ShippingMethod::METHOD_TITLE => 'method', + ShippingMethod::SHIPPING_AMOUNT => 123.56, + ShippingMethod::BASE_SHIPPING_AMOUNT => 100.06, + ShippingMethod::AVAILABLE => true, + ]; + $this->methodBuilderMock->expects($this->once()) + ->method('populateWithArray')->with($output)->will($this->returnValue($this->methodBuilderMock)); + $this->methodBuilderMock->expects($this->once())->method('create'); + + $this->service->getMethod($cartId); + } + + public function testGetListForVirtualCart() + { + $storeId = 12; + $cartId = 834; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once()) + ->method('isVirtual')->will($this->returnValue(true)); + + $this->assertEquals([], $this->service->getList($cartId)); + } + + public function testGetListForEmptyCart() + { + $storeId = 12; + $cartId = 834; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once()) + ->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getItemsCount')->will($this->returnValue(0)); + + $this->assertEquals([], $this->service->getList($cartId)); + } + + /** + * @expectedException \Magento\Framework\Exception\StateException + * @expectedExceptionMessage Shipping address not set. + */ + public function testGetListWhenShippingAddressIsNotSet() + { + $storeId = 12; + $cartId = 834; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once()) + ->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getItemsCount')->will($this->returnValue(3)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(null)); + + $this->service->getList($cartId); + } + + public function testGetList() + { + $storeId = 12; + $cartId = 834; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once()) + ->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getItemsCount')->will($this->returnValue(3)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(345)); + $this->shippingAddressMock->expects($this->once())->method('collectShippingRates'); + $shippingRateMock = $this->getMock('\Magento\Sales\Model\Quote\Address\Rate', [], [], '', false); + $this->shippingAddressMock->expects($this->once()) + ->method('getGroupedAllShippingRates') + ->will($this->returnValue([[$shippingRateMock]])); + + $currencyCode = 'EUR'; + $this->quoteMock->expects($this->once()) + ->method('getQuoteCurrencyCode') + ->will($this->returnValue($currencyCode)); + + $this->converterMock->expects($this->once()) + ->method('modelToDataObject') + ->with($shippingRateMock, $currencyCode) + ->will($this->returnValue('RateValue')); + $this->assertEquals(['RateValue'], $this->service->getList($cartId)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/ShippingMethod/WriteServiceTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/ShippingMethod/WriteServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..26e8390fd82d88db75a642be21f516fc5b4b2d6f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/ShippingMethod/WriteServiceTest.php @@ -0,0 +1,364 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Checkout\Service\V1\ShippingMethod; + +class WriteServiceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var WriteService + */ + protected $service; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $addressFactoryMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteLoaderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $shippingAddressMock; + + protected function setUp() + { + $objectManager =new \Magento\TestFramework\Helper\ObjectManager($this); + $this->addressFactoryMock = $this->getMock('\Magento\Sales\Model\Quote\AddressFactory', [], [], '', false); + $this->quoteLoaderMock = $this->getMock('\Magento\Checkout\Service\V1\QuoteLoader', [], [], '', false); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->quoteMock = $this->getMock( + '\Magento\Sales\Model\Quote', + [ + 'getItemsCount', + 'isVirtual', + 'getShippingAddress', + 'getBillingAddress', + 'collectTotals', + 'save', + '__wakeup' + ], + [], + '', + false + ); + $this->storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $this->shippingAddressMock = $this->getMock( + '\Magento\Sales\Model\Quote\Address', + [ + 'setShippingMethod', + 'requestShippingRates', + 'save', + 'getCountryId', + '__wakeup' + ], + [], + '', + false + ); + + $this->service = $objectManager->getObject( + 'Magento\Checkout\Service\V1\ShippingMethod\WriteService', + [ + 'addressFactory' => $this->addressFactoryMock, + 'quoteLoader' => $this->quoteLoaderMock, + 'storeManager' => $this->storeManagerMock + ] + ); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Shipping method is not applicable for empty cart + */ + public function testSetMethodWithInputException() + { + $cartId = 12; + $carrierCode = 34; + $methodCode = 56; + $storeId = 78; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(0)); + $this->quoteMock->expects($this->never())->method('isVirtual'); + + $this->service->setMethod($cartId, $carrierCode, $methodCode); + } + + /** + * @expectedException \Magento\Framework\Exception\NoSuchEntityException + * @expectedExceptionMessage Cart contains virtual product(s) only. Shipping method is not applicable. + */ + public function testSetMethodWithVirtualProduct() + { + $cartId = 12; + $carrierCode = 34; + $methodCode = 56; + $storeId = 78; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(1)); + $this->quoteMock->expects($this->once())->method('isVirtual')->will($this->returnValue(true)); + + $this->service->setMethod($cartId, $carrierCode, $methodCode); + } + + /** + * @expectedException \Magento\Framework\Exception\StateException + * @expectedExceptionMessage Shipping address is not set + */ + public function testSetMethodWithoutShippingAddress() + { + $cartId = 12; + $carrierCode = 34; + $methodCode = 56; + $storeId = 78; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(1)); + $this->quoteMock->expects($this->once())->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(null)); + + $this->service->setMethod($cartId, $carrierCode, $methodCode); + } + + /** + * @expectedException \Magento\Framework\Exception\StateException + * @expectedExceptionMessage Billing address is not set + */ + public function testSetMethodWithoutBillingAddress() + { + $cartId = 12; + $carrierCode = 34; + $methodCode = 56; + $storeId = 78; + $countryId = 1; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(1)); + $this->quoteMock->expects($this->once())->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->once()) + ->method('getCountryId')->will($this->returnValue($countryId)); + $billingAddressMock = $this->getMock( + '\Magento\Sales\Model\Quote\Address', + ['getCountryId', '__wakeup'], + [], + '', + false + ); + $this->quoteMock->expects($this->once()) + ->method('getBillingAddress')->will($this->returnValue($billingAddressMock)); + $billingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(null)); + + $this->service->setMethod($cartId, $carrierCode, $methodCode); + } + + /** + * @expectedException \Magento\Framework\Exception\NoSuchEntityException + * @expectedExceptionMessage Carrier with such method not found: 34, 56 + */ + public function testSetMethodWithNotFoundMethod() + { + $cartId = 12; + $carrierCode = 34; + $methodCode = 56; + $storeId = 78; + $countryId = 1; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(1)); + $this->quoteMock->expects($this->once())->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $billingAddressMock = $this->getMock( + '\Magento\Sales\Model\Quote\Address', + ['getCountryId', '__wakeup'], + [], + '', + false + ); + $this->quoteMock->expects($this->once()) + ->method('getBillingAddress')->will($this->returnValue($billingAddressMock)); + $billingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(23)); + $this->shippingAddressMock->expects($this->once()) + ->method('getCountryId')->will($this->returnValue($countryId)); + $this->shippingAddressMock->expects($this->once()) + ->method('setShippingMethod')->with($carrierCode . '_' . $methodCode); + $this->shippingAddressMock->expects($this->once()) + ->method('requestShippingRates')->will($this->returnValue(false)); + $this->shippingAddressMock->expects($this->never())->method('save'); + + $this->service->setMethod($cartId, $carrierCode, $methodCode); + } + + /** + * @expectedException \Magento\Framework\Exception\CouldNotSaveException + * @expectedExceptionMessage Cannot set shipping method. Custom Error + */ + public function testSetMethodWithCouldNotSaveException() + { + $cartId = 12; + $carrierCode = 34; + $methodCode = 56; + $storeId = 78; + $countryId = 1; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(1)); + $this->quoteMock->expects($this->once())->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->once()) + ->method('getCountryId')->will($this->returnValue($countryId)); + $billingAddressMock = $this->getMock( + '\Magento\Sales\Model\Quote\Address', + [ + 'getCountryId', + '__wakeup' + ], + [], + '', + false + ); + $this->quoteMock->expects($this->once()) + ->method('getBillingAddress')->will($this->returnValue($billingAddressMock)); + $billingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(23)); + $this->shippingAddressMock->expects($this->once()) + ->method('setShippingMethod')->with($carrierCode . '_' . $methodCode); + $this->shippingAddressMock->expects($this->once()) + ->method('requestShippingRates')->will($this->returnValue(true)); + $exception = new \Exception('Custom Error'); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnSelf()); + $this->quoteMock->expects($this->once())->method('save')->will($this->throwException($exception)); + + $this->service->setMethod($cartId, $carrierCode, $methodCode); + } + + /** + * @expectedException \Magento\Framework\Exception\StateException + * @expectedExceptionMessage Shipping address is not set + */ + public function testSetMethodWithoutAddress() + { + $cartId = 12; + $carrierCode = 34; + $methodCode = 56; + $storeId = 78; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(1)); + $this->quoteMock->expects($this->once())->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $this->shippingAddressMock->expects($this->once())->method('getCountryId'); + + $this->service->setMethod($cartId, $carrierCode, $methodCode); + } + + public function testSetMethod() + { + $cartId = 12; + $carrierCode = 34; + $methodCode = 56; + $storeId = 78; + $countryId = 1; + + $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock)); + $this->storeMock->expects($this->once())->method('getId')->will($this->returnValue($storeId)); + $this->quoteLoaderMock->expects($this->once()) + ->method('load')->with($cartId, $storeId)->will($this->returnValue($this->quoteMock)); + $this->quoteMock->expects($this->once())->method('getItemsCount')->will($this->returnValue(1)); + $this->quoteMock->expects($this->once())->method('isVirtual')->will($this->returnValue(false)); + $this->quoteMock->expects($this->once()) + ->method('getShippingAddress')->will($this->returnValue($this->shippingAddressMock)); + $billingAddressMock = $this->getMock( + '\Magento\Sales\Model\Quote\Address', + [ + 'getCountryId', + '__wakeup' + ], + [], + '', + false + ); + $this->quoteMock->expects($this->once()) + ->method('getBillingAddress')->will($this->returnValue($billingAddressMock)); + $billingAddressMock->expects($this->once())->method('getCountryId')->will($this->returnValue(23)); + $this->shippingAddressMock->expects($this->once()) + ->method('getCountryId')->will($this->returnValue($countryId)); + $this->shippingAddressMock->expects($this->once()) + ->method('setShippingMethod')->with($carrierCode . '_' . $methodCode); + $this->shippingAddressMock->expects($this->once()) + ->method('requestShippingRates')->will($this->returnValue(true)); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnSelf()); + $this->quoteMock->expects($this->once())->method('save'); + + $this->assertTrue($this->service->setMethod($cartId, $carrierCode, $methodCode)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CheckoutAgreements/Service/V1/Agreement/ReadServiceTest.php b/dev/tests/unit/testsuite/Magento/CheckoutAgreements/Service/V1/Agreement/ReadServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..acea4656774e9254ac5984b0210a3fc3fb9abc3b --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CheckoutAgreements/Service/V1/Agreement/ReadServiceTest.php @@ -0,0 +1,177 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\CheckoutAgreements\Service\V1\Agreement; + +use \Magento\TestFramework\Helper\ObjectManager; +use \Magento\Store\Model\ScopeInterface; + +class ReadServiceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ReadService + */ + private $service; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $factoryMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $agreementBuilderMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $storeManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $scopeConfigMock; + + /** + * @var ObjectManager + */ + private $objectManager; + + protected function setUp() + { + $this->objectManager = new ObjectManager($this); + + $this->factoryMock = $this->getMock( + 'Magento\CheckoutAgreements\Model\Resource\Agreement\CollectionFactory', + array('create'), + array(), + '', + false + ); + $this->agreementBuilderMock = $this->getMock( + 'Magento\CheckoutAgreements\Service\V1\Data\AgreementBuilder', + array(), + array(), + '', + false + ); + $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); + $this->scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); + $this->service = new ReadService( + $this->factoryMock, + $this->agreementBuilderMock, + $this->storeManagerMock, + $this->scopeConfigMock + ); + } + + public function testGetListReturnsEmptyListIfCheckoutAgreementsAreDisabledOnFrontend() + { + $this->scopeConfigMock->expects($this->once()) + ->method('isSetFlag') + ->with('checkout/options/enable_agreements', ScopeInterface::SCOPE_STORE, null) + ->will($this->returnValue(false)); + $this->factoryMock->expects($this->never())->method('create'); + $this->assertEmpty($this->service->getList()); + } + + public function testGetListReturnsTheListOfActiveCheckoutAgreements() + { + $this->scopeConfigMock->expects($this->once()) + ->method('isSetFlag') + ->with('checkout/options/enable_agreements', ScopeInterface::SCOPE_STORE, null) + ->will($this->returnValue(true)); + + $agreementData = array( + 'id' => 1, + 'name' => 'Checkout Agreement', + 'content' => 'Agreement content: <b>HTML</b>', + 'content_height' => '100px', + 'checkbox_text' => 'Checkout Agreement Checkbox Text', + 'active' => true, + 'html' => true, + ); + + $storeId = 1; + $storeMock = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); + $storeMock->expects($this->any())->method('getId')->will($this->returnValue($storeId)); + $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($storeMock)); + + $collectionMock = $this->objectManager->getCollectionMock( + 'Magento\CheckoutAgreements\Model\Resource\Agreement\Collection', + array($this->getAgreementMock($agreementData)) + ); + $this->factoryMock->expects($this->once())->method('create')->will($this->returnValue($collectionMock)); + $collectionMock->expects($this->once())->method('addStoreFilter')->with($storeId); + $collectionMock->expects($this->once())->method('addFieldToFilter')->with('is_active', 1); + + $agreementDataObject = $this->getMock( + 'Magento\CheckoutAgreements\Service\V1\Data\Agreement', + array(), + array(), + '', + false + ); + $this->agreementBuilderMock->expects($this->once())->method('populateWithArray')->with($agreementData); + $this->agreementBuilderMock->expects($this->once())->method('create') + ->will($this->returnValue($agreementDataObject)); + + $this->assertEquals(array($agreementDataObject), $this->service->getList()); + } + + /** + * Retrieve agreement mock based on given data + * + * @param array $agreementData + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getAgreementMock(array $agreementData) + { + $agreementMock = $this->getMock( + 'Magento\CheckoutAgreements\Model\Agreement', + array( + 'getId', 'getName', 'getContent', 'getContentHeight', 'getCheckboxText', 'getIsActive', 'getIsHtml', + '__wakeup', '__sleep', + ), + array(), + '', + false + ); + $agreementMock->expects($this->any())->method('getId') + ->will($this->returnValue($agreementData['id'])); + $agreementMock->expects($this->any())->method('getName') + ->will($this->returnValue($agreementData['name'])); + $agreementMock->expects($this->any())->method('getContent') + ->will($this->returnValue($agreementData['content'])); + $agreementMock->expects($this->any())->method('getContentHeight') + ->will($this->returnValue($agreementData['content_height'])); + $agreementMock->expects($this->any())->method('getCheckboxText') + ->will($this->returnValue($agreementData['checkbox_text'])); + $agreementMock->expects($this->any())->method('getIsActive') + ->will($this->returnValue($agreementData['active'])); + $agreementMock->expects($this->any())->method('getIsHtml') + ->will($this->returnValue($agreementData['html'])); + return $agreementMock; + } +} diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Resource/Product/Type/ConfigurableTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Resource/Product/Type/ConfigurableTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c13f1bfd630ae8292623d7e8ef5e0af66f5e94bc --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Resource/Product/Type/ConfigurableTest.php @@ -0,0 +1,98 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\ConfigurableProduct\Model\Resource\Product\Type; + +use \Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; + +class ConfigurableTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable + */ + protected $configurable; + + /** + * @var ObjectManagerHelper + */ + protected $objectManagerHelper; + + /** + * @var \Magento\Framework\App\Resource|\PHPUnit_Framework_MockObject_MockObject + */ + protected $resource; + + /** + * @var \Magento\Catalog\Model\Resource\Product\Relation|\PHPUnit_Framework_MockObject_MockObject + */ + protected $relation; + + protected function setUp() + { + $adapter = $this->getMockBuilder('\Magento\Framework\DB\Adapter\AdapterInterface')->getMock(); + + $this->resource = $this->getMock('Magento\Framework\App\Resource', [], [], '', false); + $this->resource->expects($this->any())->method('getConnection')->will($this->returnValue($adapter)); + $this->relation = $this->getMock('Magento\Catalog\Model\Resource\Product\Relation', [], [], '', false); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->configurable = $this->objectManagerHelper->getObject( + 'Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable', + [ + 'resource' => $this->resource, + 'catalogProductRelation' => $this->relation + ] + ); + } + + public function testSaveProducts() + { + $mainProduct = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getIsDuplicate', '__sleep', '__wakeup', 'getTypeInstance', '_getWriteAdapter']) + ->disableOriginalConstructor() + ->getMock(); + $mainProduct->expects($this->once())->method('getIsDuplicate')->will($this->returnValue(false)); + + $typeInstance = $this->getMockBuilder('Magento\ConfigurableProduct\Model\Product\Type\Configurable') + ->disableOriginalConstructor()->getMock(); + $typeInstance->expects($this->once())->method('getUsedProductIds')->will($this->returnValue(array(1))); + + $mainProduct->expects($this->once())->method('getTypeInstance')->will($this->returnValue($typeInstance)); + + $this->configurable->saveProducts($mainProduct, array(1,2,3)); + } + + public function testSaveProductsForDuplicate() + { + $mainProduct = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getIsDuplicate', '__sleep', '__wakeup', 'getTypeInstance', '_getWriteAdapter']) + ->disableOriginalConstructor() + ->getMock(); + + $mainProduct->expects($this->once())->method('getIsDuplicate')->will($this->returnValue(true)); + $mainProduct->expects($this->never())->method('getTypeInstance')->will($this->returnSelf()); + + $this->configurable->saveProducts($mainProduct, array(1,2,3)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/XsdTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/XsdTest.php index 146f1611e4cb44d78e3668ab50faeffc8886e78d..56a3baa6c73ae2cad8e29a3ffdcd941d8af4df3d 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/XsdTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/XsdTest.php @@ -38,7 +38,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_xsdSchema = BP . '/app/code/Magento/Core/etc/layout_single.xsd'; + $this->_xsdSchema = BP . '/app/code/Magento/Core/etc/page.xsd'; $this->_xsdValidator = new \Magento\TestFramework\Utility\XsdValidator(); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/arguments.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/arguments.xml index 9d461813625a62d9f919f850ea75102e30c1d7ad..f16de148fa1830c324b356fcf6025e26d0ca1e6b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/arguments.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/arguments.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Core/etc/layout_single.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Core/etc/page.xsd"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="testHelperWithParams" xsi:type="helper" helper="Magento\Core\Model\Layout\Argument\Handler\TestHelper::testMethod"> @@ -66,4 +66,4 @@ <argument name="string" xsi:type="string">string</argument> </action> </block> -</layout> +</page> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/invalidLayoutArgumentsXmlArray.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/invalidLayoutArgumentsXmlArray.php index f5831deb7019183cc967ea30333bc597c33e5086..ba61bbc1607beef64c6f7dd037be7606c62a380d 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/invalidLayoutArgumentsXmlArray.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/invalidLayoutArgumentsXmlArray.php @@ -23,25 +23,25 @@ */ return array( 'options without model attribute' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="options" /> </arguments> </block> - </layout>', + </page>', array("Element 'argument': The attribute 'model' is required but missing.")), 'url without path attribute' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="url" /> </arguments> </block> - </layout>', + </page>', array("Element 'argument': The attribute 'path' is required but missing.")), 'url without param name' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="url" path="module/controller/action"> @@ -49,10 +49,10 @@ return array( </argument> </arguments> </block> - </layout>', + </page>', array("Element 'param': The attribute 'name' is required but missing.")), 'url with forbidden param attribute' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="url" path="module/controller/action"> @@ -60,10 +60,10 @@ return array( </argument> </arguments> </block> - </layout>', + </page>', array("Element 'param', attribute 'forbidden': The attribute 'forbidden' is not allowed.")), 'url with forbidden param sub-element' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="url" path="module/controller/action"> @@ -71,19 +71,19 @@ return array( </argument> </arguments> </block> - </layout>', + </page>', array("Element 'forbidden': This element is not expected.")), 'helper without helper attribute' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="helper" /> </arguments> </block> - </layout>', + </page>', array("Element 'argument': The attribute 'helper' is required but missing.")), 'helper without param name' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="helper" @@ -92,10 +92,10 @@ return array( </argument> </arguments> </block> - </layout>', + </page>', array("Element 'param': The attribute 'name' is required but missing.")), 'helper with forbidden param attribute' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="helper" @@ -104,10 +104,10 @@ return array( </argument> </arguments> </block> - </layout>', + </page>', array("Element 'param', attribute 'forbidden': The attribute 'forbidden' is not allowed.")), 'helper with forbidden param sub-element' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <arguments> <argument name="argumentName" xsi:type="helper" @@ -116,17 +116,17 @@ return array( </argument> </arguments> </block> - </layout>', + </page>', array("Element 'forbidden': This element is not expected.")), 'action with doubled arguments' => array( - '<?xml version="1.0"?><layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Test\Block" name="test.block"> <action method="testAction"> <argument name="string" xsi:type="string">string1</argument> <argument name="string" xsi:type="string">string2</argument> </action> </block> - </layout>', + </page>', array( "Element 'argument': Duplicate key-sequence ['string'] in key identity-constraint 'actionArgumentName'." )), diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_default.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_default.xml index 72b04db7c2eb3dfd96773987b166091d3304733b..bd923d6452160b8aba5bf5cce77b733fc2b5423b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_default.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_default.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout/> +<page/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_layered.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_layered.xml index 72b04db7c2eb3dfd96773987b166091d3304733b..bd923d6452160b8aba5bf5cce77b733fc2b5423b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_layered.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_layered.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout/> +<page/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view.xml index 4b7b0d682d0303c40aae5cfe41964df22b367d89..a922cf3cc7e27fd2e408f9be32d159eaafedfb6e 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout> +<page> <container name="product.info.extrahint" as="extrahint" label="Product View Extra Hint"/> -</layout> +</page> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml index 6f5b12576c4e75fa520ab8455fa75e92df7d10f2..0949af576b40385370aa1d452eaf21721319f180 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout> +<page> <container name="product.info.configurable.extra" as="product_type_data_extra" label="Configurable Product Extra Info"/> -</layout> +</page> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_simple.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_simple.xml index 72b04db7c2eb3dfd96773987b166091d3304733b..bd923d6452160b8aba5bf5cce77b733fc2b5423b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_simple.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_simple.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout/> +<page/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/checkout_onepage_index.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/checkout_onepage_index.xml index 72b04db7c2eb3dfd96773987b166091d3304733b..bd923d6452160b8aba5bf5cce77b733fc2b5423b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/checkout_onepage_index.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/checkout_onepage_index.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout/> +<page/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/customer_account.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/customer_account.xml index 9036814fa19a63b13d3625f679f9f33c0529b503..58963265a732b7d8a832faa2b14856a7a8689cd8 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/customer_account.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/customer_account.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Customer My Account (All Pages)" design_abstraction="custom"/> +<page label="Customer My Account (All Pages)" design_abstraction="custom"/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/default.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/default.xml index f1c2660dcd4f83c884134d7e39f212bbfa290a63..aeab28fc4eaa7cb54cf1bbf848429b91357e8f1e 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/default.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/default.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout> +<page> <container name="content" as="content" label="Main Content Area"/> -</layout> +</page> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/file_wrong.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/file_wrong.xml index 32dbdf934f42bdd7af94227b8e61efa24a3909ed..b549b49c90db315fc27823a037a69aed920394ed 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/file_wrong.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/file_wrong.xml @@ -23,5 +23,5 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout> +<page> <container name="content" as="content" label="Main Content Area"/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_one.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_one.xml index f608276e38f4382bb7b82f7835d448174ff1680d..c41956e32ddde14dfe4ab4813c4510e93b23a2ae 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_one.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_one.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout> +<page> <block class="Magento\Framework\View\Element\Template" template="fixture_template_one.phtml"/> -</layout> +</page> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_two.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_two.xml index 00c056242b1fd0524822ab44d620bff2017804f0..972f0ff852d3852577bc12b45516a785dba37d27 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_two.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_two.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout> +<page> <block class="Magento\Framework\View\Element\Template" template="fixture_template_two.phtml"/> -</layout> +</page> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/not_a_page_type.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/not_a_page_type.xml index 03a72182cf63f3616da9b0ae15feaba3e967929e..ef69a5cfb4b9d5545456de6c7d176cebe001ca71 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/not_a_page_type.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/not_a_page_type.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Handle that Is Not a Page Type"/> +<page label="Handle that Is Not a Page Type"/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/page_empty.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/page_empty.xml index e29662dde55efaa03ff38216cbdc9acc164b28fd..6a1b1365968ae149c89f7aab01b55498f83b784e 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/page_empty.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/page_empty.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="All Empty Layout Pages" design_abstraction="page_layout"/> +<page label="All Empty Layout Pages" design_abstraction="page_layout"/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/print.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/print.xml index 72b04db7c2eb3dfd96773987b166091d3304733b..bd923d6452160b8aba5bf5cce77b733fc2b5423b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/print.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout/> +<page/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_guest_print.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_guest_print.xml index 72b04db7c2eb3dfd96773987b166091d3304733b..bd923d6452160b8aba5bf5cce77b733fc2b5423b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_guest_print.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_guest_print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout/> +<page/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_order_print.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_order_print.xml index 72b04db7c2eb3dfd96773987b166091d3304733b..bd923d6452160b8aba5bf5cce77b733fc2b5423b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_order_print.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_order_print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout/> +<page/> diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/DobTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/DobTest.php index 1e6ad5fbd71fa76ceb5a21f42e741d42228c9d31..a27dad2bfbca585009b4b3b6250d02c42034da5f 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/DobTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/DobTest.php @@ -110,7 +110,7 @@ class DobTest extends \PHPUnit_Framework_TestCase $this->_metadataService->expects( $this->any() )->method( - 'getCustomerAttributeMetadata' + 'getAttributeMetadata' )->will( $this->returnValue($this->_attribute) ); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/GenderTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/GenderTest.php index 7e0535a694526e6f1cad106825fc68cdd8b02de4..8d583c2beda4eda6f4b0c01ab1d577343b170258 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/GenderTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/GenderTest.php @@ -66,7 +66,7 @@ class GenderTest extends \PHPUnit_Framework_TestCase $this->_attributeMetadata->expects( $this->any() )->method( - 'getCustomerAttributeMetadata' + 'getAttributeMetadata' )->with( self::GENDER_ATTRIBUTE_CODE )->will( diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/NameTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/NameTest.php index 9d540707bd9c91666ab02c7c0ae96f3c00b81e0a..7fea219611e832ca34e57021bec7a7f8fa751bf2 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/NameTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/NameTest.php @@ -23,12 +23,11 @@ */ namespace Magento\Customer\Block\Widget; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface; +use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; use Magento\Customer\Service\V1\Data\Customer; -use Magento\Customer\Service\V1\Data\CustomerBuilder; -use Magento\Framework\Exception\NoSuchEntityException; use Magento\Customer\Service\V1\Data\Eav\AttributeMetadata; -use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; -use Magento\Framework\Service\Data\Eav\AttributeValueBuilder; +use Magento\Framework\Exception\NoSuchEntityException; /** * Test class for \Magento\Customer\Block\Widget\Name. @@ -77,7 +76,10 @@ class NameTest extends \PHPUnit_Framework_TestCase private $_block; /** @var \PHPUnit_Framework_MockObject_MockObject | CustomerMetadataServiceInterface */ - private $_metadataService; + private $customerMetadataService; + + /** @var \PHPUnit_Framework_MockObject_MockObject|AddressMetadataServiceInterface */ + private $addressMetadataService; /** * @var \Magento\TestFramework\Helper\ObjectManager @@ -93,17 +95,6 @@ class NameTest extends \PHPUnit_Framework_TestCase $addressHelper = $this->getMock('Magento\Customer\Helper\Address', [], [], '', false); - $this->_metadataService = $this->getMockBuilder( - 'Magento\Customer\Service\V1\CustomerMetadataService' - )->disableOriginalConstructor()->getMock(); - $this->_metadataService->expects( - $this->any() - )->method( - 'getCustomCustomerAttributeMetadata' - )->will( - $this->returnValue([]) - ); - $this->_customerHelper = $this->getMock('Magento\Customer\Helper\Data', [], [], '', false); $this->_attributeMetadata = $this->getMock( 'Magento\Customer\Service\V1\Data\Eav\AttributeMetadata', @@ -112,23 +103,31 @@ class NameTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_metadataService->expects( - $this->any() - )->method( - 'getCustomerAttributeMetadata' - )->will( - $this->returnValue($this->_attributeMetadata) - ); - $this->_metadataService->expects( - $this->any() - )->method( - 'getAddressAttributeMetadata' - )->will( - $this->returnValue($this->_attributeMetadata) + $this->customerMetadataService = $this->getMockBuilder('Magento\Customer\Service\V1\CustomerMetadataService') + ->disableOriginalConstructor() + ->getMock(); + $this->customerMetadataService + ->expects($this->any()) + ->method('getCustomAttributesMetadata') + ->will($this->returnValue([])); + $this->customerMetadataService->expects($this->any()) + ->method('getAttributeMetadata') + ->will($this->returnValue($this->_attributeMetadata)); + + $this->addressMetadataService = $this->getMockBuilder('Magento\Customer\Service\V1\AddressMetadataService') + ->disableOriginalConstructor() + ->getMock(); + $this->addressMetadataService->expects($this->any()) + ->method('getAttributeMetadata') + ->will($this->returnValue($this->_attributeMetadata)); + + $this->_block = new Name( + $context, + $addressHelper, + $this->customerMetadataService, + $this->addressMetadataService, + $this->_customerHelper ); - - - $this->_block = new Name($context, $addressHelper, $this->_metadataService, $this->_customerHelper); } /** @@ -145,7 +144,7 @@ class NameTest extends \PHPUnit_Framework_TestCase public function testShowPrefixWithException() { - $this->_metadataService->expects( + $this->customerMetadataService->expects( $this->any() )->method( 'getAttributeMetadata' @@ -165,7 +164,7 @@ class NameTest extends \PHPUnit_Framework_TestCase */ public function testMethodWithNoSuchEntityException($method) { - $this->_metadataService->expects( + $this->customerMetadataService->expects( $this->any() )->method( 'getAttributeMetadata' @@ -421,7 +420,7 @@ class NameTest extends \PHPUnit_Framework_TestCase public function testGetStoreLabelWithException() { - $this->_metadataService->expects( + $this->customerMetadataService->expects( $this->any() )->method( 'getAttributeMetadata' diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/TaxvatTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/TaxvatTest.php index 256a9eff15253ca3166da2cf2fb51cdc98e13ab4..f06b775dec4b87338c2b8ffeee265da109ec7270 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/TaxvatTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/TaxvatTest.php @@ -62,7 +62,7 @@ class TaxvatTest extends \PHPUnit_Framework_TestCase $this->_attributeMetadata->expects( $this->any() )->method( - 'getCustomerAttributeMetadata' + 'getAttributeMetadata' )->with( self::TAXVAT_ATTRIBUTE_CODE )->will( diff --git a/dev/tests/unit/testsuite/Magento/Customer/Helper/AddressTest.php b/dev/tests/unit/testsuite/Magento/Customer/Helper/AddressTest.php index fe7fde4bd976cc597b22e5931f145c878e914fcb..ba2dea2226659938cb1b59f56cf085bcd108b219 100755 --- a/dev/tests/unit/testsuite/Magento/Customer/Helper/AddressTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Helper/AddressTest.php @@ -21,8 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Helper; +use Magento\Customer\Service\V1\AddressMetadataServiceInterface; + class AddressTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Customer\Helper\Address|\PHPUnit_Framework_MockObject_MockObject */ @@ -46,6 +49,9 @@ class AddressTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Model\Address\Config|\PHPUnit_Framework_MockObject_MockObject */ protected $addressConfig; + /** @var \PHPUnit_Framework_MockObject_MockObject|AddressMetadataServiceInterface */ + private $addressMetadataService; + protected function setUp() { $this->context = $this->getMockBuilder('Magento\Framework\App\Helper\Context') @@ -67,12 +73,17 @@ class AddressTest extends \PHPUnit_Framework_TestCase 'Magento\Customer\Model\Address\Config' )->disableOriginalConstructor()->getMock(); + $this->addressMetadataService = $this->getMockBuilder('Magento\Customer\Service\V1\AddressMetadataService') + ->disableOriginalConstructor() + ->getMock(); + $this->helper = new \Magento\Customer\Helper\Address( $this->context, $this->blockFactory, $this->storeManager, $this->scopeConfig, $this->customerMetadataService, + $this->addressMetadataService, $this->addressConfig ); } @@ -89,13 +100,10 @@ class AddressTest extends \PHPUnit_Framework_TestCase )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->any())->method('getMultilineCount')->will($this->returnValue($numLines)); - $this->customerMetadataService->expects( - $this->any() - )->method( - 'getAttributeMetadata' - )->will( - $this->returnValue($attributeMock) - ); + $this->addressMetadataService + ->expects($this->any()) + ->method('getAttributeMetadata') + ->will($this->returnValue($attributeMock)); $store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store)); @@ -131,6 +139,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase $this->storeManager, $this->scopeConfig, $this->customerMetadataService, + $this->addressMetadataService, $this->addressConfig ); $this->assertEquals($result, $this->helper->getRenderer($renderer)); @@ -195,12 +204,11 @@ class AddressTest extends \PHPUnit_Framework_TestCase $this->customerMetadataService->expects($this->any()) ->method('getAttributeMetadata') - ->will($this->returnValueMap( - array( - array('customer_address', $attrCode, $attributeMock), - array('customer', $attrCode, $customAttrMock), - ) - )); + ->will($this->returnValue($customAttrMock)); + + $this->addressMetadataService->expects($this->any()) + ->method('getAttributeMetadata') + ->will($this->returnValue($attributeMock)); $this->assertEquals($result, $this->helper->getAttributeValidationClass($attrCode)); } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Address/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Address/ConverterTest.php index 3808e8c3bb00ab31cccabedf219dc052aef8f9b3..a7c424c57921447c431aea2f57eac274705f9b6e 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Address/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Address/ConverterTest.php @@ -17,7 +17,7 @@ * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. - * + * * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -49,9 +49,9 @@ class ConverterTest extends \PHPUnit_Framework_TestCase /** * - * @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Customer\Service\V1\AddressMetadataServiceInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $metadataServiceMock; + protected $addressMetadataServiceMock; protected function setUp() { @@ -79,9 +79,9 @@ class ConverterTest extends \PHPUnit_Framework_TestCase false ); - $this->metadataServiceMock = $this->getMock( - 'Magento\Customer\Service\V1\CustomerMetadataService', - array('getAllAddressAttributeMetadata'), + $this->addressMetadataServiceMock = $this->getMock( + 'Magento\Customer\Service\V1\AddressMetadataService', + array('getAllAttributesMetadata'), array(), '', false @@ -90,7 +90,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase $this->model = new Converter( $this->addressBuilderMock, $this->addressFactoryMock, - $this->metadataServiceMock + $this->addressMetadataServiceMock ); } @@ -103,7 +103,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase $addressModelMock->expects($this->once()) ->method('setAttributeSetId') ->with($this->equalTo( - \Magento\Customer\Service\V1\CustomerMetadataServiceInterface::ATTRIBUTE_SET_ID_ADDRESS + \Magento\Customer\Service\V1\AddressMetadataServiceInterface::ATTRIBUTE_SET_ID_ADDRESS )); $addressMock = $this->getMock('Magento\Customer\Service\V1\Data\Address', array(), array(), '', false); @@ -189,8 +189,8 @@ class ConverterTest extends \PHPUnit_Framework_TestCase ->method('getParentId'); $addressMock = $this->getMock('Magento\Customer\Service\V1\Data\Address', array(), array(), '', false); - $this->metadataServiceMock->expects($this->once()) - ->method('getAllAddressAttributeMetadata') + $this->addressMetadataServiceMock->expects($this->once()) + ->method('getAllAttributesMetadata') ->will($this->returnValue(array())); $this->addressBuilderMock->expects($this->once()) ->method('create') @@ -253,8 +253,8 @@ class ConverterTest extends \PHPUnit_Framework_TestCase $addressMock = $this->getMock('Magento\Customer\Service\V1\Data\Address', array(), array(), '', false); - $this->metadataServiceMock->expects($this->once()) - ->method('getAllAddressAttributeMetadata') + $this->addressMetadataServiceMock->expects($this->once()) + ->method('getAllAttributesMetadata') ->will($this->returnValue(array($attributeMock))); $this->addressBuilderMock->expects($this->once()) ->method('create') diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/ConverterTest.php index 9994385d42c71000feb68a2141e5beb4fc5c1745..f3cab332ab354a57957f8329c35eb8d4d99b614e 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/ConverterTest.php @@ -80,7 +80,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase $this->_metadataService->expects( $this->any() )->method( - 'getCustomCustomerAttributeMetadata' + 'getCustomAttributesMetadata' )->will( $this->returnValue(array()) ); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/Group/Grid/ServiceCollectionTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/Group/Grid/ServiceCollectionTest.php index 2e95455706dc21f1cd2dc24669365a55e5cc1764..52d09bf539cdf870cdce8e2214caaf69fa74714f 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/Group/Grid/ServiceCollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/Group/Grid/ServiceCollectionTest.php @@ -40,6 +40,9 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Service\V1\Data\SearchCriteriaBuilder */ protected $searchCriteriaBuilder; + /** @var \Magento\Framework\Service\V1\Data\SortOrderBuilder */ + protected $sortOrderBuilder; + /** @var \Magento\Customer\Service\V1\Data\SearchResults */ protected $searchResults; @@ -60,6 +63,9 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase 'Magento\Framework\Service\V1\Data\SearchCriteriaBuilder', ['filterGroupBuilder' => $filterGroupBuilder] ); + $this->sortOrderBuilder = $this->objectManager->getObject( + '\Magento\Framework\Service\V1\Data\SortOrderBuilder' + ); $this->groupServiceMock = $this->getMockBuilder('\Magento\Customer\Service\V1\CustomerGroupServiceInterface') ->getMock(); $this->searchResults = $this->objectManager->getObject('Magento\Customer\Service\V1\Data\SearchResultsBuilder') @@ -78,11 +84,15 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase public function testGetSearchCriteriaImplicitEq() { + $sortOrder = $this->sortOrderBuilder + ->setField('name') + ->setDirection(SearchCriteria::SORT_ASC) + ->create(); /** @var SearchCriteria $expectedSearchCriteria */ $expectedSearchCriteria = $this->searchCriteriaBuilder ->setCurrentPage(1) ->setPageSize(0) - ->addSortOrder('name', SearchCriteria::SORT_ASC) + ->addSortOrder($sortOrder) ->addFilter([$this->filterBuilder->setField('name')->setConditionType('eq') ->setValue('Magento')->create()]) ->create(); @@ -104,13 +114,16 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase $field = 'age'; $conditionType = 'gt'; $value = '35'; - + $sortOrder = $this->sortOrderBuilder + ->setField('name') + ->setDirection(SearchCriteria::SORT_ASC) + ->create(); /** @var SearchCriteria $expectedSearchCriteria */ $filter = $this->filterBuilder->setField($field)->setConditionType($conditionType)->setValue($value)->create(); $expectedSearchCriteria = $this->searchCriteriaBuilder ->setCurrentPage(1) ->setPageSize(0) - ->addSortOrder('name', SearchCriteria::SORT_ASC) + ->addSortOrder($sortOrder) ->addFilter([$filter]) ->create(); @@ -133,11 +146,15 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase $fieldB = 'B'; $value = 1; + $sortOrder = $this->sortOrderBuilder + ->setField('name') + ->setDirection(SearchCriteria::SORT_ASC) + ->create(); /** @var SearchCriteria $expectedSearchCriteria */ $expectedSearchCriteria = $this->searchCriteriaBuilder ->setCurrentPage(1) ->setPageSize(0) - ->addSortOrder('name', SearchCriteria::SORT_ASC) + ->addSortOrder($sortOrder) ->addFilter( [ $this->filterBuilder->setField($fieldA)->setConditionType('eq')->setValue($value)->create(), @@ -165,15 +182,27 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase $fieldB = 'B'; $value = 1; + $sortOrder = $this->sortOrderBuilder + ->setField('name') + ->setDirection(SearchCriteria::SORT_ASC) + ->create(); /** @var SearchCriteria $expectedSearchCriteria */ $expectedSearchCriteria = $this->searchCriteriaBuilder ->setCurrentPage(1) ->setPageSize(0) - ->addSortOrder('name', SearchCriteria::SORT_ASC) - ->addFilter([$this->filterBuilder->setField($fieldA)->setConditionType('gt') - ->setValue($value)->create()]) - ->addFilter([$this->filterBuilder->setField($fieldB)->setConditionType('gt') - ->setValue($value)->create()]) + ->addSortOrder($sortOrder) + ->addFilter( + [ + $this->filterBuilder->setField($fieldA)->setConditionType('gt') + ->setValue($value)->create() + ] + ) + ->addFilter( + [ + $this->filterBuilder->setField($fieldB)->setConditionType('gt') + ->setValue($value)->create() + ] + ) ->create(); // Verifies that the search criteria Data Object created by the serviceCollection matches expected diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/SessionTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/SessionTest.php index 419e2229771f48afe95222cab10dac452757b16e..e7306a6aadb31d62cd7e2a3418639c09b64af885 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/SessionTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/SessionTest.php @@ -65,7 +65,13 @@ class SessionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_converterMock = $this->getMock('Magento\Customer\Model\Converter', [], [], '', false); - $this->_storageMock = $this->getMock('Magento\Customer\Model\Session\Storage', [], [], '', false); + $this->_storageMock = $this->getMock( + 'Magento\Customer\Model\Session\Storage', + ['getIsCustomerEmulated', 'getData', 'unsIsCustomerEmulated', '__sleep', '__wakeup'], + [], + '', + false + ); $this->_eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $this->_httpContextMock = $this->getMock('Magento\Framework\App\Http\Context', [], [], '', false); $this->urlFactoryMock = $this->getMock('Magento\Framework\UrlFactory', [], [], '', false); @@ -218,4 +224,52 @@ class SessionTest extends \PHPUnit_Framework_TestCase ->method('setValue'); return $customerDataMock; } + + + /** + * @param bool $expectedResult + * @param bool $isCustomerIdValid + * @param bool $isCustomerEmulated + * @dataProvider getIsLoggedInDataProvider + */ + public function testIsLoggedIn($expectedResult, $isCustomerIdValid, $isCustomerEmulated) + { + $customerId = 1; + $this->_storageMock->expects($this->any())->method('getData')->with('customer_id') + ->will($this->returnValue($customerId)); + + if ($isCustomerIdValid) { + $this->customerAccountServiceMock->expects($this->once()) + ->method('getCustomer') + ->with($customerId); + } else { + $this->customerAccountServiceMock->expects($this->once()) + ->method('getCustomer') + ->with($customerId) + ->will($this->throwException(new \Exception('Customer ID is invalid.'))); + } + $this->_storageMock->expects($this->any())->method('getIsCustomerEmulated') + ->will($this->returnValue($isCustomerEmulated)); + $this->assertEquals($expectedResult, $this->_model->isLoggedIn()); + } + + /** + * @return array + */ + public function getIsLoggedInDataProvider() + { + return array( + array('expectedResult' => true, 'isCustomerIdValid' => true, 'isCustomerEmulated' => false,), + array('expectedResult' => false, 'isCustomerIdValid' => true, 'isCustomerEmulated' => true,), + array('expectedResult' => false, 'isCustomerIdValid' => false, 'isCustomerEmulated' => false,), + array('expectedResult' => false, 'isCustomerIdValid' => false, 'isCustomerEmulated' => true,), + ); + } + + public function testSetCustomerRemovesFlagThatShowsIfCustomerIsEmulated() + { + $customerMock = $this->getMock('Magento\Customer\Model\Customer', array(), array(), '', false); + $this->_storageMock->expects($this->once())->method('unsIsCustomerEmulated'); + $this->_model->setCustomer($customerMock); + } } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceCachedTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceCachedTest.php new file mode 100644 index 0000000000000000000000000000000000000000..6d0a847948d1caa63170d2d29190085afd452aa4 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceCachedTest.php @@ -0,0 +1,144 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +use Magento\Framework\Exception\NoSuchEntityException; + +class AddressMetadataServiceCachedTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + private $objectManager; + + /** + * @var \Magento\Customer\Service\V1\AddressMetadataService + */ + private $customerMetadataServiceMock; + + /** + * @var \Magento\Customer\Service\V1\AddressMetadataServiceCached + */ + private $cachedMetadataService; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->customerMetadataServiceMock = $this->getMockBuilder( + 'Magento\Customer\Service\V1\AddressMetadataService' + )->setMethods([ + 'getAttributes', + 'getAttributeMetadata', + 'getAllAttributesMetadata', + 'getCustomAttributesMetadata' + ])->disableOriginalConstructor()->getMock(); + + $this->cachedMetadataService = $this->objectManager->getObject( + 'Magento\Customer\Service\V1\AddressMetadataServiceCached', + ['metadataService' => $this->customerMetadataServiceMock] + ); + } + + public function testGetAttributes() + { + $formCode = 'f'; + $value = 'v'; + + $this->customerMetadataServiceMock->expects($this->once()) + ->method('getAttributes') + ->with($formCode) + ->will($this->returnValue($value)); + + for ($c = 0; $c < 10; $c++) { + $actualValue = $this->cachedMetadataService->getAttributes($formCode); + $this->assertEquals($value, $actualValue); + } + } + + public function testGetAttributeMetadata() + { + $attributeCode = 'a'; + $value = 'v'; + + $this->customerMetadataServiceMock->expects($this->once()) + ->method('getAttributeMetadata') + ->with($attributeCode) + ->will($this->returnValue($value)); + + for ($c = 0; $c < 10; $c++) { + $actualValue = $this->cachedMetadataService->getAttributeMetadata($attributeCode); + $this->assertEquals($value, $actualValue); + } + } + + public function testGetAttributeMetadataWithException() + { + $attributeCode = 'a'; + + $this->customerMetadataServiceMock->expects($this->exactly(10)) + ->method('getAttributeMetadata') + ->with($attributeCode) + ->will($this->throwException(new \Magento\Framework\Exception\NoSuchEntityException())); + + for ($c = 0; $c < 10; $c++) { + $exceptionThrown = false; + try { + $this->cachedMetadataService->getAttributeMetadata($attributeCode); + } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + $exceptionThrown = true; + } + $this->assertTrue($exceptionThrown); + } + } + + public function testGetAllAttributesMetadata() + { + $value = 'v'; + + $this->customerMetadataServiceMock->expects($this->once()) + ->method('getAllAttributesMetadata') + ->will($this->returnValue($value)); + + for ($c = 0; $c < 10; $c++) { + $actualValue = $this->cachedMetadataService->getAllAttributesMetadata(); + $this->assertEquals($value, $actualValue); + } + } + + public function testGetCustomAttributesMetadata() + { + $value = 'v'; + + $this->customerMetadataServiceMock->expects($this->once()) + ->method('getCustomAttributesMetadata') + ->will($this->returnValue($value)); + + for ($c = 0; $c < 10; $c++) { + $actualValue = $this->cachedMetadataService->getCustomAttributesMetadata(); + $this->assertEquals($value, $actualValue); + } + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8b8faa98c410f718f37530d844feaf138cf25a21 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/AddressMetadataServiceTest.php @@ -0,0 +1,60 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +use Magento\Framework\Exception\NoSuchEntityException; + +class AddressMetadataServiceTest extends CustomerMetadataServiceTest +{ + public function setUp() + { + parent::setUp(); + $this->service = $this->objectManager->getObject( + 'Magento\Customer\Service\V1\AddressMetadataService', + [ + 'attributeMetadataDataProvider' => $this->attributeMetadataDataProvider, + 'attributeMetadataConverter' => $this->attributeMetadataConverter + ] + ); + } + + public function testGetAttributeMetadataWithoutAttributeMetadata() + { + $this->attributeMetadataDataProvider + ->expects($this->any()) + ->method('getAttribute') + ->will($this->returnValue(false)); + + try { + $this->service->getAttributeMetadata('attributeId'); + $this->fail('Expected exception not thrown.'); + } catch (NoSuchEntityException $e) { + $this->assertSame( + "No such entity with entityType = customer_address, attributeCode = attributeId", + $e->getMessage() + ); + } + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php index 5da07017804f41a225c8c071be95c9c6aafec5cd..e7ca3b425d5104eaf7a7a0d4bfdd07ad8134b29d 100755 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php @@ -110,6 +110,11 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase */ private $_customerMetadataService; + /** + * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Service\V1\AddressMetadataService + */ + private $_addressMetadataService; + /** * @var \PHPUnit_Framework_MockObject_MockObject | CustomerRegistry */ @@ -243,11 +248,23 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService->expects( $this->any() )->method( - 'getCustomCustomerAttributeMetadata' + 'getCustomAttributesMetadata' )->will( $this->returnValue(array()) ); + $this->_addressMetadataService = $this->getMockForAbstractClass( + 'Magento\Customer\Service\V1\AddressMetadataServiceInterface', + [], + '', + false + ); + + $this->_addressMetadataService + ->expects($this->any()) + ->method('getCustomAttributesMetadata') + ->will($this->returnValue(array())); + $this->_customerBuilder = $this->_objectManager->getObject( 'Magento\Customer\Service\V1\Data\CustomerBuilder', ['metadataService' => $this->_customerMetadataService] @@ -255,7 +272,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $addressBuilder = $this->_objectManager->getObject( 'Magento\Customer\Service\V1\Data\AddressBuilder', - ['metadataService' => $this->_customerMetadataService] + ['metadataService' => $this->_addressMetadataService] ); $this->_customerDetailsBuilder = $this->_objectManager->getObject( @@ -1312,7 +1329,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService->expects( $this->any() )->method( - 'getCustomerAttributeMetadata' + 'getAttributeMetadata' )->will( $this->returnValue($mockAttribute) ); @@ -1375,7 +1392,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService->expects( $this->any() )->method( - 'getCustomerAttributeMetadata' + 'getAttributeMetadata' )->will( $this->returnValue($mockAttribute) ); @@ -1442,7 +1459,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService->expects( $this->any() )->method( - 'getCustomerAttributeMetadata' + 'getAttributeMetadata' )->will( $this->returnValue($mockAttribute) ); @@ -1492,7 +1509,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService->expects( $this->any() )->method( - 'getCustomerAttributeMetadata' + 'getAttributeMetadata' )->will( $this->returnValue($mockAttribute) ); @@ -1639,7 +1656,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService->expects( $this->any() )->method( - 'getAllCustomerAttributeMetadata' + 'getAllAttributesMetadata' )->will( $this->returnValue(array()) ); @@ -1709,7 +1726,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService->expects( $this->any() )->method( - 'getAllCustomerAttributeMetadata' + 'getAllAttributesMetadata' )->will( $this->returnValue(array()) ); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php index 56e4c24f2e770568c4b2ec211c672748339196e0..053105ccad5ddb65435a78684d408b0283189eac 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php @@ -235,37 +235,40 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase $this->objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $regionBuilder = $this->objectManagerHelper->getObject('Magento\Customer\Service\V1\Data\RegionBuilder'); - $metadataService = $this->getMockForAbstractClass( + $customerMetadataService = $this->getMockForAbstractClass( 'Magento\Customer\Service\V1\CustomerMetadataServiceInterface', array(), '', false ); - $metadataService->expects( - $this->any() - )->method( - 'getCustomAddressAttributeMetadata' - )->will( - $this->returnValue(array()) + $addressMetadataService = $this->getMockForAbstractClass( + 'Magento\Customer\Service\V1\AddressMetadataServiceInterface', + array(), + '', + false ); - $metadataService->expects( + $addressMetadataService->expects($this->any()) + ->method('getCustomAttributesMetadata') + ->will($this->returnValue(array())); + + $customerMetadataService->expects( $this->any() )->method( - 'getCustomCustomerAttributeMetadata' + 'getCustomAttributesMetadata' )->will( $this->returnValue(array()) ); $this->_addressBuilder = $this->objectManagerHelper->getObject( 'Magento\Customer\Service\V1\Data\AddressBuilder', - array('regionBuilder' => $regionBuilder, 'metadataService' => $metadataService) + array('regionBuilder' => $regionBuilder, 'metadataService' => $addressMetadataService) ); $customerBuilder = $this->objectManagerHelper->getObject( 'Magento\Customer\Service\V1\Data\CustomerBuilder', - ['metadataService' => $metadataService] + ['metadataService' => $customerMetadataService] ); $this->_customerConverter = new \Magento\Customer\Model\Converter( diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceCachedTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceCachedTest.php new file mode 100644 index 0000000000000000000000000000000000000000..63c09063a62e7cbd7e6b1ab905528ebc6bb80df4 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceCachedTest.php @@ -0,0 +1,144 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Service\V1; + +use Magento\Framework\Exception\NoSuchEntityException; + +class CustomerMetadataServiceCachedTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + private $objectManager; + + /** + * @var \Magento\Customer\Service\V1\CustomerMetadataService + */ + private $customerMetadataServiceMock; + + /** + * @var \Magento\Customer\Service\V1\CustomerMetadataServiceCached + */ + private $cachedMetadataService; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->customerMetadataServiceMock = $this->getMockBuilder( + 'Magento\Customer\Service\V1\CustomerMetadataService' + )->setMethods([ + 'getAttributes', + 'getAttributeMetadata', + 'getAllAttributesMetadata', + 'getCustomAttributesMetadata' + ])->disableOriginalConstructor()->getMock(); + + $this->cachedMetadataService = $this->objectManager->getObject( + 'Magento\Customer\Service\V1\CustomerMetadataServiceCached', + ['metadataService' => $this->customerMetadataServiceMock] + ); + } + + public function testGetAttributes() + { + $formCode = 'f'; + $value = 'v'; + + $this->customerMetadataServiceMock->expects($this->once()) + ->method('getAttributes') + ->with($formCode) + ->will($this->returnValue($value)); + + for ($c = 0; $c < 10; $c++) { + $actualValue = $this->cachedMetadataService->getAttributes($formCode); + $this->assertEquals($value, $actualValue); + } + } + + public function testGetAttributeMetadata() + { + $attributeCode = 'a'; + $value = 'v'; + + $this->customerMetadataServiceMock->expects($this->once()) + ->method('getAttributeMetadata') + ->with($attributeCode) + ->will($this->returnValue($value)); + + for ($c = 0; $c < 10; $c++) { + $actualValue = $this->cachedMetadataService->getAttributeMetadata($attributeCode); + $this->assertEquals($value, $actualValue); + } + } + + public function testGetAttributeMetadataWithException() + { + $attributeCode = 'a'; + + $this->customerMetadataServiceMock->expects($this->exactly(10)) + ->method('getAttributeMetadata') + ->with($attributeCode) + ->will($this->throwException(new \Magento\Framework\Exception\NoSuchEntityException())); + + for ($c = 0; $c < 10; $c++) { + $exceptionThrown = false; + try { + $this->cachedMetadataService->getAttributeMetadata($attributeCode); + } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + $exceptionThrown = true; + } + $this->assertTrue($exceptionThrown); + } + } + + public function testGetAllAttributesMetadata() + { + $value = 'v'; + + $this->customerMetadataServiceMock->expects($this->once()) + ->method('getAllAttributesMetadata') + ->will($this->returnValue($value)); + + for ($c = 0; $c < 10; $c++) { + $actualValue = $this->cachedMetadataService->getAllAttributesMetadata(); + $this->assertEquals($value, $actualValue); + } + } + + public function testGetCustomAttributesMetadata() + { + $value = 'v'; + + $this->customerMetadataServiceMock->expects($this->once()) + ->method('getCustomAttributesMetadata') + ->will($this->returnValue($value)); + + for ($c = 0; $c < 10; $c++) { + $actualValue = $this->cachedMetadataService->getCustomAttributesMetadata(); + $this->assertEquals($value, $actualValue); + } + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php index f17609b64b959842326fb04e27be9128c51953fb..85ccfa59eeb8350d3510b2dc11d6c0099b34c138 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php @@ -41,35 +41,66 @@ class CustomerMetadataServiceTest extends \PHPUnit_Framework_TestCase const FRONTEND_CLASS = 'frontend class'; /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Eav\Model\Config + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataDataProvider */ - private $_eavConfigMock; + protected $attributeMetadataDataProvider; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataConverter + */ + protected $attributeMetadataConverter; /** * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Eav\Model\Entity\Attribute\AbstractAttribute */ - private $_attributeEntityMock; + protected $attributeEntityMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource + * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata */ - private $_sourceMock; + protected $attributeMetadataMock; /** @var array */ - private $_validateRules = array(); + protected $validationRules = array(); /** * @var \Magento\TestFramework\Helper\ObjectManager */ - private $objectManager; + protected $objectManager; + + /** @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface */ + protected $service; public function setUp() { - $this->_eavConfigMock = $this->getMockBuilder( - '\Magento\Eav\Model\Config' - )->disableOriginalConstructor()->getMock(); + $this->attributeMetadataDataProvider = $this + ->getMockBuilder('Magento\Customer\Service\V1\Data\Eav\AttributeMetadataDataProvider') + ->disableOriginalConstructor() + ->getMock(); + + $this->attributeMetadataConverter = $this + ->getMockBuilder('Magento\Customer\Service\V1\Data\Eav\AttributeMetadataConverter') + ->disableOriginalConstructor() + ->getMock(); + + $this->attributeMetadataMock = $this + ->getMockBuilder('Magento\Customer\Service\V1\Data\Eav\AttributeMetadata') + ->disableOriginalConstructor() + ->setMethods( + array( + 'getAttributeCode', + 'getFrontendInput', + 'getInputFilter', + 'getStoreLabel', + 'getValidationRules', + 'getSource', + 'getFrontendClass', + 'usesSource' + ) + ) + ->getMock(); - $this->_attributeEntityMock = $this->getMockBuilder( + $this->attributeEntityMock = $this->getMockBuilder( '\Magento\Eav\Model\Entity\Attribute\AbstractAttribute' )->setMethods( array( @@ -85,262 +116,53 @@ class CustomerMetadataServiceTest extends \PHPUnit_Framework_TestCase ) )->disableOriginalConstructor()->getMock(); - $this->_sourceMock = $this->getMockBuilder( - '\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource' - )->disableOriginalConstructor()->getMock(); - - $frontendMock = $this->getMockBuilder( - '\Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend' - )->disableOriginalConstructor()->setMethods( - array('getClass') - )->getMock(); - - $frontendMock->expects($this->any())->method('getClass')->will($this->returnValue(self::FRONTEND_CLASS)); - $this->_mockReturnValue( - $this->_attributeEntityMock, + $this->attributeMetadataMock, array( 'getAttributeCode' => self::ATTRIBUTE_CODE, 'getFrontendInput' => self::FRONTEND_INPUT, 'getInputFilter' => self::INPUT_FILTER, 'getStoreLabel' => self::STORE_LABEL, - 'getValidateRules' => $this->_validateRules, - 'getFrontend' => $frontendMock + 'getValidationRules' => $this->validationRules, + 'getFrontendClass' => self::FRONTEND_CLASS ) ); $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->service = $this->objectManager->getObject( + 'Magento\Customer\Service\V1\CustomerMetadataService', + [ + 'attributeMetadataDataProvider' => $this->attributeMetadataDataProvider, + 'attributeMetadataConverter' => $this->attributeMetadataConverter + ] + ); } public function testGetAttributeMetadata() { - $this->_eavConfigMock->expects( - $this->any() - )->method( - 'getAttribute' - )->will( - $this->returnValue($this->_attributeEntityMock) - ); - - $this->_attributeEntityMock->expects($this->any())->method('usesSource')->will($this->returnValue(true)); - - $this->_attributeEntityMock->expects( - $this->any() - )->method( - 'getSource' - )->will( - $this->returnValue($this->_sourceMock) - ); + $this->attributeMetadataDataProvider + ->expects($this->any()) + ->method('getAttribute') + ->will($this->returnValue($this->attributeEntityMock)); - $allOptions = array( - array('label' => 'label1', 'value' => 'value1'), - array('label' => 'label2', 'value' => 'value2') - ); - $this->_sourceMock->expects($this->any())->method('getAllOptions')->will($this->returnValue($allOptions)); - - $attributeColFactoryMock = $this->getMockBuilder( - '\Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory' - )->disableOriginalConstructor()->getMock(); - $storeManagerMock = $this->getMockBuilder( - '\Magento\Store\Model\StoreManager' - )->disableOriginalConstructor()->getMock(); + $this->attributeMetadataConverter + ->expects($this->any()) + ->method('createMetadataAttribute') + ->will($this->returnValue($this->attributeMetadataMock)); - $optionBuilder = $this->objectManager->getObject('\Magento\Customer\Service\V1\Data\Eav\OptionBuilder'); - $validationRuleBuilder = $this->objectManager - ->getObject('\Magento\Customer\Service\V1\Data\Eav\ValidationRuleBuilder'); - - $attributeMetadataBuilder = $this->objectManager->getObject( - '\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder', - ['optionBuilder' => $optionBuilder, 'validationRuleBuilder' => $validationRuleBuilder] - ); - - $service = new CustomerMetadataService( - $this->_eavConfigMock, - $attributeColFactoryMock, - $storeManagerMock, - $optionBuilder, - $validationRuleBuilder, - $attributeMetadataBuilder - ); - - $attributeMetadata = $service->getAttributeMetadata('entityCode', 'attributeId'); + $attributeMetadata = $this->service->getAttributeMetadata('attributeId'); $this->assertMetadataAttributes($attributeMetadata); - - $options = $attributeMetadata->getOptions(); - $this->assertNotEquals(array(), $options); - $this->assertEquals('label1', $options[0]->getLabel()); - $this->assertEquals('value1', $options[0]->getValue()); - $this->assertEquals('label2', $options[1]->getLabel()); - $this->assertEquals('value2', $options[1]->getValue()); } public function testGetAttributeMetadataWithoutAttributeMetadata() { - $this->_eavConfigMock->expects($this->any())->method('getAttribute')->will($this->returnValue(false)); - - $attributeColFactoryMock = $this->getMockBuilder( - '\Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory' - )->disableOriginalConstructor()->getMock(); - $storeManagerMock = $this->getMockBuilder( - '\Magento\Store\Model\StoreManager' - )->disableOriginalConstructor()->getMock(); - - $optionBuilder = $this->objectManager->getObject('\Magento\Customer\Service\V1\Data\Eav\OptionBuilder'); - $validationRuleBuilder = $this->objectManager - ->getObject('\Magento\Customer\Service\V1\Data\Eav\ValidationRuleBuilder'); - - $attributeMetadataBuilder = $this->objectManager->getObject( - '\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder', - ['optionBuilder' => $optionBuilder, 'validationRuleBuilder' => $validationRuleBuilder] - ); - - $service = new CustomerMetadataService( - $this->_eavConfigMock, - $attributeColFactoryMock, - $storeManagerMock, - $optionBuilder, - $validationRuleBuilder, - $attributeMetadataBuilder - ); - - try { - $service->getAttributeMetadata('entityCode', 'attributeId'); - $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $e) { - $this->assertSame( - "No such entity with entityType = entityCode, attributeCode = attributeId", - $e->getMessage() - ); - } - } - - public function testGetAttributeMetadataWithoutOptions() - { - $this->_eavConfigMock->expects( - $this->any() - )->method( - 'getAttribute' - )->will( - $this->returnValue($this->_attributeEntityMock) - ); - - $this->_attributeEntityMock->expects( - $this->any() - )->method( - 'getSource' - )->will( - $this->returnValue($this->_sourceMock) - ); - - $this->_sourceMock->expects($this->any())->method('getAllOptions')->will($this->returnValue(array())); - - $attributeColFactoryMock = $this->getMockBuilder( - '\Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory' - )->disableOriginalConstructor()->getMock(); - $storeManagerMock = $this->getMockBuilder( - '\Magento\Store\Model\StoreManager' - )->disableOriginalConstructor()->getMock(); - - $optionBuilder = $this->objectManager->getObject('\Magento\Customer\Service\V1\Data\Eav\OptionBuilder'); - $validationRuleBuilder = $this->objectManager - ->getObject('\Magento\Customer\Service\V1\Data\Eav\ValidationRuleBuilder'); - - $attributeMetadataBuilder = $this->objectManager->getObject( - '\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder', - ['optionBuilder' => $optionBuilder, 'validationRuleBuilder' => $validationRuleBuilder] - ); - - $service = new CustomerMetadataService( - $this->_eavConfigMock, - $attributeColFactoryMock, - $storeManagerMock, - $optionBuilder, - $validationRuleBuilder, - $attributeMetadataBuilder - ); - - $attributeMetadata = $service->getAttributeMetadata('entityCode', 'attributeId'); - $this->assertMetadataAttributes($attributeMetadata); - - $options = $attributeMetadata->getOptions(); - $this->assertEquals(0, count($options)); - } - - public function testGetAttributeMetadataWithoutSource() - { - $this->_eavConfigMock->expects( - $this->any() - )->method( - 'getAttribute' - )->will( - $this->returnValue($this->_attributeEntityMock) - ); - - $this->_attributeEntityMock->expects($this->any())->method('usesSource')->will($this->returnValue(false)); - - $attributeColFactoryMock = $this->getMockBuilder( - '\Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory' - )->disableOriginalConstructor()->getMock(); - $storeManagerMock = $this->getMockBuilder( - '\Magento\Store\Model\StoreManager' - )->disableOriginalConstructor()->getMock(); - - $optionBuilder = $this->objectManager->getObject('\Magento\Customer\Service\V1\Data\Eav\OptionBuilder'); - $validationRuleBuilder = $this->objectManager - ->getObject('\Magento\Customer\Service\V1\Data\Eav\ValidationRuleBuilder'); - - $attributeMetadataBuilder = $this->objectManager->getObject( - '\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder', - ['optionBuilder' => $optionBuilder, 'validationRuleBuilder' => $validationRuleBuilder] - ); - - $service = new CustomerMetadataService( - $this->_eavConfigMock, - $attributeColFactoryMock, - $storeManagerMock, - $optionBuilder, - $validationRuleBuilder, - $attributeMetadataBuilder - ); - - $attributeMetadata = $service->getAttributeMetadata('entityCode', 'attributeId'); - $this->assertMetadataAttributes($attributeMetadata); - - $options = $attributeMetadata->getOptions(); - $this->assertEquals(0, count($options)); - } - - public function testGetCustomerAttributeMetadataWithoutAttributeMetadata() - { - $this->_eavConfigMock->expects($this->any())->method('getAttribute')->will($this->returnValue(false)); - - $attributeColFactoryMock = $this->getMockBuilder( - '\Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory' - )->disableOriginalConstructor()->getMock(); - $storeManagerMock = $this->getMockBuilder( - '\Magento\Store\Model\StoreManager' - )->disableOriginalConstructor()->getMock(); - - $optionBuilder = $this->objectManager->getObject('\Magento\Customer\Service\V1\Data\Eav\OptionBuilder'); - $validationRuleBuilder = $this->objectManager - ->getObject('\Magento\Customer\Service\V1\Data\Eav\ValidationRuleBuilder'); - - $attributeMetadataBuilder = $this->objectManager->getObject( - '\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder', - ['optionBuilder' => $optionBuilder, 'validationRuleBuilder' => $validationRuleBuilder] - ); - - $service = new CustomerMetadataService( - $this->_eavConfigMock, - $attributeColFactoryMock, - $storeManagerMock, - $optionBuilder, - $validationRuleBuilder, - $attributeMetadataBuilder - ); + $this->attributeMetadataDataProvider + ->expects($this->any()) + ->method('getAttribute') + ->will($this->returnValue(false)); try { - $service->getCustomerAttributeMetadata('attributeId'); + $this->service->getAttributeMetadata('attributeId'); $this->fail('Expected exception not thrown.'); } catch (NoSuchEntityException $e) { $this->assertSame( @@ -350,87 +172,6 @@ class CustomerMetadataServiceTest extends \PHPUnit_Framework_TestCase } } - public function testGetAddressAttributeMetadataWithoutAttributeMetadata() - { - $this->_eavConfigMock->expects($this->any())->method('getAttribute')->will($this->returnValue(false)); - - $attributeColFactoryMock = $this->getMockBuilder( - '\Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory' - )->disableOriginalConstructor()->getMock(); - $storeManagerMock = $this->getMockBuilder( - '\Magento\Store\Model\StoreManager' - )->disableOriginalConstructor()->getMock(); - - $optionBuilder = $this->objectManager->getObject('\Magento\Customer\Service\V1\Data\Eav\OptionBuilder'); - $validationRuleBuilder = $this->objectManager - ->getObject('\Magento\Customer\Service\V1\Data\Eav\ValidationRuleBuilder'); - - $attributeMetadataBuilder = $this->objectManager->getObject( - '\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder', - ['optionBuilder' => $optionBuilder, 'validationRuleBuilder' => $validationRuleBuilder] - ); - - $service = new CustomerMetadataService( - $this->_eavConfigMock, - $attributeColFactoryMock, - $storeManagerMock, - $optionBuilder, - $validationRuleBuilder, - $attributeMetadataBuilder - ); - - try { - $service->getAddressAttributeMetadata('attributeId'); - $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $e) { - $this->assertSame( - "No such entity with entityType = customer_address, attributeCode = attributeId", - $e->getMessage() - ); - } - } - - public function testGetAllAttributeSetMetadataWithoutAttributeMetadata() - { - $this->_eavConfigMock->expects($this->any())->method('getAttribute')->will($this->returnValue(false)); - - $this->_eavConfigMock->expects( - $this->any() - )->method( - 'getEntityAttributeCodes' - )->will( - $this->returnValue(array('bogus')) - ); - - $attributeColFactoryMock = $this->getMockBuilder( - '\Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory' - )->disableOriginalConstructor()->getMock(); - - $storeManagerMock = $this->getMockBuilder( - '\Magento\Store\Model\StoreManager' - )->disableOriginalConstructor()->getMock(); - - $optionBuilder = $this->objectManager->getObject('\Magento\Customer\Service\V1\Data\Eav\OptionBuilder'); - $validationRuleBuilder = $this->objectManager - ->getObject('\Magento\Customer\Service\V1\Data\Eav\ValidationRuleBuilder'); - - $attributeMetadataBuilder = $this->objectManager->getObject( - '\Magento\Customer\Service\V1\Data\Eav\AttributeMetadataBuilder', - ['optionBuilder' => $optionBuilder, 'validationRuleBuilder' => $validationRuleBuilder] - ); - - $service = new CustomerMetadataService( - $this->_eavConfigMock, - $attributeColFactoryMock, - $storeManagerMock, - $optionBuilder, - $validationRuleBuilder, - $attributeMetadataBuilder - ); - - $this->assertEquals(array(), $service->getAllAttributeSetMetadata('entityType', 0, 1)); - } - /** * @param \PHPUnit_Framework_MockObject_MockObject $mock * @param array $valueMap @@ -451,7 +192,7 @@ class CustomerMetadataServiceTest extends \PHPUnit_Framework_TestCase $this->assertEquals(self::FRONTEND_INPUT, $attributeMetadata->getFrontendInput()); $this->assertEquals(self::INPUT_FILTER, $attributeMetadata->getInputFilter()); $this->assertEquals(self::STORE_LABEL, $attributeMetadata->getStoreLabel()); - $this->assertEquals($this->_validateRules, $attributeMetadata->getValidationRules()); + $this->assertEquals($this->validationRules, $attributeMetadata->getValidationRules()); $this->assertEquals(self::FRONTEND_CLASS, $attributeMetadata->getFrontendClass()); } } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/AddressConverterTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/AddressConverterTest.php index fcbabe9023404404de029e866c613fcf1b8e8322..2b973dc8fb3620d294f172fb356f7a5a3a51dc69 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/AddressConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/AddressConverterTest.php @@ -23,7 +23,7 @@ */ namespace Magento\Customer\Service\V1\Data; -use Magento\Customer\Service\V1\CustomerMetadataService; +use Magento\Customer\Service\V1\AddressMetadataService; use Magento\Framework\Service\Data\Eav\AttributeValue; class AddressConverterTest extends \PHPUnit_Framework_TestCase @@ -31,30 +31,42 @@ class AddressConverterTest extends \PHPUnit_Framework_TestCase /** @var \Magento\TestFramework\Helper\ObjectManager */ protected $_objectManager; - /** @var CustomerMetadataService */ - protected $_customerMetadataService; + /** @var AddressMetadataService */ + protected $addressMetadataService; protected function setUp() { $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - /** @var CustomerMetadataService $customerMetadataService */ - $this->_customerMetadataService = $this->getMockBuilder( - 'Magento\Customer\Service\V1\CustomerMetadataService' - )->setMethods( - array('getCustomAddressAttributeMetadata') - )->disableOriginalConstructor()->getMock(); - $this->_customerMetadataService->expects( - $this->any() - )->method( - 'getCustomAddressAttributeMetadata' - )->will( - $this->returnValue( - array( - new \Magento\Framework\Object(array('attribute_code' => 'warehouse_zip')), - new \Magento\Framework\Object(array('attribute_code' => 'warehouse_alternate')) - ) - ) - ); + $this->addressMetadataService = $this->getMockBuilder('Magento\Customer\Service\V1\AddressMetadataService') + ->setMethods(array('getAttributeMetadata', 'getCustomAttributesMetadata')) + ->disableOriginalConstructor() + ->getMock(); + + $customAttributeMetadata1 = $this->getMockBuilder('Magento\Customer\Service\V1\Data\Eav\AttributeMetadata') + ->disableOriginalConstructor() + ->getMock(); + $customAttributeMetadata1 + ->expects($this->any()) + ->method('getAttributeCode') + ->will($this->returnValue('warehouse_zip')); + + $customAttributeMetadata2 = $this->getMockBuilder('Magento\Customer\Service\V1\Data\Eav\AttributeMetadata') + ->disableOriginalConstructor() + ->getMock(); + $customAttributeMetadata2 + ->expects($this->any()) + ->method('getAttributeCode') + ->will($this->returnValue('warehouse_alternate')); + + $attributesMetadata = array($customAttributeMetadata1, $customAttributeMetadata2); + $this->addressMetadataService + ->expects($this->any()) + ->method('getAttributeMetadata') + ->will($this->returnValue($attributesMetadata)); + $this->addressMetadataService + ->expects($this->any()) + ->method('getCustomAttributesMetadata') + ->will($this->returnValue($attributesMetadata)); } public function testToFlatArray() @@ -122,7 +134,7 @@ class AddressConverterTest extends \PHPUnit_Framework_TestCase [ 'valueBuilder' => $valueBuilder, 'regionBuilder' => $this->_objectManager->getObject('\Magento\Customer\Service\V1\Data\RegionBuilder'), - 'metadataService' => $this->_customerMetadataService + 'metadataService' => $this->addressMetadataService ] ); $addressData = $addressDataBuilder->mergeDataObjectWithArray($addressData, $updatedAddressData); @@ -145,7 +157,7 @@ class AddressConverterTest extends \PHPUnit_Framework_TestCase [ 'valueBuilder' => $valueBuilder, 'regionBuilder' => $regionBuilder, - 'metadataService' => $this->_customerMetadataService + 'metadataService' => $this->addressMetadataService ] )->setId( '1' diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/AddressTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/AddressTest.php index 5caf847a8ed7913c6e6129cf37734affe254e712..2a4e6bc31e88c98b84ffa31fc1851b7858179e3c 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/AddressTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/AddressTest.php @@ -108,14 +108,14 @@ class AddressTest extends \PHPUnit_Framework_TestCase $regionBuilder = $this->objectManagerHelper->getObject('Magento\Customer\Service\V1\Data\RegionBuilder'); /** @var \Magento\Customer\Service\V1\CustomerMetadataService $customerMetadataService */ $this->_customerMetadataService = $this->getMockBuilder( - 'Magento\Customer\Service\V1\CustomerMetadataService' + 'Magento\Customer\Service\V1\AddressMetadataService' )->setMethods( - array('getCustomAddressAttributeMetadata') + array('getCustomAttributesMetadata') )->disableOriginalConstructor()->getMock(); $this->_customerMetadataService->expects( $this->any() )->method( - 'getCustomAddressAttributeMetadata' + 'getCustomAttributesMetadata' )->will( $this->returnValue( array( diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/CustomerBuilderTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/CustomerBuilderTest.php index a6ba8c23725868b2f9f577fec970919e221d3a00..d93576a5de17ef30a6aa55e8735a0d4c7b6a3426 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/CustomerBuilderTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/CustomerBuilderTest.php @@ -39,6 +39,9 @@ class CustomerBuilderTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Service\V1\CustomerMetadataService */ private $_customerMetadataService; + /** @var \Magento\Customer\Service\V1\AddressMetadataService */ + private $_addressMetadataService; + /** @var \Magento\Framework\Service\Data\Eav\AttributeValueBuilder */ private $_valueBuilder; @@ -49,12 +52,12 @@ class CustomerBuilderTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService = $this->getMockBuilder( 'Magento\Customer\Service\V1\CustomerMetadataService' )->setMethods( - array('getCustomCustomerAttributeMetadata') + array('getCustomAttributesMetadata') )->disableOriginalConstructor()->getMock(); $this->_customerMetadataService->expects( $this->any() )->method( - 'getCustomCustomerAttributeMetadata' + 'getCustomAttributesMetadata' )->will( $this->returnValue( array( @@ -63,6 +66,23 @@ class CustomerBuilderTest extends \PHPUnit_Framework_TestCase ) ) ); + $this->_addressMetadataService = $this->getMockBuilder( + 'Magento\Customer\Service\V1\AddressMetadataService' + )->setMethods( + array('getCustomAttributesMetadata') + )->disableOriginalConstructor()->getMock(); + $this->_addressMetadataService->expects( + $this->any() + )->method( + 'getCustomAttributesMetadata' + )->will( + $this->returnValue( + array( + new \Magento\Framework\Object(array('attribute_code' => 'warehouse_zip')), + new \Magento\Framework\Object(array('attribute_code' => 'warehouse_alternate')) + ) + ) + ); $this->_valueBuilder = $this->_objectManager->getObject( 'Magento\Framework\Service\Data\Eav\AttributeValueBuilder' ); @@ -167,7 +187,7 @@ class CustomerBuilderTest extends \PHPUnit_Framework_TestCase [ 'valueBuilder' => $this->_valueBuilder, 'regionBuilder' => $this->_objectManager->getObject('\Magento\Customer\Service\V1\Data\RegionBuilder'), - 'metadataService' => $this->_customerMetadataService + 'metadataService' => $this->_addressMetadataService ] )->create(); $this->_customerBuilder->populate($addressData); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/CustomerTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/CustomerTest.php index b4d74c45ddf286d9d7584534b01b93b5eeb8bb4c..840fd79671ef83dfc15c02e2cff135a96ebbac93 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/CustomerTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/CustomerTest.php @@ -88,7 +88,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase $customerMetadataService->expects( $this->any() )->method( - 'getCustomCustomerAttributeMetadata' + 'getCustomAttributesMetadata' )->will( $this->returnValue([ new \Magento\Framework\Object(['attribute_code' => 'zip']), diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataConverterTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataConverterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..062464a2d1f359070a2c82c9dd3295ffd83e3764 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataConverterTest.php @@ -0,0 +1,170 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Customer\Service\V1\Data\Eav; + +class AttributeMetadataConverterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + } + + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testCreateMetadataAttribute() + { + $attribute = $this->getMockBuilder('Magento\Customer\Model\Attribute') + ->disableOriginalConstructor() + ->setMethods([ + 'usesSource', + 'getSource', + 'getValidateRules', + 'getAttributeCode', + 'getFrontendInput', + 'getInputFilter', + 'getStoreLabel', + 'getIsVisible', + 'getIsRequired', + 'getMultilineCount', + 'getDataModel', + 'getFrontend', + 'getFrontendLabel', + 'getBackendType', + 'getNote', + 'getIsSystem', + 'getIsUserDefined', + 'getSortOrder', + '__wakeup', + ]) + ->getMock(); + + $frontend = $this->getMockBuilder('Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend') + ->disableOriginalConstructor() + ->setMethods(['getClass']) + ->getMock(); + $attribute->expects($this->once())->method('getFrontend')->will($this->returnValue($frontend)); + $frontendClass = 'class'; + $frontend->expects($this->once())->method('getClass')->will($this->returnValue($frontendClass)); + + $attribute->expects($this->once())->method('usesSource')->will($this->returnValue(true)); + $source = $this->getMockBuilder('Magento\Eav\Model\Entity\Attribute\Source\AbstractSource') + ->disableOriginalConstructor() + ->setMethods(['getAllOptions']) + ->getMock(); + $options = [ + [ + 'label' => 'label1', + 'value' => 'value1', + ], + [ + 'label' => 'label2', + 'value' => 'value2', + ] + ]; + $source->expects($this->once())->method('getAllOptions')->will($this->returnValue($options)); + $attribute->expects($this->once())->method('getSource')->will($this->returnValue($source)); + $attribute->expects($this->once())->method('getValidateRules')->will($this->returnValue( + [ + 'name1' => 'value1', + 'name2' => 'value2', + ] + )); + + $attributeCode = 'attrCode'; + $frontendInput = 'frontendInput'; + $inputFilter = 'inputFilter'; + $storeLabel = 'storeLabel'; + $isVisible = 'isVisible'; + $isRequired = 'isRequired'; + $multilineCount = 'multilineCount'; + $dataModel = 'dataModel'; + $frontendLabel = 'frontendLabel'; + $backendType = 'backendType'; + $note = 'note'; + $isSystem = 'isSystem'; + $isUserDefined = 'isUserDefined'; + $sortOrder = 'sortOrder'; + + $attribute->expects($this->once())->method('getAttributeCode')->will($this->returnValue($attributeCode)); + $attribute->expects($this->once())->method('getFrontendInput')->will($this->returnValue($frontendInput)); + $attribute->expects($this->once())->method('getInputFilter')->will($this->returnValue($inputFilter)); + $attribute->expects($this->once())->method('getStoreLabel')->will($this->returnValue($storeLabel)); + $attribute->expects($this->once())->method('getIsVisible')->will($this->returnValue($isVisible)); + $attribute->expects($this->once())->method('getIsRequired')->will($this->returnValue($isRequired)); + $attribute->expects($this->once())->method('getMultilineCount')->will($this->returnValue($multilineCount)); + $attribute->expects($this->once())->method('getDataModel')->will($this->returnValue($dataModel)); + $attribute->expects($this->once())->method('getFrontendLabel')->will($this->returnValue($frontendLabel)); + $attribute->expects($this->once())->method('getBackendType')->will($this->returnValue($backendType)); + $attribute->expects($this->once())->method('getNote')->will($this->returnValue($note)); + $attribute->expects($this->once())->method('getIsSystem')->will($this->returnValue($isSystem)); + $attribute->expects($this->once())->method('getIsUserDefined')->will($this->returnValue($isUserDefined)); + $attribute->expects($this->once())->method('getSortOrder')->will($this->returnValue($sortOrder)); + + $converter = $this->objectManager->getObject( + 'Magento\Customer\Service\V1\Data\Eav\AttributeMetadataConverter' + ); + + $metadataAttribute = $converter->createMetadataAttribute($attribute); + + $this->assertEquals($attributeCode, $metadataAttribute->getAttributeCode()); + $this->assertEquals($frontendInput, $metadataAttribute->getFrontendInput()); + $this->assertEquals($inputFilter, $metadataAttribute->getInputFilter()); + $this->assertEquals($storeLabel, $metadataAttribute->getStoreLabel()); + $this->assertEquals($isVisible, $metadataAttribute->isVisible()); + $this->assertEquals($isRequired, $metadataAttribute->isRequired()); + $this->assertEquals($multilineCount, $metadataAttribute->getMultilineCount()); + $this->assertEquals($dataModel, $metadataAttribute->getDataModel()); + $this->assertEquals($frontendClass, $metadataAttribute->getFrontendClass()); + $this->assertEquals($frontendLabel, $metadataAttribute->getFrontendLabel()); + $this->assertEquals($backendType, $metadataAttribute->getBackendType()); + $this->assertEquals($note, $metadataAttribute->getNote()); + $this->assertEquals($isSystem, $metadataAttribute->isSystem()); + $this->assertEquals($isUserDefined, $metadataAttribute->isUserDefined()); + $this->assertEquals($sortOrder, $metadataAttribute->getSortOrder()); + + $optionBuilder = $this->objectManager->getObject( + 'Magento\Customer\Service\V1\Data\Eav\OptionBuilder' + ); + $expectedOptions = [ + $optionBuilder->setLabel('label1')->setValue('value1')->create(), + $optionBuilder->setLabel('label2')->setValue('value2')->create(), + ]; + $this->assertEquals($expectedOptions, $metadataAttribute->getOptions()); + + $validateRulesBuilder = $this->objectManager->getObject( + 'Magento\Customer\Service\V1\Data\Eav\ValidationRuleBuilder' + ); + $expectedRules = [ + $validateRulesBuilder->setName('name1')->setValue('value1')->create(), + $validateRulesBuilder->setName('name2')->setValue('value2')->create(), + ]; + $this->assertEquals($expectedRules, $metadataAttribute->getValidationRules()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataDataProviderTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataDataProviderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..907513501d486636db763c033bc91b3601c635ee --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/Data/Eav/AttributeMetadataDataProviderTest.php @@ -0,0 +1,203 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Customer\Service\V1\Data\Eav; + +class AttributeMetadataDataProviderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + /** + * @var \Magento\Eav\Model\Config + */ + protected $configEav; + + /** + * @var \Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory + */ + protected $attrFormCollectionFactory; + + /** + * @var \Magento\Customer\Model\Resource\Form\Attribute\Collection + */ + protected $attrFormCollection; + + /** + * @var \Magento\Store\Model\StoreManager + */ + protected $storeManager; + + /** + * @var AttributeMetadataDataProvider + */ + protected $attributeMetadataProvider; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->configEav = $this->getMockBuilder('Magento\Eav\Model\Config') + ->disableOriginalConstructor() + ->setMethods(['getAttribute', 'getEntityAttributeCodes']) + ->getMock(); + + $this->attrFormCollection = $this->getMockBuilder('Magento\Customer\Model\Resource\Form\Attribute\Collection') + ->disableOriginalConstructor() + ->setMethods(['setStore', 'setEntityType', 'addFormCodeFilter', 'setSortOrder']) + ->getMock(); + + $this->attrFormCollectionFactory = $this->getMockBuilder( + 'Magento\Customer\Model\Resource\Form\Attribute\CollectionFactory' + )->disableOriginalConstructor()->setMethods(['create'])->getMock(); + + $this->attrFormCollectionFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->attrFormCollection)); + + $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManager') + ->disableOriginalConstructor() + ->setMethods(['getStore']) + ->getMock(); + + $this->attributeMetadataProvider = $this->objectManager->getObject( + 'Magento\Customer\Service\V1\Data\Eav\AttributeMetadataDataProvider', + [ + 'eavConfig' => $this->configEav, + 'attrFormCollectionFactory' => $this->attrFormCollectionFactory, + 'storeManager' => $this->storeManager + ] + ); + } + + public function testGetAttribute() + { + $entityType = 'entityType'; + $attributeCode = 'attributeCode'; + $value = 'value'; + + $this->configEav->expects($this->once()) + ->method('getAttribute') + ->with($entityType, $attributeCode) + ->will($this->returnValue($value)); + + $actualValue = $this->attributeMetadataProvider->getAttribute($entityType, $attributeCode); + + $this->assertEquals($value, $actualValue); + } + + public function testGetAllAttributeCodesWithStoreId() + { + $entityType = 'entityType'; + $attributeSetId = 'attributeSetId'; + $storeId = 'storeId'; + $value = 'value'; + + $objectCodes = new \Magento\Framework\Object( + [ + 'store_id' => $storeId, + 'attribute_set_id' => $attributeSetId, + ] + ); + + $this->configEav->expects($this->once()) + ->method('getEntityAttributeCodes') + ->with($entityType, $objectCodes) + ->will($this->returnValue($value)); + + $actualValue = $this->attributeMetadataProvider->getAllAttributeCodes($entityType, $attributeSetId, $storeId); + + $this->assertEquals($value, $actualValue); + } + + public function testGetAllAttributeCodesWithoutStoreId() + { + $entityType = 'entityType'; + $attributeSetId = 'attributeSetId'; + $storeId = 'storeId'; + $value = 'value'; + + $store = $this->getMockBuilder('Magento\Model\Store') + ->disableOriginalConstructor() + ->setMethods(['getId']) + ->getMock(); + $store->expects($this->once()) + ->method('getId') + ->will($this->returnValue($storeId)); + + $this->storeManager->expects($this->once()) + ->method('getStore') + ->will($this->returnValue($store)); + + $objectCodes = new \Magento\Framework\Object( + [ + 'store_id' => $storeId, + 'attribute_set_id' => $attributeSetId, + ] + ); + + $this->configEav->expects($this->once()) + ->method('getEntityAttributeCodes') + ->with($entityType, $objectCodes) + ->will($this->returnValue($value)); + + $actualValue = $this->attributeMetadataProvider->getAllAttributeCodes($entityType, $attributeSetId, null); + + $this->assertEquals($value, $actualValue); + } + + public function testLoadAttributesCollection() + { + $entityType = 'entityType'; + $formCode = 'formCode'; + + $store = $this->getMockBuilder('Magento\Model\Store') + ->disableOriginalConstructor() + ->getMock(); + $this->storeManager->expects($this->once()) + ->method('getStore') + ->will($this->returnValue($store)); + + $this->attrFormCollection->expects($this->once()) + ->method('setStore') + ->with($store) + ->will($this->returnSelf()); + $this->attrFormCollection->expects($this->once()) + ->method('setEntityType') + ->with($entityType) + ->will($this->returnSelf()); + $this->attrFormCollection->expects($this->once()) + ->method('addFormCodeFilter') + ->with($formCode) + ->will($this->returnSelf()); + $this->attrFormCollection->expects($this->once()) + ->method('setSortOrder') + ->will($this->returnSelf()); + + $actualValue = $this->attributeMetadataProvider->loadAttributesCollection($entityType, $formCode); + + $this->assertEquals($this->attrFormCollection, $actualValue); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultilineTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultilineTest.php index 8db21719266e209cde93f0444523a593c08fb81d..1814e89dee5de6a8aa840c72a65a569c78fb3eb6 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultilineTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultilineTest.php @@ -130,11 +130,12 @@ class MultilineTest extends \PHPUnit_Framework_TestCase * @covers \Magento\Eav\Model\Attribute\Data\Text::validateValue * * @param mixed $value + * @param bool $isAttributeRequired * @param array $rules * @param array $expectedResult * @dataProvider validateValueDataProvider */ - public function testValidateValue($value, $rules, $expectedResult) + public function testValidateValue($value, $isAttributeRequired, $rules, $expectedResult) { $entityMock = $this->getMock('\Magento\Framework\Model\AbstractModel', [], [], '', false); $entityMock->expects($this->any())->method('getDataUsingMethod')->will($this->returnValue("value1\nvalue2")); @@ -143,6 +144,7 @@ class MultilineTest extends \PHPUnit_Framework_TestCase $attributeMock->expects($this->any())->method('getMultilineCount')->will($this->returnValue(2)); $attributeMock->expects($this->any())->method('getValidateRules')->will($this->returnValue($rules)); $attributeMock->expects($this->any())->method('getStoreLabel')->will($this->returnValue('Label')); + $attributeMock->expects($this->any())->method('getIsRequired')->will($this->returnValue($isAttributeRequired)); $this->stringMock->expects($this->any())->method('strlen')->will($this->returnValue(5)); @@ -159,29 +161,58 @@ class MultilineTest extends \PHPUnit_Framework_TestCase return [ [ 'value' => false, + 'isAttributeRequired' => false, 'rules' => [], 'expectedResult' => true, ], [ 'value' => 'value', + 'isAttributeRequired' => false, 'rules' => [], 'expectedResult' => true, ], [ 'value' => ['value1', 'value2'], + 'isAttributeRequired' => false, 'rules' => [], 'expectedResult' => true, ], [ 'value' => 'value', + 'isAttributeRequired' => false, 'rules' => ['max_text_length' => 3], 'expectedResult' => ['"Label" length must be equal or less than 3 characters.'], ], [ 'value' => 'value', + 'isAttributeRequired' => false, 'rules' => ['min_text_length' => 10], 'expectedResult' => ['"Label" length must be equal or greater than 10 characters.'], - ] + ], + [ + 'value' => "value1\nvalue2\nvalue3", + 'isAttributeRequired' => false, + 'rules' => [], + 'expectedResult' => ['"Label" cannot contain more than 2 lines.'], + ], + [ + 'value' => ['value1', 'value2', 'value3'], + 'isAttributeRequired' => false, + 'rules' => [], + 'expectedResult' => ['"Label" cannot contain more than 2 lines.'], + ], + [ + 'value' => [], + 'isAttributeRequired' => true, + 'rules' => [], + 'expectedResult' => ['"Label" is a required value.'], + ], + [ + 'value' => '', + 'isAttributeRequired' => true, + 'rules' => [], + 'expectedResult' => ['"Label" is a required value.'], + ], ]; } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/ViewTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ViewTest.php index 7df8f4bd21635aba8965d4680a7026d7b59ba55f..bd77b734bf6a70c362209da154eeee74c86e51d8 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ViewTest.php @@ -66,16 +66,28 @@ class ViewTest extends \PHPUnit_Framework_TestCase $this->_layoutMock = $this->getMock('Magento\Framework\View\Layout', array(), array(), '', false); $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_configScopeMock = $this->getMock('Magento\Framework\Config\ScopeInterface'); - $this->_layoutProcessor = $this->getMock('Magento\Framework\View\Layout\ProcessorInterface'); - $this->_layoutMock->expects( - $this->any() - )->method( - 'getUpdate' - )->will( - $this->returnValue($this->_layoutProcessor) - ); + $this->_layoutProcessor = $this->getMock('Magento\Core\Model\Layout\Merge', [], [], '', false); + $this->_layoutMock->expects($this->any())->method('getUpdate') + ->will($this->returnValue($this->_layoutProcessor)); $this->_actionFlagMock = $this->getMock('Magento\Framework\App\ActionFlag', array(), array(), '', false); $this->_eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); + $resultPage = $this->getMockBuilder('Magento\Framework\View\Result\Page') + ->setConstructorArgs( + $helper->getConstructArguments('Magento\Framework\View\Result\Page', ['request' => $this->_requestMock]) + ) + ->setMethods(['getLayout']) + ->getMock(); + $resultPage->expects($this->any()) + ->method('getLayout') + ->will($this->returnValue($this->_layoutMock)); + $pageFactory = $this->getMockBuilder('Magento\Framework\View\Result\PageFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $pageFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($resultPage)); + $this->_view = $helper->getObject( 'Magento\Framework\App\View', array( @@ -84,7 +96,8 @@ class ViewTest extends \PHPUnit_Framework_TestCase 'response' => $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false), 'configScope' => $this->_configScopeMock, 'eventManager' => $this->_eventManagerMock, - 'actionFlag' => $this->_actionFlagMock + 'actionFlag' => $this->_actionFlagMock, + 'pageFactory' => $pageFactory ) ); } @@ -148,13 +161,10 @@ class ViewTest extends \PHPUnit_Framework_TestCase public function testGetDefaultLayoutHandle() { - $this->_requestMock->expects( - $this->once() - )->method( - 'getFullActionName' - )->will( - $this->returnValue('ExpectedValue') - ); + $this->_requestMock->expects($this->once()) + ->method('getFullActionName') + ->will($this->returnValue('ExpectedValue')); + $this->assertEquals('expectedvalue', $this->_view->getDefaultLayoutHandle()); } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Service/Config/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Framework/Service/Config/ConverterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..2fcf2ebc156b750720bc9149a1e3f5ef0f3016e1 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Service/Config/ConverterTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Framework\Service\Config; + +class ConverterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\Service\Config\Converter + */ + protected $_converter; + + /** + * Initialize parameters + */ + protected function setUp() + { + $this->_converter = new \Magento\Framework\Service\Config\Converter(); + } + + /** + * Test invalid data + */ + public function testInvalidData() + { + $result = $this->_converter->convert(array('invalid data')); + $this->assertEmpty($result); + } + + /** + * Test empty data + */ + public function testConvertNoElements() + { + $result = $this->_converter->convert(new \DOMDocument()); + $this->assertEmpty($result); + } + + /** + * Test converting valid data object config + */ + public function testConvert() + { + $expected = [ + 'Magento\Tax\Service\V1\Data\TaxRate' => [ + ], + 'Magento\Catalog\Service\Data\V1\Product' => [ + 'stock_item' => 'Magento\CatalogInventory\Service\Data\V1\StockItem' + ], + 'Magento\Customer\Service\V1\Data\Customer' => [ + 'custom_1' => 'Magento\Customer\Service\V1\Data\CustomerCustom', + 'custom_2' => 'Magento\CustomerExtra\Service\V1\Data\CustomerCustom2' + ], + ]; + + $xmlFile = __DIR__ . '/_files/data_object_valid.xml'; + $dom = new \DOMDocument(); + $dom->loadXML(file_get_contents($xmlFile)); + $result = $this->_converter->convert($dom); + $this->assertEquals($expected, $result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Service/Config/ReaderTest.php b/dev/tests/unit/testsuite/Magento/Framework/Service/Config/ReaderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b76599297c9a30cdfd5bea9c281e69a48c5fcaba --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Service/Config/ReaderTest.php @@ -0,0 +1,60 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Framework\Service\Config; + +class ReaderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\Service\Config\Reader + */ + protected $_reader; + + /** + * Prepare parameters + */ + public function setUp() + { + $fileResolver = $this->getMockBuilder('Magento\Framework\App\Config\FileResolver') + ->disableOriginalConstructor() + ->getMock(); + $converter = $this->getMockBuilder('Magento\Framework\Service\Config\Converter') + ->disableOriginalConstructor() + ->getMock(); + $schema = $this->getMockBuilder('Magento\Framework\Service\Config\SchemaLocator') + ->disableOriginalConstructor() + ->getMock(); + $validator = $this->getMockBuilder('\Magento\Framework\Config\ValidationStateInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->_reader = new \Magento\Framework\Service\Config\Reader($fileResolver, $converter, $schema, $validator); + } + + /** + * Test creating object + */ + public function testInstanceof() + { + $this->assertInstanceOf('Magento\Framework\Service\Config\Reader', $this->_reader); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Service/Config/SchemaLocatorTest.php b/dev/tests/unit/testsuite/Magento/Framework/Service/Config/SchemaLocatorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8547e4e0789da8cc01b8b869edfb40826a7feb4e --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Service/Config/SchemaLocatorTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Framework\Service\Config; + +/** + * Test for \Magento\Framework\Service\Config\SchemaLocator + */ +class SchemaLocatorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\Service\Config\SchemaLocator + */ + protected $_model; + + protected function setUp() + { + $this->_model = new \Magento\Framework\Service\Config\SchemaLocator(); + } + + public function testGetSchema() + { + $expected = str_replace('\\', '/', BP . '/lib/internal/Magento/Framework/Service/etc/data_object.xsd'); + $actual = str_replace('\\', '/', $this->_model->getSchema()); + $this->assertEquals($expected, $actual); + } + + public function testGetPerFileSchema() + { + $actual = str_replace('\\', '/', $this->_model->getPerFileSchema()); + $expected = str_replace('\\', '/', BP . '/lib/internal/Magento/Framework/Service/etc/data_object.xsd'); + $this->assertEquals($expected, $actual); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Service/Config/_files/data_object_valid.xml b/dev/tests/unit/testsuite/Magento/Framework/Service/Config/_files/data_object_valid.xml new file mode 100644 index 0000000000000000000000000000000000000000..f59381a1f0a680457c67a49bdeb6559abbe1f715 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Service/Config/_files/data_object_valid.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Service/etc/data_object.xsd"> + <custom_attributes for="Magento\Tax\Service\V1\Data\TaxRate"> + </custom_attributes> + <custom_attributes for="Magento\Catalog\Service\Data\V1\Product"> + <attribute code="stock_item" type="Magento\CatalogInventory\Service\Data\V1\StockItem" /> + </custom_attributes> + <custom_attributes for="Magento\Customer\Service\V1\Data\Customer"> + <attribute code="custom_1" type="Magento\Customer\Service\V1\Data\CustomerCustom" /> + <attribute code="custom_2" type="Magento\CustomerExtra\Service\V1\Data\CustomerCustom2" /> + </custom_attributes> +</config> diff --git a/dev/tests/unit/testsuite/Magento/Framework/Service/Data/Eav/AttributeValueTest.php b/dev/tests/unit/testsuite/Magento/Framework/Service/Data/Eav/AttributeValueTest.php index 9534bf01a7318c9415c4fbf1d78e65f87f942271..41ba4f1794e10991f600d77ed1a2be1e0d6c001e 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Service/Data/Eav/AttributeValueTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Service/Data/Eav/AttributeValueTest.php @@ -23,21 +23,65 @@ */ namespace Magento\Framework\Service\Data\Eav; +use Magento\Framework\Validator\Test\True; + class AttributeValueTest extends \PHPUnit_Framework_TestCase { const ATTRIBUTE_CODE = 'ATTRIBUTE_CODE'; - const VALUE = 'VALUE'; + const STRING_VALUE = 'VALUE'; + + const INTEGER_VALUE = 1; + + const FLOAT_VALUE = 1.0; + + const BOOLEAN_VALUE = true; + + public function testConstructorAndGettersWithString() + { + $helper = new \Magento\TestFramework\Helper\ObjectManager($this); + $attributeBuilder = $helper->getObject('\Magento\Framework\Service\Data\Eav\AttributeValueBuilder') + ->setAttributeCode(self::ATTRIBUTE_CODE) + ->setValue(self::STRING_VALUE); + $attribute = new AttributeValue($attributeBuilder); + + $this->assertSame(self::ATTRIBUTE_CODE, $attribute->getAttributeCode()); + $this->assertSame(self::STRING_VALUE, $attribute->getValue()); + } + + public function testConstructorAndGettersWithInteger() + { + $helper = new \Magento\TestFramework\Helper\ObjectManager($this); + $attributeBuilder = $helper->getObject('\Magento\Framework\Service\Data\Eav\AttributeValueBuilder') + ->setAttributeCode(self::ATTRIBUTE_CODE) + ->setValue(self::INTEGER_VALUE); + $attribute = new AttributeValue($attributeBuilder); + + $this->assertSame(self::ATTRIBUTE_CODE, $attribute->getAttributeCode()); + $this->assertSame(self::INTEGER_VALUE, $attribute->getValue()); + } + + public function testConstructorAndGettersWithFloat() + { + $helper = new \Magento\TestFramework\Helper\ObjectManager($this); + $attributeBuilder = $helper->getObject('\Magento\Framework\Service\Data\Eav\AttributeValueBuilder') + ->setAttributeCode(self::ATTRIBUTE_CODE) + ->setValue(self::FLOAT_VALUE); + $attribute = new AttributeValue($attributeBuilder); + + $this->assertSame(self::ATTRIBUTE_CODE, $attribute->getAttributeCode()); + $this->assertSame(self::FLOAT_VALUE, $attribute->getValue()); + } - public function testConstructorAndGetters() + public function testConstructorAndGettersWithBoolean() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $attributeBuilder = $helper->getObject('\Magento\Framework\Service\Data\Eav\AttributeValueBuilder') ->setAttributeCode(self::ATTRIBUTE_CODE) - ->setValue(self::VALUE); + ->setValue(self::BOOLEAN_VALUE); $attribute = new AttributeValue($attributeBuilder); $this->assertSame(self::ATTRIBUTE_CODE, $attribute->getAttributeCode()); - $this->assertSame(self::VALUE, $attribute->getValue()); + $this->assertSame(self::BOOLEAN_VALUE, $attribute->getValue()); } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Service/DataObjectConverterTest.php b/dev/tests/unit/testsuite/Magento/Framework/Service/DataObjectConverterTest.php index da12eefa256cdfb98800d93ac46e9213bc392925..28f371caa263a7023da522a1c5797d0600a1414c 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Service/DataObjectConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Service/DataObjectConverterTest.php @@ -143,7 +143,7 @@ class DataObjectConverterTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); $metadataService->expects($this->any()) - ->method('getCustomCustomerAttributeMetadata') + ->method('getCustomAttributesMetadata') ->will($this->returnValue([])); /** @var \Magento\Customer\Service\V1\Data\CustomerBuilder $customerBuilder */ $customerBuilder = $objectManager->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Framework/Session/SessionManagerTest.php b/dev/tests/unit/testsuite/Magento/Framework/Session/SessionManagerTest.php index 1b7e52ee1644216ac51f8cee8b9c67ad2980ff11..d592e998ff3fd06d28ca6e9ddab7c9d4b5e0cac5 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Session/SessionManagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Session/SessionManagerTest.php @@ -116,18 +116,5 @@ namespace Magento\Framework\Session { $this->objectManager->getObject('Magento\Framework\Session\SessionManager'); $this->assertTrue(SessionManagerTest::$isIniSetInvoked); } - - /** - * @runInSeparateProcess - */ - public function testRegenerateId() - { - require_once __DIR__ . '/../../_files/session_backend_mock.php'; - - $this->mockSessionConfig->expects($this->once()) - ->method('getUseCookies') - ->will($this->returnValue(false)); - $this->assertSame($this->sessionManager, $this->sessionManager->regenerateId()); - } } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/File/Collector/BaseTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/File/Collector/BaseTest.php index cd0c1929b6a2322fda9740044b4cc6914e75b6a6..19bde27a256e75e94a58176616d4fdf793b63645 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/File/Collector/BaseTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/File/Collector/BaseTest.php @@ -57,8 +57,21 @@ class BaseTest extends \PHPUnit_Framework_TestCase ->with('Magento\Framework\View\File', $this->anything()) ->will($this->returnCallback(array($this, 'createFileCallback'))); $fileFactory = new \Magento\Framework\View\File\Factory($objectManager); - $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $theme->expects($this->once())->method('getArea')->will($this->returnValue('frontend')); + $theme = $this->getMock( + 'Magento\Framework\View\Design\ThemeInterface', + [ + 'getArea', + 'getThemePath', + 'getFullPath', + 'getParentTheme', + 'getCode', + 'isPhysical', + 'getInheritedThemes', + 'getId', + 'getData' + ] + ); + $theme->expects($this->once())->method('getData')->with('area')->will($this->returnValue('frontend')); $model = new Base($filesystem, $fileFactory, 'layout'); $result = $model->getFiles($theme, '*.xml'); diff --git a/dev/tests/unit/testsuite/Magento/Integration/Service/V1/AdminTokenServiceTest.php b/dev/tests/unit/testsuite/Magento/Integration/Service/V1/AdminTokenServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..32ac2a834077644587a4bd088ebb75297f993eaa --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Integration/Service/V1/AdminTokenServiceTest.php @@ -0,0 +1,170 @@ +<?php +/** + * Test for \Magento\Integration\Service\V1\TokenService + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Service\V1; + +use Magento\Integration\Model\Integration; +use Magento\Integration\Model\Oauth\Token; + +class AdminTokenServiceTest extends \PHPUnit_Framework_TestCase +{ + /** \Magento\Integration\Service\V1\TokenService */ + protected $_tokenService; + + /** \Magento\Integration\Model\Oauth\Token\Factory|\PHPUnit_Framework_MockObject_MockObject */ + protected $_tokenModelFactoryMock; + + /** \Magento\User\Model\User|\PHPUnit_Framework_MockObject_MockObject */ + protected $_userModelMock; + + /** \Magento\Integration\Model\Resource\Oauth\Token\Collection|\PHPUnit_Framework_MockObject_MockObject */ + protected $_tokenModelCollectionMock; + + /** \Magento\Integration\Model\Resource\Oauth\Token\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject */ + protected $_tokenModelCollectionFactoryMock; + + /** + * @var \Magento\Integration\Model\Oauth\Token|\PHPUnit_Framework_MockObject_MockObject + */ + private $_tokenMock; + + protected function setUp() + { + $this->_tokenModelFactoryMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token\Factory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + + $this->_userModelMock = $this->getMockBuilder('Magento\User\Model\User') + ->disableOriginalConstructor() + ->getMock(); + + $this->_customerAccountServiceMock = $this + ->getMockBuilder('Magento\Customer\Service\V1\CustomerAccountServiceInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->_tokenMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token') + ->disableOriginalConstructor() + ->setMethods(['getToken', 'loadByAdminId', 'setRevoked', 'save', '__wakeup'])->getMock(); + + $this->_tokenModelCollectionMock = $this->getMockBuilder( + 'Magento\Integration\Model\Resource\Oauth\Token\Collection' + )->disableOriginalConstructor()->setMethods( + ['addFilterByAdminId', 'getSize', '__wakeup', '_beforeLoad', '_afterLoad', 'getIterator'] + )->getMock(); + + $this->_tokenModelCollectionFactoryMock = $this->getMockBuilder( + 'Magento\Integration\Model\Resource\Oauth\Token\CollectionFactory' + )->setMethods(['create'])->disableOriginalConstructor()->getMock(); + + $this->_tokenModelCollectionFactoryMock->expects($this->once()) + ->method('create') + ->will($this->returnValue($this->_tokenModelCollectionMock)); + + $this->_tokenService = new \Magento\Integration\Service\V1\TokenService( + $this->_tokenModelFactoryMock, + $this->_userModelMock, + $this->_customerAccountServiceMock, + $this->_tokenModelCollectionFactoryMock + ); + + } + + public function testRevokeAdminAccessToken() + { + $adminId = 1; + + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('addFilterByAdminId') + ->with($adminId) + ->will($this->returnValue($this->_tokenModelCollectionMock)); + $this->_tokenModelCollectionMock->expects($this->any()) + ->method('getSize') + ->will($this->returnValue(1)); + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('getIterator') + ->will($this->returnValue(new \ArrayIterator([$this->_tokenMock]))); + $this->_tokenModelCollectionMock->expects($this->any()) + ->method('_fetchAll') + ->with(null) + ->will($this->returnValue(1)); + $this->_tokenMock->expects($this->once()) + ->method('setRevoked') + ->will($this->returnValue($this->_tokenMock)); + $this->_tokenMock->expects($this->once()) + ->method('save'); + + $this->assertTrue($this->_tokenService->revokeAdminAccessToken($adminId)); + } + + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage This user has no tokens. + */ + public function testRevokeAdminAccessTokenWithoutAdminId() + { + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('addFilterByAdminId') + ->with(null) + ->will($this->returnValue($this->_tokenModelCollectionMock)); + $this->_tokenMock->expects($this->never()) + ->method('save'); + $this->_tokenMock->expects($this->never()) + ->method('setRevoked') + ->will($this->returnValue($this->_tokenMock)); + $this->_tokenService->revokeAdminAccessToken(null); + } + + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage The tokens could not be revoked. + */ + public function testRevokeAdminAccessTokenCannotRevoked() + { + $exception = new \Exception(); + $adminId = 1; + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('addFilterByAdminId') + ->with($adminId) + ->will($this->returnValue($this->_tokenModelCollectionMock)); + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('getSize') + ->will($this->returnValue(1)); + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('getIterator') + ->will($this->returnValue(new \ArrayIterator([$this->_tokenMock]))); + + $this->_tokenMock->expects($this->never()) + ->method('save'); + $this->_tokenMock->expects($this->once()) + ->method('setRevoked') + ->will($this->throwException($exception)); + $this->_tokenService->revokeAdminAccessToken($adminId); + } +} + + diff --git a/dev/tests/unit/testsuite/Magento/Integration/Service/V1/TokenServiceTest.php b/dev/tests/unit/testsuite/Magento/Integration/Service/V1/TokenServiceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..3c381a05d0ca4378675f54309cbc2f1aa675c509 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Integration/Service/V1/TokenServiceTest.php @@ -0,0 +1,172 @@ +<?php +/** + * Test for \Magento\Integration\Service\V1\TokenService + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Service\V1; + +use Magento\Integration\Model\Integration; +use Magento\Integration\Model\Oauth\Token; + +class TokenServiceTest extends \PHPUnit_Framework_TestCase +{ + /** \Magento\Integration\Service\V1\TokenService */ + protected $_tokenService; + + /** \Magento\Integration\Model\Oauth\Token\Factory|\PHPUnit_Framework_MockObject_MockObject */ + protected $_tokenModelFactoryMock; + + /** \Magento\User\Model\User|\PHPUnit_Framework_MockObject_MockObject */ + protected $_userModelMock; + + /** \Magento\Customer\Service\V1\CustomerAccountServiceInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $_customerAccountServiceMock; + + /** \Magento\Integration\Model\Resource\Oauth\Token\Collection|\PHPUnit_Framework_MockObject_MockObject */ + protected $_tokenModelCollectionMock; + + /** \Magento\Integration\Model\Resource\Oauth\Token\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject */ + protected $_tokenModelCollectionFactoryMock; + + /** + * @var \Magento\Integration\Model\Oauth\Token|\PHPUnit_Framework_MockObject_MockObject + */ + private $_tokenMock; + + protected function setUp() + { + $this->_tokenModelFactoryMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token\Factory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + + $this->_userModelMock = $this->getMockBuilder('Magento\User\Model\User') + ->disableOriginalConstructor() + ->getMock(); + + $this->_customerAccountServiceMock = $this + ->getMockBuilder('Magento\Customer\Service\V1\CustomerAccountServiceInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->_tokenMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token') + ->disableOriginalConstructor() + ->setMethods(['getToken', 'loadByCustomerId', 'setRevoked', 'save', '__wakeup'])->getMock(); + + $this->_tokenModelCollectionMock = $this->getMockBuilder( + 'Magento\Integration\Model\Resource\Oauth\Token\Collection' + )->disableOriginalConstructor()->setMethods( + ['addFilterByCustomerId', 'getSize', '__wakeup', '_beforeLoad', '_afterLoad', 'getIterator'] + )->getMock(); + + $this->_tokenModelCollectionFactoryMock = $this->getMockBuilder( + 'Magento\Integration\Model\Resource\Oauth\Token\CollectionFactory' + )->setMethods(['create'])->disableOriginalConstructor()->getMock(); + + $this->_tokenModelCollectionFactoryMock->expects($this->once()) + ->method('create') + ->will($this->returnValue($this->_tokenModelCollectionMock)); + + $this->_tokenService = new \Magento\Integration\Service\V1\TokenService( + $this->_tokenModelFactoryMock, + $this->_userModelMock, + $this->_customerAccountServiceMock, + $this->_tokenModelCollectionFactoryMock + ); + + } + + public function testRevokeCustomerAccessToken() + { + $customerId = 1; + + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('addFilterByCustomerId') + ->with($customerId) + ->will($this->returnValue($this->_tokenModelCollectionMock)); + $this->_tokenModelCollectionMock->expects($this->any()) + ->method('getSize') + ->will($this->returnValue(1)); + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('getIterator') + ->will($this->returnValue(new \ArrayIterator([$this->_tokenMock]))); + $this->_tokenModelCollectionMock->expects($this->any()) + ->method('_fetchAll') + ->will($this->returnValue(1)); + $this->_tokenMock->expects($this->once()) + ->method('setRevoked') + ->will($this->returnValue($this->_tokenMock)); + $this->_tokenMock->expects($this->once()) + ->method('save'); + + $this->assertTrue($this->_tokenService->revokeCustomerAccessToken($customerId)); + } + + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage This customer has no tokens. + */ + public function testRevokeCustomerAccessTokenWithoutCustomerId() + { + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('addFilterByCustomerId') + ->with(null) + ->will($this->returnValue($this->_tokenModelCollectionMock)); + $this->_tokenMock->expects($this->never()) + ->method('save'); + $this->_tokenMock->expects($this->never()) + ->method('setRevoked') + ->will($this->returnValue($this->_tokenMock)); + $this->_tokenService->revokeCustomerAccessToken(null); + } + + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage The tokens could not be revoked. + */ + public function testRevokeCustomerAccessTokenCannotRevoked() + { + $exception = new \Exception(); + $customerId = 1; + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('addFilterByCustomerId') + ->with($customerId) + ->will($this->returnValue($this->_tokenModelCollectionMock)); + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('getSize') + ->will($this->returnValue(1)); + $this->_tokenModelCollectionMock->expects($this->once()) + ->method('getIterator') + ->will($this->returnValue(new \ArrayIterator([$this->_tokenMock]))); + + $this->_tokenMock->expects($this->never()) + ->method('save'); + $this->_tokenMock->expects($this->once()) + ->method('setRevoked') + ->will($this->throwException($exception)); + $this->_tokenService->revokeCustomerAccessToken($customerId); + } +} + + diff --git a/dev/tests/unit/testsuite/Magento/Payment/Model/MethodListTest.php b/dev/tests/unit/testsuite/Magento/Payment/Model/MethodListTest.php new file mode 100644 index 0000000000000000000000000000000000000000..6110a12cd47b3740a978248fb3d826993a7276cf --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Payment/Model/MethodListTest.php @@ -0,0 +1,101 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Payment\Model; + +class MethodListTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var MethodList + */ + protected $methodList; + + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $paymentHelperMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $specificationFactoryMock; + + protected function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->paymentHelperMock = $this->getMock('\Magento\Payment\Helper\Data', [], [], '', false); + $this->specificationFactoryMock = $this->getMock( + '\Magento\Payment\Model\Checks\SpecificationFactory', [], [], '', false + ); + $this->methodList = $this->objectManager->getObject( + '\Magento\Payment\Model\MethodList', + [ + 'paymentHelper' => $this->paymentHelperMock, + 'specificationFactory' => $this->specificationFactoryMock + ] + ); + } + + public function testGetAvailableMethods() + { + $storeId = 1; + $quoteMock = $this->getMock('\Magento\Sales\Model\Quote', [], [], '', false); + $quoteMock->expects($this->once())->method('getStoreId')->will($this->returnValue($storeId)); + $quoteMock->expects($this->atLeastOnce()) + ->method('getPayment') + ->will($this->returnValue($this->getMock('\Magento\Sales\Model\Quote\Payment', [], [], '', false))); + + $methodMock = $this->getMock('Magento\Payment\Model\Method\AbstractMethod', ['setInfoInstance'], [], '', false); + + $compositeMock = $this->getMock('\Magento\Payment\Model\Checks\Composite', [], [], '', false); + $compositeMock->expects($this->atLeastOnce()) + ->method('isApplicable') + ->with($methodMock, $quoteMock) + ->will($this->returnValue(true)); + + $this->specificationFactoryMock->expects($this->atLeastOnce()) + ->method('create') + ->will($this->returnValue($compositeMock)); + + $storeMethods = [$methodMock]; + + $this->paymentHelperMock->expects($this->once()) + ->method('getStoreMethods') + ->with($storeId, $quoteMock) + ->will($this->returnValue($storeMethods)); + + $methodMock->expects($this->atLeastOnce()) + ->method('setInfoInstance') + ->with($this->getMock('\Magento\Sales\Model\Quote\Payment', [], [], '', false)) + ->will($this->returnSelf()); + + $this->assertEquals([$methodMock], $this->methodList->getAvailableMethods($quoteMock)); + } +} + \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Rss/Block/Order/Info/Buttons/RssTest.php b/dev/tests/unit/testsuite/Magento/Rss/Block/Order/Info/Buttons/RssTest.php new file mode 100644 index 0000000000000000000000000000000000000000..30cb284ac86e13c6ace48c5f01788c3bf311b925 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Rss/Block/Order/Info/Buttons/RssTest.php @@ -0,0 +1,75 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Rss\Block\Order\Info\Buttons; + +use \Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; + +class RssTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Rss\Block\Order\Info\Buttons\Rss */ + protected $rss; + + /** @var ObjectManagerHelper */ + protected $objectManagerHelper; + + /** @var \Magento\Framework\View\Element\Template\Context|\PHPUnit_Framework_MockObject_MockObject */ + protected $context; + + /** @var \Magento\Framework\Registry */ + protected $registry; + + /** @var \Magento\Rss\Helper\Order|\PHPUnit_Framework_MockObject_MockObject */ + protected $rssOrderHelper; + + protected function setUp() + { + $this->context = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false); + $this->rssOrderHelper = $this->getMock('Magento\Rss\Helper\Order', [], [], '', false); + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->registry = $this->objectManagerHelper->getObject('Magento\Framework\Registry'); + + $this->rss = $this->objectManagerHelper->getObject( + 'Magento\Rss\Block\Order\Info\Buttons\Rss', + [ + 'context' => $this->context, + 'registry' => $this->registry, + 'orderHelper' => $this->rssOrderHelper + ] + ); + } + + public function testGetOrder() + { + $currentOrder = $this->getMock('Magento\Sales\Model\Order', [], [], '', false); + $this->registry->register('current_order', $currentOrder); + $this->assertEquals($currentOrder, $this->rss->getOrder()); + } + + public function testGetOrderHelper() + { + $orderHelper = $this->rss->getOrderHelper(); + $this->assertEquals($this->rssOrderHelper, $orderHelper); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/AbstractConditionTest.php b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/AbstractConditionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9c1053d85fd5e5c4a7a6a24589b19dd24976593d --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/AbstractConditionTest.php @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Rule\Model\Condition; + +class AbstractConditionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var AbstractCondition|\PHPUnit_Framework_MockObject_MockObject + */ + protected $_condition; + + public function setUp() + { + $this->_condition = $this->getMockForAbstractClass( + '\Magento\Rule\Model\Condition\AbstractCondition', + [], + '', + false + ); + } + + public function testGetjointTables() + { + $this->_condition->setAttribute('category_ids'); + $this->assertEquals([], $this->_condition->getTablesToJoin()); + $this->_condition->setAttribute('gdsjkfghksldjfg'); + $this->assertEmpty($this->_condition->getTablesToJoin()); + } + + public function testGetMappedSqlField() + { + $this->_condition->setAttribute('category_ids'); + $this->assertEquals('category_ids', $this->_condition->getMappedSqlField()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Product/AbstractProductTest.php b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Product/AbstractProductTest.php new file mode 100644 index 0000000000000000000000000000000000000000..149836263878d3444e5724396d871bbe9bcaf90d --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Product/AbstractProductTest.php @@ -0,0 +1,55 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Rule\Model\Condition\Product; + +class AbstractProductTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var AbstractProduct|\PHPUnit_Framework_MockObject_MockObject + */ + protected $_condition; + + public function setUp() + { + $this->_condition = $this->getMockForAbstractClass( + '\Magento\Rule\Model\Condition\Product\AbstractProduct', + [], + '', + false + ); + } + + public function testGetjointTables() + { + $this->_condition->setAttribute('category_ids'); + $this->assertEquals([], $this->_condition->getTablesToJoin()); + } + + public function testGetMappedSqlField() + { + $this->_condition->setAttribute('category_ids'); + $this->assertEquals('e.entity_id', $this->_condition->getMappedSqlField()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Sql/BuilderTest.php b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Sql/BuilderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a763067bfda4df429262aa98daabba7f357b211f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Sql/BuilderTest.php @@ -0,0 +1,90 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Rule\Model\Condition\Sql; + +use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; + +class BuilderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Rule\Model\Condition\Sql\Builder|\PHPUnit_Framework_MockObject_MockObject + */ + protected $_builder; + + public function setUp() + { + $expressionMock = $this->getMock('\Magento\Rule\Model\Condition\Sql\Expression', [], [], '', false); + $expressionFactory = $this->getMock( + '\Magento\Rule\Model\Condition\Sql\ExpressionFactory', + ['create'], + [], + '', + false + ); + $expressionFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($expressionMock)); + $this->_builder = (new ObjectManagerHelper($this))->getObject( + '\Magento\Rule\Model\Condition\Sql\Builder', + ['expressionFactory' => $expressionFactory] + ); + } + + public function testAttachConditionToCollection() + { + $collection = $this->getMock( + '\Magento\Eav\Model\Entity\Collection\AbstractCollection', + ['getResource', 'getSelect'], + [], + '', + false + ); + $combine = $this->getMock('\Magento\Rule\Model\Condition\Combine', ['getConditions'], [], '', false); + $resource = $this->getMock('Magento\Framework\DB\Adapter\Pdo\Mysql', ['getReadConnection'], [], '', false); + $select = $this->getMock('\Magento\Framework\DB\Select', ['where'], [], '', false); + $select->expects($this->never()) + ->method('where'); + + $connection = $this->getMockForAbstractClass('\Magento\Framework\DB\Adapter\AdapterInterface', [], '', false); + + $collection->expects($this->once()) + ->method('getResource') + ->will($this->returnValue($resource)); + + $collection->expects($this->any()) + ->method('getSelect') + ->will($this->returnValue($select)); + + $resource->expects($this->once()) + ->method('getReadConnection') + ->will($this->returnValue($connection)); + + $combine->expects($this->any()) + ->method('getConditions') + ->will($this->returnValue([])); + + $this->_builder->attachConditionToCollection($collection, $combine); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Sql/ExpressionTest.php b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Sql/ExpressionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..02f7fabb381e405e4e5006cf167207cdce72d224 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/Sql/ExpressionTest.php @@ -0,0 +1,39 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Rule\Model\Condition\Sql; + +use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; + +class ExpressionTest extends \PHPUnit_Framework_TestCase +{ + public function testExpression() + { + $expression = (new ObjectManagerHelper($this))->getObject( + '\Magento\Rule\Model\Condition\Sql\Expression', + ['expression' => 'SQL_EXPRESSION'] + ); + $this->assertEquals('(SQL_EXPRESSION)', (string)$expression); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Order/HistoryTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Order/HistoryTest.php index bd046e5dce285b52cf4964e50e726751c11ae54c..9c5fcf93f17f0c3374864de5a4ff510d4aa59a3d 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Order/HistoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Order/HistoryTest.php @@ -50,45 +50,30 @@ class HistoryTest extends \PHPUnit_Framework_TestCase */ protected $orderConfig; + /** + * @var \Magento\Framework\View\Page\Config|\PHPUnit_Framework_MockObject_MockObject + */ + protected $pageConfig; + public function setUp() { $this->context = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false, false); - $this->orderCollectionFactory = $this->getMock( - 'Magento\Sales\Model\Resource\Order\CollectionFactory', - ['create'], - [], - '', - false, - false - ); - $this->customerSession = $this->getMock( - 'Magento\Customer\Model\Session', - ['getCustomerId'], - [], - '', - false, - false - ); - $this->orderConfig = $this->getMock( - 'Magento\Sales\Model\Order\Config', - ['getVisibleOnFrontStatuses'], - [], - '', - false, - false - ); + $this->orderCollectionFactory = $this->getMockBuilder('Magento\Sales\Model\Resource\Order\CollectionFactory') + ->disableOriginalConstructor()->setMethods(['create'])->getMock(); + + $this->customerSession = $this->getMockBuilder('Magento\Customer\Model\Session') + ->setMethods(['getCustomerId'])->disableOriginalConstructor()->getMock(); + + $this->orderConfig = $this->getMockBuilder('Magento\Sales\Model\Order\Config') + ->setMethods(['getVisibleOnFrontStatuses'])->disableOriginalConstructor()->getMock(); + + $this->pageConfig = $this->getMockBuilder('Magento\Framework\View\Page\Config') + ->disableOriginalConstructor()->getMock(); } public function testConstructMethod() { $data = []; - $layout = $this->getMock('Magento\Core\Model\Layout', ['getBlock'], [], '', false, false); - $this->context->expects($this->once()) - ->method('getLayout') - ->will($this->returnValue($layout)); - $layout->expects($this->once()) - ->method('getBlock') - ->will($this->returnValue(false)); $customerId = 25; $this->customerSession->expects($this->once()) @@ -133,6 +118,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase $this->orderCollectionFactory, $this->customerSession, $this->orderConfig, + $this->pageConfig, $data ); $this->assertEquals($orderCollection, $this->model->getOrders()); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/OrderTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/OrderTest.php index 4f902eadd6cf790730f16ef3d5d9b8ba38a47cd5..4caf8750d8aa36d289a8885754469a6a7ff67179 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/OrderTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/OrderTest.php @@ -91,17 +91,16 @@ class OrderTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->setMethods(['isDeleted', 'canReviewPayment', 'canFetchTransactionInfo']) ->getMock(); - $paymentMock->expects($this->once()) + $paymentMock->expects($this->any()) ->method('canReviewPayment') ->will($this->returnValue(false)); - $paymentMock->expects($this->once()) + $paymentMock->expects($this->any()) ->method('canFetchTransactionInfo') ->will($this->returnValue(true)); $this->preparePaymentMock($paymentMock); - $this->order->setActionFlag(\Magento\Sales\Model\Order::ACTION_FLAG_UNHOLD, false); - $this->order->setState(\Magento\Sales\Model\Order::STATE_NEW); + $this->order->setState(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW); $this->assertFalse($this->order->canCancel()); } @@ -111,10 +110,10 @@ class OrderTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->setMethods(['isDeleted', 'canReviewPayment', 'canFetchTransactionInfo']) ->getMock(); - $paymentMock->expects($this->once()) + $paymentMock->expects($this->any()) ->method('canReviewPayment') ->will($this->returnValue(false)); - $paymentMock->expects($this->once()) + $paymentMock->expects($this->any()) ->method('canFetchTransactionInfo') ->will($this->returnValue(false)); @@ -133,10 +132,10 @@ class OrderTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->setMethods(['isDeleted', 'canReviewPayment', 'canFetchTransactionInfo']) ->getMock(); - $paymentMock->expects($this->once()) + $paymentMock->expects($this->any()) ->method('canReviewPayment') ->will($this->returnValue(false)); - $paymentMock->expects($this->once()) + $paymentMock->expects($this->any()) ->method('canFetchTransactionInfo') ->will($this->returnValue(false)); @@ -158,10 +157,10 @@ class OrderTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->setMethods(['isDeleted', 'canReviewPayment', 'canFetchTransactionInfo']) ->getMock(); - $paymentMock->expects($this->once()) + $paymentMock->expects($this->any()) ->method('canReviewPayment') ->will($this->returnValue(false)); - $paymentMock->expects($this->once()) + $paymentMock->expects($this->any()) ->method('canFetchTransactionInfo') ->will($this->returnValue(false)); @@ -210,7 +209,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase if ($canVoidOrder) { $expected = 'some value'; $payment->expects( - $this->once() + $this->any() )->method( 'canVoid' )->with( @@ -238,11 +237,11 @@ class OrderTest extends \PHPUnit_Framework_TestCase $collectionMock->expects($this->any()) ->method('getIterator') ->will($this->returnValue($iterator)); - $collectionMock->expects($this->once()) + $collectionMock->expects($this->any()) ->method('setOrderFilter') ->will($this->returnSelf()); - $this->paymentCollectionFactoryMock->expects($this->once()) + $this->paymentCollectionFactoryMock->expects($this->any()) ->method('create') ->will($this->returnValue($collectionMock)); } @@ -315,7 +314,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase ->setMethods(['isDeleted', 'filterByTypes', 'filterByParent', 'getQtyToInvoice']) ->getMock(); - $itemMock->expects($this->once()) + $itemMock->expects($this->any()) ->method('getQtyToInvoice') ->will($this->returnValue($qtyInvoiced)); @@ -328,11 +327,11 @@ class OrderTest extends \PHPUnit_Framework_TestCase $itemCollectionMock->expects($this->any()) ->method('getIterator') ->will($this->returnValue($iterator)); - $itemCollectionMock->expects($this->once()) + $itemCollectionMock->expects($this->any()) ->method('setOrderFilter') ->will($this->returnSelf()); - $this->orderItemCollectionFactoryMock->expects($this->once()) + $this->orderItemCollectionFactoryMock->expects($this->any()) ->method('create') ->will($this->returnValue($itemCollectionMock)); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Quote/Address/ValidatorTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Quote/Address/ValidatorTest.php index a831dc5cb3428d54c3d5829653f300f18b288fe3..998c6ece8887f43fac7227a014a497e1e745fd0a 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Quote/Address/ValidatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Quote/Address/ValidatorTest.php @@ -24,6 +24,8 @@ namespace Magento\Sales\Model\Quote\Address; +use Magento\TestFramework\Helper\ObjectManager; + class ValidatorTest extends \PHPUnit_Framework_TestCase { /** @@ -34,7 +36,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $factoryMock; + protected $countryFactoryMock; /** * @var \PHPUnit_Framework_MockObject_MockObject @@ -48,7 +50,8 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->factoryMock = $this->getMock('\Magento\Directory\Model\CountryFactory', [], [], '', false); + $objectManager = new ObjectManager($this); + $this->countryFactoryMock = $this->getMock('\Magento\Directory\Model\CountryFactory', [], [], '', false); $this->countryMock = $this->getMock('\Magento\Directory\Model\Country', [], [], '', false); $this->itemMock = $this->getMock( '\Magento\Sales\Model\Quote\Address', @@ -57,8 +60,16 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase '', false ); - $this->factoryMock->expects($this->any())->method('create')->will($this->returnValue($this->countryMock)); - $this->model = new Validator($this->factoryMock); + $this->countryFactoryMock + ->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->countryMock)); + $this->model = $objectManager->getObject( + '\Magento\Sales\Model\Quote\Address\Validator', + [ + 'countryFactory' => $this->countryFactoryMock, + ] + ); } public function testValidateWithEmptyObject() diff --git a/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxClassServiceTest.php b/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxClassServiceTest.php index b988bdefdfa56e6c8645f65729fea1b2ccde1c53..72bb7ce3924d631f73cea3affa2c2dbccf0f2fde 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxClassServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxClassServiceTest.php @@ -28,6 +28,7 @@ use Magento\Framework\Exception\InputException; use Magento\Tax\Service\V1\Data\TaxClass; use Magento\Tax\Service\V1\Data\TaxClassBuilder; use Magento\Tax\Service\V1\Data\TaxClassKey; +use Magento\Framework\Service\V1\Data\SearchCriteria; /** * Test for \Magento\Tax\Service\V1\TaxClassService @@ -83,6 +84,11 @@ class TaxClassServiceTest extends \PHPUnit_Framework_TestCase */ private $objectManager; + /** + * @var \Magento\Framework\Service\V1\Data\SortOrderBuilder; + */ + private $sortOrderBuilder; + public function setUp() { $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); @@ -104,6 +110,10 @@ class TaxClassServiceTest extends \PHPUnit_Framework_TestCase $this->taxClassBuilder = $this->objectManager->getObject('Magento\Tax\Service\V1\Data\TaxClassBuilder'); $this->taxClassService = $this->createService(); + + $this->sortOrderBuilder = $this->objectManager->getObject( + 'Magento\Framework\Service\V1\Data\SortOrderBuilder' + ); } public function testCreateTaxClass() @@ -432,7 +442,7 @@ class TaxClassServiceTest extends \PHPUnit_Framework_TestCase $this->searchCriteriaBuilderMock->expects($this->exactly(2)) ->method('addFilter') ->will($this->returnValue($this->searchCriteriaBuilderMock)); - /** @var \Magento\Framework\Service\V1\Data\SearchCriteria $searchCriteria*/ + /** @var \Magento\Framework\Service\V1\Data\SearchCriteria $searchCriteria */ $searchCriteria = $this->createSearchCriteria(); $this->searchCriteriaBuilderMock->expects($this->once()) ->method('create') @@ -592,10 +602,16 @@ class TaxClassServiceTest extends \PHPUnit_Framework_TestCase */ $searchCriteriaBuilder->addFilter([$filter1, $filter2]); $searchCriteriaBuilder->addFilter([$filter3, $filter4]); + /**@var \Magento\Framework\Service\V1\Data\SortOrderBuilder $sortOrderBuilder */ + $sortOrderBuilder = $this->objectManager->getObject( + 'Magento\Framework\Service\V1\Data\SortOrderBuilder' + ); + /** @var \Magento\Framework\Service\V1\Data\SortOrder $sortOrder */ + $sortOrder = $sortOrderBuilder->setField('class_name')->setDirection(SearchCriteria::SORT_ASC)->create(); $searchCriteria = $searchCriteriaBuilder ->setCurrentPage(1) ->setPageSize(10) - ->setSortOrders(['class_name' => 1]) + ->setSortOrders([$sortOrder]) ->create(); return $searchCriteria; } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxRateServiceTest.php b/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxRateServiceTest.php index 020980e2aae776933ff58f372fc87d4835bdb19d..33d0dc7ba1d9b2cf166afbfc5a4f7ba3da2ee727 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxRateServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxRateServiceTest.php @@ -29,6 +29,7 @@ use Magento\Tax\Service\V1\Data\TaxRate; use Magento\TestFramework\Helper\ObjectManager; use Magento\Framework\Service\V1\Data\SearchCriteriaBuilder; use Magento\Tax\Model\Calculation\RateFactory; +use Magento\Framework\Service\V1\Data\SearchCriteria; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -84,6 +85,16 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase */ private $taxRateBuilder; + /** + * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Directory\Model\CountryFactory + */ + private $countryFactoryMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Directory\Model\RegionFactory + */ + private $regionFactoryMock; + public function setUp() { $this->objectManager = new ObjectManager($this); @@ -97,8 +108,8 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); $this->rateFactoryMock = $this->getMockBuilder('Magento\Tax\Model\Calculation\RateFactory') - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $this->taxRateSearchResultsBuilder = $this->objectManager->getObject( 'Magento\Tax\Service\V1\Data\TaxRateSearchResultsBuilder' ); @@ -110,6 +121,30 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase ['filterGroupBuilder' => $filterGroupBuilder] ); + $this->countryFactoryMock = $this->getMockBuilder('Magento\Directory\Model\CountryFactory') + ->disableOriginalConstructor()->setMethods(['create']) + ->getMock(); + $countryMock = $this->getMockBuilder('Magento\Directory\Model\Country') + ->disableOriginalConstructor() + ->getMock(); + $countryMock->expects($this->any())->method('loadByCode')->will($this->returnValue($countryMock)); + $countryMock->expects($this->any())->method('getId')->will($this->returnValue('valid')); + $this->countryFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($countryMock)); + + $this->regionFactoryMock = $this->getMockBuilder('Magento\Directory\Model\RegionFactory') + ->disableOriginalConstructor()->setMethods(['create']) + ->getMock(); + $regionMock = $this->getMockBuilder('Magento\Directory\Model\Region') + ->disableOriginalConstructor() + ->getMock(); + $regionMock->expects($this->any())->method('load')->will($this->returnValue($regionMock)); + $regionMock->expects($this->any())->method('getId')->will($this->returnValue('valid')); + $this->regionFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($regionMock)); + $zipRangeBuilder = $this->objectManager->getObject('Magento\Tax\Service\V1\Data\ZipRangeBuilder'); $this->taxRateBuilder = $this->objectManager->getObject( 'Magento\Tax\Service\V1\Data\TaxRateBuilder', @@ -128,14 +163,14 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase 'zip_range' => ['from' => 78765, 'to' => 78780] ]; - $taxRateDataObject = $this->taxRateBuilder->populateWithArray($taxData)->create(); + $taxRateDataObject = $this->taxRateBuilder->populateWithArray($taxData)->create(); $this->rateModelMock->expects($this->once()) ->method('save') ->will($this->returnValue($this->rateModelMock)); $this->converterMock->expects($this->once()) ->method('createTaxRateModel') ->will($this->returnValue($this->rateModelMock)); - $taxRate = $this->taxRateBuilder->populate($taxRateDataObject)->setPostcode('78765-78780')->create(); + $taxRate = $this->taxRateBuilder->populate($taxRateDataObject)->setPostcode('78765-78780')->create(); $this->converterMock->expects($this->once()) ->method('createTaxRateDataObjectFromModel') ->will($this->returnValue($taxRate)); @@ -182,6 +217,141 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase $this->taxRateService->createTaxRate($taxRateDataObject); } + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Invalid value of "XX" provided for the country_id field. + */ + public function testCreateTaxRateWithInputException_invalidCountry() + { + $taxData = [ + 'country_id' => 'XX', + 'region_id' => '8', + 'percentage_rate' => '8.25', + 'code' => 'US-CA-*-Rate', + 'zip_range' => ['from' => 78765, 'to' => 78780] + ]; + + // create mock country object with invalid country + $this->countryFactoryMock = $this->getMockBuilder('Magento\Directory\Model\CountryFactory') + ->disableOriginalConstructor()->setMethods(['create']) + ->getMock(); + $countryMock = $this->getMockBuilder('Magento\Directory\Model\Country') + ->disableOriginalConstructor() + ->getMock(); + $countryMock->expects($this->any()) + ->method('loadByCode') + ->will($this->returnValue($countryMock)); + $countryMock->expects($this->any()) + ->method('getId') + ->will($this->returnValue(null)); + $this->countryFactoryMock->expects($this->once()) + ->method('create') + ->will($this->returnValue($countryMock)); + + // recreate the service with new countryMock values + $this->createService(); + + $taxRateDataObject = $this->taxRateBuilder->populateWithArray($taxData)->create(); + $this->taxRateService->createTaxRate($taxRateDataObject); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage country_id is a required field. + */ + public function testCreateTaxRateWithInputException_spaceCountry() + { + $taxData = [ + 'country_id' => ' ', + 'region_id' => '8', + 'percentage_rate' => '8.25', + 'code' => 'US-CA-*-Rate', + 'zip_range' => ['from' => 78765, 'to' => 78780] + ]; + + // create mock country object with invalid country + $this->countryFactoryMock = $this->getMockBuilder('Magento\Directory\Model\CountryFactory') + ->disableOriginalConstructor()->setMethods(['create']) + ->getMock(); + $countryMock = $this->getMockBuilder('Magento\Directory\Model\Country') + ->disableOriginalConstructor() + ->getMock(); + $countryMock->expects($this->any())->method('loadByCode')->will($this->returnValue($countryMock)); + $countryMock->expects($this->any())->method('getId')->will($this->returnValue(null)); + + // recreate the service with new countryMock values + $this->createService(); + + $taxRateDataObject = $this->taxRateBuilder->populateWithArray($taxData)->create(); + $this->taxRateService->createTaxRate($taxRateDataObject); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Invalid value of "-" provided for the region_id field. + */ + public function testCreateTaxRateWithInputException_invalidRegion() + { + $taxData = [ + 'country_id' => 'US', + 'region_id' => '-', + 'percentage_rate' => '8.25', + 'code' => 'US-CA-*-Rate', + 'zip_range' => ['from' => 78765, 'to' => 78780] + ]; + + // create mock country object with invalid region + $this->regionFactoryMock = $this->getMockBuilder('Magento\Directory\Model\RegionFactory') + ->disableOriginalConstructor()->setMethods(['create']) + ->getMock(); + $regionMock = $this->getMockBuilder('Magento\Directory\Model\Region') + ->disableOriginalConstructor() + ->getMock(); + $regionMock->expects($this->any()) + ->method('load') + ->will($this->returnValue($regionMock)); + $regionMock->expects($this->any()) + ->method('getId') + ->will($this->returnValue(null)); + $this->regionFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($regionMock)); + + // recreate the service with new regionMock values + $this->createService(); + + $taxRateDataObject = $this->taxRateBuilder->populateWithArray($taxData)->create(); + $this->taxRateService->createTaxRate($taxRateDataObject); + } + + public function testCreateTaxRateWithInputException_spaceRegion() + { + $taxData = [ + 'country_id' => 'US', + 'region_id' => ' ', + 'percentage_rate' => '8.25', + 'code' => 'US-CA-*-Rate', + 'zip_range' => ['from' => 78765, 'to' => 78780] + ]; + + $taxRateDataObject = $this->taxRateBuilder->populateWithArray($taxData)->create(); + $this->rateModelMock->expects($this->once()) + ->method('save') + ->will($this->returnValue($this->rateModelMock)); + $this->converterMock->expects($this->once()) + ->method('createTaxRateModel') + ->will($this->returnValue($this->rateModelMock)); + $taxRate = $this->taxRateBuilder->populate($taxRateDataObject)->setPostcode('78765-78780')->create(); + $this->converterMock->expects($this->once()) + ->method('createTaxRateDataObjectFromModel') + ->will($this->returnValue($taxRate)); + + $taxRateServiceData = $this->taxRateService->createTaxRate($taxRateDataObject); + + //Assertion + $this->assertSame($taxRate, $taxRateServiceData); + } + /** * @expectedException \Magento\Framework\Model\Exception */ @@ -195,7 +365,7 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase 'zip_range' => ['from' => 78765, 'to' => 78780] ]; - $taxRateDataObject = $this->taxRateBuilder->populateWithArray($taxData)->create(); + $taxRateDataObject = $this->taxRateBuilder->populateWithArray($taxData)->create(); $this->rateModelMock->expects($this->once()) ->method('save') ->will($this->throwException(new \Magento\Framework\Model\Exception())); @@ -412,10 +582,14 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase $filterBuilder = $this->objectManager->getObject('\Magento\Framework\Service\V1\Data\FilterBuilder'); $filter = $filterBuilder->setField(TaxRate::KEY_REGION_ID)->setValue(self::REGION_ID)->create(); + $sortOrderBuilder = $this->objectManager->getObject('\Magento\Framework\Service\V1\Data\SortOrderBuilder'); + $sortOrder = $sortOrderBuilder + ->setField(TaxRate::KEY_REGION_ID) + ->setDirection(SearchCriteria::SORT_ASC) + ->create(); $this->searchCriteriaBuilder ->addFilter([$filter]) - ->addSortOrder('id', \Magento\Framework\Service\V1\Data\SearchCriteria::SORT_ASC); - + ->addSortOrder($sortOrder); $this->createService(); $searchCriteria = $this->searchCriteriaBuilder->create(); $searchResults = $this->taxRateService->searchTaxRates($searchCriteria); @@ -450,7 +624,9 @@ class TaxRateServiceTest extends \PHPUnit_Framework_TestCase 'rateFactory' => $this->rateFactoryMock, 'rateRegistry' => $this->rateRegistryMock, 'converter' => $this->converterMock, - 'taxRateSearchResultsBuilder' => $this->taxRateSearchResultsBuilder + 'taxRateSearchResultsBuilder' => $this->taxRateSearchResultsBuilder, + 'countryFactory' => $this->countryFactoryMock, + 'regionFactory' => $this->regionFactoryMock ] ); } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxRuleServiceTest.php b/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxRuleServiceTest.php index cec65a1dc64b4192d10d88d6972385160cc157a4..61f05b3668427750dd5c415260cb889a3dcd5dcd 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxRuleServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Service/V1/TaxRuleServiceTest.php @@ -30,6 +30,7 @@ use Magento\Tax\Service\V1\Data\TaxRule; use Magento\Tax\Service\V1\Data\TaxClass; use Magento\Tax\Model\ClassModel as TaxClassModel; use Magento\TestFramework\Helper\ObjectManager; +use Magento\Framework\Service\V1\Data\SearchCriteria; /** * Class TaxRuleServiceTest @@ -526,9 +527,14 @@ class TaxRuleServiceTest extends \PHPUnit_Framework_TestCase 'Magento\Framework\Service\V1\Data\SearchCriteriaBuilder', ['filterGroupBuilder' => $filterGroupBuilder] ); + $sortOrderBuilder = $this->objectManager->getObject('\Magento\Framework\Service\V1\Data\SortOrderBuilder'); + $sortOrder = $sortOrderBuilder + ->setField('id') + ->setDirection(SearchCriteria::SORT_ASC) + ->create(); $searchCriteria = $searchCriteriaBuilder ->addFilter([$filter]) - ->addSortOrder('id', \Magento\Framework\Service\V1\Data\SearchCriteria::SORT_ASC) + ->addSortOrder($sortOrder) ->create(); /** @var \Magento\Tax\Service\V1\Data\TaxRuleSearchResultsBuilder $searchResultsBuilder */ diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/ConverterTest.php index 306db652af93773a801ddcd91927bed15b87282a..6bc84a5c75810c7100197a9894917c071df7c82e 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/ConverterTest.php @@ -50,16 +50,10 @@ class ConverterTest extends \PHPUnit_Framework_TestCase 'empty' => array( 'label' => 'Empty', 'code' => 'empty', - 'template' => 'empty.phtml', - 'layout_handle' => 'page_empty', - 'is_default' => 0 ), - 'one_column' => array( + '1column' => array( 'label' => '1 column', - 'code' => 'one_column', - 'template' => '1column.phtml', - 'layout_handle' => 'page_one_column', - 'is_default' => 1 + 'code' => '1column', ) ); $this->assertEquals($expectedResult, $this->_model->convert($dom), '', 0, 20); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/_files/page_layouts.xml b/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/_files/page_layouts.xml index 5a8237a1d0d310c3c94070e46bc719a4f1c2158f..1073d12b6ee7f901f0d5f7125afcacbc1855e612 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/_files/page_layouts.xml +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/_files/page_layouts.xml @@ -23,18 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> - <layouts default="one_column"> - <layout id="empty"> - <label translate="true">Empty</label> - <template>empty.phtml</template> - <layout_handle>page_empty</layout_handle> - </layout> - <layout id="one_column"> - <label translate="true">1 column</label> - <template>1column.phtml</template> - <layout_handle>page_one_column</layout_handle> - </layout> - </layouts> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> + <layout id="empty"> + <label translate="true">Empty</label> + </layout> + <layout id="1column"> + <label translate="true">1 column</label> + </layout> </page_layouts> diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Authorization/TokenUserContextTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Authorization/TokenUserContextTest.php index 94f162e7d09dafa4c2cd86bab2c22707f4954c0d..672971e499aa6c8fb79133ccb8a41357c9d244a1 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Authorization/TokenUserContextTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Authorization/TokenUserContextTest.php @@ -143,6 +143,37 @@ class TokenUserContextTest extends \PHPUnit_Framework_TestCase $this->assertNull($this->tokenUserContext->getUserId()); } + public function testRevokedToken() + { + $bearerToken = 'bearer1234'; + + $this->request->expects($this->once()) + ->method('getHeader') + ->with('Authorization') + ->will($this->returnValue("Bearer {$bearerToken}")); + + $token = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token') + ->disableOriginalConstructor() + ->setMethods(['loadByToken', 'getId', 'getRevoked', '__wakeup']) + ->getMock(); + $this->tokenFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($token)); + $token->expects($this->once()) + ->method('loadByToken') + ->with($bearerToken) + ->will($this->returnSelf()); + $token->expects($this->once()) + ->method('getId') + ->will($this->returnValue(1)); + $token->expects($this->once()) + ->method('getRevoked') + ->will($this->returnValue(1)); + + $this->assertNull($this->tokenUserContext->getUserType()); + $this->assertNull($this->tokenUserContext->getUserId()); + } + /** * @dataProvider getValidTokenData */ diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/ClassReflector/TypeProcessorTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/ClassReflector/TypeProcessorTest.php index c47b3d84b7a97a51e1efc10775bf3b072fe08bd9..6c69df742d52db256899edc56dbc1e7481065b59 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/ClassReflector/TypeProcessorTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/ClassReflector/TypeProcessorTest.php @@ -89,8 +89,9 @@ class TypeProcessorTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('blah', $this->_typeProcessor->normalizeType('blah')); $this->assertEquals('string', $this->_typeProcessor->normalizeType('str')); - //$this->assertEquals('integer', $this->_typeProcessor->normalizeType('int')); + $this->assertEquals('int', $this->_typeProcessor->normalizeType('integer')); $this->assertEquals('boolean', $this->_typeProcessor->normalizeType('bool')); + $this->assertEquals('anyType', $this->_typeProcessor->normalizeType('mixed')); } public function testIsTypeSimple() @@ -104,6 +105,14 @@ class TypeProcessorTest extends \PHPUnit_Framework_TestCase $this->assertFalse($this->_typeProcessor->isTypeSimple('blah')); } + public function testIsTypeAny() + { + $this->assertTrue($this->_typeProcessor->isTypeAny('mixed')); + $this->assertTrue($this->_typeProcessor->isTypeAny('mixed[]')); + $this->assertFalse($this->_typeProcessor->isTypeAny('int')); + $this->assertFalse($this->_typeProcessor->isTypeAny('int[]')); + } + public function testIsArrayType() { $this->assertFalse($this->_typeProcessor->isArrayType('string')); @@ -116,6 +125,7 @@ class TypeProcessorTest extends \PHPUnit_Framework_TestCase $this->assertEquals('string', $this->_typeProcessor->getArrayItemType('string[]')); $this->assertEquals('integer', $this->_typeProcessor->getArrayItemType('int[]')); $this->assertEquals('boolean', $this->_typeProcessor->getArrayItemType('bool[]')); + $this->assertEquals('any', $this->_typeProcessor->getArrayItemType('mixed[]')); } public function testTranslateTypeName() @@ -143,4 +153,50 @@ class TypeProcessorTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('ArrayOfComplexType', $this->_typeProcessor->translateArrayTypeName('complexType')); } + + public function testProcessSimpleTypeIntToString() + { + $value = 1; + $type = 'string'; + $this->assertSame('1', $this->_typeProcessor->processSimpleAndAnyType($value, $type)); + } + + public function testProcessSimpleTypeStringToInt() + { + $value = '1'; + $type = 'int'; + $this->assertSame(1, $this->_typeProcessor->processSimpleAndAnyType($value, $type)); + } + + public function testProcessSimpleTypeMixed() + { + $value = 1; + $type = 'mixed'; + $this->assertSame(1, $this->_typeProcessor->processSimpleAndAnyType($value, $type)); + } + + public function testProcessSimpleTypeIntArrayToStringArray() + { + $value = [1, 2, 3, 4, 5]; + $type = 'string[]'; + $this->assertSame(['1', '2', '3', '4', '5'], $this->_typeProcessor->processSimpleAndAnyType($value, $type)); + } + + public function testProcessSimpleTypeStringArrayToIntArray() + { + $value = ['1', '2', '3', '4', '5']; + $type = 'int[]'; + $this->assertSame([1, 2, 3, 4, 5], $this->_typeProcessor->processSimpleAndAnyType($value, $type)); + } + + /** + * @expectedException \Magento\Webapi\Exception + * @expectedExceptionMessage Invalid type for value :"1". Expected Type: "int[]". + */ + public function testProcessSimpleTypeInvalidType() + { + $value = 1; + $type = 'int[]'; + $this->_typeProcessor->processSimpleAndAnyType($value, $type); + } } diff --git a/dev/tests/unit/testsuite/Magento/Rss/Block/WishlistTest.php b/dev/tests/unit/testsuite/Magento/Wishlist/Block/RssTest.php similarity index 98% rename from dev/tests/unit/testsuite/Magento/Rss/Block/WishlistTest.php rename to dev/tests/unit/testsuite/Magento/Wishlist/Block/RssTest.php index 470bee917247ff7ec95d8d5dd599a8a05b282dc0..d58267781d4f8a6a4492ca2c7879a1765d42fbfe 100644 --- a/dev/tests/unit/testsuite/Magento/Rss/Block/WishlistTest.php +++ b/dev/tests/unit/testsuite/Magento/Wishlist/Block/RssTest.php @@ -22,16 +22,16 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Rss\Block; +namespace Magento\Wishlist\Block; /** * Test for rendering price html in rss templates * */ -class WishlistTest extends \PHPUnit_Framework_TestCase +class RssTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Rss\Block\Catalog\Category + * @var \Magento\Wishlist\Block\Rss */ protected $block; @@ -144,7 +144,7 @@ class WishlistTest extends \PHPUnit_Framework_TestCase $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->block = $objectManager->getObject( - 'Magento\Rss\Block\Wishlist', + 'Magento\Wishlist\Block\Rss', [ 'context' => $templateContextMock, 'productFactory' => $this->productFactoryMock, diff --git a/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php b/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php index 9d1f17af07afe7bae01f079cfbbbb087d4efbece..0bffd8e97e6bccc9678010134711efec8d4caa20 100644 --- a/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php +++ b/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php @@ -52,7 +52,7 @@ abstract class AbstractHelper /** * @var \Magento\Framework\Module\Manager */ - private $_moduleManager; + protected $_moduleManager; /** * @var \Magento\Framework\Logger diff --git a/lib/internal/Magento/Framework/App/View.php b/lib/internal/Magento/Framework/App/View.php index 8eb0420c95b1036b512d647f437a843fb3f2c419..73baafce443436446e686de86cc5e4869bd364f9 100644 --- a/lib/internal/Magento/Framework/App/View.php +++ b/lib/internal/Magento/Framework/App/View.php @@ -41,9 +41,9 @@ class View implements ViewInterface protected $_eventManager; /** - * @var \Magento\Framework\Translate\InlineInterface + * @var \Magento\Framework\View\Result\Page */ - protected $_translateInline; + protected $page; /** * @var ActionFlag @@ -71,7 +71,7 @@ class View implements ViewInterface * @param ResponseInterface $response * @param \Magento\Framework\Config\ScopeInterface $configScope * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Framework\Translate\InlineInterface $translateInline + * @param \Magento\Framework\View\Result\PageFactory $pageFactory * @param ActionFlag $actionFlag */ public function __construct( @@ -80,7 +80,7 @@ class View implements ViewInterface ResponseInterface $response, \Magento\Framework\Config\ScopeInterface $configScope, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Translate\InlineInterface $translateInline, + \Magento\Framework\View\Result\PageFactory $pageFactory, ActionFlag $actionFlag ) { $this->_layout = $layout; @@ -88,8 +88,18 @@ class View implements ViewInterface $this->_response = $response; $this->_configScope = $configScope; $this->_eventManager = $eventManager; - $this->_translateInline = $translateInline; $this->_actionFlag = $actionFlag; + $this->page = $pageFactory->create(); + } + + /** + * Retrieve current page object + * + * @return \Magento\Framework\View\Result\Page + */ + public function getPage() + { + return $this->page; } /** @@ -99,7 +109,7 @@ class View implements ViewInterface */ public function getLayout() { - return $this->_layout; + return $this->page->getLayout(); } /** @@ -110,14 +120,13 @@ class View implements ViewInterface if ($this->_isLayoutLoaded) { throw new \RuntimeException('Layout must be loaded only once.'); } - // if handles were specified in arguments load them first - if (false !== $handles && '' !== $handles) { - $this->getLayout()->getUpdate()->addHandle($handles ? $handles : 'default'); - } - if ($addActionHandles) { // add default layout handles for this action - $this->addActionLayoutHandles(); + $this->page->initLayout(); + } + // if handles were specified in arguments load them first + if (!empty($handles)) { + $this->getLayout()->getUpdate()->addHandle($handles); } $this->loadLayoutUpdates(); @@ -142,7 +151,7 @@ class View implements ViewInterface */ public function getDefaultLayoutHandle() { - return strtolower($this->_request->getFullActionName()); + return $this->page->getDefaultLayoutHandle(); } /** @@ -167,13 +176,7 @@ class View implements ViewInterface */ public function addPageLayoutHandles(array $parameters = array(), $defaultHandle = null) { - $handle = $defaultHandle ? $defaultHandle : $this->getDefaultLayoutHandle(); - $pageHandles = array($handle); - foreach ($parameters as $key => $value) { - $pageHandles[] = $handle . '_' . $key . '_' . $value; - } - // Do not sort array going into add page handles. Ensure default layout handle is added first. - return $this->getLayout()->getUpdate()->addPageHandles($pageHandles); + return $this->page->addPageLayoutHandles($parameters, $defaultHandle); } /** @@ -184,7 +187,6 @@ class View implements ViewInterface public function loadLayoutUpdates() { \Magento\Framework\Profiler::start('LAYOUT'); - // dispatch event for adding handles to layout update $this->_eventManager->dispatch( 'controller_action_layout_load_before', @@ -275,9 +277,7 @@ class View implements ViewInterface 'controller_action_layout_render_before_' . $this->_request->getFullActionName() ); - $output = $this->getLayout()->getOutput(); - $this->_translateInline->processResponseBody($output); - $this->_response->appendBody($output); + $this->page->renderResult($this->_response); \Magento\Framework\Profiler::stop('layout_render'); \Magento\Framework\Profiler::stop('LAYOUT'); diff --git a/lib/internal/Magento/Framework/App/ViewInterface.php b/lib/internal/Magento/Framework/App/ViewInterface.php index 985c00b9134054ec510040aa5dd85cf142f09a49..a85cc50cde40a5ab22e40985b8f64b16e9b71d18 100644 --- a/lib/internal/Magento/Framework/App/ViewInterface.php +++ b/lib/internal/Magento/Framework/App/ViewInterface.php @@ -82,6 +82,13 @@ interface ViewInterface */ public function generateLayoutBlocks(); + /** + * Retrieve current page object + * + * @return \Magento\Framework\View\Result\Page + */ + public function getPage(); + /** * Retrieve current layout object * diff --git a/lib/internal/Magento/Framework/AppInterface.php b/lib/internal/Magento/Framework/AppInterface.php index bdb85fda79d5586131215e3b59dd4ee8b88dc653..f8ac21218bbe636822b7ca7ac6553b063e1ac4cd 100644 --- a/lib/internal/Magento/Framework/AppInterface.php +++ b/lib/internal/Magento/Framework/AppInterface.php @@ -35,7 +35,7 @@ interface AppInterface /** * Magento version */ - const VERSION = '0.1.0-alpha91'; + const VERSION = '0.1.0-alpha92'; /** * Launch application diff --git a/lib/internal/Magento/Framework/Service/AbstractServiceCollection.php b/lib/internal/Magento/Framework/Service/AbstractServiceCollection.php index 12d5ef8c4a701e1327a4d6936caa39d1a481a29b..6997e75a0d1c5fbd28a9c9e36a660210b6ef6493 100644 --- a/lib/internal/Magento/Framework/Service/AbstractServiceCollection.php +++ b/lib/internal/Magento/Framework/Service/AbstractServiceCollection.php @@ -25,11 +25,12 @@ namespace Magento\Framework\Service; use Magento\Framework\Data\Collection\EntityFactoryInterface; +use Magento\Framework\Exception; use Magento\Framework\Service\V1\Data\Filter; use Magento\Framework\Service\V1\Data\FilterBuilder; use Magento\Framework\Service\V1\Data\SearchCriteria; use Magento\Framework\Service\V1\Data\SearchCriteriaBuilder; -use Magento\Framework\Exception; +use Magento\Framework\Service\V1\Data\SortOrderBuilder; /** * Base for service collections @@ -62,19 +63,27 @@ abstract class AbstractServiceCollection extends \Magento\Framework\Data\Collect */ protected $searchCriteriaBuilder; + /** + * @var \Magento\Framework\Service\V1\Data\SortOrderBuilder + */ + protected $sortOrderBuilder; + /** * @param EntityFactoryInterface $entityFactory * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Magento\Framework\Service\V1\Data\SortOrderBuilder $sortOrderBuilder */ public function __construct( EntityFactoryInterface $entityFactory, FilterBuilder $filterBuilder, - SearchCriteriaBuilder $searchCriteriaBuilder + SearchCriteriaBuilder $searchCriteriaBuilder, + SortOrderBuilder $sortOrderBuilder ) { parent::__construct($entityFactory); $this->filterBuilder = $filterBuilder; $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->sortOrderBuilder = $sortOrderBuilder; } /** @@ -149,10 +158,11 @@ abstract class AbstractServiceCollection extends \Magento\Framework\Data\Collect $this->searchCriteriaBuilder->addFilter($filterGroup); } foreach ($this->_orders as $field => $direction) { - $this->searchCriteriaBuilder->addSortOrder( - $field, - $direction == 'ASC' ? SearchCriteria::SORT_ASC : SearchCriteria::SORT_DESC - ); + /** @var \Magento\Framework\Service\V1\Data\SortOrder $sortOrder */ + /** @var string $direction */ + $direction = ($direction == 'ASC') ? SearchCriteria::SORT_ASC : SearchCriteria::SORT_DESC; + $sortOrder = $this->sortOrderBuilder->setField($field)->setDirection($direction)->create(); + $this->searchCriteriaBuilder->addSortOrder($sortOrder); } $this->searchCriteriaBuilder->setCurrentPage($this->_curPage); $this->searchCriteriaBuilder->setPageSize($this->_pageSize); diff --git a/lib/internal/Magento/Framework/Service/Config/Converter.php b/lib/internal/Magento/Framework/Service/Config/Converter.php new file mode 100644 index 0000000000000000000000000000000000000000..20c84b6e6a47cf3afc9b805dc13286ee80b04d25 --- /dev/null +++ b/lib/internal/Magento/Framework/Service/Config/Converter.php @@ -0,0 +1,62 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Framework\Service\Config; + +class Converter implements \Magento\Framework\Config\ConverterInterface +{ + /** + * Convert dom node tree to array + * + * @param \DOMDocument $source + * @return array + */ + public function convert($source) + { + $output = []; + if (!$source instanceof \DOMDocument) { + return $output; + } + + /** @var \DOMNodeList $types */ + $types = $source->getElementsByTagName('custom_attributes'); + /** @var \DOMNode $type */ + foreach ($types as $type) { + $typeConfig = []; + $typeName = $type->getAttribute('for'); + + $attributes = $type->getElementsByTagName('attribute'); + foreach ($attributes as $attribute) { + $code = $attribute->getAttribute('code'); + $codeType = $attribute->getAttribute('type'); + + if ($code && $codeType) { + $typeConfig[$code] = $codeType; + } + } + + $output[$typeName] = $typeConfig; + } + return $output; + } +} diff --git a/lib/internal/Magento/Framework/Service/Config/MetadataConfig.php b/lib/internal/Magento/Framework/Service/Config/MetadataConfig.php new file mode 100644 index 0000000000000000000000000000000000000000..750793cb2403d5b7aafbbdfcda2f20d418115bae --- /dev/null +++ b/lib/internal/Magento/Framework/Service/Config/MetadataConfig.php @@ -0,0 +1,84 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\Service\Config; + +use Magento\Framework\Service\Data\Eav\MetadataServiceInterface; +use Magento\Framework\Service\Config\Reader as ServiceConfigReader; +use Magento\Framework\Service\Data\AttributeMetadataBuilderInterface; + +/** + * Class which allows to get a metadata of the attributes declared in a config. + */ +class MetadataConfig implements MetadataServiceInterface +{ + /** + * @var ServiceConfigReader + */ + private $serviceConfigReader; + + /** + * @var AttributeMetadataBuilderInterface + */ + private $attributeMetadataBuilder; + + /** + * Initialize dependencies. + * + * @param ServiceConfigReader $serviceConfigReader + * @param AttributeMetadataBuilderInterface|null $attributeMetadataBuilder + */ + public function __construct( + ServiceConfigReader $serviceConfigReader, + AttributeMetadataBuilderInterface $attributeMetadataBuilder = null + ) { + $this->serviceConfigReader = $serviceConfigReader; + $this->attributeMetadataBuilder = $attributeMetadataBuilder; + } + + /** + * {@inheritdoc} + */ + public function getCustomAttributesMetadata($dataObjectClassName = null) + { + $attributes = []; + if (!is_null($this->attributeMetadataBuilder) && !is_null($dataObjectClassName)) { + /** + * Attribute metadata builder and data object class name are expected to be configured + * via DI using virtual types. If configuration is missing, empty array should be returned. + */ + $allAttributes = $this->serviceConfigReader->read(); + if (isset($allAttributes[$dataObjectClassName]) + && is_array($allAttributes[$dataObjectClassName]) + ) { + $attributeCodes = array_keys($allAttributes[$dataObjectClassName]); + foreach ($attributeCodes as $attributeCode) { + $this->attributeMetadataBuilder->setAttributeCode($attributeCode); + $attributes[$attributeCode] = $this->attributeMetadataBuilder->create(); + } + } + } + return $attributes; + } +} diff --git a/lib/internal/Magento/Framework/Service/Config/Reader.php b/lib/internal/Magento/Framework/Service/Config/Reader.php new file mode 100644 index 0000000000000000000000000000000000000000..e505d9ab8a358c7f8d380fe638d894d399a941b2 --- /dev/null +++ b/lib/internal/Magento/Framework/Service/Config/Reader.php @@ -0,0 +1,69 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Framework\Service\Config; + +class Reader extends \Magento\Framework\Config\Reader\Filesystem +{ + /** + * List of id attributes for merge + * + * @var array + */ + protected $_idAttributes = array( + '/config/custom_attributes' => 'for', + '/config/custom_attributes/attribute' => 'code' + ); + + /** + * @param \Magento\Framework\Config\FileResolverInterface $fileResolver + * @param \Magento\Framework\Service\Config\Converter $converter + * @param \Magento\Framework\Service\Config\SchemaLocator $schemaLocator + * @param \Magento\Framework\Config\ValidationStateInterface $validationState + * @param string $fileName + * @param array $idAttributes + * @param string $domDocumentClass + * @param string $defaultScope + */ + public function __construct( + \Magento\Framework\Config\FileResolverInterface $fileResolver, + \Magento\Framework\Service\Config\Converter $converter, + \Magento\Framework\Service\Config\SchemaLocator $schemaLocator, + \Magento\Framework\Config\ValidationStateInterface $validationState, + $fileName = 'data_object.xml', + $idAttributes = array(), + $domDocumentClass = 'Magento\Framework\Config\Dom', + $defaultScope = 'global' + ) { + parent::__construct( + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope + ); + } +} diff --git a/lib/internal/Magento/Framework/Service/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Service/Config/SchemaLocator.php new file mode 100644 index 0000000000000000000000000000000000000000..e72a2dfd776c8327b9ed053548777fdc3a6c150e --- /dev/null +++ b/lib/internal/Magento/Framework/Service/Config/SchemaLocator.php @@ -0,0 +1,49 @@ +<?php +/** + * Event observers configuration schema locator + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Framework\Service\Config; + +class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface +{ + /** + * Get path to merged config schema + * + * @return string + */ + public function getSchema() + { + return realpath(__DIR__ . '/../etc/data_object.xsd'); + } + + /** + * Get path to pre file validation schema + * + * @return string + */ + public function getPerFileSchema() + { + return $this->getSchema(); + } +} diff --git a/lib/internal/Magento/Framework/Service/Data/AbstractObjectBuilder.php b/lib/internal/Magento/Framework/Service/Data/AbstractObjectBuilder.php index 81bbd1c075b8a49e5db503fec66bc89127b7278b..96344a9fa96e042bcf8278b6d47b17edfe961993 100644 --- a/lib/internal/Magento/Framework/Service/Data/AbstractObjectBuilder.php +++ b/lib/internal/Magento/Framework/Service/Data/AbstractObjectBuilder.php @@ -63,16 +63,6 @@ abstract class AbstractObjectBuilder return $this->populateWithArray($prototype->__toArray()); } - /** - * Template method used to configure the attribute codes for the custom attributes - * - * @return array - */ - public function getCustomAttributesCodes() - { - return array(); - } - /** * Populates the fields with data from the array. * diff --git a/lib/internal/Magento/Framework/Service/Data/AttributeMetadataBuilder.php b/lib/internal/Magento/Framework/Service/Data/AttributeMetadataBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..6a6520cefea8a1bf586eb568d61256e251b4f5c1 --- /dev/null +++ b/lib/internal/Magento/Framework/Service/Data/AttributeMetadataBuilder.php @@ -0,0 +1,44 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\Service\Data; + +/** + * Default implementation of the AttributeMetadataBuilderInterface + */ +class AttributeMetadataBuilder extends AbstractObjectBuilder implements AttributeMetadataBuilderInterface +{ + const ATTRIBUTE_CODE = 'attribute_code'; + + /** + * Set attribute code + * + * @param string $attributeCode + * @return $this + */ + public function setAttributeCode($attributeCode) + { + return $this->_set(self::ATTRIBUTE_CODE, $attributeCode); + } +} diff --git a/lib/internal/Magento/Framework/Service/Data/AttributeMetadataBuilderInterface.php b/lib/internal/Magento/Framework/Service/Data/AttributeMetadataBuilderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..b292994579e33db7cfc1a96e5e36565a7117db90 --- /dev/null +++ b/lib/internal/Magento/Framework/Service/Data/AttributeMetadataBuilderInterface.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\Service\Data; + +/** + * Attribute metadata object builder interface. + */ +interface AttributeMetadataBuilderInterface +{ + /** + * Set code of the attribute. + * + * @param string $attributeCode + * @return $this + */ + public function setAttributeCode($attributeCode); + + /** + * Build the attribute data object. + * + * @return AbstractObject + */ + public function create(); +} diff --git a/lib/internal/Magento/Framework/Service/Data/Eav/AbstractObjectBuilder.php b/lib/internal/Magento/Framework/Service/Data/Eav/AbstractObjectBuilder.php index 234117461e9cb0a1a653164fe24cfa8d3f6a70fe..eeab2ce66cee31bccc78c5737bc2915942b8ffbb 100644 --- a/lib/internal/Magento/Framework/Service/Data/Eav/AbstractObjectBuilder.php +++ b/lib/internal/Magento/Framework/Service/Data/Eav/AbstractObjectBuilder.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Framework\Service\Data\Eav; /** @@ -31,17 +32,25 @@ abstract class AbstractObjectBuilder extends \Magento\Framework\Service\Data\Abs /** * @var AttributeValueBuilder */ - protected $_valueBuilder; + protected $valueBuilder; + + /** + * @var MetadataServiceInterface + */ + protected $metadataService; /** * @param \Magento\Framework\Service\Data\ObjectFactory $objectFactory * @param AttributeValueBuilder $valueBuilder + * @param MetadataServiceInterface $metadataService */ public function __construct( \Magento\Framework\Service\Data\ObjectFactory $objectFactory, - AttributeValueBuilder $valueBuilder + AttributeValueBuilder $valueBuilder, + MetadataServiceInterface $metadataService ) { - $this->_valueBuilder = $valueBuilder; + $this->valueBuilder = $valueBuilder; + $this->metadataService = $metadataService; parent::__construct($objectFactory); } @@ -78,7 +87,7 @@ abstract class AbstractObjectBuilder extends \Magento\Framework\Service\Data\Abs $customAttributesCodes = $this->getCustomAttributesCodes(); /* If key corresponds to custom attribute code, populate custom attributes */ if (in_array($attributeCode, $customAttributesCodes)) { - $valueObject = $this->_valueBuilder + $valueObject = $this->valueBuilder ->setAttributeCode($attributeCode) ->setValue($attributeValue) ->create(); @@ -92,9 +101,14 @@ abstract class AbstractObjectBuilder extends \Magento\Framework\Service\Data\Abs * * @return string[] */ - public function getCustomAttributesCodes() + protected function getCustomAttributesCodes() { - return array(); + $attributeCodes = []; + $dataObjectClassName = $this->_getDataObjectType(); + foreach ($this->metadataService->getCustomAttributesMetadata($dataObjectClassName) as $attribute) { + $attributeCodes[] = $attribute->getAttributeCode(); + } + return $attributeCodes; } /** diff --git a/lib/internal/Magento/Framework/Service/Data/Eav/AttributeValue.php b/lib/internal/Magento/Framework/Service/Data/Eav/AttributeValue.php index d70230b09bac80e1596e9543700d5e72f5610f87..eae69528417dd4b229d6e3f846453d851f0fa6bb 100644 --- a/lib/internal/Magento/Framework/Service/Data/Eav/AttributeValue.php +++ b/lib/internal/Magento/Framework/Service/Data/Eav/AttributeValue.php @@ -48,7 +48,7 @@ class AttributeValue extends \Magento\Framework\Service\Data\AbstractObject /** * Get attribute value * - * @return string the attribute value + * @return mixed the attribute value */ public function getValue() { diff --git a/lib/internal/Magento/Framework/Service/Data/Eav/MetadataObjectInterface.php b/lib/internal/Magento/Framework/Service/Data/Eav/MetadataObjectInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..87ee6edbd79dd6749440dfe5c0329ac3448f2797 --- /dev/null +++ b/lib/internal/Magento/Framework/Service/Data/Eav/MetadataObjectInterface.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\Service\Data\Eav; + + +interface MetadataObjectInterface +{ + /** + * Retrieve code of the attribute. + * + * @return string + */ + public function getAttributeCode(); +} diff --git a/lib/internal/Magento/Framework/Service/Data/Eav/MetadataServiceInterface.php b/lib/internal/Magento/Framework/Service/Data/Eav/MetadataServiceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..bd532cfef619d630cc5e5375e5c480350c757585 --- /dev/null +++ b/lib/internal/Magento/Framework/Service/Data/Eav/MetadataServiceInterface.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\Service\Data\Eav; + +interface MetadataServiceInterface +{ + /** + * Get custom attribute metadata for the given Data object's attribute set + * + * @param string|null $dataObjectClassName Data object class name + * @return \Magento\Framework\Service\Data\Eav\MetadataObjectInterface[] + */ + public function getCustomAttributesMetadata($dataObjectClassName = null); +} diff --git a/lib/internal/Magento/Framework/Service/V1/Data/SearchCriteria.php b/lib/internal/Magento/Framework/Service/V1/Data/SearchCriteria.php index 6feacc7dd0859b8e4a0b3f7286c5978d8799c579..2173fb17203bddf2ad498b14655175a0f90c241b 100644 --- a/lib/internal/Magento/Framework/Service/V1/Data/SearchCriteria.php +++ b/lib/internal/Magento/Framework/Service/V1/Data/SearchCriteria.php @@ -55,7 +55,7 @@ class SearchCriteria extends AbstractObject /** * Get sort order * - * @return string[]|null + * @return \Magento\Framework\Service\V1\Data\SortOrder[]|null */ public function getSortOrders() { diff --git a/lib/internal/Magento/Framework/Service/V1/Data/SearchCriteriaBuilder.php b/lib/internal/Magento/Framework/Service/V1/Data/SearchCriteriaBuilder.php index 9e56257d09e9e7d83b52cd980b1d95f28c478d71..4d0b38f508e88398d58e31adafd5c4b41612fc5e 100644 --- a/lib/internal/Magento/Framework/Service/V1/Data/SearchCriteriaBuilder.php +++ b/lib/internal/Magento/Framework/Service/V1/Data/SearchCriteriaBuilder.php @@ -26,6 +26,7 @@ namespace Magento\Framework\Service\V1\Data; use Magento\Framework\Service\Data\AbstractObjectBuilder; use Magento\Framework\Service\V1\Data\Search\FilterGroupBuilder; +use Magento\Framework\Service\V1\Data\SortOrder; /** * Builder for SearchCriteria Service Data Object @@ -89,24 +90,22 @@ class SearchCriteriaBuilder extends AbstractObjectBuilder /** * Add sort order * - * @param string $field - * @param int $direction + * @param SortOrder $sortOrder * @return $this */ - public function addSortOrder($field, $direction) + public function addSortOrder($sortOrder) { if (!isset($this->_data[SearchCriteria::SORT_ORDERS])) { - $this->_data[SearchCriteria::SORT_ORDERS] = array(); + $this->_data[SearchCriteria::SORT_ORDERS] = []; } - - $this->_data[SearchCriteria::SORT_ORDERS][$field] = $direction; + $this->_data[SearchCriteria::SORT_ORDERS][] = $sortOrder; return $this; } /** * Set sort orders * - * @param array $sortOrders + * @param SortOrder[] $sortOrders * @return $this */ public function setSortOrders(array $sortOrders) diff --git a/lib/internal/Magento/Framework/Service/V1/Data/SortOrder.php b/lib/internal/Magento/Framework/Service/V1/Data/SortOrder.php new file mode 100644 index 0000000000000000000000000000000000000000..58fefc544ecd426f7b3472f1cea362df343ed93a --- /dev/null +++ b/lib/internal/Magento/Framework/Service/V1/Data/SortOrder.php @@ -0,0 +1,56 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\Service\V1\Data; + +use Magento\Framework\Service\Data\AbstractObject; + +/** + * Data object for sort order. + */ +class SortOrder extends AbstractObject +{ + const FIELD = 'field'; + const DIRECTION = 'direction'; + + /** + * Get sorting field. + * + * @return string + */ + public function getField() + { + return $this->_get(SortOrder::FIELD); + } + + /** + * Get sorting direction. + * + * @return string + */ + public function getDirection() + { + return $this->_get(SortOrder::DIRECTION); + } +} diff --git a/lib/internal/Magento/Framework/Service/V1/Data/SortOrderBuilder.php b/lib/internal/Magento/Framework/Service/V1/Data/SortOrderBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..8d31f4054e241074a32d5c680a72378001979543 --- /dev/null +++ b/lib/internal/Magento/Framework/Service/V1/Data/SortOrderBuilder.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\Service\V1\Data; + +use Magento\Framework\Service\Data\AbstractObjectBuilder; + +/** + * Builder for sort order data object. + * + * @method SortOrder create() + */ +class SortOrderBuilder extends AbstractObjectBuilder +{ + /** + * Set sorting field. + * + * @param string $field + * @return $this + */ + public function setField($field) + { + $this->_set(SortOrder::FIELD, $field); + return $this; + } + + /** + * Set sorting direction. + * + * @param string $direction + * @return $this + */ + public function setDirection($direction) + { + $this->_set(SortOrder::DIRECTION, $direction); + return $this; + } +} diff --git a/lib/internal/Magento/Framework/Service/etc/data_object.xsd b/lib/internal/Magento/Framework/Service/etc/data_object.xsd new file mode 100644 index 0000000000000000000000000000000000000000..af96930e4572520337480f931b0433c28074bb8a --- /dev/null +++ b/lib/internal/Magento/Framework/Service/etc/data_object.xsd @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="config"> + <xs:complexType> + <xs:sequence> + <xs:element name="custom_attributes" type="custom_attributesType" minOccurs="1" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Main schema element. Extended Attributes</xs:documentation> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:complexType name="attributeType"> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute type="xs:string" name="code" use="required"/> + <xs:attribute type="xs:string" name="type" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:complexType name="custom_attributesType"> + <xs:sequence> + <xs:element type="attributeType" name="attribute" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute type="xs:string" name="for" use="required"/> + </xs:complexType> +</xs:schema> diff --git a/lib/internal/Magento/Framework/View/File/Collector/Base.php b/lib/internal/Magento/Framework/View/File/Collector/Base.php index 0ca54a869ab93ebcd97863f55383d479ec8535c4..0b75f079a9213f03cf158057f896de4938c25c2c 100644 --- a/lib/internal/Magento/Framework/View/File/Collector/Base.php +++ b/lib/internal/Magento/Framework/View/File/Collector/Base.php @@ -95,7 +95,7 @@ class Base implements CollectorInterface $moduleFull = "{$matches['namespace']}_{$matches['module']}"; $result[] = $this->fileFactory->create($filename, $moduleFull, null, true); } - $area = $theme->getArea(); + $area = $theme->getData('area'); $themeFiles = $this->modulesDirectory->search("{$namespace}/{$module}/view/{$area}/{$this->subDir}{$filePath}"); $pattern = "#(?<namespace>[^/]+)/(?<module>[^/]+)/view/{$area}/{$this->subDir}" . $filePathPtn . "$#i"; foreach ($themeFiles as $file) { diff --git a/lib/internal/Magento/Framework/View/Layout.php b/lib/internal/Magento/Framework/View/Layout.php index bb55c22db1266e320f6ae8140debae8dc564756c..f14b6c5a1737c37929f513462496121fec3e8732 100644 --- a/lib/internal/Magento/Framework/View/Layout.php +++ b/lib/internal/Magento/Framework/View/Layout.php @@ -325,6 +325,7 @@ class Layout extends \Magento\Framework\Simplexml\Config implements \Magento\Fra $this->_scheduledStructure->flushScheduledStructure(); $this->_readStructure($this->getNode()); + $this->_addToOutputRootContainers($this->getNode()); while (false === $this->_scheduledStructure->isStructureEmpty()) { $this->_scheduleElement(key($this->_scheduledStructure->getStructure())); @@ -347,9 +348,6 @@ class Layout extends \Magento\Framework\Simplexml\Config implements \Magento\Fra list($type, $node, $actions, $args, $attributes) = current($this->_scheduledStructure->getElements()); $elementName = key($this->_scheduledStructure->getElements()); - if (isset($node['output'])) { - $this->addOutputElement($elementName); - } if ($type == Element::TYPE_BLOCK) { $this->_generateBlock($elementName); } else { @@ -361,6 +359,23 @@ class Layout extends \Magento\Framework\Simplexml\Config implements \Magento\Fra \Magento\Framework\Profiler::stop(__CLASS__ . '::' . __METHOD__); } + /** + * Add parent containers to output + * + * @param Element $nodeList + * @return $this + */ + protected function _addToOutputRootContainers(Element $nodeList) + { + /** @var $node Element */ + foreach ($nodeList as $node) { + if ($node->getName() === Element::TYPE_CONTAINER) { + $this->addOutputElement($node->getElementName()); + } + } + return $this; + } + /** * Remove scheduled element * diff --git a/lib/internal/Magento/Framework/View/Layout/ProcessorInterface.php b/lib/internal/Magento/Framework/View/Layout/ProcessorInterface.php index e22aa6e70e5b31fdfece8f4606ac9da679444da0..2fb5ea758eb2887c59b0ecc23e6c52ab224f32ac 100644 --- a/lib/internal/Magento/Framework/View/Layout/ProcessorInterface.php +++ b/lib/internal/Magento/Framework/View/Layout/ProcessorInterface.php @@ -80,10 +80,17 @@ interface ProcessorInterface * Return whether any page handles have been added or not. * * @param array $handlesToTry - * @return ProcessorInterface + * @return bool */ public function addPageHandles(array $handlesToTry); + /** + * Get declared page layout for current handles + * + * @return null|string + */ + public function getPageLayout(); + /** * Retrieve all design abstractions that exist in the system. * diff --git a/lib/internal/Magento/Framework/View/Page/Config.php b/lib/internal/Magento/Framework/View/Page/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..8262204ed81326fc2d08ce5f4ad05bd5e6647aec --- /dev/null +++ b/lib/internal/Magento/Framework/View/Page/Config.php @@ -0,0 +1,183 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\View\Page; + +/** + * An API for page configuration + * + * Has methods for managing properties specific to web pages: + * - title + * - related documents, linked static assets in particular + * - meta info + * - root element properties + * - etc... + */ +class Config +{ + /**#@+ + * Constants of available types + */ + const ELEMENT_TYPE_BODY = 'body'; + const ELEMENT_TYPE_HTML = 'html'; + /**#@-*/ + + /** + * Allowed group of types + * + * @var array + */ + private $allowedTypes = [ + self::ELEMENT_TYPE_BODY, + self::ELEMENT_TYPE_HTML + ]; + + /** + * @var string + */ + protected $title; + + /** + * @var \Magento\Framework\View\Asset\Collection + */ + protected $assetCollection; + + /** + * @var string[][] + */ + protected $elements = []; + + /** + * @var string + */ + protected $pageLayout; + + /** + * Constructor + * + * @param \Magento\Framework\View\Asset\Collection $assetCollection + */ + public function __construct( + \Magento\Framework\View\Asset\Collection $assetCollection + ) { + $this->assetCollection = $assetCollection; + } + + /** + * Set page title + * + * @param string $title + * @return $this + */ + public function setTitle($title) + { + $this->title = $title; + return $this; + } + + /** + * Return page title + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * @return \Magento\Framework\View\Asset\Collection + */ + public function getAssetCollection() + { + return $this->assetCollection; + } + + /** + * Add CSS class to page body tag + * + * @param string $className + * @return $this + */ + public function addBodyClass($className) + { + $className = preg_replace('#[^a-z0-9]+#', '-', strtolower($className)); + $bodyClasses = $this->getElementAttribute(self::ELEMENT_TYPE_BODY, 'classes'); + $this->setElementAttribute(self::ELEMENT_TYPE_BODY, 'classes', $bodyClasses . ' ' . $className); + return $this; + } + + /** + * Set additional element attribute + * + * @param string $elementType + * @param string $attribute + * @param mixed $value + * @return $this + * @throws \Magento\Framework\Exception + */ + public function setElementAttribute($elementType, $attribute, $value) + { + if (array_search($elementType, $this->allowedTypes) === false) { + throw new \Magento\Framework\Exception($elementType . ' isn\'t allowed'); + } + $this->elements[$elementType][$attribute] = $value; + return $this; + } + + /** + * Retrieve additional element attribute + * + * @param string $elementType + * @param string $attribute + * @return null + */ + public function getElementAttribute($elementType, $attribute) + { + return isset($this->elements[$elementType][$attribute]) ? $this->elements[$elementType][$attribute] : null; + } + + /** + * Set page layout + * + * @param string $handle + * @return $this + * @throws \UnexpectedValueException + */ + public function setPageLayout($handle) + { + $this->pageLayout = $handle; + return $this; + } + + /** + * Return current page layout + * + * @return string + */ + public function getPageLayout() + { + return $this->pageLayout; + } +} diff --git a/lib/internal/Magento/Framework/View/PageLayout/Config.php b/lib/internal/Magento/Framework/View/PageLayout/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..08c17422faa2f0d2a20d99fb89378dc2aabffe15 --- /dev/null +++ b/lib/internal/Magento/Framework/View/PageLayout/Config.php @@ -0,0 +1,128 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\View\PageLayout; + +/** + * Page layouts configuration + */ +class Config extends \Magento\Framework\Config\AbstractXml +{ + /** + * Get absolute path to the XML-schema file + * + * @return string + */ + public function getSchemaFile() + { + return __DIR__ . '/etc/layouts.xsd'; + } + + /** + * Get page layout that contains declared in system + * + * @return string[][] + */ + public function getPageLayouts() + { + return $this->_data; + } + + /** + * Checks that the page layout declared in configuration + * + * @param string $pageLayout + * @return bool + */ + public function hasPageLayout($pageLayout) + { + return isset($this->_data[$pageLayout]); + } + + /** + * Retrieve page layout options + * + * @return array + */ + public function getOptions() + { + return $this->getPageLayouts(); + } + + /** + * @param bool $withEmpty + * @return array + */ + public function toOptionArray($withEmpty = false) + { + foreach ($this->getPageLayouts() as $value => $label) { + $options[] = array('label' => $label, 'value' => $value); + } + + if ($withEmpty) { + array_unshift($options, array('value' => '', 'label' => __('-- Please Select --'))); + } + return $options; + } + + /** + * Extract configuration data from the DOM structure + * + * @param \DOMDocument $dom + * @return array + */ + protected function _extractData(\DOMDocument $dom) + { + $result = []; + + /** @var \DOMElement $layout */ + foreach ($dom->getElementsByTagName('layout') as $layout) { + $result[$layout->getAttribute('id')] = trim($layout->nodeValue); + } + return $result; + } + + /** + * Get XML-contents, initial for merging + * + * @return string + */ + protected function _getInitialXml() + { + return '<?xml version="1.0" encoding="UTF-8"?>' + .'<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></page_layouts>'; + } + + /** + * Get list of paths to identifiable nodes + * + * @return array + */ + protected function _getIdAttributes() + { + return [ + '/page_layouts/layout' => 'id' + ]; + } +} diff --git a/lib/internal/Magento/Framework/View/PageLayout/File/Collector/Aggregated.php b/lib/internal/Magento/Framework/View/PageLayout/File/Collector/Aggregated.php new file mode 100644 index 0000000000000000000000000000000000000000..fa5ce5f72aca51607f52762ef145430d52252929 --- /dev/null +++ b/lib/internal/Magento/Framework/View/PageLayout/File/Collector/Aggregated.php @@ -0,0 +1,48 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\View\PageLayout\File\Collector; + +use Magento\Framework\View\Design\ThemeInterface; + +/** + * Source of layout files aggregated from a theme and its parents according to merging and overriding conventions + */ +class Aggregated extends \Magento\Framework\View\Layout\File\Collector\Aggregated +{ + /** + * @param ThemeInterface $theme + * @param string $filePath + * @return array + */ + public function getFilesContent(ThemeInterface $theme, $filePath) + { + $result = []; + foreach ($this->getFiles($theme, $filePath) as $file) { + $result[$file->getFilename()] = file_get_contents($file->getFilename()); + } + + return $result; + } +} diff --git a/app/code/Magento/Theme/etc/page_layouts.xsd b/lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd similarity index 70% rename from app/code/Magento/Theme/etc/page_layouts.xsd rename to lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd index 2f15f2c090f66ce84775861e5529c5fa3cfb2ce3..9a8b0f7ab52587911a5e80ac62a9f771fcf6c56e 100644 --- a/app/code/Magento/Theme/etc/page_layouts.xsd +++ b/lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd @@ -32,31 +32,19 @@ </xs:annotation> <xs:complexType> <xs:sequence> - <xs:element name="layouts" type="layoutsType" /> + <xs:element name="layout" type="layoutType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:key name="layout-id"> - <xs:selector xpath="layouts/layout" /> + <xs:selector xpath="layout" /> <xs:field xpath="@id" /> </xs:key> - <xs:keyref refer="layout-id" name="layout-ref"> - <xs:selector xpath="layouts" /> - <xs:field xpath="@default" /> - </xs:keyref> + <xs:unique name="layoutType"> + <xs:selector xpath="layout"/> + <xs:field xpath="@id"/> + </xs:unique> </xs:element> - <xs:complexType name="layoutsType"> - <xs:annotation> - <xs:documentation> - The containing element for a list of layouts - </xs:documentation> - </xs:annotation> - <xs:sequence maxOccurs="unbounded"> - <xs:element name="layout" type="layoutType" /> - </xs:sequence> - <xs:attribute name="default" use="required" type="xs:IDREF" /> - </xs:complexType> - <xs:complexType name="layoutType"> <xs:annotation> <xs:documentation> @@ -65,10 +53,8 @@ </xs:annotation> <xs:all> <xs:element name="label" type="translatableType" /> - <xs:element name="template" type="xs:string" /> - <xs:element name="layout_handle" type="xs:string" /> </xs:all> - <xs:attribute name="id" type="xs:ID" use="required" /> + <xs:attribute name="id" type="xs:string" use="required" /> </xs:complexType> <xs:complexType name="translatableType"> @@ -78,5 +64,4 @@ </xs:extension> </xs:simpleContent> </xs:complexType> - </xs:schema> diff --git a/lib/internal/Magento/Framework/View/Result/Layout.php b/lib/internal/Magento/Framework/View/Result/Layout.php new file mode 100644 index 0000000000000000000000000000000000000000..df7451f13d4597cec381db3def59afdf97d4a7ec --- /dev/null +++ b/lib/internal/Magento/Framework/View/Result/Layout.php @@ -0,0 +1,105 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\View\Result; + +use Magento\Framework\View; +use Magento\Framework\App\ResponseInterface; + +/** + * A generic layout response can be used for rendering any kind of layout + * So it comprises a response body from the layout elements it has and sets it to the HTTP response + */ +class Layout extends View\Element\Template + //implements ResultInterface +{ + /** + * @var \Magento\Framework\View\LayoutFactory + */ + protected $layoutFactory; + + /** + * @var \Magento\Framework\View\LayoutInterface + */ + protected $layout; + + /** + * @var \Magento\Framework\Translate\InlineInterface + */ + protected $translateInline; + + /** + * @param View\Element\Template\Context $context + * @param View\LayoutFactory $layoutFactory + * @param \Magento\Framework\Translate\InlineInterface $translateInline + * @param array $data + */ + public function __construct( + View\Element\Template\Context $context, + View\LayoutFactory $layoutFactory, + \Magento\Framework\Translate\InlineInterface $translateInline, + array $data = array() + ) { + $this->layoutFactory = $layoutFactory; + $this->translateInline = $translateInline; + parent::__construct($context, $data); + } + + /** + * Get layout instance for current page + * + * TODO: This layout model must be isolated, now are used shared instance of layout (MAGETWO-26282) + * + * @return \Magento\Framework\View\Layout + */ + public function getLayout() + { + return $this->_layout; + } + + /** + * Create new instance of layout for current page + * + * @return $this + */ + public function initLayout() + { + $this->layout = $this->layoutFactory->create(); + return $this; + } + + /** + * Render current layout + * + * @param ResponseInterface $response + * @return $this + */ + public function renderResult(ResponseInterface $response) + { + $layout = $this->getLayout(); + $output = $layout->getOutput(); + $response->appendBody($output); + return $this; + } +} diff --git a/lib/internal/Magento/Framework/View/Result/Page.php b/lib/internal/Magento/Framework/View/Result/Page.php new file mode 100644 index 0000000000000000000000000000000000000000..c6f4a8e716f146ada39f88571a8a21d4cdc5c8f2 --- /dev/null +++ b/lib/internal/Magento/Framework/View/Result/Page.php @@ -0,0 +1,192 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\View\Result; + +use Magento\Framework\View; +use Magento\Framework\App\ResponseInterface; + +/** + * A "page" result that encapsulates page type, page configuration + * and imposes certain layout handles. + * + * The framework convention is that there will be loaded a guaranteed handle for "all pages", + * then guaranteed handle that corresponds to page type + * and a guaranteed handle that stands for page layout (a wireframe of a page) + * + * Page result is a more specific implementation of a generic layout response + */ +class Page extends Layout +{ + /** + * Default template + */ + const DEFAULT_ROOT_TEMPLATE = 'Magento_Theme::root.phtml'; + + /** + * @var string + */ + protected $pageType; + + /** + * @var string + */ + protected $pageLayout; + + /** + * @var \Magento\Framework\View\Page\Config + */ + protected $pageConfig; + + /** + * Constructor + * + * @param View\Element\Template\Context $context + * @param View\LayoutFactory $layoutFactory + * @param \Magento\Framework\Translate\InlineInterface $translateInline + * @param View\Page\Config $pageConfig + * @param string $pageType + * @param array $data + */ + public function __construct( + View\Element\Template\Context $context, + View\LayoutFactory $layoutFactory, + \Magento\Framework\Translate\InlineInterface $translateInline, + View\Page\Config $pageConfig, + $pageType, + array $data = array() + ) { + $this->pageConfig = $pageConfig; + $this->pageType = $pageType; + parent::__construct($context, $layoutFactory, $translateInline, $data); + } + + /** + * {@inheritdoc} + */ + public function initLayout() + { + $update = $this->getLayout()->getUpdate(); + $update->addHandle('default'); + $update->addHandle($this->getDefaultLayoutHandle()); + $pageLayout = $this->getPageLayout(); + if ($pageLayout) { + $update->addHandle($pageLayout); + $this->setTemplate(self::DEFAULT_ROOT_TEMPLATE); + } + return $this; + } + + /** + * Get default page layout regarding definition in layout + * + * @return null|string + */ + protected function getPageLayout() + { + if ($this->pageLayout === null) { + $update = $this->getLayout()->getUpdate(); + $this->pageLayout = $update->isLayoutDefined() ? '' : $update->getPageLayout(); + } + return $this->pageLayout; + } + + /** + * @return \Magento\Framework\View\Page\Config + */ + public function getConfig() + { + return $this->pageConfig; + } + + /** + * Add layout updates handles associated with the action page + * + * @param array|null $parameters page parameters + * @param string|null $defaultHandle + * @return bool + */ + public function addPageLayoutHandles(array $parameters = array(), $defaultHandle = null) + { + $handle = $defaultHandle ? $defaultHandle : $this->getDefaultLayoutHandle(); + $pageHandles = array($handle); + foreach ($parameters as $key => $value) { + $pageHandles[] = $handle . '_' . $key . '_' . $value; + } + // Do not sort array going into add page handles. Ensure default layout handle is added first. + return $this->getLayout()->getUpdate()->addPageHandles($pageHandles); + } + + /** + * Retrieve the default layout handle name for the current action + * + * @return string + */ + public function getDefaultLayoutHandle() + { + return strtolower($this->_request->getFullActionName()); + } + + /** + * @param ResponseInterface $response + * @return $this + */ + public function renderResult(ResponseInterface $response) + { + if ($this->getTemplate()) { + $layout = $this->getLayout(); + $config = $this->getConfig(); + + $this->assign('headContent', $layout->getBlock('head')->toHtml()); + $this->addDefaultBodyClasses(); + $this->assign('bodyClasses', $config->getElementAttribute($config::ELEMENT_TYPE_BODY, 'classes')); + $this->assign('bodyAttributes', $config->getElementAttribute($config::ELEMENT_TYPE_BODY, 'attributes')); + $this->assign('htmlAttributes', $config->getElementAttribute($config::ELEMENT_TYPE_HTML, 'attributes')); + + $output = $layout->getOutput(); + $this->translateInline->processResponseBody($output); + $this->assign('layoutContent', $output); + $response->appendBody($this->toHtml()); + } else { + parent::renderResult($response); + } + return $this; + } + + /** + * Add default body classes for current page layout + * + * @return $this + */ + protected function addDefaultBodyClasses() + { + $config = $this->getConfig(); + $config->addBodyClass($this->_request->getFullActionName('-')); + $pageLayout = $this->getPageLayout(); + if ($pageLayout) { + $config->addBodyClass('page-layout-' . $pageLayout); + } + return $this; + } +} diff --git a/lib/internal/Magento/Framework/View/Result/PageFactory.php b/lib/internal/Magento/Framework/View/Result/PageFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..2fd4496a4f7654a4df3d57c1938e86b0c9945b47 --- /dev/null +++ b/lib/internal/Magento/Framework/View/Result/PageFactory.php @@ -0,0 +1,61 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Framework\View\Result; + +use Magento\Framework\ObjectManager; + +/** + * A factory that knows how to create a "page" result + * Requires an instance of controller action in order to impose page type, + * which is by convention is determined from the controller action class + */ +class PageFactory +{ + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @param ObjectManager $objectManager + */ + public function __construct(ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create new page regarding its type + * + * TODO: As argument has to be controller action interface, temporary solution until controller output models + * TODO: are not implemented + * + * @return \Magento\Framework\View\Result\Page + */ + public function create() + { + return $this->objectManager->create('\Magento\Framework\View\Result\Page', ['pageType' => 'noroute']); + } +} diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 4e38d9c4816d4ec0d94a2a7c62b17f7bc4750981..9f523df43e0deec650c70b2ed269527629c0cab4 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -2,7 +2,7 @@ "name": "magento/framework", "description": "N/A", "type": "magento2-library", - "version": "0.1.0-alpha91", + "version": "0.1.0-alpha92", "require": { "php": "~5.4.11|~5.5.0", "ext-spl": "*", diff --git a/lib/web/css/source/lib/variables.less b/lib/web/css/source/lib/variables.less index 66aec212956f6298b5d8a3d60edc81465d762703..5165ba7560fdbc391aebafec877238d84efe82be 100644 --- a/lib/web/css/source/lib/variables.less +++ b/lib/web/css/source/lib/variables.less @@ -284,10 +284,10 @@ @layout-width-xs-indent: 10px; // Classnames defining different layouts -@layout-class-1column: layout-1; -@layout-class-2columns-left: layout-2-left; -@layout-class-2columns-right: layout-2-right; -@layout-class-3columns: layout-3; +@layout-class-1column: page-layout-1column; +@layout-class-2columns-left: page-layout-2columns-left; +@layout-class-2columns-right: page-layout-2columns-right; +@layout-class-3columns: page-layout-3columns; // Variables used for layout grid @total-columns: 12; diff --git a/lib/web/mage/collapsible.js b/lib/web/mage/collapsible.js index 048e4cc7759d99292301a990160ff82f8235861d..a546a10b6bb17d942ac2370a5c9916e0cec77751 100644 --- a/lib/web/mage/collapsible.js +++ b/lib/web/mage/collapsible.js @@ -323,6 +323,8 @@ define([ .removeClass(this.options.icons.activeHeader) .addClass(this.options.icons.header); } + + this.element.trigger('dimensionsChanged'); }, activate: function () { @@ -369,6 +371,8 @@ define([ .removeClass(this.options.icons.header) .addClass(this.options.icons.activeHeader); } + + this.element.trigger('dimensionsChanged'); }, _loadContent: function () { diff --git a/lib/web/mage/deletable-item.js b/lib/web/mage/deletable-item.js index 4151c20ee9d4dc8dc50cb535ec734cac7e6336ae..d8f3e6264edeea276547623143be66f853861cbe 100644 --- a/lib/web/mage/deletable-item.js +++ b/lib/web/mage/deletable-item.js @@ -34,7 +34,7 @@ define([ options: { deleteEvent: 'click', deleteSelector: '[data-role="delete"]', - hiddenClass: 'hidden' + hiddenClass: 'no-display' }, /** diff --git a/lib/web/mage/item-table.js b/lib/web/mage/item-table.js index 85ee44841bd52d350f8102791c089fd198e8ee86..e4faac80db7ca1fffda452eb19e2a4c577748772 100644 --- a/lib/web/mage/item-table.js +++ b/lib/web/mage/item-table.js @@ -117,7 +117,7 @@ define([ * @private */ _getDeletableItems: function () { - return this.element.find(this.options.itemsSelector + "> :data('mage-deletableItem')"); + return this.element.find(this.options.itemsSelector + "> .deletableItem"); }, /** diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index 4e3a075c2993bf485c1288c02061d02aecd47686..cdf509ee57a5bb9fa58ba2cbed68b050113828d5 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -36,28 +36,62 @@ define([ * @private */ _create: function() { - $(window).on('scroll', $.proxy(this._setTop, this)); + $(window).on({ + 'scroll': $.proxy(this._stick, this), + 'resize': $.proxy(this.reset, this) + }); + + this.element.on('dimensionsChanged', $.proxy(this.reset, this)); + + this.reset(); }, /** * float Block on windowScroll * @private */ - _setTop: function() { - if ((this.element).is(':visible')) { - var startOffset = this.element.parent().offset().top + parseInt(this.element.css("margin-top"), 10), - currentOffset = $(document).scrollTop(), - parentHeight = $(this.options.container).height() - parseInt(this.element.css("margin-top"), 10), - discrepancyOffset = currentOffset - startOffset; + _stick: function() { + var offset, + isStatic; + + isStatic = this.element.css('position') === 'static'; - if (discrepancyOffset >= 0) { - if (discrepancyOffset + this.element.innerHeight() < parentHeight) { - this.element.css('top', discrepancyOffset); - } - } else { - this.element.css('top', 0); - } + if( !isStatic && this.element.is(':visible') ) { + offset = $(document).scrollTop() - this.parentOffset; + + offset = Math.max( 0, Math.min( offset, this.maxOffset) ); + + this.element.css( 'top', offset ); } + }, + + /** + * Defines maximum offset value of the element. + * @private + */ + _calculateDimens: function(){ + var $parent = this.element.parent(), + topMargin = parseInt( this.element.css("margin-top"), 10 ), + parentHeight = $parent.height() - topMargin, + height = this.element.innerHeight(), + maxScroll = document.body.offsetHeight - window.innerHeight; + + this.parentOffset = $parent.offset().top + topMargin; + this.maxOffset = maxScroll - this.parentOffset; + + if( this.maxOffset + height >= parentHeight ){ + this.maxOffset = parentHeight - height; + } + + return this; + }, + + /** + * Facade method that palces sticky element where it should be. + */ + reset: function(){ + this._calculateDimens() + ._stick(); } }); diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js index 3363b476c067bd348534af10c1906f0287397b30..c2211bcba54234c595afad3614f1668b018140d3 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -114,7 +114,7 @@ 'AE': [new RegExp('^3[47][0-9]{13}$'), new RegExp('^[0-9]{4}$'), true], 'DI': [new RegExp('^(30[0-5][0-9]{13}|3095[0-9]{12}|35(2[8-9][0-9]{12}|[3-8][0-9]{13})|36[0-9]{12}|3[8-9][0-9]{14}|6011(0[0-9]{11}|[2-4][0-9]{11}|74[0-9]{10}|7[7-9][0-9]{10}|8[6-9][0-9]{10}|9[0-9]{11})|62(2(12[6-9][0-9]{10}|1[3-9][0-9]{11}|[2-8][0-9]{12}|9[0-1][0-9]{11}|92[0-5][0-9]{10})|[4-6][0-9]{13}|8[2-8][0-9]{12})|6(4[4-9][0-9]{13}|5[0-9]{14}))$'), new RegExp('^[0-9]{3}$'), true], 'JCB': [new RegExp('^(30[0-5][0-9]{13}|3095[0-9]{12}|35(2[8-9][0-9]{12}|[3-8][0-9]{13})|36[0-9]{12}|3[8-9][0-9]{14}|6011(0[0-9]{11}|[2-4][0-9]{11}|74[0-9]{10}|7[7-9][0-9]{10}|8[6-9][0-9]{10}|9[0-9]{11})|62(2(12[6-9][0-9]{10}|1[3-9][0-9]{11}|[2-8][0-9]{12}|9[0-1][0-9]{11}|92[0-5][0-9]{10})|[4-6][0-9]{13}|8[2-8][0-9]{12})|6(4[4-9][0-9]{13}|5[0-9]{14}))$'), new RegExp('^[0-9]{3,4}$'), true], - 'OT': [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), false] + 'OT': [new RegExp('^([0-9]+)$'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), false] }; /**