It seems that block_page_alter was used at some point to place the blocks in the renderable array in drupal_render_page.

In common.inc, there is a comment before the invokation of hook_page_alter

  // Modules alter the $page as needed. Blocks are populated into regions like
  // 'sidebar_first', 'footer', etc.
  drupal_alter('page', $page);

and block_install changes the weight of block so that it is the first page_alter called

function block_install() {
  // Block should go first so that other modules can alter its output
  // during hook_page_alter(). Almost everything on the page is a block,
  // so before block module runs, there will not be much to alter.
  db_update('system')
    ->fields(array('weight' => -5))
    ->condition('name', 'block')
    ->execute();
}

However, blocks are now added using block_page_build.

At the very least, the comment in common.inc should be removed. The reordering of weights achieved through block_install might not be necessary anymore either. If it is, the comment should be changed to clarify why.

Comments

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Attaching a patch for the comment issue in common.inc

We should still consider the second block of code, whether it can be removed altogether or whether the comment should be changed.

Bathie’s picture

Hello. The patch did not apply because it was too old.
I recreated it against 7.x-dev of 15 Feb 2012.
Did I do it the right way? This is my first patch.

Status: Needs review » Needs work

The last submitted patch, block_comments-block_page_alter-1062576-2.patch, failed testing.

Bathie’s picture

Status: Needs work » Needs review

Hello, I don't see the problem with the failed patch, could you help me?

bobbyaldol’s picture

@Bathie , you did not mention the function name (ie you did not clearly tell where the change is.) I guess. I am new to Drupal too, just guessing because thats the only difference between your patch and linclark's.

bobbyaldol’s picture

Status: Needs review » Reviewed & tested by the community
tim.plunkett’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs backport to D7

Moving to 8.x to be fixed there first.

dcam’s picture

Status: Needs work » Needs review
StatusFileSize
new882 bytes

Rerolled #1 for D8.

dcam’s picture

#8: block-comments-1062576-8.patch queued for re-testing.

benjy’s picture

StatusFileSize
new907 bytes

Re-rolled this patch.

benjy’s picture

Title: Comments refer to block_page_alter when block_page_build is used instead » Update drupal_alter() comments in drupal_render_page()
benjy’s picture

Status: Needs review » Closed (won't fix)

This issue is no longer relevant as the comment has already been fixed.