The advanced_render() process relies on views_handler_field::get_render_tokens(). That, in turn, relies on the $handler->last_render property for each field.
That works fine if the entirety of the rendering happens in the row plugin. However, in some cases the style plugin may want to render a given field instead. (The Views_cycle module is one such example.) That is a problem, however, as for some reason the $handler->last_render property gets lost by the time you get to the style plugin's preprocess template... even if the fields you want to use are not marked "exclude from display". That breaks the advanced_render() process for any field that is rendered in the style plugin.
As a temporary workaround you can re-render the entire row in the style plugin, after which the replacements work again. However, that is extremely wasteful:
$keys = array_keys($view->field);
foreach ($keys as $id) {
$view->field[$id]->theme($row);
}
Figuring out why $handler->last_render is going missing would be even better.
Comments
Comment #1
Crell commentedThis seems to have been fixed by #647694-9: views_handler_field_counter::render() ignores $values so $view->render_field('counter', $row) always returns last row count