In the theme function of Panels are the following variables defined:

$theme['panels_pane'] = array(
    'variables' => array(
        'output' => array(),
        'pane' => array(),
        'display' => array()
    ),
  );

But in the the template_preprocess_panels_pane() function is the content expected in $vars['content'].

So, if a other theme function (maybe a style plugin) call the "panels_pane" theme function all works:

  return theme('panels_pane', array('content' => $vars['content'], 'pane' => $vars['pane'], 'display' => $vars['display']));

But if the style plugin use a render array instead, the rendered pane is empty:

$pane = array(
    '#theme' => 'panels_pane',
    '#output' => 'Test Output',
    '#pane' => $vars['pane'],
    '#display' => $vars['display'],
);

$output = drupal_render($pane);

The problem is, that the theme() function only pass the arguments to the theme function, which are expected (in this case "output"). This behavior is only, if theme() is called from within a render array. This is also the reason why theme('panels_pane', array(...)) works and with drupal_render() not.

CommentFileSizeAuthor
#1 changed-variable-key-2263073-1.patch558 bytescbeier

Comments

cbeier’s picture

StatusFileSize
new558 bytes

The patch corrects the name of the variables key.

niko-’s picture

Status: Active » Reviewed & tested by the community

Hi

Thanks @cbeier , patch #1 works for me
RTBC

kristiaanvandeneynde’s picture

Looks good to me.

japerry’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone! Fixed.

  • japerry committed f7ed1af on 7.x-3.x authored by cbeier
    Issue #2263073 by cbeier: Theme panels_pane variables does not match...

Status: Fixed » Closed (fixed)

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