Problem/Motivation

We should be able to reposition, enable, and create blocks using hook_block_info_alter(), but it is only invoked in _block_rehash, and for some reason _block_rehash does the exact opposite right below a comment stating intent to this effect, and in fact deletes the inactive block that we are trying to reposition.

Proposed resolution

Make the code not blatantly incorrect.

Remaining tasks

  • Merge the patch.
  • Perhaps remove the delete query at the end of the function, since it seems to serve no purpose whatsoever.

User interface changes

When a module that implements hook_block_info_alter() is active, the blocks it did not accidentally delete will be available for the user to configure.

API changes

Calling _block_rehash is less likely to delete blocks that you did not want deleted.

CommentFileSizeAuthor
#1 2175279_1.patch1.48 KBwamilton
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wamilton’s picture

Status: Active » Needs review
FileSize
1.48 KB

Patch attached.