Problem/Motivation

We can create and export fieldable panels panes with UUIDs - but not other entity types.
We can attach them as page manager contexts in code however, the reference is made using the serial ID.
Sample exported code showing context:

'contexts' => array(
    0 => array(
      'identifier' => 'My pane',
      'keyword' => 'node',
      'name' => 'entity:node',
      'entity_id' => '2',
      'id' => 1,
    ),
  ),

Proposed resolution

Provide an entity context that uses UUID.

Remaining tasks

Patch (in progress)
Review.
Tests.

User interface changes

None

API changes

New context type

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Sample of new context on export

$handler->conf = array(
  'title' => 'Panel',
  'no_blocks' => 0,
  'pipeline' => 'standard',
  'body_classes_to_remove' => '',
  'body_classes_to_add' => '',
  'css_id' => '',
  'css' => '',
  'contexts' => array(
    0 => array(
      'identifier' => 'Node (by uuid)',
      'keyword' => 'node',
      'name' => 'entity_uuid:node',
      'entity_uuid' => '5495A31E-F3E2-4FB4-9642-03FB62368951',
      'id' => 1,
    ),
  ),
  'relationships' => array(),
);

Screenshots:

larowlan’s picture

Title: Add an 'entity context from UUID' context plugin » Add an 'entity from UUID' context plugin
larowlan’s picture

Issue summary: View changes
larowlan’s picture

Issue summary: View changes
DamienMcKenna’s picture

Assigned: larowlan » Unassigned

rhys’s picture

FileSize
2.75 KB

I condensed this down so that it would simply add the UUID to any existing contexts that support entity uuids.

Although this patch doesn't sufficiently clean the features so the overridden notice will still be there.

gnucifer’s picture

This issue is basically the same as https://www.drupal.org/node/2145567? I am also in need of this functionality. Will have a look at #7.

gnucifer’s picture

After trying out and reviewing all the patches in this thread and discovering some issues I have come to the conclusion that the patch in https://www.drupal.org/node/2145567 is probably the way to go. It's probably also nicer that the integration resides in the uuid module.

Chris Matthews’s picture

The 4 year old patch in #7 to entity.inc applied cleanly to the latest ctools 7.x-1.x-dev, but per gnucifer's comment in #9 it sounds like this issue may need to be closed in favor of the patch in #2145567: CTools Contexts are missing UUID support..