install from drush fails due to hidden dependency

fgm - October 20, 2009 - 10:23
Project:ImageCache
Version:6.x-2.0-beta10
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

If you try to install imagecache using drush enable imagecache, you'll notice this error:var_export(debug_backtrace());

The following modules will be enabled: imagecache
Do you really want to continue? (y/n): ImageCache was enabled successfully. [ok]
user warning: Table 'premium.imagecache_preset' [error]
doesn't exist
query: SELECT * FROM imagecache_preset ORDER BY presetname in
(your dir)/sites/all/modules/imagecache/imagecache.module
on line 909.
An error occurred at function : drush_pm_enable [error]
user warning: Table 'premium.imagecache_preset' [error]
An error occurred at function : drush_pm_enable [error]
make: *** [imagecache.ok] Erreur 1

This show that imagecache_presets() is invoked during the install process, at a step where the {imagecache_preset} table has not yet been created.

Debugging it shows that it is actually triggered from imagecache_form_system_modules_alter(), which is itself invoked by the drupal_execute() in Drush on the system modules form, right before imagecache_install() runs and creates the table.

 
 

Drupal is a registered trademark of Dries Buytaert.