If I use im_raw in an installation profile the installation fails.

CommentFileSizeAuthor
patch.diff398 bytesjantimon

Comments

jantimon’s picture

Starting Drupal installation. This takes a few seconds ...                                        [ok]

Fatal error: Call to undefined function image_styles() in /drupal/htdocs/sites/all/modules/contrib/im_raw/im_raw.module on line 99

Call Stack:
    0.0010     390460   1. {main}() /drupal/tools/drush/drush.php:0
    0.0209    2211784   2. drush_main() /drupal/tools/drush/drush.php:42
    0.1718    6162840   3. drush_dispatch() /drupal/tools/drush/drush.php:102
    0.1719    6163332   4. call_user_func_array() /drupal/tools/drush/includes/command.inc:195
    0.1719    6163584   5. drush_command() /drupal/tools/drush/includes/command.inc:0
    0.1723    6167284   6. call_user_func_array() /drupal/tools/drush/includes/command.inc:712
    0.1723    6167316   7. drush_invoke() /drupal/tools/drush/includes/command.inc:0
    1.6150    6550500   8. call_user_func_array() /drupal/tools/drush/includes/command.inc:111
    1.6150    6550752   9. drush_core_site_install() /drupal/tools/drush/includes/command.inc:0
    1.6171    6564320  10. drush_core_site_install_version() /drupal/tools/drush/commands/core/site_install.drush.inc:101
    1.6248    6973080  11. install_drupal() /drupal/tools/drush/commands/core/drupal/site_install_7.inc:50
    1.8815   12868728  12. install_run_tasks() /drupal/htdocs/includes/install.core.inc:80
   10.6652   17539748  13. install_run_task() /drupal/htdocs/includes/install.core.inc:343
   12.5036   18499724  14. batch_process() /drupal/htdocs/includes/install.core.inc:447
   12.5077   18731792  15. _batch_process() /drupal/htdocs/includes/form.inc:4286
   20.7966   24522476  16. call_user_func_array() /drupal/htdocs/includes/batch.inc:285
   20.7966   24522512  17. _install_module_batch() /drupal/htdocs/includes/batch.inc:0
   20.7966   24522780  18. module_enable() /drupal/htdocs/includes/install.core.inc:1530
   21.2176   24549788  19. module_invoke() /drupal/htdocs/includes/module.inc:453
   21.2176   24550232  20. call_user_func_array() /drupal/htdocs/includes/module.inc:793
   21.2176   24550428  21. im_raw_enable() /drupal/htdocs/includes/module.inc:0


Variables in local scope (#21):
  $style = *uninitialized*
  $styles = *uninitialized*

Drush command terminated abnormally due to an unrecoverable error.                                [error]
Error: Call to undefined function image_styles() in
/drupal/htdocs/sites/all/modules/contrib/im_raw/im_raw.module, line 99
4 commands have been executed
adrinux’s picture

I've applied your patch to the DRUPAL-7--1 branch, so should find its way into the next dev tarball. I tweaked the code comment a little in a second commit.

BUT I'm wondering if this isn't an issue with the install profile, are you enabling im_raw with the install profile? And is this error occurring because it's dependencies aren't enabled first? It would require both imagemagick.module and core's image.module to be enabled. The latter isn't enabled by default and that's where I think image_styles() is found.

That said I've not done a lot with install profiles, so I'll leave this open for now and if your sure it's a real issue not one caused by your install profile, please close it. If it is due to you not enabling dependencies then let me know and I'll revert the patch.

jantimon’s picture

One of my features is using im_raw in its dependencies.
This feature is installed by the installation profile.

Without my patch the installation crashes.
As you can see the missing function is image_styles()
which is in core anyway.

The patch isn't something fancy but a snippet from
field_groups:

/**
 * Implements hook_menu().
 */
function field_group_menu() {
  $items = array();

  // Ensure the following is not executed until field_bundles is working and
  // tables are updated. Needed to avoid errors on initial installation.
  if (defined('MAINTENANCE_MODE')) {
    return $items;
  }

  //...
adrinux’s picture

Status: Active » Fixed

Sounds like a lot of modules will have/need something like this. Marking this fixed.

adrinux’s picture

Title: Crashes during installation » Crashes during installation in an installation profile

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.