You are here

function fieldblock_update_7100 in Field as Block 7

Update legacy fieldblock deltas to use md5 identifier. Reset drupal core block schema.

File

./fieldblock.install, line 80

Code

function fieldblock_update_7100() {
  $blocks = db_query("SELECT bid, delta FROM {block} WHERE module = 'fieldblock'");
  foreach ($blocks as $block) {
    db_query("UPDATE {block} SET delta = :new_delta WHERE bid = :bid AND delta = :old_delta AND module = 'fieldblock'", array(
      ':new_delta' => md5($block->delta),
      ':bid' => $block->bid,
      ':old_delta' => $block->delta,
    ));
  }
  _fieldblock_db_alter_block_delta_length(32);
}