mollie / Magento

Mollie Payments for Magento 1.x
https://www.mollie.com/
BSD 2-Clause "Simplified" License
39 stars 30 forks source link

Helper_Data#isModuleEnabled crashes the adminhtml #241

Closed Hanmac closed 2 months ago

Hanmac commented 4 months ago

https://github.com/mollie/Magento/blob/e3e85896d98aa362fd349841f160722a23e6a3de/app/code/community/Mollie/Mpm/Helper/Data.php#L85-L96

crashes the adminhtml, see this Stacktrace:

Mage_Core_Model_Store_Exception in /var/www/bauma1.9.x/app/code/core/Mage/Core/Model/App.php:1484
Stack trace:
#0 /var/www/app/code/core/Mage/Core/Model/App.php(882): Mage_Core_Model_App->throwStoreException()
#1 /var/www/app/Mage.php(411): Mage_Core_Model_App->getStore('Mollie_Mpm')
#2 /var/www/vendor/mollie/magento/app/code/community/Mollie/Mpm/Helper/Data.php(132): Mage::getStoreConfig('payment/mollie/...', 'Mollie_Mpm')
#3 /var/www/vendor/mollie/magento/app/code/community/Mollie/Mpm/Helper/Data.php(107): Mollie_Mpm_Helper_Data->getStoreConfig('payment/mollie/...', 'Mollie_Mpm')
#4 /var/www/vendor/mollie/magento/app/code/community/Mollie/Mpm/Helper/Data.php(95): Mollie_Mpm_Helper_Data->isAvailable('Mollie_Mpm')
#5 /var/www/app/code/core/Mage/Core/Helper/Abstract.php(134): Mollie_Mpm_Helper_Data->isModuleEnabled('Mollie_Mpm')
#6 /var/www/app/code/core/Mage/Adminhtml/Block/Page/Menu.php(307): Mage_Core_Helper_Abstract->isModuleOutputEnabled()
#7 /var/www/app/code/core/Mage/Adminhtml/Block/Page/Menu.php(127): Mage_Adminhtml_Block_Page_Menu->_isEnabledModuleOutput(Object(Varien_Simplexml_Element))
#8 /var/www/app/code/core/Mage/Adminhtml/Block/Page/Menu.php(88): Mage_Adminhtml_Block_Page_Menu->_buildMenuArray(Object(Varien_Simplexml_Element))

Because the Adminhtml refers to mpm: <mollie module="mpm">, the Menu class is looking if the Module is Enabled or not

The Original Method uses $moduleName and not $storeId = null

public function isModuleEnabled($moduleName = null)
Frank-Magmodules commented 2 months ago

Thank you for opening this issue @Hanmac . We’re pleased to inform you that we have recently released a new version of the Magento 1 plugin that addresses the issue you described. We will also close the related PR, but we want to express our gratitude for your effort in sharing this issue and fix with us. I’m closing this issue for now, but feel free to respond or reopen it if needed.​

Hanmac commented 2 months ago

I wouldn't call it fixed, more like patched

maybe in a next major, the deprecated function can be removed, and the whole problem can be avoided

(issue doesn't need to be reopened)

Frank-Magmodules commented 2 months ago

Hi There @Hanmac ,

Thank you for your response. This function is indeed marked as deprecated and may need to be removed. However, this extension is currently in maintenance mode. This means that we will fix any bugs that arise, but we won’t add new features unless absolutely necessary. Thank you for your understanding!