Conflict with themes implementing theme_blocks()

Created on 16 November 2009, over 15 years ago
Updated 22 February 2023, about 2 years ago

Problem/Motivation

If a context is defined where blocks should appear, the blocks may not show up as desired depending on which theme is used on the website. If a theme implements an override of theme_blocks(), then the Context module won't work with that theme. Since all theme_ functions are designed to be overridden by themes, the problem needs to be fixed in the Context module.

Proposed resolution

Remove context's theme_blocks() override. And, in context_page_alter() (context's preprocess_page function), it can go through all the regions and set the blocks with drupal_set_content().

Remaining tasks

Using patch in comment #45, blocks added through the normal blocks admin page are added to each region twice, as duplicates. If the variable context_reaction_block_disable_core is not TRUE, context_reaction_block's ->execute() will include core blocks, printing them twice.

Patch in #75 may fix this bug, but it needs testing.

Note: the patches need testing with Zen 6.x-2.0 β†’ , an old version of Zen, since 6.x-2.1 and later implement a work-around for this Context bug.

Original report by tahiticlic

Hi,

I've an issue with a zen subtheme and Context : I've defined a context where blocks should appear. With a garland subtheme, no problem. With a zen subtheme, the blocks don't show... I've limited the theme to this only subtheme

Any idea of what I'm doing wrong?

πŸ› Bug report
Status

Closed: outdated

Version

3.0

Component

User interface

Created by

πŸ‡΅πŸ‡«French Polynesia tahiticlic

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024