OrchardCore
OrchardCore copied to clipboard
Unable to disable a feature when it depends on a feature that is always enabled.
Describe the bug
Let's say you have "A" Module and it depends on "B" module, where module "A" is configured to "IsAlwaysEnabled" and module "B" is NOT always enabled. Attempting to disable module "B" should not be allowed "and it isn't allowed". However, when you attempt to disable module "B" you get a success error B was disabled.
But it would still be enabled.
To Reproduce
Steps to reproduce the behavior:
- Create module A
- Create module B and make it always enabled. Module B should depend on module A
- attempt to disable module A
- You'll see success message
A was disabled.
but if you search again for module "A" you'll noticed that it's still enabled.
Expected behavior
I would expect to see a warning or error that say "module A was not disabled because module B depends on it". Better yet, maybe we should treat module A as always enabled since at least one of it's dependent is configured to always be enabled.
Screenshots
Thanks for reproting this, possible solutions is to avoid disable the module, or exclude those who marked as always enabled
I might submit a PR to fix this
or exclude those who marked as always enabled
Already done I think but we also need to check its dependents (not dependencies) to see if one is AlwaysEnabled AND already Enabled
Note: Already checked somewhere because at the end we don't disable the feature
Does we check all the dependency hierarchy?