If you create a block manually in admin/build/block/add Drupal will tell you "The block has been created" and the block will show up in the 'boxes' database table but will not appear in admin/build/block.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Zack Rosen’s picture

FileSize
889 bytes

Here is a patch but I'm not sure if this is the optimal fix.

The problem was that the patch to add configurable block titles changed the query used to generate the list of manualy created blocks in the block_block() function so that it would load the block titles from the block table in addition to the data stored in the boxes table:

$result = db_query("SELECT bid, bl.title, info FROM {boxes} bx INNER JOIN {blocks} bl ON bx.bid = bl.delta WHERE module = 'block' ORDER BY title");

This creates a problem because the _block_rehash() function automatically creates the data in the block table from the _block() list hook.... which of course will never return the manually created blocks because they were never set. This patch simply removes the join on the blocks table.

Zack Rosen’s picture

Status: Active » Needs review
drumm’s picture

Status: Needs review » Needs work

Removing check_plain() and the surrounding logic seems like a mistake.

Zack Rosen’s picture

FileSize
902 bytes

I added back in the check_plain() for $info.

I don't think we have to fall back on the block title as it's description anymore since descriptions are now required for all blocks as of rev 1.176 :

http://tinyurl.com/s8n88

Zack Rosen’s picture

Status: Needs work » Needs review
Jaza’s picture

Status: Needs review » Reviewed & tested by the community

Tested, works, code looks reasonable to me. RTBC.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

drumm’s picture

Please reopen if you want to do more cleanup and remove that ORDER BY which I suspect is useless.

Anonymous’s picture

Status: Fixed » Closed (fixed)