So Omega does all kind of crazy with it's regions - not least disabling ones which have not been explicitly enabled in it's UI, whipping them out of the page array before blockgroup can render them.

Patch to follow.

Comments

jamsilver’s picture

Assigned: jamsilver » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.78 KB

Patch attached! This makes it work for me with Omega.

znerol’s picture

StatusFileSize
new1.05 KB

Thanks for the patch. From what I see, alpha keeps a copy of the regions it moved around in the #exclude-array. So we may just fetch the blockgroups from there. Attached is a patch which exposes the pullup-key using drupal_alter. Themers doing funny things with the page-array then should implement that hook. The implementation for alpha is given below:

/**
 * Implements hook_blockgroup_pullup_key_alter().
 */
function alpha_blockgroup_pullup_key_alter(&$key) {
  array_unshift($key, '#excluded');
}

Would that approach solve your issue?

jamsilver’s picture

Ooh, interesting solution.

Hard to say whether it is Alpha's responsibility to support Block Group, or Block Group's responsibility to support Alpha. Usually you would say that themes come along later and so should support modules, but Block Group is doing the decidedly dodgy act of injecting regions into the theme (hook_system_info_alter), so perhaps should make the effort to make sure it works in all cases?

Either way, I'd be interested in hearing why Block group needs to pass the $page array by reference here? Obviously this issue would be solved if it just passed its region by value, impervious to any alterations made during page build.

Presumably it's to allow themes / modules to make changes to the block group region?

znerol’s picture

Its because there could be nested blockgroups. With the pullup-trick I save myself of figuring out the correct processing order in blockgroup_page_alter. Nested blockgroups are put in place during the #pre_render callback of the enclosing blockgroup.

jamsilver’s picture

Ah, very elegant. I like it.

Could there be compromise here, where you move the regions over to some '#blockgroups' part of the page array? Still refer to it by reference so nested blockgroups work, but put it somewhere where people are unlikely to mess with?

Given that altering the page array is a perfectly acceptable thing for people to do, It feels a little fragile that blockgroups can break because of it.

What do you think?

znerol’s picture

StatusFileSize
new1.96 KB

Wow, what a great suggestion. That also solves another issue with omega. Because the region is out of the way when the theme picks up, it does not assign those nasty grid-X classes to the blockgroup region anymore.

znerol’s picture

Status: Needs review » Closed (fixed)