When a module is installed / uninstalled, a decent status message ought to be displayed. Right now, all we get is 'configuration settings saved', which isn't terribly useful. Currently, a few modules tack on their own messages.
The attached patch is very likely incorrect in that the status messages are probably being displayed in the wrong place / function. However, opinions are welcome as to where exactly they should go.
Issues:
a) Should they be displayed for a Drupal (profile) install?
b) Would it be better for them to be displayed for hook_enable / hook_disable?
c) Should they be watchdogged as well?
-K
Comments
Comment #1
keith.smith commented:( patch no longer applies
# patch -p0 < install-message.patch
(Stripping trailing CRs from patch.)
patching file includes/install.inc
(Stripping trailing CRs from patch.)
patching file modules/system/system.module
Hunk #1 FAILED at 1789.
1 out of 1 hunk FAILED -- saving rejects to file modules/system/system.module.rej
Comment #2
roychri commentedRerolled patch for D7.
Comment #3
dries commentedLooks good to me, but not tested. I can commit this after a quick test.
Comment #4
webchickHrm. The only thing is that this will cause module_enable and module_disable to always trigger dsm()s. This is not always what you want.
For example, if you are creating a custom install profile for hosted-drupal-service.com, all of a sudden your users are encountered with a bunch of "Blah blah module was installed" and they're going "Uh, what the heck is a module?"
I'd rather this logic be moved into the module enable form than internal API functions so we don't lose the flexibility to enable/disable/uninstall modules "silently" if we so choose.
Comment #5
roychri commented@webchick: Is this what you had in mind?
Comment #6
webchickSomething exactly just like that, yes! :)
Now the only problem is that this patch breaks system.test's "Module list functionality" test. It's probably due to the string change.
Comment #7
dman commentedI'm in favor of this idea, and have been for a while : Display a note confirming that the module is installed and ready for action.
I'd agree that this automatic one may be better as part of the UI than the core.
I'd also like to see a link to a new modules settings and help pages added to the message ... but that may be a bit much to have as a global change. Could get verbose quick.
I'm just sick of Module that do something somewhere hidden on install and never tell me about it
.dan.
Comment #8
roychri commented@webchick: This new patch now modifies the system.test to take into consideration the text change. I ran the tests for system module and it passed.
Comment #9
moshe weitzman commentedlooks good to me too
Comment #10
samirnassar commentedPatch works as advertised. +1
Comment #11
roychri commentedThanks moshe weitzman and steamedpenguin for the testing.
Comment #12
catchStill break system.test - looks like #8 never made it.
Comment #13
Jaza commentedBump.
Comment #14
geerlingguy commentedComment #15
mlncn commentedSome basics of this i think have gotten in, in the ensuing years. Presently enabling modules gives a Status message such as:
The related permissions part now has a link to a beautifully filtered set of permissions for only the relevant modules. (Thanks Benji and all!)
However, there is no mention of the configuration link— you would have to filter through the list of modules again to look at the module you just enabled to see if it now has a "Configuration" link.
Likewise, there is no link to help in the message.
Both configuration and help links should be included in the automatic notification about a module.
The same information should be presented when enabling modules with Drush. (Presently the modules / configuration objects text is, but no attempt at providing mention of or text versions of links for permissions.)
Also, i feel like there should also be a dedicated hook to provide additional information.
Presently any further information has to be given by setting a separate message:
(For now i will update Module documentation guidelines - best practices with this modern Drupal code, it has Drupal 7 code for this already.)
Module development guides should affirmatively tell developers to add a custom message if there are important configuration or usage steps that are not already captured by the permissions or configure links.