From 98cc7522594a0cfb33c5ce5d017948e551c4462c Mon Sep 17 00:00:00 2001 From: NamrataChangani Date: Sat, 19 May 2018 15:21:25 +0530 Subject: [PATCH 1/3] Fixed set template syntax in block file #2 --- .../Paypal/Block/Adminhtml/System/Config/ApiWizard.php | 2 +- .../Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php | 2 +- app/code/Magento/Paypal/Block/Iframe.php | 4 ++-- app/code/Magento/Review/Block/Form.php | 2 +- app/code/Magento/Review/Block/Rating/Entity/Detailed.php | 2 +- app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php | 2 +- app/code/Magento/UrlRewrite/Block/Edit.php | 2 +- app/code/Magento/User/Block/Role/Tab/Users.php | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php index a1cfabd48440f..afa80892487a5 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php @@ -13,7 +13,7 @@ class ApiWizard extends \Magento\Config\Block\System\Config\Form\Field /** * Path to block template */ - const WIZARD_TEMPLATE = 'system/config/api_wizard.phtml'; + const WIZARD_TEMPLATE = 'Magento_Paypal::system/config/api_wizard.phtml'; /** * Set template to itself diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php index bdca98e089e7b..c481871e1fb0f 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php @@ -11,7 +11,7 @@ class BmlApiWizard extends ApiWizard /** * Path to block template */ - const WIZARD_TEMPLATE = 'system/config/bml_api_wizard.phtml'; + const WIZARD_TEMPLATE = 'Magento_Paypal::system/config/bml_api_wizard.phtml'; /** * Get the button and scripts contents diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php index 98fc05d0d2f60..8ccba52b8e686 100644 --- a/app/code/Magento/Paypal/Block/Iframe.php +++ b/app/code/Magento/Paypal/Block/Iframe.php @@ -116,7 +116,7 @@ protected function _construct() if ($file && $directory->isExist($directory->getRelativePath($file))) { $this->setTemplate($templateFile); } else { - $this->setTemplate('hss/iframe.phtml'); + $this->setTemplate('Magento_Paypal::hss/iframe.phtml'); } } } @@ -198,7 +198,7 @@ protected function _beforeToHtml() protected function _toHtml() { if ($this->_isAfterPaymentSave()) { - $this->setTemplate('hss/js.phtml'); + $this->setTemplate('Magento_Paypal::hss/js.phtml'); return parent::_toHtml(); } if (!$this->_shouldRender) { diff --git a/app/code/Magento/Review/Block/Form.php b/app/code/Magento/Review/Block/Form.php index 440e13deb5839..c6dfad8265ac7 100644 --- a/app/code/Magento/Review/Block/Form.php +++ b/app/code/Magento/Review/Block/Form.php @@ -139,7 +139,7 @@ protected function _construct() ); } - $this->setTemplate('form.phtml'); + $this->setTemplate('Magento_Review::form.phtml'); } /** diff --git a/app/code/Magento/Review/Block/Rating/Entity/Detailed.php b/app/code/Magento/Review/Block/Rating/Entity/Detailed.php index 0ce4f436ae704..eee00483ace66 100644 --- a/app/code/Magento/Review/Block/Rating/Entity/Detailed.php +++ b/app/code/Magento/Review/Block/Rating/Entity/Detailed.php @@ -49,7 +49,7 @@ protected function _toHtml() $reviewsCount = $this->_ratingFactory->create()->getTotalReviews($entityId, true); if ($reviewsCount == 0) { #return __('Be the first to review this product'); - $this->setTemplate('empty.phtml'); + $this->setTemplate('Magento_Review::empty.phtml'); return parent::_toHtml(); } diff --git a/app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php b/app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php index 87f65ef311ac2..fb6c5e7b431ef 100644 --- a/app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php +++ b/app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php @@ -66,7 +66,7 @@ public function afterGetSectionData(\Magento\Checkout\CustomerData\Cart $subject foreach ($result['items'] as $key => $itemAsArray) { if ($item = $this->findItemById($itemAsArray['item_id'], $items)) { $this->itemPriceRenderer->setItem($item); - $this->itemPriceRenderer->setTemplate('checkout/cart/item/price/sidebar.phtml'); + $this->itemPriceRenderer->setTemplate('Magento_Tax::checkout/cart/item/price/sidebar.phtml'); $result['items'][$key]['product_price']=$this->itemPriceRenderer->toHtml(); } } diff --git a/app/code/Magento/UrlRewrite/Block/Edit.php b/app/code/Magento/UrlRewrite/Block/Edit.php index baee8af893083..210ed5189eb4c 100644 --- a/app/code/Magento/UrlRewrite/Block/Edit.php +++ b/app/code/Magento/UrlRewrite/Block/Edit.php @@ -65,7 +65,7 @@ public function __construct( */ protected function _prepareLayout() { - $this->setTemplate('edit.phtml'); + $this->setTemplate('Magento_UrlRewrite::edit.phtml'); $this->_addBackButton(); $this->_prepareLayoutFeatures(); diff --git a/app/code/Magento/User/Block/Role/Tab/Users.php b/app/code/Magento/User/Block/Role/Tab/Users.php index 27604c9aed29a..2d04ef27f536d 100644 --- a/app/code/Magento/User/Block/Role/Tab/Users.php +++ b/app/code/Magento/User/Block/Role/Tab/Users.php @@ -45,7 +45,7 @@ protected function _construct() $roleId = $this->getRequest()->getParam('rid', false); /** @var \Magento\User\Model\ResourceModel\User\Collection $users */ $users = $this->_userCollectionFactory->create()->load(); - $this->setTemplate('role/users.phtml')->assign('users', $users->getItems())->assign('roleId', $roleId); + $this->setTemplate('Magento_User::role/users.phtml')->assign('users', $users->getItems())->assign('roleId', $roleId); } /** From 4499034ae38aeed1d547971d57da0365aa89ce71 Mon Sep 17 00:00:00 2001 From: Vishal Gelani Date: Sun, 20 May 2018 06:42:54 +0530 Subject: [PATCH 2/3] Fixed coding standard error --- app/code/Magento/User/Block/Role/Tab/Users.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/User/Block/Role/Tab/Users.php b/app/code/Magento/User/Block/Role/Tab/Users.php index 2d04ef27f536d..a95a68cbe14f3 100644 --- a/app/code/Magento/User/Block/Role/Tab/Users.php +++ b/app/code/Magento/User/Block/Role/Tab/Users.php @@ -45,7 +45,9 @@ protected function _construct() $roleId = $this->getRequest()->getParam('rid', false); /** @var \Magento\User\Model\ResourceModel\User\Collection $users */ $users = $this->_userCollectionFactory->create()->load(); - $this->setTemplate('Magento_User::role/users.phtml')->assign('users', $users->getItems())->assign('roleId', $roleId); + $this->setTemplate('Magento_User::role/users.phtml') + ->assign('users', $users->getItems()) + ->assign('roleId', $roleId); } /** From b405dfaddc12ff42f90425de1f45530cced78327 Mon Sep 17 00:00:00 2001 From: vgelani Date: Mon, 16 Jul 2018 13:47:25 +0530 Subject: [PATCH 3/3] Reverted changes --- app/code/Magento/Paypal/Block/Iframe.php | 4 ++-- app/code/Magento/Review/Block/Form.php | 2 +- app/code/Magento/Review/Block/Rating/Entity/Detailed.php | 2 +- app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php | 2 +- app/code/Magento/UrlRewrite/Block/Edit.php | 2 +- app/code/Magento/User/Block/Role/Tab/Users.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php index 8ccba52b8e686..98fc05d0d2f60 100644 --- a/app/code/Magento/Paypal/Block/Iframe.php +++ b/app/code/Magento/Paypal/Block/Iframe.php @@ -116,7 +116,7 @@ protected function _construct() if ($file && $directory->isExist($directory->getRelativePath($file))) { $this->setTemplate($templateFile); } else { - $this->setTemplate('Magento_Paypal::hss/iframe.phtml'); + $this->setTemplate('hss/iframe.phtml'); } } } @@ -198,7 +198,7 @@ protected function _beforeToHtml() protected function _toHtml() { if ($this->_isAfterPaymentSave()) { - $this->setTemplate('Magento_Paypal::hss/js.phtml'); + $this->setTemplate('hss/js.phtml'); return parent::_toHtml(); } if (!$this->_shouldRender) { diff --git a/app/code/Magento/Review/Block/Form.php b/app/code/Magento/Review/Block/Form.php index c6dfad8265ac7..440e13deb5839 100644 --- a/app/code/Magento/Review/Block/Form.php +++ b/app/code/Magento/Review/Block/Form.php @@ -139,7 +139,7 @@ protected function _construct() ); } - $this->setTemplate('Magento_Review::form.phtml'); + $this->setTemplate('form.phtml'); } /** diff --git a/app/code/Magento/Review/Block/Rating/Entity/Detailed.php b/app/code/Magento/Review/Block/Rating/Entity/Detailed.php index eee00483ace66..0ce4f436ae704 100644 --- a/app/code/Magento/Review/Block/Rating/Entity/Detailed.php +++ b/app/code/Magento/Review/Block/Rating/Entity/Detailed.php @@ -49,7 +49,7 @@ protected function _toHtml() $reviewsCount = $this->_ratingFactory->create()->getTotalReviews($entityId, true); if ($reviewsCount == 0) { #return __('Be the first to review this product'); - $this->setTemplate('Magento_Review::empty.phtml'); + $this->setTemplate('empty.phtml'); return parent::_toHtml(); } diff --git a/app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php b/app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php index fb6c5e7b431ef..87f65ef311ac2 100644 --- a/app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php +++ b/app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php @@ -66,7 +66,7 @@ public function afterGetSectionData(\Magento\Checkout\CustomerData\Cart $subject foreach ($result['items'] as $key => $itemAsArray) { if ($item = $this->findItemById($itemAsArray['item_id'], $items)) { $this->itemPriceRenderer->setItem($item); - $this->itemPriceRenderer->setTemplate('Magento_Tax::checkout/cart/item/price/sidebar.phtml'); + $this->itemPriceRenderer->setTemplate('checkout/cart/item/price/sidebar.phtml'); $result['items'][$key]['product_price']=$this->itemPriceRenderer->toHtml(); } } diff --git a/app/code/Magento/UrlRewrite/Block/Edit.php b/app/code/Magento/UrlRewrite/Block/Edit.php index 210ed5189eb4c..baee8af893083 100644 --- a/app/code/Magento/UrlRewrite/Block/Edit.php +++ b/app/code/Magento/UrlRewrite/Block/Edit.php @@ -65,7 +65,7 @@ public function __construct( */ protected function _prepareLayout() { - $this->setTemplate('Magento_UrlRewrite::edit.phtml'); + $this->setTemplate('edit.phtml'); $this->_addBackButton(); $this->_prepareLayoutFeatures(); diff --git a/app/code/Magento/User/Block/Role/Tab/Users.php b/app/code/Magento/User/Block/Role/Tab/Users.php index a95a68cbe14f3..d93e7ad63e354 100644 --- a/app/code/Magento/User/Block/Role/Tab/Users.php +++ b/app/code/Magento/User/Block/Role/Tab/Users.php @@ -45,7 +45,7 @@ protected function _construct() $roleId = $this->getRequest()->getParam('rid', false); /** @var \Magento\User\Model\ResourceModel\User\Collection $users */ $users = $this->_userCollectionFactory->create()->load(); - $this->setTemplate('Magento_User::role/users.phtml') + $this->setTemplate('role/users.phtml') ->assign('users', $users->getItems()) ->assign('roleId', $roleId); }