From d500ed33d6cb1db9a65f057dbd0dc246108e189e Mon Sep 17 00:00:00 2001 From: webchick Date: Fri, 11 Jan 2013 00:05:45 -0800 Subject: [PATCH] Issue #1884826 by pwolanin, dawehner: Fixed Regression - replace md5 in Block module calls with sha2 hashes. --- .../block/Plugin/views/display/Block.php | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php b/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php index 0495e1bd414..04c5f04fadd 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php +++ b/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php @@ -163,9 +163,6 @@ class Block extends DisplayPluginBase { public function submitOptionsForm(&$form, &$form_state) { parent::submitOptionsForm($form, $form_state); switch ($form_state['section']) { - case 'display_id': - $this->updateBlockBid($form_state['view']->storage->get('name'), $this->display['id'], $this->display['new_id']); - break; case 'block_description': $this->setOption('block_description', $form_state['values']['block_description']); break; @@ -185,36 +182,4 @@ class Block extends DisplayPluginBase { return FALSE; } - /** - * Update the block delta when you change the machine readable name of the display. - */ - protected function updateBlockBid($name, $old_delta, $delta) { - $old_hashes = $hashes = state()->get('views_block_hashes'); - - $old_delta = $name . '-' . $old_delta; - $delta = $name . '-' . $delta; - if (strlen($old_delta) >= 32) { - $old_delta = md5($old_delta); - unset($hashes[$old_delta]); - } - if (strlen($delta) >= 32) { - $md5_delta = md5($delta); - $hashes[$md5_delta] = $delta; - $delta = $md5_delta; - } - - // Maybe people don't have block module installed, so let's skip this. - if (db_table_exists('block')) { - db_update('block') - ->fields(array('delta' => $delta)) - ->condition('delta', $old_delta) - ->execute(); - } - - // Update the hashes if needed. - if ($hashes != $old_hashes) { - state()->set('views_block_hashes', $hashes); - } - } - }