If another preprocessor or processor has already rendered the $page variable AdvAgg will clobber $page_top, $page_bottom and $page resulting in an empty page.
The problematic code is:
if (isset($variables['page']['page_top'])) {
$variables['page_top'] = drupal_render($variables['page']['page_top']);
}
elseif (!isset($variables['page_top'])) {
$variables['page_top'] = '';
}
if (isset($variables['page']['page_bottom'])) {
$variables['page_bottom'] = drupal_render($variables['page']['page_bottom']);
}
elseif (!isset($variables['page_bottom'])) {
$variables['page_bottom'] = '';
}
// Place the rendered HTML for the page body into a top level variable.
if (isset($variables['page']['#children'])) {
$variables['page'] = $variables['page']['#children'];
}
The problem is if $variables['page'] is a string 'page_top' gets cast to the integer 1, isset() returns true and we end up calling drupal_render() on the second character of the string and set $variables['page_top'] to the return value.
We should probably check that $variables['page'] is indeed an array in these if statements to fix the problem. I'll attach a patch in the comments.
Comments
Comment #2
Dean Reilly commentedComment #3
damienmckennaLooks entirely reasonable.
Comment #5
mikeytown2 commentedThanks for the patch! Also thanks for testing out the patch! It's been committed.