9
Vote

Enabled features with missing/disabled dependencies should be automatically disabled.

description

Otherwise we get an YSOD with Autofac resolution exception.
It may happen in various scenarios - eg. when you update the module code and there is a new dependency added, which is currently disabled. Or when a dependent module got missing for some reason.

So there are two options:
  1. Enable the disabled dependencies (if possible)
  2. Disable the feature(s) depending on disabled/missing features (if a dependency is missing it's the only option)
Second seems safer beacuse it lets you see the changes first and decide whether to enable the new dependencies at the moment or not.

comments

PaulDevenney wrote Aug 1, 2013 at 10:08 AM

This is actually quite a severe problem. Take for example a scenario with 2 features, a "Caching" module and a "Caching.Azure" module. Enabling the Caching.Azure module suppresses the original dependency. If this feature is enabled on an environment that does not support it, it throws an exception (not a dependency issue, but same basic problem). You now cannot turn off this feature via UI or via command line (both throw the same error.

I would suggest the resolution to both these issues is the same. Feature disabling needs to be able to work without loading up an entire shell context (somehow).

pszmyd wrote Aug 5, 2013 at 8:43 PM

Good idea. There should be some fail-safe mechanism implemented that in any case would allow user to enter admin and/or CLI and perform some maintenance tasks.

The only problem is it's sometimes hard to determine which component is actually the source of the problem. Exception may be thrown by the one not necessarily responsible and we don't want to disable half of the features because one of the dependencies throws exceptions around. Anyway - it's really worth looking into and a topic for a bigger discussion.

CSADNT wrote Aug 6, 2013 at 6:18 AM

May be a 'debug' mode where you select features to enable before start

hkui wrote Oct 14, 2013 at 7:58 AM

Another duplicate: https://orchard.codeplex.com/workitem/20205
Although it describes a different scenario, which makes this issue even more important.

AimOrchard wrote Oct 14, 2013 at 9:38 AM

It is also a big problem if you wish to add a new dependency to an existing module where the module was already enabled but the dependency was not.

Jimasp wrote Dec 6, 2013 at 12:16 PM

While this issue is a bigger problem, in the case of most of the duplicate issues, a warning message at the top of the dashboard would suffice.

AimOrchard wrote Dec 6, 2013 at 1:26 PM

I would prefer that, by default, it would try to enable any new found dependencies that are not enabled at startup and the launch should FAIL (optional?) when it cannot.