#954324: Mini panels failed during uninstall.
authorEarl Miles
Wed, 27 Oct 2010 18:58:45 +0000 (18:58 +0000)
committerEarl Miles
Wed, 27 Oct 2010 18:58:45 +0000 (18:58 +0000)
CHANGELOG.txt
panels_mini/panels_mini.install

index 18add9e..7359f40 100644 (file)
@@ -12,3 +12,4 @@ Panels 7.x-dev
 #940002: Custom style modal was broken.
 #953484: Panes were not properly using classes array.
 #941532: panel nodes had some serious problems do to hook_node_*.
+#954324: Mini panels failed during uninstall.
index 235e611..b0a3143 100644 (file)
@@ -99,9 +99,11 @@ function panels_mini_schema_1() {
  * Implementation of hook_uninstall().
  */
 function panels_mini_uninstall() {
-  $result = db_query("SELECT * FROM {panels_mini}");
   $panels_exists = db_table_exists('panels_display');
-  while ($panel_mini = db_fetch_object($result)) {
+
+  $result = db_query("SELECT * FROM {panels_mini}");
+  $deltas = array();
+  foreach ($result as $panel_mini) {
     // Delete all associated displays.
     if (!function_exists('panels_delete_display')) {
       require_once drupal_get_path('module', 'panels') .'/panels.module';
@@ -110,8 +112,15 @@ function panels_mini_uninstall() {
       panels_delete_display($panel_mini->did);
     }
 
+    $deltas[] = $panel_mini->pid;
+  }
+
+  if ($deltas) {
     // Delete all configured blocks.
-    db_query("DELETE FROM {blocks} WHERE module = 'panels_mini' AND delta = %d", $panel_mini->pid);
+    db_delete('blocks')
+      ->condition('module', 'panels_mini')
+      ->condition('delta', $deltas)
+      ->execute();
   }
 }