This issue is caused by #2415427: Avoid loading FPP from database in fieldable_panels_panes_preprocess_panels_pane()

Here's the PHP notices:

Notice: Trying to get property of non-object in fieldable_panels_panes_preprocess_panels_pane() (line 756 of /var/aegir/prj/fieldable_panels_panes/fieldable_panels_panes.module).
Notice: Trying to get property of non-object in fieldable_panels_panes_preprocess_panels_pane() (line 760 of /var/aegir/prj/fieldable_panels_panes/fieldable_panels_panes.module).

And here's the code in question:

function fieldable_panels_panes_preprocess_panels_pane(&$vars) {
  if ($vars['pane']->type == 'fieldable_panels_pane') {
    if (!empty($vars['content']['#fieldable_panels_pane'])) {
      $entity = $vars['content']['#fieldable_panels_pane'];
      if ($entity->link && !empty($vars['title'])) {
        $vars['title'] = l($vars['title'], $entity->path);
      }
      ctools_include('cleanstring');
      $vars['classes_array'][] = 'pane-bundle-' . ctools_cleanstring($entity->bundle, array('lower case' => TRUE));
    }
  }
}

Basically, if the FPP is hidden via visibility rules, then $vars['content']['#fieldable_panels_pane'] won't be an entity object. In my testing it was actually the string "P", which is super wierd and might be a bug from somewhere else?

Anyway, the easiest solution is to just check if it's an object in the if statement. I'll upload a patch that does this in a moment!

Comments

dsnopek’s picture

Status: Active » Needs review
StatusFileSize
new744 bytes

Patch is attached! Please let me know what you think.

dsnopek’s picture

Issue tags: +panopoly
monymirza’s picture

Status: Needs review » Reviewed & tested by the community

thanks, fixed now.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

  • DamienMcKenna committed 8b8e945 on 7.x-1.x authored by dsnopek
    Issue #2463965 by dsnopek: PHP notice when FPP is hidden via visibility...
dsnopek’s picture

Thanks! :-)

Status: Fixed » Closed (fixed)

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

koykov’s picture

damienmckenna’s picture

@koykov: Were you uploading another patch for the same problem?