Problem/Motivation
If a module alters system info to make a module required that module's dependencies are not automatically required.
This can be tested by installing the standard profile and then using Drush to uninstall the datetime module. This is not possible in Drupal's UI because the form currently does funky processing to ensure that dependents can not be disabled.
This issue was discovered by adding a testing that enabled and uninstalls all the modules in #1808248: Add a separate module install/uninstall step to the config import process. This is critical because it allows the extreme test written in that patch to work.
Proposed resolution
Add a recursive function to ensure that all required modules dependencies are also required.
Remaining tasks
Review patch.
User interface changes
None.
API changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | interdiff.txt | 1.53 KB | jeroent |
| #19 | 2181811-d7.19.patch | 4.35 KB | jeroent |
| #18 | 2181811-d7.18.patch | 4.19 KB | jeroent |
| #4 | 3-4-interdiff.txt | 649 bytes | alexpott |
| #3 | 2181811.3.patch | 4.37 KB | alexpott |
Comments
Comment #1
alexpottPatch extracted from #1808248: Add a separate module install/uninstall step to the config import process.
Comment #2
swentel commentedNice catch
The only nitpick I could have on this patch is maybe trying to loose the round brackets around the module name - they feel like they are a bit redundant, as well as on command line as in the UI.
Comment #3
alexpott@swentel thanks for the review.
Brackets removed.
Comment #4
alexpottMore from @swentel in IRC
Comment #7
swentel commentedYes, RTBC when green - probably tomorrow :)
Comment #8
catchNicely found. I can't find any complains so committed/pushed to 8.x, thanks!
Comment #9
catchNot quite - needs backport to 7.x too.
Comment #10
jeroentI think it should be something like this.
Drupal 7 patch attached.
Comment #12
jeroentThe node module is already required in Drupal 7, So i changed the test, to test it with the list module.
Patch attached.
Comment #13
marcingy commentedComment #14
fabianx commentedRTBC, test looks good to me, fix too.
Comment #15
alexpott#2410151: _system_rebuild_module_data_ensure_required does not parse dependencies needs to be taken in to account
Comment #16
jeroentMade changes as in #2410151: _system_rebuild_module_data_ensure_required does not parse dependencies.
Patch attached.
Comment #17
fabianx commentedNeither interdiff nor patch make sense to me, patch looks identical. Wrong patch?
Comment #18
jeroentLet's start again.
Created straight reroll.
Comment #19
jeroentIn this patch I addressed the changes as in issue #2410151: _system_rebuild_module_data_ensure_required does not parse dependencies.
Comment #20
fabianx commentedRTBC, thats better :). Thanks!
Comment #22
David_Rothstein commentedI tried this patch and don't understand why we'd want this.
On a fresh install of Drupal core using the standard install profile, I looked at the "required by" line for the Options module on the module administration page.
Before the patch, it looks like this:
After the patch, it looks like this:
That is repetitive (taxonomy listed twice) and doesn't really make any sense.
Especially given the way that e.g. field_system_info_alter() uses the concept of a "required" module as a temporary thing rather than a permanent thing, I'm not sure what we gain by marking all these other modules as required too?
I was able to reproduce the bug involving Drush:
So it shouldn't have let me disable that at all, but it did (and on top of that, it actually wound up disabling the Taxonomy module too, although it never said so on the screen).
But why is that a bug in Drupal core? If module A depends on module B and module A can't be disabled, why isn't Drush able to detect that module B shouldn't be disabled either?
Comment #23
David_Rothstein commentedAlso a minor issue, if we wind up going ahead with this:
The code comment should say "List" rather than "Node".
Comment #26
stefan.r commentedMaybe @alexpott can clarify and help us decide what to do with this :)
Comment #29
alexpottI feel that this is part of moving the immense amount of system logic that is in the module installation forms into the API and making it consistent so the API and it's consumers like Drush don't have to repeat all the logic that is in the form.
Comment #30
stephencamilo commentedComment #31
hestenetReset issue status.