The mvpcreator_theme_current_panels_variant function does a node_load on an entity ID to determine what display it's using. It checks if the handler is 'panelizer_node', then takes the ID in the argument and runs node_load.
However, Panelizer also uses the panelizer_node handler for taxonomy terms. See PanelizerEntityTaxonomyTerm.class.php:
/**
* Implements a delegated hook_page_manager_handlers().
*
* This makes sure that all panelized entities have the proper entry
* in page manager for rendering.
*/
public function hook_default_page_manager_handlers(&$handlers) {
page_manager_get_task('term_view');
$handler = new stdClass;
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'term_view_panelizer';
$handler->task = 'term_view';
$handler->subtask = '';
$handler->handler = 'panelizer_node';
$handler->weight = -100;
$handler->conf = array(
'title' => t('Term panelizer'),
'context' => page_manager_term_view_get_type() == 'multiple' ? 'argument_terms_1' : 'argument_term_1',
'access' => array(),
);
$handlers['term_view_panelizer'] = $handler;
return $handlers;
}
This means that when run on a taxonomy term page, the function will return the display of the node with the same ID rather than the one associated with the term.
Instead, the function should check the task name and then either do a node_load or a taxonomy_term_load. If there are more types of tasks that use the panelizer_node handler, the code here will have to account for them.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | mvpcreator_theme-entity-types-2698107-2.patch | 1.18 KB | cboyden |
Comments
Comment #2
cboyden commentedThe attached patch adds a switch statement to handle all of the entity types in Panelizer that use the panelizer_node handler.
Comment #3
dsnopekOh, wow! I guess there's still plenty to learn about how Panelizer works. :-) Great catch, thanks!
Comment #5
dsnopekWorked in my testing, committed! Thanks :-)