diff --git a/fieldable_panels_panes.module b/fieldable_panels_panes.module index 251747f..c170aaa 100644 --- a/fieldable_panels_panes.module +++ b/fieldable_panels_panes.module @@ -919,8 +919,12 @@ function fieldable_panels_panes_load_from_subtype($subtype_name) { * Properly load the entity via $subtype_name. * * @param string $subtype_name - * A string combining an indicator of the type of ID, e.g. 'fpid', 'vid' or - * 'vuuid', and an integer ID, separated by a colon; e.g. "fpid:123". + * A string combining an indicator of the type of ID, e.g. 'fpid', 'vid', + * 'uuid', 'vuuid' or 'current, and an integer ID, separated by a colon; e.g. + * "fpid:123". If the type is 'current' the newest revision will be loaded, + * 'fpid' and 'uuid' will load the revision considered best, 'vid' and 'vuuid' + * will load a specific revision. Both 'uuid' and 'vuuid' require the UUID + * module to be present. * * @return object * The requested FPP object. @@ -938,6 +942,7 @@ function fieldable_panels_panes_load_from_subtype_force($subtype_name) { $object = reset($object); } } + // UUID integration for revisions. elseif ($type == 'vuuid' && module_exists('uuid')) { $vids = entity_get_id_by_uuid('fieldable_panels_pane', array($id), TRUE); @@ -950,6 +955,7 @@ function fieldable_panels_panes_load_from_subtype_force($subtype_name) { $fpid = db_query('SELECT fpid FROM {fieldable_panels_panes_revision} WHERE vid = :vid', array(':vid' => $id))->fetchField(); $object = fieldable_panels_panes_load($fpid, $id); } + // 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(); diff --git a/plugins/content_types/fieldable_panels_pane.inc b/plugins/content_types/fieldable_panels_pane.inc index 200acd2..c96c622 100644 --- a/plugins/content_types/fieldable_panels_pane.inc +++ b/plugins/content_types/fieldable_panels_pane.inc @@ -283,11 +283,12 @@ function fieldable_panels_panes_fieldable_panels_pane_content_type_edit_form_sub } } } + else { - // The current key will tell FPP to load up the current revision. This + // The 'current' key will tell FPP to load up the current revision. This // bypasses the entity cache on the FPP entity class and loads the revision // that was just saved instead of the previous revision. This is only - // really relevant in panels IPE administration or similar circumstances. + // really relevant in Panels IPE administration or similar circumstances. $entity_id = 'current:' . $entity->fpid; }