In template.php we should do something like this to avoid php notices.

function aurora_preprocess_panels_pane(&$vars) {
  $subtype = isset($vars['pane']->subtype) ? $vars['pane']->subtype : '';
  $layout = isset($vars['display']->layout) ? $vars['display']->layout : '';
  $vars['theme_hook_suggestions'][] = 'panels_pane__' . $layout;
  $vars['theme_hook_suggestions'][] = 'panels_pane__' . $subtype;
  $vars['theme_hook_suggestions'][] = 'panels_pane__' . $layout . '__' . $subtype;
}

Some panes don't have a subtype or layout. Let me know if you need a patch.

CommentFileSizeAuthor
#3 check-panel-pane-vars-2106777-3.patch1.01 KBawolfey
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Snugug’s picture

Patches always welcome

awolfey’s picture

Actually it would be much better to not add the suggestions if the vars aren't there.

awolfey’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.01 KB

Here's a patch. There's probably a more elegant way to do this.

  • Commit afd4eb5 on 7.x-3.x by ChinggizKhan:
    #2106777: Prevent PHP errors if panels pane vars aren't set
    
iamcarrico’s picture

Status: Needs review » Fixed

Applied the patch, and cleaned it up a titch. Thank you!

Status: Fixed » Closed (fixed)

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