It has always bothered me that the theming of blocks for the page template occurred "inside" theme_page() and its overrides. It's quite unclean, and binds the two together too tightly. However, thanks to the new theme system, we don't need to do it there anymore.

The attached patch is largely just a cut/paste from template_page() to a new block_preprocess_page(), so that block creation happens there instead of in the page template itself where it doesn't belong. It's mostly just a cleanup, but it also means that there's technically no theme-level dependency on the block module anymore.

There should be no functionality changes from this patch.

CommentFileSizeAuthor
block_preprocess.patch4.15 KBCrell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

I tested and all is well. This does clean up the page building nicely.

When testing, I recommend changing themes in order to rebuild the theme cache so the blocks will show.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Needs work

1 hunk failed. sigh.

Crell’s picture

I'm not going to bother rerolling this until a D7 maintainer is named. It's not worth the effort.

moshe weitzman’s picture

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

I think this was adequately cleaned up in the hook_page_alter() issue which was committed.