Fieldable panel panes do not always define $block->title:

    $block = new stdClass();
    if (empty($settings['extra_fields']['display']) || !empty($settings['extra_fields']['display']['title']['default']['visible'])) {
      $block->title = !empty($entity->title) ? filter_xss_admin($entity->title) : '';
    }
    // If the above if fails, the $block->title is never set.

Notice: Undefined property: stdClass::$title in panels_renderer_editor->render_pane() (line 156 of panels/plugins/display_renderers/panels_renderer_editor.class.php).

While I think fieldable panel panes should always have a block title defined, this is easy to prevent in Panels by changing:

    if (!$block->title) {
      $block->title = t('No title');
    }

To use empty():

    if (empty($block->title)) {
      $block->title = t('No title');
    }
CommentFileSizeAuthor
#1 1781264-undefined-block-title.patch570 bytesdave reid

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new570 bytes
merlinofchaos’s picture

Status: Needs review » Fixed

The fix is sensible. Committed and pushed.

Status: Fixed » Closed (fixed)

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

  • Commit 6d59ebd on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by merlinofchaos:
    Issue #1781264 by Dave Reid: Lack of empty() could cause notice on rare...