Notice: Undefined index: content in template_preprocess_node() (line 1467 of drupal-7.x-dev\modules\node\node.module).
function template_preprocess_node(&$variables) {
...
// Helpful $content variable for templates.
foreach (element_children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
// Make the field variables available with the appropriate language.
field_attach_preprocess('node', $node, $variables['content'], $variables); //<--line 1467
the content could be empty if links are removed with views module, body is empty and comment module disabled..
solution: add $variables['content'] = array();
before foreach..
Comment | File | Size | Author |
---|---|---|---|
#2 | node-preprocess-notice-1153022.patch | 503 bytes | lyricnz |
Comments
Comment #1
PasqualleComment #2
lyricnz CreditAttribution: lyricnz commentedComment #3
lyricnz CreditAttribution: lyricnz commentedComment #4
PasqualleComment #5
catchComment #6
webchickHm. This seems harmless enough, though it would undo $variables['content'] if it was set to anything before it. Looking at http://api.drupal.org/api/drupal/includes--theme.inc/function/theme though, it seems pretty safe to assume that this should come first.
Committed to 8.x and 7.x. Thanks!
Comment #8
WilliamB CreditAttribution: WilliamB commentedGetting this issue in Drupal 7.2