# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- quicktabs.install.ori
+++ quicktabs.install
@@ -96,6 +96,18 @@
  */
 function quicktabs_update_7300() {
 
+  // Add the renderer field
+// Moved it first to avoid update fail when its referenced below!
+  $renderer_field = array(
+    'description' => 'The rendering mechanism.',
+    'type' => 'varchar',
+    'length' => 255,
+    'not null' => TRUE,
+    'default' => 'quicktabs',
+  );
+  db_add_field('quicktabs', 'renderer', $renderer_field);
+  $output[] = "Added the renderer field";
+
   if (!db_field_exists('quicktabs', 'machine_name')) {
     // Pull all existing quicktabs, and then delete existing quicktabs. We will reinsert.
     $result = db_query("SELECT * FROM {quicktabs}");
@@ -124,7 +136,7 @@
       }
       $row['machine_name'] = $used[] = $i == 0 ? $qt_name : "{$qt_name}_{$i}";
       unset($row['qtid']);
-      unset($row['style']);
+//      unset($row['style']);
       $row['renderer'] = 'tabs';
       $placeholders = implode(', ', array_keys($row));
       $values = array();
@@ -138,19 +150,7 @@
       $output[] = "Converted quicktab {$row['machine_name']}.";
     }
   }
-
-  // Add the renderer field
-  $renderer_field = array(
-    'description' => 'The rendering mechanism.',
-    'type' => 'varchar',
-    'length' => 255,
-    'not null' => TRUE,
-    'default' => 'quicktabs',
-  );
-  db_add_field('quicktabs', 'renderer', $renderer_field);
-  $output[] = "Added the renderer field";
-
-  
+ 
   return implode('<br />', $output);
 }
 
