Open Hanmac opened 2 weeks ago
Error: Class "Mage_Giftmessage_Helper_Message" not found in /var/www/app/Mage.php:612 Stack trace: #0 /var/www//app/code/core/Mage/Core/Model/Layout.php(625): Mage::helper() #1 /var/www/app/code/core/Mage/Core/Block/Abstract.php(1108): Mage_Core_Model_Layout->helper() #2 /var/www/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php(208): Mage_Core_Block_Abstract->helper() #3 /var/www/app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml(29): Mage_Adminhtml_Block_Sales_Order_View_Items_Renderer_Default->canDisplayGiftmessage() #4 /var/www/app/code/core/Mage/Core/Block/Template.php(273): include('...') #5 /var/www/app/code/core/Mage/Core/Block/Template.php(310): Mage_Core_Block_Template->fetchView()
Currently in the Route adminhtml_sales_order_view, the gift_options Block is added there: https://github.com/OpenMage/magento-lts/blob/5a95706f4d03d94f90878d12ac448d1a1e28096d/app/design/adminhtml/default/default/layout/sales.xml#L86-L88
adminhtml_sales_order_view
That in itself isn't the problem, because the Template itself checks again: https://github.com/OpenMage/magento-lts/blob/5a95706f4d03d94f90878d12ac448d1a1e28096d/app/design/adminhtml/default/default/template/sales/order/view/giftmessage.phtml#L16 which calls this function https://github.com/OpenMage/magento-lts/blob/5a95706f4d03d94f90878d12ac448d1a1e28096d/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php#L279-L284
or a different function for the different Item Renderer https://github.com/OpenMage/magento-lts/blob/5a95706f4d03d94f90878d12ac448d1a1e28096d/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php#L205-L214
The problem there is the direct call to the Helper Mage_GiftMessage_Helper_Message, without checking first if the Module Mage_GiftMessage is enabled.
Mage_GiftMessage_Helper_Message
Mage_GiftMessage
Probably both these functions should have this?
if (!Mage::helper('core')->isModuleEnabled('Mage_GiftMessage')) { return false; }
I haven't checked all Routes yet if they need to be protected like this
Also see https://www.vianetz.com/de/blog/magento-remove-giftmessage-extension/
I added a Draft PR, it doesn't address the product attribute, but the templates all have better protection functions now
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Possible Solution
Currently in the Route
adminhtml_sales_order_view
, the gift_options Block is added there: https://github.com/OpenMage/magento-lts/blob/5a95706f4d03d94f90878d12ac448d1a1e28096d/app/design/adminhtml/default/default/layout/sales.xml#L86-L88That in itself isn't the problem, because the Template itself checks again: https://github.com/OpenMage/magento-lts/blob/5a95706f4d03d94f90878d12ac448d1a1e28096d/app/design/adminhtml/default/default/template/sales/order/view/giftmessage.phtml#L16 which calls this function https://github.com/OpenMage/magento-lts/blob/5a95706f4d03d94f90878d12ac448d1a1e28096d/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php#L279-L284
or a different function for the different Item Renderer https://github.com/OpenMage/magento-lts/blob/5a95706f4d03d94f90878d12ac448d1a1e28096d/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php#L205-L214
The problem there is the direct call to the Helper
Mage_GiftMessage_Helper_Message
, without checking first if the ModuleMage_GiftMessage
is enabled.Probably both these functions should have this?
I haven't checked all Routes yet if they need to be protected like this