diff --git a/plugins/entity/PanelizerEntityDefault.class.php b/plugins/entity/PanelizerEntityDefault.class.php index b41fc7d..13730e1 100644 --- a/plugins/entity/PanelizerEntityDefault.class.php +++ b/plugins/entity/PanelizerEntityDefault.class.php @@ -209,6 +209,13 @@ abstract class PanelizerEntityDefault implements PanelizerEntityInterface { public $entity_type = ''; /** + * Storage for the display defaults already loaded by the system. + * Used in default_display_exists() + */ + private $displays = array(); + private $displays_loaded = array(); + + /** * Initialize the plugin and store the plugin info. */ function init($plugin) { @@ -873,18 +880,16 @@ abstract class PanelizerEntityDefault implements PanelizerEntityInterface { $entity_type = $parts[0]; $bundle = $parts[1]; - $machine_name = $parts[2]; - $view_mode = 'page_manager'; - if (isset($parts[3])) { - $view_mode = $parts[3]; - } - static $displays; - if (is_null($displays)) { + + $short_name = $entity_type . ':' . $bundle; + if (empty($this->displays_loaded[$short_name])) { + $this->displays_loaded[$short_name] = TRUE; $displays = $this->get_default_panelizer_objects($bundle); + $this->displays = array_merge($this->displays, $displays); } - return isset($displays[$display_name]); + return isset($this->displays[$display_name]); } public function get_default_display_variable_name($bundle, $view_mode = 'page_manager') {