I'm using latest PB code and latest ctools (7.x-1.2+45-dev) modules. I have the following configuration

  $path_breadcrumb = new stdClass();
  $path_breadcrumb->api_version = 1;
  $path_breadcrumb->machine_name = 'file_add';
  $path_breadcrumb->name = 'File add';
  $path_breadcrumb->path = 'node/add/file';
  $path_breadcrumb->data = array(
    'titles' => array(
      0 => '%site:current-user:name',
      1 => 'Files',
      2 => 'Add new file',
    ),
    'paths' => array(
      0 => 'user/%site:current-user:uid',
      1 => 'user/%site:current-user:uid/files',
      2 => '<none>',
    ),
    'home' => 1,
    'translatable' => 0,
    'arguments' => array(
    ),
    'access' => array(
    ),
  );
  $path_breadcrumb->weight = -100;
  $export['file_add'] = $path_breadcrumb;

When I use this %site and everything related to it gets mapped to empty string. I traced this problem down to this snippet:

  // Add custom ctools context for site.
  $site = new ctools_context('site');
  $site->plugin = 'site';
  $site->keyword = 'site';
  $contexts['site'] = $site;

PB calls ctools_context_keyword_substitute, which calls ctools_context_convert_context, which calls ctools_get_context($context->plugin) and gets a null (since there is no site plugin.

I tried to find a fix, but I'm not very familiar with the entire ctools system.

Cheers,
Andrei

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rosberg’s picture

I was trying to use %site:name in my breadcrumb and experienced the same problem.

My temporary workaround was to create a new substitution token !site_name ( replaced by: variable_get('site_name') ). Attached is a patch for this, maybe it can help someone else.

Spleshka’s picture

@abautu,
Thanks for report. Think that will be fixed soon.

@rosberg,
I can't accept your patch. We should fix all %site context here, not only %site:name token.

kalabro’s picture

Version: 7.x-3.0-beta1 » 7.x-3.x-dev
Status: Active » Fixed
kalabro’s picture

Status: Fixed » Postponed

For multilevel tokens like %site:current-user:name waiting #1964434: Token context: tokens with deep more then 1 don't work to fix.

kalabro’s picture

Status: Postponed » Fixed

Should be finally fixed in 7.x-3.0-beta5.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.