From c34d334b9dac41462a981bcd779b45af342334cc Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano Date: Fri, 9 Feb 2024 00:28:56 +0000 Subject: [PATCH 1/2] Fixed call to a member function setOnclick() on false in Mage_Adminhtml_Block_Sales_Order_View_Giftmessage --- .../Adminhtml/Block/Sales/Order/View/Giftmessage.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 e5674b52405..fc0d3cb73b7 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 @@ -81,14 +81,17 @@ protected function _prepareLayout() } /** - * Retrieve save button html - * * @return string * @throws Exception */ public function getSaveButtonHtml() { - $this->getChild('save_button')->setOnclick( + $saveButton = $this->getChild('save_button'); + if (!is_object($saveButton)) { + return ''; + } + + $saveButton->setOnclick( 'giftMessagesController.saveGiftMessage(\'' . $this->getHtmlId() . '\')' ); From 838bc3c19db1d91661727a632df90b68269dac23 Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano Date: Sat, 17 Feb 2024 21:43:30 +0000 Subject: [PATCH 2/2] Fixing case error when checking for module name --- .../Block/Sales/Order/View/Giftmessage.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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 fc0d3cb73b7..9ce243f7b67 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 @@ -50,7 +50,7 @@ public function getOrder() */ protected function _beforeToHtml() { - if (Mage::helper('core')->isModuleOutputEnabled('Mage_Giftmessage')) { + if (Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { if ($this->getParentBlock() && ($order = $this->getOrder())) { $this->setEntity($order); } @@ -61,13 +61,11 @@ protected function _beforeToHtml() } /** - * Prepares layout of block - * * @return $this */ protected function _prepareLayout() { - if (Mage::helper('core')->isModuleOutputEnabled('Mage_Giftmessage')) { + if (Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) { $this->setChild( 'save_button', $this->getLayout()->createBlock('adminhtml/widget_button') @@ -86,12 +84,7 @@ protected function _prepareLayout() */ public function getSaveButtonHtml() { - $saveButton = $this->getChild('save_button'); - if (!is_object($saveButton)) { - return ''; - } - - $saveButton->setOnclick( + $this->getChild('save_button')->setOnclick( 'giftMessagesController.saveGiftMessage(\'' . $this->getHtmlId() . '\')' );