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.
For some reason this gives you a "undefined function" error if you install optionwidget module and content.module at the same time. If you install first content.module and then optionwidget.module, it works.
Comments
Comment #1
yched CreditAttribution: yched commentedRight, all those content_notify functions should be wrapped in an include_once('content.module')...
Comment #2
yched CreditAttribution: yched commentedRight, all those content_notify functions should be wrapped in an include_once('content.module')...
Comment #3
KarenS CreditAttribution: KarenS commentedI just ran into this while trying to debug another update problem. It turns out the content module is one of the last to be installed, even though it is first alphabetically. The fieldgroup module is one of the first to install even though it has a weight of 9 and the others are zero. We should do something about fixing the update order in D7...
Comment #4
KarenS CreditAttribution: KarenS commentedAnd now that modules are updated even if they are disabled, it will not matter which you install first, the updates will run on everything in the modules folder the first time you visit the update page, so all the core CCK fields will get updated at once. In fact, it's odd you saw any difference, unless you physically removed optionwidgets from the modules folder, or didn't put it there in the first place.
Comment #5
yched CreditAttribution: yched commentedcontent module is one of the last to be installed
to be installed ? or to be updated ?
Killes initial report is not in an update context. It was from a fresh install, when enabling content and optionwidgets at the same time.
In such a case (module dependency), I'd expect core to install the dependency first (content) ?
But even if content is enabled first, I guess content.module does not get loaded by the time optionwidgets_enable() is run...
Comment #6
yched CreditAttribution: yched commentedOK, after actually checking :
Core does load .modules files right after enabling them, but does not ensure dependency order...
My first impression would be this is a core bug ?
Comment #7
KarenS CreditAttribution: KarenS commentedI was talking about updating not installing. It wasn't completely clear in the post which it was. The bizarre order is happening in the update process. A patch went into core that is supposed to install modules in dependency order, and they are enabled after they are installed, so it's odd that the content module was not available by the time optionwidgets was installed.
Obviously we can't count on anything so we should include_once() in all the functions on the install page.
But instead of adding it to every function, would it be better to just include it one time at the top of the install file?
Comment #8
KarenS CreditAttribution: KarenS commentedHere's the commit that was supposed to ensure modules installed in dependency order http://drupal.org/cvs?commit=91237.
Comment #9
yched CreditAttribution: yched commenteder, you're right of course, and I overlooked that part. Modules are indeed supposed to be installed in the right order. Mmmh.
So we shouldn't need the includes in the first place ?
Comment #10
KarenS CreditAttribution: KarenS commentedI just went back and added watchdog entries to the install code to log what order things happen in, and they install in the right order, content module first, number, text, and optionwidgets next (they have other modules that depend on them) and then everything else. And all modules are enabled after they are installed.
So it's a mystery why we should need to include anything, but apparently we must.
I also did some testing to see if it works to just include it once at the top of the .install file instead of over and over in every function, and it seems to, so I've committed that change.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.