On line 651 (both in 7.x-1.x-dev and -alpha2) the presence of the 'content' key in the page array needs to be validated in the page_build hook:

change
$page['content'] = array('metatags' => array()) + $page['content'];

to:
$page['content'] = (array_key_exists('content', $page)) ? array('metatags' => array()) + $page['content'] : array('metatags' => array());

This creates the $page['content'] key if it does not exist in the $page array, and sets the empty 'metatags' array to the index.

This error appears to have been reported in the following issue, but not resolved in the dev release:

I notice it on the CKEditor admin page.

Comments

ciniko’s picture

I had the same problem, which is solved after i used your code, thanks...

Dave Reid’s picture

Status: Active » Fixed

The current code has this above the described lines:

  // For some reason with Overlay enabled we get an empty $page, so just fail
  // this case.
  if (!isset($page['content'])) {
    return;
  }

This is already fixed in the latest release.

davmorr’s picture

I just upgraded to the alpha2 release and the error message no longer displays. I wasn't sure if the "$page['content'] => array ( [metatags] => array ( ) ) )" was expected elsewhere and would cause less obvious process issue down the line - I didn't have time to step through the code as much as I wanted to - so I went ahead and created placeholders, just in case. Nice module, thanks for contributing!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

changed key validation from isset($page['content']) to array_key_exists('content', $page)