The admin title configured while creating a new custom block is not loaded into the $block object while displaying the block. This information might be useful while theming the block and there should be no side-effect in including it, thus this should be backportable too.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Status: Active » Needs review
Issue tags: +Quick fix
FileSize
815 bytes
plach’s picture

Issue tags: +Novice
joachim’s picture

Status: Needs review » Needs work
+++ b/core/modules/block/block.module
@@ -254,8 +254,13 @@ function block_block_save($delta = 0, $edit = array()) {
-  $block = db_query('SELECT body, format FROM {block_custom} WHERE bid = :bid', array(':bid' => $delta))->fetchObject();

The query should remain as a static query, as it's faster than dynamic.

-2 days to next Drupal core point release.

plach’s picture

I thought the guidelines were about dbtng-ing all queries, when possible. Is there some reference documentation saying that we should make exceptions for performance reasons?

joachim’s picture

That's what everyone says... but here's a comment with a link to a post by Crell about it: http://drupal.org/node/310072#comment-4389610

plach’s picture

Status: Needs work » Needs review
FileSize
776 bytes

Thanks! One could argue that the query should be alterable and as such needing dbtng-ing anyway, but this would be another issue. Rerolled to leave the static query in place.

plach’s picture

@joachim:

Anything else?

cweagans’s picture

Issue tags: +Needs backport to D7
plach’s picture

bump

benjy’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
error: patch failed: core/modules/block/block.module:254
error: core/modules/block/block.module: patch does not apply
plach’s picture

Version: 8.x-dev » 7.x-dev
Status: Needs work » Needs review
Issue tags: -Quick fix, -Novice, -Needs backport to D7, -Needs reroll

I think this does not apply to D8 anymore, now that we have custom blocks.

plach’s picture

Issue tags: +Quick fix
plach’s picture

Issue tags: -Quick fix

#6: block-1387668-6.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Quick fix

The last submitted patch, block-1387668-6.patch, failed testing.

plach’s picture

Status: Needs work » Needs review
FileSize
756 bytes
peximo’s picture

Status: Needs review » Reviewed & tested by the community

Hi, patch works as described.

David_Rothstein’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review

Why should we tack this on for custom blocks but not any other kind of block? For any block (custom or not), if you need the admin description you can already get it by invoking hook_block_info().

It is also passed through directly to the theme but not sanitized anywhere. It may be inviting trouble to give themers $block->subject (which is sanitized for inclusion in HTML) along with $block->info (which is not).