diff --git a/.phpstan.dist.baseline.neon b/.phpstan.dist.baseline.neon index 69bbb43b6cd..360b0969a54 100644 --- a/.phpstan.dist.baseline.neon +++ b/.phpstan.dist.baseline.neon @@ -4945,11 +4945,6 @@ parameters: count: 1 path: app/code/core/Mage/Rating/Model/Resource/Rating.php - - - message: "#^Parameter \\#1 \\$object of method Mage_Rating_Model_Resource_Rating\\:\\:_getEntitySummaryData\\(\\) expects Mage_Rating_Model_Rating, Mage_Core_Model_Abstract given\\.$#" - count: 1 - path: app/code/core/Mage/Rating/Model/Resource/Rating.php - - message: "#^Variable \\$data in empty\\(\\) always exists and is not falsy\\.$#" count: 1 diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php index 301276bb93e..49c73900e12 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php @@ -41,7 +41,7 @@ protected function _prepareCollection() if ($store = $this->getRequest()->getParam('store')) { $websiteId = Mage::app()->getStore($store)->getWebsiteId(); } - if (Mage::helper('catalog')->isModuleEnabled('Mage_ProductAlert')) { + if ($this->isModuleEnabled('Mage_ProductAlert', 'catalog')) { $collection = Mage::getModel('productalert/price') ->getCustomerCollection() ->join($productId, $websiteId); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php index b959624d73e..be704805f8b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php @@ -41,7 +41,7 @@ protected function _prepareCollection() if ($store = $this->getRequest()->getParam('store')) { $websiteId = Mage::app()->getStore($store)->getWebsiteId(); } - if (Mage::helper('catalog')->isModuleEnabled('Mage_ProductAlert')) { + if ($this->isModuleEnabled('Mage_ProductAlert', 'catalog')) { $collection = Mage::getModel('productalert/stock') ->getCustomerCollection() ->join($productId, $websiteId); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php index cf4b69198af..b1e36c50493 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php @@ -28,7 +28,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi protected function _prepareLayout() { parent::_prepareLayout(); - if (Mage::helper('catalog')->isModuleEnabled('Mage_Cms') + if ($this->isModuleEnabled('Mage_Cms', 'catalog') && Mage::getSingleton('cms/wysiwyg_config')->isEnabled() ) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php index 423dd4db0f2..39ed663d4c9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php @@ -30,7 +30,7 @@ public function __construct() public function getBackordersOption() { - if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { + if ($this->isModuleEnabled('Mage_CatalogInventory', 'catalog')) { return Mage::getSingleton('cataloginventory/source_backorders')->toOptionArray(); } @@ -44,7 +44,7 @@ public function getBackordersOption() */ public function getStockOption() { - if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { + if ($this->isModuleEnabled('Mage_CatalogInventory', 'catalog')) { return Mage::getSingleton('cataloginventory/source_stock')->toOptionArray(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php index bd8dd5cd8ea..dd4503a64b2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php @@ -128,7 +128,7 @@ protected function _sortValues($data) public function getCustomerGroups($groupId = null) { if ($this->_customerGroups === null) { - if (!Mage::helper('catalog')->isModuleEnabled('Mage_Customer')) { + if (!$this->isModuleEnabled('Mage_Customer', 'catalog')) { return []; } $collection = Mage::getModel('customer/group')->getCollection(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php index 1cf453cc825..44555a2d3eb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php @@ -128,7 +128,7 @@ protected function _prepareCollection() ->addFilterByRequiredOptions() ->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner'); - if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { + if ($this->isModuleEnabled('Mage_CatalogInventory', 'catalog')) { Mage::getModel('cataloginventory/stock_item')->addCatalogInventoryToProductCollection($collection); } /** @var Mage_Catalog_Model_Product_Type_Configurable $productType */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php index 457e95b5b8c..0a62896c5eb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php @@ -33,7 +33,7 @@ public function __construct() protected function _prepareCollection() { - if (Mage::helper('catalog')->isModuleEnabled('Mage_Tag')) { + if ($this->isModuleEnabled('Mage_Tag', 'catalog')) { $collection = Mage::getModel('tag/tag') ->getCustomerCollection() ->addProductFilter($this->getProductId()) diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php index 21b6c8233c0..90f7f129e25 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php @@ -71,7 +71,7 @@ protected function _prepareLayout() ]); } - if (Mage::helper('core')->isModuleEnabled('Mage_CatalogInventory')) { + if ($this->isModuleEnabled('Mage_CatalogInventory')) { $this->addTab('inventory', [ 'label' => Mage::helper('catalog')->__('Inventory'), 'content' => $this->_translateHtml($this->getLayout() @@ -131,7 +131,7 @@ protected function _prepareLayout() } if ($this->getRequest()->getParam('id', false)) { - if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')) { + if ($this->isModuleEnabled('Mage_Review', 'catalog')) { if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/reviews_ratings')) { $this->addTab('reviews', [ 'label' => Mage::helper('catalog')->__('Product Reviews'), @@ -140,7 +140,7 @@ protected function _prepareLayout() ]); } } - if (Mage::helper('catalog')->isModuleEnabled('Mage_Tag')) { + if ($this->isModuleEnabled('Mage_Tag', 'catalog')) { if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/tag')) { $this->addTab('tags', [ 'label' => Mage::helper('catalog')->__('Product Tags'), diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php index fed7a9d3160..3b06077ec84 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php @@ -52,7 +52,7 @@ protected function _prepareCollection() ->addAttributeToSelect('attribute_set_id') ->addAttributeToSelect('type_id'); - if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { + if ($this->isModuleEnabled('Mage_CatalogInventory', 'catalog')) { $collection->joinField( 'qty', 'cataloginventory/stock_item', @@ -216,7 +216,7 @@ protected function _prepareColumns() ] ); - if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { + if ($this->isModuleEnabled('Mage_CatalogInventory', 'catalog')) { $this->addColumn( 'qty', [ @@ -284,7 +284,7 @@ protected function _prepareColumns() ] ); - if (Mage::helper('catalog')->isModuleEnabled('Mage_Rss') && + if ($this->isModuleEnabled('Mage_Rss', 'catalog') && Mage::helper('rss')->isRssAdminCatalogNotifyStockEnabled() ) { $this->addRssList('rss/catalog/notifystock', Mage::helper('catalog')->__('Notify Low Stock RSS')); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php index 6edc81e2786..43d145a4561 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php @@ -74,7 +74,9 @@ protected function _beforeToHtml() 'url' => $this->getUrl('*/*/wishlist', ['_current' => true]), ]); - if (Mage::helper('core')->isModuleOutputEnabled('Mage_Newsletter') && Mage::getSingleton('admin/session')->isAllowed('newsletter/subscriber')) { + if ($this->isModuleOutputEnabled('Mage_Newsletter') + && Mage::getSingleton('admin/session')->isAllowed('newsletter/subscriber') + ) { /** @var Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter $block */ $block = $this->getLayout()->createBlock('adminhtml/customer_edit_tab_newsletter'); $this->addTab('newsletter', [ @@ -83,7 +85,9 @@ protected function _beforeToHtml() ]); } - if (Mage::helper('core')->isModuleOutputEnabled('Mage_Review') && Mage::getSingleton('admin/session')->isAllowed('catalog/reviews_ratings')) { + if ($this->isModuleOutputEnabled('Mage_Review') + && Mage::getSingleton('admin/session')->isAllowed('catalog/reviews_ratings') + ) { $this->addTab('reviews', [ 'label' => Mage::helper('customer')->__('Product Reviews'), 'class' => 'ajax', @@ -91,7 +95,9 @@ protected function _beforeToHtml() ]); } - if (Mage::helper('core')->isModuleEnabled('Mage_Tag') && Mage::getSingleton('admin/session')->isAllowed('catalog/tag')) { + if ($this->isModuleEnabled('Mage_Tag') + && Mage::getSingleton('admin/session')->isAllowed('catalog/tag') + ) { $this->addTab('tags', [ 'label' => Mage::helper('customer')->__('Product Tags'), 'class' => 'ajax', diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php index 79427f65dfc..344fc19db6f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php @@ -30,7 +30,7 @@ public function __construct() protected function _prepareCollection() { - if (!Mage::helper('core')->isModuleEnabled('Mage_Reports')) { + if (!$this->isModuleEnabled('Mage_Reports')) { return $this; } $collection = Mage::getResourceModel('reports/order_collection') diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php index 51a774db5ef..4b3eb4c032d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php @@ -30,7 +30,7 @@ protected function _construct() protected function _prepareLayout() { - if (!Mage::helper('core')->isModuleEnabled('Mage_Reports')) { + if (!$this->isModuleEnabled('Mage_Reports')) { return $this; } $isFilter = $this->getRequest()->getParam('store') || $this->getRequest()->getParam('website') || $this->getRequest()->getParam('group'); diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php index d408e912d5d..f67608ccd3b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php @@ -32,7 +32,7 @@ public function __construct() protected function _prepareCollection() { - if (!Mage::helper('core')->isModuleEnabled('Mage_CatalogSearch')) { + if (!$this->isModuleEnabled('Mage_CatalogSearch')) { return parent::_prepareCollection(); } $this->_collection = Mage::getModel('catalogsearch/query') diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php index ce109a0730c..d60a530ab01 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php @@ -32,7 +32,7 @@ public function __construct() protected function _prepareCollection() { - if (!Mage::helper('core')->isModuleEnabled('Mage_CatalogSearch')) { + if (!$this->isModuleEnabled('Mage_CatalogSearch')) { return parent::_prepareCollection(); } $this->_collection = Mage::getModel('catalogsearch/query') diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php index d2050cc8aa2..ea8d319a8f9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php @@ -30,7 +30,7 @@ public function __construct() protected function _prepareCollection() { - if (!Mage::helper('core')->isModuleEnabled('Mage_Sales')) { + if (!$this->isModuleEnabled('Mage_Sales')) { return $this; } if ($this->getParam('website')) { diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php index 0e0c351d1b2..32b3c63a805 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php @@ -30,7 +30,7 @@ protected function _construct() protected function _prepareLayout() { - if (!Mage::helper('core')->isModuleEnabled('Mage_Reports')) { + if (!$this->isModuleEnabled('Mage_Reports')) { return $this; } $isFilter = $this->getRequest()->getParam('store') || $this->getRequest()->getParam('website') || $this->getRequest()->getParam('group'); diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php b/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php index 4bea0e438b1..64c7e93ab5e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php @@ -48,7 +48,7 @@ protected function _getHelper() */ public function isShow() { - if (!$this->isOutputEnabled('Mage_AdminNotification')) { + if (!$this->isModuleOutputEnabled('Mage_AdminNotification')) { return false; } if ($this->getRequest()->getControllerName() === 'notification') { diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php index 6677213e980..7429d4e30fe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php @@ -92,7 +92,7 @@ public function canShow() return false; } - if (!$this->isOutputEnabled('Mage_AdminNotification')) { + if (!$this->isModuleOutputEnabled('Mage_AdminNotification')) { $this->_available = false; return false; } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php index 3b3286749de..f935d8d379d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php @@ -193,7 +193,7 @@ protected function _prepareColumns() ] ); - if (Mage::helper('catalog')->isModuleEnabled('Mage_Rss') && + if ($this->isModuleEnabled('Mage_Rss', 'catalog') && Mage::helper('rss')->isRssAdminCatalogReviewEnabled() ) { $this->addRssList('rss/catalog/review', Mage::helper('catalog')->__('Pending Reviews RSS')); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php index e3415a1689f..f5b9017af25 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php @@ -82,7 +82,7 @@ protected function _getGiftmessageSaveModel() public function canDisplayGiftmessage(): bool { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php index 9a4ed55c104..322b3e5513e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php @@ -129,7 +129,7 @@ public function getItemOrigPrice($item) */ public function isGiftMessagesAvailable($item = null) { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ @@ -150,7 +150,7 @@ public function isGiftMessagesAvailable($item = null) */ public function isAllowedForGiftMessage($item) { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } return Mage::getSingleton('adminhtml/giftmessage_save')->getIsAllowedQuoteItem($item); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php index 034c7044f4b..bf6377f3d24 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php @@ -152,7 +152,7 @@ protected function _prepareColumns() */ public function addRssFeedLink() { - if (Mage::helper('sales')->isModuleOutputEnabled('Mage_Rss')) { + if ($this->isModuleOutputEnabled('Mage_Rss', 'sales')) { $storeId = null; $filterString = $this->getParam($this->getVarNameFilter(), ''); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php index 9c5ab121116..0ba762aa5c3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php @@ -51,7 +51,7 @@ public function getOrder() */ protected function _beforeToHtml() { - if (Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if ($this->isModuleOutputEnabled('Mage_GiftMessage')) { if ($this->getParentBlock() && ($order = $this->getOrder())) { $this->setEntity($order); } @@ -66,7 +66,7 @@ protected function _beforeToHtml() */ protected function _prepareLayout() { - if (Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if ($this->isModuleOutputEnabled('Mage_GiftMessage')) { $this->setChild( 'save_button', $this->getLayout()->createBlock('adminhtml/widget_button') @@ -280,7 +280,7 @@ public function getHtmlId() */ public function canDisplayGiftmessage() { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php index 152db9e4bec..bd3ebfbff52 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php @@ -205,7 +205,7 @@ public function getHtmlId() */ public function canDisplayGiftmessage() { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php index e1eb6b77321..a23fd4bf3e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php @@ -593,7 +593,7 @@ public function canUseWebsiteValue($field) protected function _canShowField($field) { $ifModuleEnabled = trim((string)$field->if_module_enabled); - if ($ifModuleEnabled && !Mage::helper('Core')->isModuleEnabled($ifModuleEnabled)) { + if ($ifModuleEnabled && !$this->isModuleEnabled($ifModuleEnabled)) { return false; } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php index b720fd6f150..bc5050e94c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php @@ -102,6 +102,8 @@ protected function _getFieldHtml($fieldset, $moduleName) 'inherit' => $inherit, 'can_use_default_value' => $this->getForm()->canUseDefaultValue($e), 'can_use_website_value' => $this->getForm()->canUseWebsiteValue($e), + 'scope' => true, + 'scope_label' => Mage::helper('adminhtml')->__('[STORE VIEW]'), ] )->setRenderer($this->_getFieldRenderer()); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php index 69af033f22e..a2027d5f24f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php @@ -27,7 +27,7 @@ public function __construct() { $backupAvailable = Mage::getSingleton('admin/session')->isAllowed('system/tools/backup') - && Mage::helper('core')->isModuleEnabled('Mage_Backup') + && $this->isModuleEnabled('Mage_Backup') && !Mage::getStoreConfigFlag('advanced/modules_disable_output/Mage_Backup'); $saveLabel = ''; diff --git a/app/code/core/Mage/Adminhtml/Block/Template.php b/app/code/core/Mage/Adminhtml/Block/Template.php index 36778c3ee84..63314a08acc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/Template.php @@ -41,21 +41,14 @@ public function getFormKey() } /** - * Check whether the module output is enabled - * - * Because many module blocks belong to Adminhtml module, - * the feature "Disable module output" doesn't cover Admin area - * * @param string $moduleName Full module name * @return bool + * @deprecated + * @see Mage_Core_Block_Template::isModuleOutputEnabled() */ public function isOutputEnabled($moduleName = null) { - if ($moduleName === null) { - $moduleName = $this->getModuleName(); - } - - return Mage::helper('core')->isModuleOutputEnabled($moduleName); + return $this->isModuleOutputEnabled($moduleName); } /** diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php index 6fb1b334098..ae0ad64a089 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php @@ -172,7 +172,7 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) // add enable products limitation $statusCond = $write->quoteInto('=?', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); $this->_addAttributeToSelect($select, 'status', 'e.entity_id', 'cs.store_id', $statusCond, true); - if (Mage::helper('core')->isModuleEnabled('Mage_Tax')) { + if ($this->isModuleEnabled('Mage_Tax')) { $taxClassId = $this->_addAttributeToSelect($select, 'tax_class_id', 'e.entity_id', 'cs.store_id'); } else { $taxClassId = new Zend_Db_Expr('0'); diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php index d6444b379bd..5e912d9e87b 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php @@ -313,7 +313,7 @@ public function addReviewSummaryTemplate($type, $template) protected function _initReviewsHelperBlock() { if (!$this->_reviewsHelperBlock) { - if (!Mage::helper('catalog')->isModuleEnabled('Mage_Review')) { + if (!$this->isModuleEnabled('Mage_Review', 'catalog')) { return false; } diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Related.php b/app/code/core/Mage/Catalog/Block/Product/List/Related.php index 7d647978067..ecb5181d86d 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Related.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Related.php @@ -45,7 +45,7 @@ protected function _prepareData() ->addStoreFilter() ; - if (Mage::helper('catalog')->isModuleEnabled('Mage_Checkout')) { + if ($this->isModuleEnabled('Mage_Checkout', 'catalog')) { Mage::getResourceSingleton('checkout/cart')->addExcludeProductFilter( $this->_itemCollection, Mage::getSingleton('checkout/session')->getQuoteId() diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php b/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php index d0bc1e9a739..e82a9e0fc16 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php @@ -48,7 +48,7 @@ protected function _prepareData() ->setPositionOrder() ->addStoreFilter() ; - if (Mage::helper('catalog')->isModuleEnabled('Mage_Checkout')) { + if ($this->isModuleEnabled('Mage_Checkout', 'catalog')) { Mage::getResourceSingleton('checkout/cart')->addExcludeProductFilter( $this->_itemCollection, Mage::getSingleton('checkout/session')->getQuoteId() diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index 29ee1f0fd9b..e210ca9c68f 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -1740,7 +1740,7 @@ public function toArray(array $arrAttributes = []) public function fromArray($data) { if (isset($data['stock_item'])) { - if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { + if ($this->isModuleEnabled('Mage_CatalogInventory', 'catalog')) { $stockItem = Mage::getModel('cataloginventory/stock_item') ->setData($data['stock_item']) ->setProduct($this); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php index f19685d93de..62bde0c0095 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php @@ -1230,7 +1230,7 @@ protected function _joinPriceRules() return $this; } - if (!Mage::helper('catalog')->isModuleEnabled('Mage_CatalogRule')) { + if (!$this->isModuleEnabled('Mage_CatalogRule', 'catalog')) { return $this; } $wId = Mage::app()->getWebsite()->getId(); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php index f615a7db169..ecbc21e241a 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php @@ -225,7 +225,7 @@ protected function _prepareFinalPriceData($entityIds = null) // add enable products limitation $statusCond = $write->quoteInto('=?', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); $this->_addAttributeToSelect($select, 'status', 'e.entity_id', 'cs.store_id', $statusCond, true); - if (Mage::helper('core')->isModuleEnabled('Mage_Tax')) { + if ($this->isModuleEnabled('Mage_Tax')) { $taxClassId = $this->_addAttributeToSelect($select, 'tax_class_id', 'e.entity_id', 'cs.store_id'); } else { $taxClassId = new Zend_Db_Expr('0'); diff --git a/app/code/core/Mage/Checkout/Block/Links.php b/app/code/core/Mage/Checkout/Block/Links.php index cbfa885a101..f1637a8ffd0 100644 --- a/app/code/core/Mage/Checkout/Block/Links.php +++ b/app/code/core/Mage/Checkout/Block/Links.php @@ -33,7 +33,7 @@ class Mage_Checkout_Block_Links extends Mage_Core_Block_Template public function addCartLink() { $parentBlock = $this->getParentBlock(); - if ($parentBlock && Mage::helper('core')->isModuleOutputEnabled('Mage_Checkout')) { + if ($parentBlock && $this->isModuleOutputEnabled('Mage_Checkout')) { /** @var Mage_Checkout_Helper_Cart $helper */ $helper = $this->helper('checkout/cart'); $count = $this->getSummaryQty() ?: $helper->getSummaryCount(); @@ -65,7 +65,7 @@ public function addCheckoutLink() } $parentBlock = $this->getParentBlock(); - if ($parentBlock && Mage::helper('core')->isModuleOutputEnabled('Mage_Checkout')) { + if ($parentBlock && $this->isModuleOutputEnabled('Mage_Checkout')) { $text = $this->__('Checkout'); $parentBlock->addLink( $text, diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index 574399230cc..22dcf707e39 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -1442,7 +1442,7 @@ public function addModelTags(Mage_Core_Model_Abstract $model) } /** - * Get block cache life time + * Get block cache lifetime * * @return int|null */ @@ -1550,7 +1550,7 @@ protected function _getSidPlaceholder($cacheKey = null) /** * Collect and retrieve items tags. - * Item should implements Mage_Core_Model_Abstract::getCacheIdTags method + * Item should implement Mage_Core_Model_Abstract::getCacheIdTags method * * @param array|Varien_Data_Collection $items * @return array @@ -1578,4 +1578,28 @@ protected function _isSecure() { return $this->_getApp()->getFrontController()->getRequest()->isSecure(); } + + public function isModuleEnabled(?string $moduleName = null, string $helperAlias = 'core'): bool + { + if ($moduleName === null) { + $moduleName = $this->getModuleName(); + } + + return Mage::helper($helperAlias)->isModuleEnabled($moduleName); + } + + /** + * Check whether the module output is enabled + * + * Because many module blocks belong to Adminhtml module, + * the feature "Disable module output" doesn't cover Admin area + */ + public function isModuleOutputEnabled(?string $moduleName = null, string $helperAlias = 'core'): bool + { + if ($moduleName === null) { + $moduleName = $this->getModuleName(); + } + + return Mage::helper($helperAlias)->isModuleOutputEnabled($moduleName); + } } diff --git a/app/code/core/Mage/Core/Helper/Abstract.php b/app/code/core/Mage/Core/Helper/Abstract.php index 6cc5411c995..4de37c3ff22 100644 --- a/app/code/core/Mage/Core/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Helper/Abstract.php @@ -43,6 +43,8 @@ abstract class Mage_Core_Helper_Abstract */ protected $_layout; + protected array $modulesDisabled = []; + /** * Retrieve request object * @@ -151,15 +153,19 @@ public function isModuleEnabled($moduleName = null) $moduleName = $this->_getModuleName(); } + if (array_key_exists($moduleName, $this->modulesDisabled)) { + return $this->modulesDisabled[$moduleName]; + } + if (!Mage::getConfig()->getNode('modules/' . $moduleName)) { - return false; + return $this->modulesDisabled[$moduleName] = false; } $isActive = Mage::getConfig()->getNode('modules/' . $moduleName . '/active'); if (!$isActive || !in_array((string)$isActive, ['true', '1'])) { - return false; + return $this->modulesDisabled[$moduleName] = false; } - return true; + return $this->modulesDisabled[$moduleName] = true; } /** diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index f40524ccd8f..a0029676c19 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -636,4 +636,9 @@ protected function _clearData() { return $this; } + + public function isModuleEnabled(string $moduleName, string $helperAlias = 'core'): bool + { + return Mage::helper($helperAlias)->isModuleEnabled($moduleName); + } } diff --git a/app/code/core/Mage/Core/Model/Resource/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Abstract.php index 6f959665c14..92b536135de 100644 --- a/app/code/core/Mage/Core/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Abstract.php @@ -230,4 +230,9 @@ protected function _prepareTableValueForSave($value, $type) } return $value; } + + public function isModuleEnabled(string $moduleName, string $helperAlias = 'core'): bool + { + return Mage::helper($helperAlias)->isModuleEnabled($moduleName); + } } diff --git a/app/code/core/Mage/Customer/Block/Form/Register.php b/app/code/core/Mage/Customer/Block/Form/Register.php index 32d466c7511..fa0479b0209 100644 --- a/app/code/core/Mage/Customer/Block/Form/Register.php +++ b/app/code/core/Mage/Customer/Block/Form/Register.php @@ -136,7 +136,7 @@ public function getRegion() */ public function isNewsletterEnabled() { - return Mage::helper('core')->isModuleOutputEnabled('Mage_Newsletter'); + return $this->isModuleOutputEnabled('Mage_Newsletter'); } /** diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php index e2d43eb66b1..a6ad1599183 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php @@ -218,7 +218,7 @@ public function getAttributeObject() */ public function isConfigurableSwatchesEnabled(): bool { - return Mage::helper('core')->isModuleEnabled('Mage_ConfigurableSwatches') + return $this->isModuleEnabled('Mage_ConfigurableSwatches') && Mage::helper('configurableswatches')->attrIsSwatchType($this->getAttributeObject()); } } diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php index f690053a1ee..299fe19ffd7 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php @@ -1518,4 +1518,9 @@ public function _prepareSelect(Varien_Db_Select $select) return (string)$select; } + + public function isModuleEnabled(string $moduleName, string $helperAlias = 'core'): bool + { + return Mage::helper($helperAlias)->isModuleEnabled($moduleName); + } } diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating.php b/app/code/core/Mage/Rating/Model/Resource/Rating.php index 4169a5b28e9..af64e45e151 100644 --- a/app/code/core/Mage/Rating/Model/Resource/Rating.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating.php @@ -210,14 +210,15 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) /** * Perform actions after object delete - * Prepare rating data for reaggregate all data for reviews + * Prepare rating data for re-aggregate all data for reviews * + * @param Mage_Rating_Model_Rating $object * @return $this */ protected function _afterDelete(Mage_Core_Model_Abstract $object) { parent::_afterDelete($object); - if (!Mage::helper('rating')->isModuleEnabled('Mage_Review')) { + if (!$this->isModuleEnabled('Mage_Review', 'rating')) { return $this; } $data = $this->_getEntitySummaryData($object); diff --git a/app/code/core/Mage/Rss/Block/Order/Details.php b/app/code/core/Mage/Rss/Block/Order/Details.php index eed201b7ab7..0e8dd5350d6 100644 --- a/app/code/core/Mage/Rss/Block/Order/Details.php +++ b/app/code/core/Mage/Rss/Block/Order/Details.php @@ -28,7 +28,7 @@ public function __construct() public function getGiftMessageItem(Mage_Sales_Model_Order_Item $item): ?Mage_GiftMessage_Model_Message { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return null; } /** @var Mage_GiftMessage_Helper_Message $helper */ @@ -41,7 +41,7 @@ public function getGiftMessageItem(Mage_Sales_Model_Order_Item $item): ?Mage_Gif public function getGiftMessageOrder(): ?Mage_GiftMessage_Model_Message { $order = $this->getOrder(); - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return null; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Sales/Block/Order/Creditmemo.php b/app/code/core/Mage/Sales/Block/Order/Creditmemo.php index 803aa31dcc8..3fe31e71640 100644 --- a/app/code/core/Mage/Sales/Block/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Block/Order/Creditmemo.php @@ -140,7 +140,7 @@ public function getPrintAllCreditmemosUrl($order) public function canDisplayGiftmessage(): bool { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Items.php index 40670738783..0a1dfd4a22a 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items.php @@ -25,7 +25,7 @@ class Mage_Sales_Block_Order_Email_Items extends Mage_Sales_Block_Items_Abstract { public function getGiftMessageOrder(): ?Mage_GiftMessage_Model_Message { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return null; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php index 39c789eb45f..440db16a6b7 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php @@ -94,7 +94,7 @@ public function getProductAdditionalInformationBlock() public function getGiftMessage(): ?Mage_GiftMessage_Model_Message { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return null; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Sales/Block/Order/Invoice.php b/app/code/core/Mage/Sales/Block/Order/Invoice.php index 5076bc6ec87..e47e488d7c5 100644 --- a/app/code/core/Mage/Sales/Block/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Block/Order/Invoice.php @@ -140,7 +140,7 @@ public function getPrintAllInvoicesUrl($order) public function canDisplayGiftmessage(): bool { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php index 334a0dcb003..3b2b1204612 100644 --- a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php @@ -176,9 +176,10 @@ public function getProductAdditionalInformationBlock() { return $this->getLayout()->getBlock('additional.product.info'); } + public function canDisplayGiftmessage(): bool { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ @@ -191,7 +192,7 @@ public function canDisplayGiftmessage(): bool public function getGiftMessage(): ?Mage_GiftMessage_Model_Message { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return null; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Sales/Block/Order/Items.php b/app/code/core/Mage/Sales/Block/Order/Items.php index 5f416c489a2..a5c22c13c3f 100644 --- a/app/code/core/Mage/Sales/Block/Order/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Items.php @@ -34,7 +34,7 @@ public function getOrder() public function canDisplayGiftmessage(Mage_Sales_Model_Order_Item $item): bool { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Sales/Block/Order/Shipment.php b/app/code/core/Mage/Sales/Block/Order/Shipment.php index 3aea022442c..13af7a6c1cd 100644 --- a/app/code/core/Mage/Sales/Block/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Block/Order/Shipment.php @@ -140,7 +140,7 @@ public function getPrintAllShipmentsUrl($order) public function canDisplayGiftmessage(): bool { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ diff --git a/app/code/core/Mage/Sales/Block/Order/View.php b/app/code/core/Mage/Sales/Block/Order/View.php index fa27db170ca..03f1609c18e 100644 --- a/app/code/core/Mage/Sales/Block/Order/View.php +++ b/app/code/core/Mage/Sales/Block/Order/View.php @@ -122,7 +122,7 @@ public function getCreditmemoUrl($order) public function canDisplayGiftmessageItems(): bool { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */ @@ -132,7 +132,7 @@ public function canDisplayGiftmessageItems(): bool public function canDisplayGiftmessageOrder(): bool { - if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { + if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) { return false; } /** @var Mage_GiftMessage_Helper_Message $helper */