hook_views_post_render does not play nicely with base themes in Views versions 7.x-3.x.
I'm seeing the following error message:
Warning: Missing argument 2 for THEME_views_post_render(), called in PATH/modules/views/includes/view.inc on line 1287 and defined in THEME_views_post_render() (line 247 of PATH/themes/custom/THEME/template.php).
The problem appears to lie within includes/view.inc, where:
foreach ($GLOBALS['base_theme_info'] as $base) {
$function = $base->name . '_views_post_render';
if (function_exists($function)) {
$function($this);
}
}
$function = $GLOBALS['theme'] . '_views_post_render';
if (function_exists($function)) {
$function($this, $this->display_handler->output, $cache);
}
This should presumably be:
foreach ($GLOBALS['base_theme_info'] as $base) {
$function = $base->name . '_views_post_render';
if (function_exists($function)) {
$function($this, $this->display_handler->output, $cache);
}
}
$function = $GLOBALS['theme'] . '_views_post_render';
if (function_exists($function)) {
$function($this, $this->display_handler->output, $cache);
}
Comments
Comment #1
tom.gillett commentedPatch attached.
Comment #2
mrdalesmith commentedPatch confirmed as working.
Comment #3
mrdalesmith commentedComment #4
damienmckennaI looked this over, it seems correct. I'm also not concerned about the D8 aspects because theming in D8 is very different to D7.
Comment #6
damienmckennaCommitted. Thanks!