-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Dont show disabled modules in "Disable Modules Output" config #4305
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works as expected.
Thought about it, but it makes no sense.
I put it on draft b/c ...
|
edbdf61
to
49eea29
Compare
app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php
Show resolved
Hide resolved
Alternative: // File app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php
protected function _getFieldHtml($fieldset, $moduleName)
{
$isInactive = (string) Mage::getConfig()->getNode('modules')->$moduleName->active !== 'true';
// ...
$field = $fieldset->addField(
$moduleName,
'select',
[
'name' => 'groups[modules_disable_output][fields][' . $moduleName . '][value]',
// ...
'disabled' => $isInactive,
'title' => $isInactive ? 'Inactivated in /etc/modules' : '',
//... |
Wouldnt this not bypass the observers? |
Yes, observer is not required. And if you want to not show the modules: |
I've tested it. Running |
$moduleName = 'Mage_Core';
$isInactive = (string) Mage::getConfig()->getNode('modules')->$moduleName->active !== 'true'; My tests:
Really weird. Is it just me or for you too? |
I actually don’t think the modules xml section is cached at all, probably so you can disable a broken module. But I’m not at my desk to confirm this. |
Another test: $modules = array_keys(Mage::getConfig()->getNode('modules')->asArray()); // 88 elements
foreach ($modules as $moduleName) {
$result[$moduleName] = (string) Mage::getConfig()->getNode('modules')->$moduleName->active !== 'true';
}
|
My tests: require_once('app/Mage.php');
umask(0);
Mage::app()->loadArea('adminhtml'); #to call the observer
function test4305_Observer() {
$test = new Mage_Adminhtml_Block_System_Config_Form_Fieldset_Modules_DisableOutput();
$test->getModules();
}
function test4305_Config() {
for ($i = 0; $i <= 60; $i++) {
$isInactive = (string)Mage::getConfig()->getNode('modules')->Mage_Core->active !== 'true';
}
}
No. Config cache enabled (last 5) vs config cache disabled. I'd recommand to test #4325. |
Description (*)
Don't show disabled modules in admin - system - config - advanced - advanced
Manual testing scenarios (*)
Disabled module is still there.