Issue #1173012 by carlos8f, Fabianx, Gábor Hojtsy: do not remove blocks for disabled modules in _block_rehash() to avoid blocks disappearing for people following the update guide to the letter disabling contrib modules when updating Drupal core
parent
ae71f5d4d1
commit
d9fb98f75d
|
@ -301,8 +301,12 @@ function _block_rehash($theme = NULL) {
|
||||||
|
|
||||||
// Remove blocks that are no longer defined by the code from the database.
|
// Remove blocks that are no longer defined by the code from the database.
|
||||||
foreach ($old_blocks as $module => $old_module_blocks) {
|
foreach ($old_blocks as $module => $old_module_blocks) {
|
||||||
foreach ($old_module_blocks as $delta => $block) {
|
// This cleanup does not apply to disabled modules, to avoid configuration
|
||||||
db_query("DELETE FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $module, $delta, $theme);
|
// being lost when modules are disabled.
|
||||||
|
if (module_exists($module)) {
|
||||||
|
foreach ($old_module_blocks as $delta => $block) {
|
||||||
|
db_query("DELETE FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $module, $delta, $theme);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $blocks;
|
return $blocks;
|
||||||
|
|
Loading…
Reference in New Issue