Closed (fixed)
Project:
Autoload
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Apr 2010 at 12:57 UTC
Updated:
18 Aug 2013 at 21:25 UTC
Jump to comment: Most recent file
Comments
Comment #1
falcon commentedPatch has been attached. I set the weight to a quite low number. I can't imagine any module needing to have a lower weight than this one. Might be something wrong with my imagination though...
Comment #2
falcon commentedI hope you'll find the time to review this change!
Comment #3
vegardjo commentedSubscribe
Comment #4
kars-t commentedHi
I'd say that the number is too high and that you should use hook_install with an update instead of hook_enable.
Comment #5
falcon commentedRegarding the number: I guess the one who commits the patch can change the number to anything he likes.
Regarding hook_enable: In the spaces module hook_enable is used instead of hook install. The hook_enable function is commited by yhahn of development seed. I followed his example. By using hook_enable you can be sure that the module already exists in the systems table.
Comment #6
kars-t commentedI see that for example the dev module uses hook_install for D6 and hook_enable for D7
Maybe one should update this page about setting a modules weight. http://drupal.org/node/110238
Learned something new :)
But still you should add an hook_update to the patch so people currently using this module will get the weight set by running update.php
Look at the dev module .install for an easy example.
Comment #7
falcon commentedI agree, it should be an update function there. Creating the update function is copy-paste, and I'm sure the project maintainer can copy paste
db_query("UPDATE {system} SET weight = -282828 WHERE name = 'autoload' AND type = 'module'");into whatever hooks he prefer to paste it into, if he wants to add it.
Comment #8
falcon commentedWe've got several bug reports on the quiz module that relates to this issue. I will wait a few more days and if nothing happens with this issue I will temporarily add the fix to quiz_update_N and quiz_enable.
Comment #9
halcyonCorsair commentedSubscribing.
Comment #10
halcyonCorsair commentedI see this has already been fixed in CVS, would you consider releasing that change?
Comment #11
Crell commentedI don't know what you're talking about, halcyon. The code in the 6.x-1.x branch doesn't even have a .install file.
That said, I went ahead and added one. I went with hook_install() for no particular reason. :-)
Comment #12
Crell commentedCorrection, I went with hook_enable(). Even I can't keep them straight.
Comment #13
mikeryanLooks like that patch added hook_enable to autoload.install but didn't remove it from autoload.module, running drush updatedb bit me...
Comment #14
dkruglyak commentedYes it breaks my install too. Just commit mikeryan's fix!
Comment #15
falcon commentedYeah, it seems this is kind of my fault. Sorry. I didn't notice that a fix was already commited, but not released when I created this issue...
Comment #16
dkruglyak commentedSo can we commit the fix ASAP? In the latest CVS I still see both autoload.install and autoload.module redeclare autoload_enable function.
Comment #17
Crell commentedAnd bah on me for not noticing it either. Fixed in dev.
Comment #19
derEremit commentedJust experienced that problem while testing quiz for an old d6 site.
Setup a new empty site just with admin_menu quiz and autoload. Had to set the weight higher than -100 ( -10000).
So out of the box it doesn't work
Comment #20
Crell commentedModule weights are not a be-all-end-all solution. They cannot work with every situation out of the box. In the long run they should go away. As should Drupal 6, with Drupal 8 coming out next year. :-)