Skip to content
Snippets Groups Projects
Commit 8c26f947 authored by Nils Destoop's avatar Nils Destoop Committed by Tim Plunkett
Browse files

Issue #1621236 by zuuperman, dawehner: Fixed Fatal error on updating display...

Issue #1621236 by zuuperman, dawehner: Fixed Fatal error on updating display machine name, when blocks module is not installed.
parent 10a85c7e
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -206,16 +206,21 @@ function update_block_bid($name, $old_delta, $delta) { ...@@ -206,16 +206,21 @@ function update_block_bid($name, $old_delta, $delta) {
$hashes[$md5_delta] = $delta; $hashes[$md5_delta] = $delta;
$delta = $md5_delta; $delta = $md5_delta;
} }
db_update('block')
->fields(array('delta' => $delta)) // Maybe people don't have block module installed, so let's skip this.
->condition('delta', $old_delta) if (module_exists('block')) {
->execute(); db_update('block')
->fields(array('delta' => $delta))
->condition('delta', $old_delta)
->execute();
}
// Update the hashes if needed. // Update the hashes if needed.
if ($hashes != $old_hashes) { if ($hashes != $old_hashes) {
variable_set('views_block_hashes', $hashes); variable_set('views_block_hashes', $hashes);
} }
} }
/** /**
* Save the block cache setting in the blocks table if this block allready * 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. * exists in the blocks table. Dirty fix untill http://drupal.org/node/235673 gets in.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment