feedapi_enabled_type is called in the .install file, but defined in the .module.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 576848-10_drupal_load.patch | 1013 bytes | alex_b |
| #1 | 576848_update_get_types.patch | 1.58 KB | aron novak |
feedapi_enabled_type is called in the .install file, but defined in the .module.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 576848-10_drupal_load.patch | 1013 bytes | alex_b |
| #1 | 576848_update_get_types.patch | 1.58 KB | aron novak |
Comments
Comment #1
aron novakPatch is attached. However i'm not glad about querying serialized data from variables table. Any better way?
This is a regression of #455688: Make refresh rate of feeds configurable
Comment #2
alex_b commentedCalling feedapi_enabled_type() should be fine in hook_update_N() - killes, can you describe better the problem that has occurred?
Comment #3
jbrauer commentedThe error reported is:
Fatal error: Call to undefined function feedapi_enabled_type() in /drupalroot/sites/all/modules/feedapi/feedapi.install on line 250
This patch seems to address that error but then it comes back in update 6107 which calls the same undefined function.
Comment #4
jbrauer commentedLooking at this further it seems to happen only on sites that have FeedAPI disabled, but haven't had FeedAPI uninstalled. At least on several sites in a multi-site install I've been working with. The modules directory is the same for all sites to the same code is present but only a problem on updating those sites have disabled feedapi
Comment #5
alex_b commented#4: Just learned something new. I see now that the update system tries to update all modules that are available and have a schema record in system, not just enabled modules.
This means we can't use any module API functions in our updates.
Needs fixing.
Comment #6
adrian commentedyou can use module_list() and it's force list parameter to add it if need be.
outside of modifying core, it's pretty much your only real option.
Comment #7
fagoWhat about using drupal_load() to load your module? ;)
Comment #8
damienmckennaIs that an intended behavior? Should it be running updates on modules that are not enabled?
Comment #9
wim leersYou may never ever call your module functions or APIs anyway, because they may change over time, thereby breaking the upgrade path.
Comment #10
alex_b commented#9: that's a good point.
I just tested using drupal_load() on systems where feedapi is present but not enabled. It works. Attaching the patch as a stop gap.
Otherwise I agree with Wim that we shouldn't use the module's APIs so as to not break upgrade paths when if it changes.
Comment #11
buddaI can get this error when using drush to update the feedapi module, and then calling drush 'updatedb'.
Fatal error: Call to undefined function feedapi_enabled_type() in /var/www/html/drupal-6-sites/all/modules/feedapi/feedapi.install on line 237Comment #12
owen barton commentedThis still breaks upgrades for anyone coming from Drupal 5. Unless the changes can easily be done at a level closer to the database, one way around the API limitation is simply to place clones of the called function stack in the install file - (e.g. "feedapi_update_6106_feedapi_enabled_type") - verbose, but it does the job.