Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Set theme to chameleon or marvin, create a node with empty body promoted to front page, then visit the front page:
notice: Undefined property: stdClass::$body in /var/www/drupal-cvs/local/themes/chameleon/chameleon.theme on line 128.
Comment | File | Size | Author |
---|---|---|---|
#5 | chameleon-isset_2.patch | 820 bytes | Freso |
#4 | chameleon-isset_1.patch | 821 bytes | John Morahan |
chameleon-isset_0.patch | 648 bytes | John Morahan | |
Comments
Comment #1
Gábor HojtsyIf the body is empty, it will not be set? Are you sure?
Comment #2
John Morahan CreditAttribution: John Morahan commentedWell, if it's empty, then concatenating it to
$output
is harmless. The real problem here is in the teaser view, where the body is always unset. If$node->teaser
is set but empty, theif
will fail and try to display the unset$node->body
instead.A similar isset($node->body) fix is used in template_preprocess_node.
Setting to CNW because of http://drupal.org/node/176078#comment-306220 - will look at this later.
Comment #3
Gábor HojtsyOh, yes, agreed.
Comment #4
John Morahan CreditAttribution: John Morahan commentedHere's a combined patch.
Comment #5
Freso CreditAttribution: Freso commentedI can reproduce the bug on a clean D6 install from CVS. Applying the patch fixes the problem, and I can't identify anything that should break.
I don't know whether there are any performance difference doing
else if
vs.elseif
, though I seem to have it implied somewhere in a discussion regarding the use ofcase
. Either way,elseif
is used in the Coding standards, andelse if
isn't, so I've attached a patch identical John Morahan's latest, except with the replaced by an .Either this or the original patch is RTBC.
Comment #6
Gábor HojtsyThanks, committed.
Comment #7
(not verified) CreditAttribution: commented