diff --git a/plugins/entity/PanelizerEntityDefault.class.php b/plugins/entity/PanelizerEntityDefault.class.php old mode 100644 new mode 100755 index c9dc149..c95508e --- a/plugins/entity/PanelizerEntityDefault.class.php +++ b/plugins/entity/PanelizerEntityDefault.class.php @@ -800,6 +800,7 @@ abstract class PanelizerEntityDefault implements PanelizerEntityInterface { if ($this->supports_revisions) { if (empty($entity->panelizer->revision_id) || $entity->panelizer->revision_id != $revision_id) { $update = array(); + $display_is_modified = TRUE; } else { $update = array('entity_type', 'revision_id'); @@ -818,11 +819,19 @@ abstract class PanelizerEntityDefault implements PanelizerEntityInterface { // us know if we need to clone a new display or not. // NOTE: This means that when exporting or deploying, we need to be sure // to set the display_is_modified flag to ensure this gets written. - if (!empty($entity->panelizer->display_is_modified)) { + if (!empty($entity->panelizer->display_is_modified) || !empty($display_is_modified)) { // If this is a new entry or the entry is using a display from a default, // clone the display. - if (!$update || empty($entity->panelizer->did)) { - $panelizer = $this->clone_panelizer($entity->panelizer, $entity); + if (empty($update) || empty($entity->panelizer->did)) { + // If there is an original entity set on the current entity with a + // panelizer object, use this. Then we are working on a new revision. + // Else just clone the panelizer object on the current entity. + if (!empty($entity->original->panelizer)) { + $panelizer = $this->clone_panelizer($entity->original->panelizer, $entity); + } + else { + $panelizer = $this->clone_panelizer($entity->panelizer, $entity); + } } else { $panelizer = $entity->panelizer;