The 7.x-1.x branch of styles is missing styles_style_flush(). While styles isn't a dependency of media_gallery, there is still a call to this function in the module's .install file:

   // media_gallery.install, line 64
  if (module_exists('styles')) {
     styles_style_flush();   // this function does not exist in styles 7.x-1.x !
   }

The error is easily reproduced by:

1) Download and enable the supported styles 7.x-1.0-alpha4 release
2) Download and attempt to enable Media Gallery 7.x-1.x-dev . The call to styles_style_flush() in media_gallery.install, line 64 will fail:

$ drush -y en media_gallery
The following extensions will be enabled: media_gallery, multiform
Do you really want to continue? (y/n): y
PHP Fatal error:  Call to undefined function styles_style_flush() in /home/damien/www/drupal/7.x/sites/all/modules/media_gallery/media_gallery.install on line 64
Drush command terminated abnormally due to an unrecoverable error.                                                                                     [error]

I have attached a patch which also checks for the function existing - thereby bypassing the error at install time. The module has no other references to styles.module so bypassing this flush command (for which I can find no equivalent in styles 7.x-1.x branch) should do the trick.

Patch for 7.x-1.x-dev attached with this one liner change:

  if (module_exists('styles') && function_exists('styles_style_flush')) {
    styles_style_flush();
  }

Comments

lsolesen’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies cleanly and I think the approach is right.

lsolesen’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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