diff --git a/plugins/content_types/fieldable_panels_pane.inc b/plugins/content_types/fieldable_panels_pane.inc index bd7eac3..f2f5502 100644 --- a/plugins/content_types/fieldable_panels_pane.inc +++ b/plugins/content_types/fieldable_panels_pane.inc @@ -205,12 +205,38 @@ function fieldable_panels_panes_fieldable_panels_pane_content_type_edit_form_sub fieldable_panels_panes_entity_edit_form_submit($form, $form_state); - // Sub type is not explicitly set, define it here. - if (module_exists('uuid') && isset($entity->uuid)) { - $entity_id = 'uuid:' . $entity->uuid; - } - else { - $entity_id = 'fpid:' . $entity->fpid; + // @todo: This is here to show that this should be a setting somewhere, however, + // I was having a time figureing out the appropriate place to put it + // and what to call it exactly. This is only temporary and hopefully + // someone will have some ideas. this would only apply for things like + // panelizer pages so that a pane actually corresponds to revision of + // the node. When the entity is reusable we want it to act as if it + // were global. We should also add some type of notice on the form so + // it's not completely confusing for users. + $revision_context_aware = (empty($entity->reusable)) ? TRUE : FALSE; + + if (!empty($entity->is_new) || $revision_context_aware) { + if (module_exists('uuid') && isset($entity->uuid)) { + if ($revision_context_aware) { + // @todo: So I feel that this should be vuuid, however, when I tried + // the entity is never loaded back up, seems to work fine as + // just vid. I did briefly look, however, in the interest of + // time I stopped, hopefully someone else knows. + //$entity_id = 'vuuid:' . $entity->vuuid; + $entity_id = 'vid:' . $entity->vid; + } + else { + $entity_id = 'uuid:' . $entity->uuid; + } + } + else { + if ($revision_context_aware) { + $entity_id = 'vid:' . $entity->vid; + } + else { + $entity_id = 'fpid:' . $entity->fpid; + } + } } // @todo: This won't work if $form_state does not contain 'pane' which could @@ -325,3 +351,4 @@ function _fieldable_panels_panes_load_entity($subtype_name) { function fieldable_panels_panes_content_type_create_access($type, $subtype) { return fieldable_panels_panes_access('create', $subtype['name']); } +