Problem/Motivation

Spotted this notice in the D7 branch. We have a panel node that is getting these notices despite having told the toc block that it should _only_ appear on nodes of type Page.

Proposed resolution

Check to see if #items has any items to render.

The attached patch checks to see if $node->content['body']['#items'][0]['format'] is not empty() and only tries to render if there's something there. This removes the notice.

Remaining tasks

The attached patch needs review.

  1. Install, enable and configure tableofcontents, panels and supporting modules
  2. create a panel node
  3. disable the toc block on panel nodes
  4. verify the notices appear
  5. patch & retest