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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Title: Documentation problem with node_build_content » node_build_content return value doc is wrong

That 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.

barbi’s picture

Assigned: Unassigned » barbi
barbi’s picture

Priority: Normal » Critical
Status: Active » Needs review
FileSize
507 bytes

Changed return to "A fully-populated node object."

dawehner’s picture

Priority: Critical » Normal
Status: Needs review » Reviewed & tested by the community

node_load does the same see


 * @return
 *   A fully-populated node object.
 */
function node_load($param = array(), $revision = NULL, $reset = NULL) {

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.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Well, 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.

barbi’s picture

Follow up:
Can you please suggest a good description?

barbi’s picture

Status: Needs work » Needs review
FileSize
602 bytes

Modified the description to
* An node object with its content property set to structured array
* containing the individual elements of the node's body.

jhodgdon’s picture

Status: Needs review » Needs work

An node -> A node
set to structured array -> set to a structured array

Other than that, excellent...

barbi’s picture

Status: Needs work » Needs review
FileSize
603 bytes

Sorry for the multiple iterations. Made the two corrections mentioned in #8.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

That looks good to me. And don't worry about multiple iterations -- most issues in Drupal core go through many. This is nothing. :)

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the improvements, committed.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.