You are here

function media_gallery_update in Media Gallery 7

Same name and namespace in other branches
  1. 7.2 media_gallery.module \media_gallery_update()

Implements hook_update().

File

./media_gallery.module, line 560

Code

function media_gallery_update($node) {

  // If the media gallery node is being saved and is configured to not provide
  // a block, remove all blocks associated with it from the database. The block
  // module might not be installed, so we need to check that the database table
  // exists before querying it.
  if (empty($node->media_gallery_expose_block[LANGUAGE_NONE][0]['value']) && db_table_exists('block')) {
    db_delete('block')
      ->condition('module', 'media_gallery')
      ->condition('delta', $node->nid)
      ->execute();
  }
}