diff --git a/fieldable_panels_panes.module b/fieldable_panels_panes.module index 6a4836a..34ee0b1 100644 --- a/fieldable_panels_panes.module +++ b/fieldable_panels_panes.module @@ -898,7 +898,7 @@ function fieldable_panels_panes_load_from_subtype_force($subtype_name) { elseif ($type == 'vuuid' && module_exists('uuid')) { $vids = entity_get_id_by_uuid('fieldable_panels_pane', array($id), TRUE); if ($vids && $content = entity_load('fieldable_panels_pane', FALSE, array('vid' => reset($vids)))) { - $content = reset($content); + $object = reset($content); } } // If the type is 'vid' then a specific FPP revision is being requested. @@ -909,7 +909,7 @@ function fieldable_panels_panes_load_from_subtype_force($subtype_name) { // Load up the current revision. elseif($type == 'current') { $vid = db_query('SELECT MAX(vid) FROM {fieldable_panels_panes_revision} WHERE fpid = :fpid', array(':fpid' => $id))->fetchField(); - $content = fieldable_panels_panes_load($id, $vid); + $object = fieldable_panels_panes_load($id, $vid); } // The remaining scenario is that it's a regular FPP id, i.e. an "fpid", so diff --git a/includes/PanelsPaneController.class.php b/includes/PanelsPaneController.class.php index 6f3b5ad..7381427 100644 --- a/includes/PanelsPaneController.class.php +++ b/includes/PanelsPaneController.class.php @@ -185,7 +185,12 @@ class PanelsPaneController extends DrupalDefaultEntityController { $entity->uid = $uid; // Update the existing revision if specified. if (!empty($entity->vid)) { - drupal_write_record('fieldable_panels_panes_revision', $entity, 'vid'); + if (module_exists('uuid')) { + drupal_write_record('fieldable_panels_panes_revision', $entity, 'vuuid'); + } + else { + drupal_write_record('fieldable_panels_panes_revision', $entity, 'vid'); + } } else { // Otherwise insert a new revision. This will automatically update $entity diff --git a/plugins/content_types/fieldable_panels_pane.inc b/plugins/content_types/fieldable_panels_pane.inc index 12723a1..b26741f 100644 --- a/plugins/content_types/fieldable_panels_pane.inc +++ b/plugins/content_types/fieldable_panels_pane.inc @@ -256,7 +256,7 @@ function fieldable_panels_panes_fieldable_panels_pane_content_type_edit_form_sub fieldable_panels_panes_entity_edit_form_submit($form, $form_state); // @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 + // I was having a time figuring 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 @@ -347,11 +347,23 @@ function _fieldable_panels_panes_custom_content_type($entity) { 'icon' => 'icon_block_custom.png', ); + $revision_context_aware = (empty($entity->reusable)) ? TRUE : FALSE; + if (module_exists('uuid') && isset($entity->uuid)) { - $info['name'] = 'uuid:' . $entity->uuid; + if ($revision_context_aware) { + $info['name'] = 'vuuid:' . $entity->vuuid; + } + else { + $info['name'] = 'uuid:' . $entity->uuid; + } } else { - $info['name'] = 'fpid:' . $entity->fpid; + if ($revision_context_aware) { + $info['name'] = 'vid:' . $entity->vid; + } + else { + $info['name'] = 'fpid:' . $entity->fpid; + } } $info['entity_id'] = $info['name']; @@ -364,3 +376,4 @@ function _fieldable_panels_panes_custom_content_type($entity) { function fieldable_panels_panes_content_type_create_access($type, $subtype) { return fieldable_panels_panes_access('create', $subtype['name']); } +