Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Just to not bring noise into the main issue.
Started fresh as the patch in http://drupal.org/node/1199946#comment-5786690 was really old.
Patch coming up in a few minutes.
Things todo
- Rename module_enable() to module_install() and refactor the code
- Remove hook_modules_enabled() and merge with hook_modules_installed()
- Remove hook_disable() and merge with hook_uninstall()
- Remove the concept of active/inactive in Field API - also remove the property from Field
Comment | File | Size | Author |
---|---|---|---|
#107 | 1199946-helper-107.patch | 199.67 KB | alexpott |
#107 | interdiff.txt | 6.54 KB | alexpott |
#106 | interdiff.txt | 2.65 KB | alexpott |
#106 | 1199946-398-2.patch | 199.85 KB | alexpott |
#103 | 1199946-398.patch | 197 KB | alexpott |
Comments
Comment #1
swentel CreditAttribution: swentel commentedThis will fail on so many places - also because I already removed module_disable() - but let's see :)
Comment #2
amateescu CreditAttribution: amateescu commentedThe first problem I see here is that if we remove the 'disabled' state we must also remove 'enabled', thus keeping only installed/uninstalled states.
Comment #3
swentel CreditAttribution: swentel commentedI'll be working on this tomorrow all day.
@amateescu Talked this through with alex pott, for now we keep this the yml file - but that might all go away once we get to a point where we getting green .. :)
Comment #5
amateescu CreditAttribution: amateescu commentedWell.. my problem was not with the yml files, but more like with their wording/meaning. I guess what I'm trying to say is that we need to rename
module_enable()
tomodule_install()
and refer to everything as just 'installed' and 'uninstalled'.Comment #6
swentel CreditAttribution: swentel commentedNew patch - you can not disable a module anymore on admin/modules - it shows up now on the uninstall page. Has less failures now on the module enable disable test
Comment #8
swentel CreditAttribution: swentel commentedThis makes disable/enable test pass and also fixes a cleanup in config_get_module_config_entities() which now actually is going to work.
update_manager_access() throws 4 notices though when you try and disable it, so added a temp workaround for that, needs some clearing somewhere in module_uninstall() (which contains code from module_disable() - but needs refactoring of course ..)
Comment #10
swentel CreditAttribution: swentel commentedRemoved the workaround in _menu_check_access().
Comment #12
aspilicious CreditAttribution: aspilicious commentedThis should have less fails. It's possible I removed to much code :). Needs to be reviewed very carefully but this is a starting point for the remaining failures.
Comment #14
swentel CreditAttribution: swentel commentedWorking on the remaining ones.
Comment #14.0
swentel CreditAttribution: swentel commentedUpdated issue summary.
Comment #15
swentel CreditAttribution: swentel commentedLast one for now. I'm officially sprinted out from DrupalCon. Away for a week also, so anyone else is invited to move this forward.
Updated the issue summary of this issue to add some thoughts/todo's
Comment #16
aspilicious CreditAttribution: aspilicious commentedI'm not 100% sure but I think this patch removes modules that depend on the uninstalled one automaticly? Correct?
If that's the case this shouldn't happen, or should it?
Comment #17
swentel CreditAttribution: swentel commentedThat is how HEAD now work yes ..
Comment #18
aspilicious CreditAttribution: aspilicious commentedwell HEAD doesn't work that way, cause there was a test that checked that which I had to remove to get green light from the bot :p
Comment #19
aspilicious CreditAttribution: aspilicious commentedHere it is
Comment #21
swentel CreditAttribution: swentel commentedRe-rolled after the module_enable and module_disable code got moved to ModuleHandler.
I'm not able to run this on my own completely, I'm busy doing Field API stuff atm as well, so someone should take over/help along - but let's make sure we communicate this well so we don't do double work.
Comment #22
swentel CreditAttribution: swentel commentedComment #24
fubhy CreditAttribution: fubhy commentedI'm willing to help/take over. Talk to you tomorrow on IRC?
Comment #25
fubhy CreditAttribution: fubhy commentedStarted working on this today.
Comment #26
gddFollowing on from #1199946: Disabled modules are broken beyond repair so the "disable" functionality needs to be removed, I do think it is important to leave this implementable in contrib, so we should definitely figure that part out. I had previously said that removing a module from the list in hook_module_implements_alter() would do it, but fubhy pointed out to me in IRC that that is no guarantee that code runs. However I'm trying to think of a case where a module has code that would run with all its hooks disabled and I'm not coming up with anything. The one thing I did think of is Domain which has special code in settings.php, but then again disabling Domain won't stop that code from running either so its not a parallel.
Regardless, a more graceful way of allowing contrib to add this functionality would be welcomed.
Comment #27
catchhook_module_implements_alter() won't disable classes from running - the module would have to be unregistered from the class loader as well. Then any plugins referenced in config are just going to completely disappear but that's what people want apparently.
Comment #28
fubhy CreditAttribution: fubhy commentedExactly, classes, the module's bundle, etc. are are all still there. So the only reliable way would be to prevent them from being introduced to the container and class loader. @see DrupalKernel::initializeContainer()
Comment #29
fubhy CreditAttribution: fubhy commentedComment #30
fubhy CreditAttribution: fubhy commentedComment #31
gddAll the manifest stuff was removed as part of ... whatever issue it was where we made you require full config trees again, so you need to update from head :)
I realize it is early in this patch's life to be worrying about UI considerations but something I was thinking is that we may want to remove the checkboxes from the main modules page entirely, and leave the Uninstall tab in place. I think this could help alleviate the concerns about users unintentionally deleting data when they think they are disabling a module. We should also have some text on that page saying something like 'If you think you may want this module's data again, please backup your config directory located at
' Thoughts on this?
Comment #32
fubhy CreditAttribution: fubhy commentedYep. That is exactly what this Patch does.
Comment #33
gddOh perfect! fubhy++
Comment #35
catchOne thing with the uninstall tab is it only appears for modules with hook_schema() or hook_uninstall() - unless that changed and I missed it. That's already wrong with config but even more wrong if this is the only way we provide to switch a module off!
Comment #36
fubhy CreditAttribution: fubhy commentedYeah it's definitely not finished yet. Also, the code for the module overview needs to be cleaned up and get the disable functionality fully removed. But this is just a start.. so
Comment #37
fubhy CreditAttribution: fubhy commentedComment #39
fubhy CreditAttribution: fubhy commentedOkay, that's just one actual fail left and 4 or 5 minor things that I missed. Will fix the rest tomorrow. Should be green some time in the afternoon.
Comment #40
PanchoYes, the checkboxes are confusing:
Checkboxes are expected to allow switching on and off like a light switch.
While we got used to the fact that a dependency might disable a checkbox, everybody certainly expects this to be possible if there is no indication the module is required by something else, especially right after installing a module.
However, we shouldn't remove them completely without substitution because we still need them as status indicators.
We might want to show a checkbox only for uninstalled modules and otherwise replace them with a green tick mark. This would clearly indicate that once installed they can't simply be unchecked. I think this is a large improvement, see in the screenshot the pre-installed modules vs. the yet to enable Field UI module:
The issue is assigned to you, so I'm providing you just the diff, in case you want to roll it into your next patch:
Comment #41
David_Rothstein CreditAttribution: David_Rothstein commentedYou missed it - twice now, in fact :)
https://drupal.org/node/1199946#comment-6956130 (see comment at the bottom)
Since D7, all modules appear on the uninstall page.
Comment #42
fubhy CreditAttribution: fubhy commentedUpgrade path tests are still failing (at least locally)
Comment #44
fubhy CreditAttribution: fubhy commentedUpdateModuleHandler is very hard to grok and I am having trouble to get it to work. Will focus on that tomorrow...
Comment #45
fubhy CreditAttribution: fubhy commentedSome more fixes...
Comment #47
fubhy CreditAttribution: fubhy commentedComment #49
fubhy CreditAttribution: fubhy commentedComment #51
fubhy CreditAttribution: fubhy commentedHuh? Where do the new install/uninstall fails come from?
Comment #53
fubhy CreditAttribution: fubhy commentedUh, found the reason.
Comment #55
fubhy CreditAttribution: fubhy commented#53: 2003966-53.patch queued for re-testing.
Comment #57
fubhy CreditAttribution: fubhy commentedComment #59
fubhy CreditAttribution: fubhy commentedComment #60
fubhy CreditAttribution: fubhy commentedComment #62
fubhy CreditAttribution: fubhy commentedComment #64
Anonymous (not verified) CreditAttribution: Anonymous commentedwas just reading through this patch and noticed:
which looks like it should be ->uninstall(). attached patch makes that change, lets see if that brings some fails down.
Comment #66
fubhy CreditAttribution: fubhy commentedI screwed up the InstallUninstallTest. ModuleHandler is actually working already. And module_disable() should not be invoked anywhere anymore. Thanks though :)
Comment #67
fubhy CreditAttribution: fubhy commentedComment #69
fubhy CreditAttribution: fubhy commentedComment #71
fubhy CreditAttribution: fubhy commentedComment #72
fubhy CreditAttribution: fubhy commentedThat patch should bring us back to only UpgradePathTest failures.
Comment #74
fubhy CreditAttribution: fubhy commentedComment #76
fubhy CreditAttribution: fubhy commentedComment #78
fubhy CreditAttribution: fubhy commentedOkay, I need help with t his one... I have no clue why this fails. It's the last failure and it's technically just one... Which is: Forum module fails upon uninstallation. But it doesn't do that when I do it manually. Just in this freaking test. It throws an exception from FieldInstance saying that it could not create a field for a missing UUID. Really, no idea... Been stepping through the code with xdebug for 3 days now, looking at interdiffs to swentel's patch, etc. No clue.
Comment #80
ParisLiakos CreditAttribution: ParisLiakos commentedsomething like #2004316: Exception on field_purge_batch() after deleting a field ?
Comment #81
swentel CreditAttribution: swentel commentedreroll after content types went in - not sure whether I did everything right - time now to figure out the instance deletion.
Comment #83
swentel CreditAttribution: swentel commentedOh bah - expect more failures again though
Comment #85
ParisLiakos CreditAttribution: ParisLiakos commentedreroll
Comment #87
ParisLiakos CreditAttribution: ParisLiakos commentedComment #88
jibran#87: 2003966-87.patch queued for re-testing.
Comment #90
alexpottrerolled against head
Comment #91
alexpottRemoved module_install() as adding a deprecated function is plain weird. Based on #305
Comment #93
alexpottFor some reason this failed on the main issue re-running test here so as to not clog that issue....
Comment #94
alexpottRerolled on top of the massive changes from this morning
Comment #95
alexpottForgot to remove core/modules/field/lib/Drupal/field/Tests/ActiveTest.php
Comment #96
alexpottOkay messed up the reroll a bit - but it lead to me finding #2078837: Ensure that we are using SQL storage for taxonomy_update_8007() so all is good
Comment #98
alexpottOkay hopefully we're green again...
Comment #99
Anonymous (not verified) CreditAttribution: Anonymous commentedrestoring behaviour of uninstall/reinstall test to use all modules.
expecting some fails with forum and taxonomy.
Comment #101
alexpottChasing head
Comment #102
alexpottComment #103
alexpottRerolled
Comment #105
fubhy CreditAttribution: fubhy commented/me *shakes fist at testbot*
Comment #106
alexpottSo this has exposed a very interesting bug. During ModulesDisabledUpgradePathTest it tries to enable the editor module. This then discovers the default config for in the standard profile. It tries to install it and kaboom because this config is also dependent on ckeditor as that is the plugin it uses :)
Attached is one possible fix where we only include installation profile module configuration during an installation. Not entirely sure that the fix is legit.
Comment #107
alexpottSo I've backed out the changes in #106 as this is a separate bug.
Whilst investigating the issue fixed in #106 I discovered that modules enabled in Drupal 7 are being enabled. I don't think we can do this. We should prevent major version upgrade if there are disabled modules.
We need to work on the text in UPGRADE.txt
Comment #108
jibranAnd just like that.
Comment #108.0
jibranUpdated issue summary.