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.
API page: http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...
Describe the problem you have found:
The return values is documented as:
An structured array containing the individual elements of the node's body.
But the code disagrees:
$node->body = isset($node->body) ? str_replace('<!--break-->', '', $node->body) : '';
//...
return $node;
We're really returning a node withe the node's content property containing an array of structured data. See hook_view() for more details.
Comment | File | Size | Author |
---|---|---|---|
#9 | node_build_content-1095066-9.patch | 603 bytes | barbi |
#7 | node_build_content-1095066-7.patch | 602 bytes | barbi |
#3 | node_build_content-1095066.patch | 507 bytes | barbi |
Comments
Comment #1
jhodgdonThat is true, and it should be fixed. This is a Drupal 6 problem only -- in D7 the function doesn't return anything (it modifies $node in place).
Agreed with the "Novice" tag. Should be a good project for a novice doc contributor.
Comment #2
barbi CreditAttribution: barbi commentedComment #3
barbi CreditAttribution: barbi commentedChanged return to "A fully-populated node object."
Comment #4
dawehnernode_load does the same see
so the patch is fine.
Congratulations on your first patch.
@barbi: Critical means that something is really really broken. For example a white screen of death.
Set back to normal again.
Comment #5
Gábor HojtsyWell, node_build_content() is only one of the functions that is being used to build up the "fully-populated node object", so I'd not say it builds a fully populated node object. Yes, that is what node_load() does. We should be more specific here and say what it builds.
Comment #6
barbi CreditAttribution: barbi commentedFollow up:
Can you please suggest a good description?
Comment #7
barbi CreditAttribution: barbi commentedModified the description to
* An node object with its content property set to structured array
* containing the individual elements of the node's body.
Comment #8
jhodgdonAn node -> A node
set to structured array -> set to a structured array
Other than that, excellent...
Comment #9
barbi CreditAttribution: barbi commentedSorry for the multiple iterations. Made the two corrections mentioned in #8.
Comment #10
jhodgdonThat looks good to me. And don't worry about multiple iterations -- most issues in Drupal core go through many. This is nothing. :)
Comment #11
Gábor HojtsyThanks for the improvements, committed.