Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache isModuleOutputEnabled or isModuleEnabled status #4323

Merged
merged 23 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
05c60f8
cache module output status
sreichel Oct 30, 2024
8a58463
Merge branch 'main' into cache-enabled-modules
sreichel Oct 30, 2024
31465ad
revert config caching
sreichel Oct 31, 2024
33102ba
added scope label to config
sreichel Oct 31, 2024
d2a6dbe
deprecated Mage_Adminhtml_Block_Template::isOutputEnabled()
sreichel Oct 31, 2024
058bb24
use new method
sreichel Oct 31, 2024
f740625
added Mage_Core_Block_Template::isModuleEnabled()
sreichel Oct 31, 2024
1d78c7f
moved to abstract class
sreichel Oct 31, 2024
11fff7f
added Mage_Core_Model_Resource_Abstract::isModuleEnabled()
sreichel Oct 31, 2024
b62d9ba
added Mage_Eav_Model_Entity_Collection_Abstract::isModuleEnabled()
sreichel Oct 31, 2024
5c57b3e
use new methods
sreichel Oct 31, 2024
51c7171
use trait
sreichel Oct 31, 2024
4fbd820
updated baseline
sreichel Oct 31, 2024
a112d9f
copyright [skip ci]
sreichel Oct 31, 2024
e148f84
Merge branch 'main' into cache-enabled-modules
sreichel Oct 31, 2024
418052b
Merge remote-tracking branch 'origin/cache-enabled-modules' into cach…
sreichel Oct 31, 2024
d6dc2eb
Merge branch 'main' into cache-enabled-modules
sreichel Nov 7, 2024
3204696
Revert "use trait"
sreichel Nov 7, 2024
0660f6c
Merge branch 'main' into cache-enabled-modules
kiatng Nov 10, 2024
c32d424
Merge branch 'main' into cache-enabled-modules
sreichel Nov 11, 2024
ca8908a
Merge branch 'main' into cache-enabled-modules
sreichel Nov 12, 2024
a249bf1
update
sreichel Nov 12, 2024
11cd047
Merge branch 'main' into cache-enabled-modules
sreichel Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,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());

Expand Down
12 changes: 9 additions & 3 deletions app/code/core/Mage/Core/Helper/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ abstract class Mage_Core_Helper_Abstract
*/
protected $_layout;

protected array $modulesDisabled = [];
kiatng marked this conversation as resolved.
Show resolved Hide resolved

/**
* Retrieve request object
*
Expand Down Expand Up @@ -150,15 +152,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;
}

/**
Expand Down
Loading