On my site I was having this message print out:-
Notice: Undefined index: body in adsense_injector_node_view() (line 158 of
/home/robogeek4/davidherron.com/sites/all/modules/adsense_injector/adsense_injector.module).The line corresponds to this:-
$node->content['body'][0]['#markup'] = strtr($template, array('%teaser' => $node->content['body'][0]['#markup']));
This occurred on the front page of my site, but not while viewing one of the nodes. However one of the nodes visible on the front page did not have any body content and had arisen as an accident and may have been malformed in the database. In any case when I deleted that node, the message went away.
Clearly $node->content did not have a 'body' element.
I just created a content type which does not have a body element in its fields, and the message did not occur. So this does not occur for content types that lack a field named 'body'. It occurs for content types that are supposed to have a field named body, but it's not there for some reason.
Comments
Comment #1
greg boggsIf someone is able to reproduce this, please list out the steps for me and I'll work on a fix.
Comment #2
restinua commentedI have got all most the same problem. After upgrade from Drupal 6 to 7. I am reinstall the module Content Injector.
So now I don't have any text area after words
"Node body insertion elements. There are currently three elements defined: top, inline, and bottom.
Elements having empty or default values are collapsed by default."
Same problem was after upgrading from 6.x-2.x to 6.x-3.x releases of Content Injector and the cure was "reset to default values".
In Drupal 7 no magic button to reset defaults :-(
Error message:
Notice: Undefined index: body_insertions in function _ai_get_body_insertions_vars() (array 357........... modules/adsense_injector/adsense_injector.module).
Help to reset defaults Content Injector.