You are here

function image_gallery_update_1 in Image 6

Same name and namespace in other branches
  1. 5.2 contrib/image_gallery/image_gallery.install \image_gallery_update_1()
  2. 5 contrib/image_gallery/image_gallery.install \image_gallery_update_1()
  3. 7 contrib/image_gallery/image_gallery.install \image_gallery_update_1()

Re-assign image vocabularies to image_gallery module.

File

contrib/image_gallery/image_gallery.install, line 56

Code

function image_gallery_update_1() {
  $ret = array();
  if ($vid = variable_get('image_nav_vocabulary', '')) {
    $args = array(
      $vid,
    );
    $query = "UPDATE {vocabulary} SET module = 'image_gallery' WHERE vid = %d";
    _db_query_callback($args, TRUE);
    $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
    $ret[] = update_sql($query);
  }
  else {
    $ret[] = update_sql("UPDATE {vocabulary} SET module = 'image_gallery' WHERE module = 'image'");
  }
  return $ret;
}