Index: image.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.install,v
retrieving revision 1.3
diff -u -r1.3 image.install
--- image.install	21 Mar 2007 19:16:23 -0000	1.3
+++ image.install	12 Apr 2007 19:05:50 -0000
@@ -1,38 +1,54 @@
-<?php
-// $Id: image.install,v 1.3 2007/03/21 19:16:23 drewish Exp $
-
-/**
- * Installing and updating image.module.
- */
-
-function image_install() {
-  //Nothing to do.
-}
-
-/**
- * Update 4.5 to 4.6 or later.
- */
-function image_update_1() {
-  if (db_table_exists('image')) {
-    if ($result = db_query("SELECT * FROM {image}")) {
-      $fields = array('thumb_path' => 'thumbnail',
-                      'preview_path' => 'preview',
-                      'image_path' => '_original');
-      
-      while ($old_image = db_fetch_object($result)) {
-        foreach ($fields as $old => $new) {
-          $old_file = '';
-          if (file_exists($old_image->$old)) {
-            $old_file = $old_image->$old;
-          } else {
-            $old_file = file_create_path($old_image->$old);
-          }
-          if ($old_file && $old_image->$old != '' && db_num_rows(db_query("SELECT fid FROM {files} WHERE nid=%d and filename='%s'", $old_image->nid, $new)) == 0) {
-            _image_insert($old_image, $new, $old_file);
-          }
-        }
-      }
-    }
-  }
-  return array();
+<?php
+// $Id: image.install,v 1.3 2007/03/21 19:16:23 drewish Exp $
+
+/**
+ * Installing and updating image.module.
+ */
+
+function image_install() {
+  //Nothing to do.
+}
+
+/**
+ * Update 4.5 to 4.6 or later.
+ */
+function image_update_1() {
+  if (db_table_exists('image')) {
+    if ($result = db_query("SELECT * FROM {image}")) {
+      $fields = array('thumb_path' => 'thumbnail',
+                      'preview_path' => 'preview',
+                      'image_path' => '_original');
+
+      while ($old_image = db_fetch_object($result)) {
+        foreach ($fields as $old => $new) {
+          $old_file = '';
+          if (file_exists($old_image->$old)) {
+            $old_file = $old_image->$old;
+          } else {
+            $old_file = file_create_path($old_image->$old);
+          }
+          if ($old_file && $old_image->$old != '' && db_num_rows(db_query("SELECT fid FROM {files} WHERE nid=%d and filename='%s'", $old_image->nid, $new)) == 0) {
+            _image_insert($old_image, $new, $old_file);
+          }
+        }
+      }
+    }
+  }
+  return array();
+}
+
+/**
+ * Rename the old image gallery taxonomy variable. Do it here because if the
+ * image_gallery module has never been installed the update would be ignored.
+ */
+function image_update_2() {
+  $old = variable_get('image_nav_vocabulary', FALSE);
+  // if an old value as set...
+  if ($old) {
+    if (variable_get('image_gallery_nav_vocabulary', FALSE)) {
+      variable_set('image_gallery_nav_vocabulary', $old);
+    }
+    // remove the old one.
+    variable_del('image_nav_vocabulary');
+  }
 }

