From 8c26f94769c35565968f2d96c59774f97319552f Mon Sep 17 00:00:00 2001
From: zuuperman <zuuperman@361625.no-reply.drupal.org>
Date: Sun, 22 Jul 2012 20:28:58 +0200
Subject: [PATCH] Issue #1621236 by zuuperman, dawehner: Fixed Fatal error on
 updating display machine name, when blocks module is not installed.

---
 plugins/views_plugin_display_block.inc | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/plugins/views_plugin_display_block.inc b/plugins/views_plugin_display_block.inc
index 20331007e1a3..32df07d5dc8a 100644
--- a/plugins/views_plugin_display_block.inc
+++ b/plugins/views_plugin_display_block.inc
@@ -206,16 +206,21 @@ function update_block_bid($name, $old_delta, $delta) {
       $hashes[$md5_delta] = $delta;
       $delta = $md5_delta;
     }
-    db_update('block')
-      ->fields(array('delta' => $delta))
-      ->condition('delta', $old_delta)
-      ->execute();
+
+    // Maybe people don't have block module installed, so let's skip this.
+    if (module_exists('block')) {
+      db_update('block')
+        ->fields(array('delta' => $delta))
+        ->condition('delta', $old_delta)
+        ->execute();
+    }
 
     // Update the hashes if needed.
     if ($hashes != $old_hashes) {
       variable_set('views_block_hashes', $hashes);
     }
   }
+
   /**
    * Save the block cache setting in the blocks table if this block allready
    * exists in the blocks table. Dirty fix untill http://drupal.org/node/235673 gets in.
-- 
GitLab