I get this notice with each node: Notice: Undefined index: nl in node_tokens() (line 139 of ........drupal\modules\node\node.tokens.inc)

I made my page node-type with multilanguage=false and added a body field. Then I imported 300 nodes from joomla with the joomla module. Then I made the page node-type multilingual and changed some nodes to language = 'nl'.

In de node table, those nodes get 'nl' in the language column, but the `field_data_body` and `field_revision_body` tables keep their language = 'und' value. Even with new nodes, made in language 'nl', the notice shows.

Anybody knows what is wrong?

Comments

kingandy’s picture

Looks like node.tokens.inc is just trying to set $item = $node->body[$node->language][0]; without checking that $node->body[$node->language] exists first ... and since this is a non-multilanguage node I would guess it's never going to exist.

If the page renders fine apart from the notice, this may be just lazy coding rather than a bug. Still, it could be worth raising this as an issue.

++Andy

Babalu’s picture

I got the same error
How can i solve that

dave reid’s picture

This is a core bug: http://drupal.org/node/1178580.

kingandy’s picture

It's a notice, rather than a bug, but yeah.

++Andy

jagmeister’s picture

This is for drupal 8.x is there any fix for drupal 7.x

headstartcms’s picture

Notice: Undefined index: en in node_tokens() (line 139 of /home/server/public_html/modules/node/node.tokens.inc).
Notice: Undefined index: en in node_tokens() (line 139 of /home/server/public_html/modules/node/node.tokens.inc).