This would be awesome IMHO. I've several modules in which I've placed a .install file just because the weight needed to be changed on installation. Putting this in a .info file would be much more efficient. Something like;
; $Id:$
name = Module
description = Description
package = Other
core = 6.x
weight = 2
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | drupal_info_weight-416590.patch | 4.24 KB | dawehner |
| #1 | drupal_info_weight-416590.patch | 2.36 KB | dawehner |
Comments
Comment #1
dawehnerthis is definite a good idea,
Additional its also logical, when we have exact this in system table, that there is a weight in theme info files.
here is a first patch:
which adds weight for both modules and themes
i'm wondering where there is the documentation for info files
still needs testing using a module_test.module :), anyone know wether a module file is required for a module?
Comment #2
dawehneroh forgot to set needs review
Comment #3
stborchertPatch looks good and works as expected. Tested with a simple (empty and otherwise useless) module.
Comment #4
dawehnerso here is a new version with a included test.
together with a module_test.info and a module_test.module with another weight
Comment #5
moshe weitzman commentedI don't really see any point in clutterring the .info syntax with this. Is this reread on every submission of the modules form? Do existing weight adjustments get blown away. If not, then we are inconsistent with the module name and description and dependencies.
Comment #6
dries commentedI think we should stay clear from adding things like weights to .info files. Their purpose is to describe the module, not to do configuration management.
Comment #7
skilip commentedNot to be cocky (well maybe just a little) but what's the differnce then between weight and for example version, or php-version? Beside that, I can understand we need to avoid cluttering of the .info system. Any suggestions on how we could declare a module's weight on installation? Maybe something like hook_module_registry_alter? Or change hook_theme_registry_alter into hook_system_registry_alter ?
Comment #8
webchick@skilip: Will http://api.drupal.org/api/function/hook_system_info_alter work?
Comment #9
skilip commented@webchick: I don't think so. If so, adding weight into the .info file should have the same effect.
[edit]Why isn't it possible to hook into the modules registry process while the theme registry does?[/edit]
Comment #10
moshe weitzman commentedMany many modules do this with an update query to the system table in hook_enable(). see devel or og for example.
Comment #11
skilip commentedStill odd IMO opinion, having a weight column in the system table, but no possibility in core to do anything with it.
Comment #12
skilip commentedNo opinions about this? Am I completely alone here?
Comment #13
dave reidThis is a duplicate of #127641: Module weight in .info