I've been reading through the issues and have seen mention of UUID integration into ctools. Right now I'm exporting specific nodes of a specific content type using `uuid_features` to handle static content. This is so the content can be edited on a dev/staging site, approved, and then exported to production. I had to patch ctools/plugins/content_types/node/node.inc so it would look for a uuid and reassign the nid to that node. I realize there is probably a more 'complete' answer to this problem but for now I had to get this working.

I couldn't decide which of these might be better (quicker) so I'll outline them both.

/**
 * Output function for the 'node' content type.
 *
 * Outputs a node based on the module and delta supplied in the configuration.
 */
function ctools_node_content_type_render($subtype, $conf, $panel_args) {
  if (!empty($conf['uuid'])) {
    $nid = db_query('SELECT nid FROM {node} WHERE uuid = :uuid', array(':uuid' => $conf['uuid']))->fetchField(); // OR - array_pop(array_flip($conf['uuid']));
  }
  else {
    $nid = $conf['nid'];
  }
/**
 * Validate the node selection.
 */
function  ctools_node_content_type_edit_form_validate(&$form, &$form_state) {

.......

if ($node) {
    $form_state['values']['nid'] = $node->nid;
    $form_state['values']['uuid'] = db_query('SELECT uuid FROM {node} WHERE nid = :nid', array(':nid' => $node->nid))->fetchField(); // OR - entity_get_uuid_by_id('node', array($node->nid));
  }

Please let me know if this is on the right track or way off base. I will include the patch I'm using.

CommentFileSizeAuthor
#1 ctools-uuid-2018111-1.patch1.03 KBscottalan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scottalan’s picture

FileSize
1.03 KB

My patch ---

scottalan’s picture

So this was only part of the code anyway and now that 7.x-3.x-dev adds the drupal_alter in panels_renderer_standard.class.php this can easily be handled from a custom module. Thanks!