Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1119 diff -u -r1.1119 node.module --- modules/node/node.module 5 Sep 2009 06:53:01 -0000 1.1119 +++ modules/node/node.module 6 Sep 2009 08:59:44 -0000 @@ -784,7 +784,11 @@ * Whether to reset the node_load_multiple cache. * * @return - * A fully-populated node object. + * A fully-populated node object representing the first matching node if one + * is found, or boolean FALSE otherwise. + * In case the array form for $param is used and does not uniquely specify a + * node, the first matching node will be returned, and can vary from one call + * to the next. */ function node_load($nid, $vid = array(), $reset = FALSE) { $vid = isset($vid) ? array('vid' => $vid) : NULL; @@ -1328,7 +1332,7 @@ $form['content_ranking']['info'] = array( '#value' => '' . t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') . '' ); - + // Note: reversed to reflect that higher number = higher ranking. $options = drupal_map_assoc(range(0, 10)); foreach (module_invoke_all('ranking') as $var => $values) { @@ -1353,7 +1357,7 @@ ->condition('n.status', 1) ->addTag('node_access') ->searchExpression($keys, 'node'); - + // Insert special keywords. $query->setOption('type', 'n.type'); $query->setOption('language', 'n.language'); @@ -1364,10 +1368,10 @@ if (!$query->executeFirstPass()) { return array(); } - + // Add the ranking expressions. _node_rankings($query); - + // Add a count query. $inner_query = clone $query; $count_query = db_select($inner_query->fields('i', array('sid'))); @@ -1376,7 +1380,7 @@ $find = $query ->limit(10) ->execute(); - + // Load results. $results = array(); foreach ($find as $item) { @@ -1384,14 +1388,14 @@ $node = node_load($item->sid); $node = node_build_content($node, 'search_result'); $node->rendered = drupal_render($node->content); - + // Fetch comments for snippet. $node->rendered .= ' ' . module_invoke('comment', 'node_update_index', $node); // Fetch terms for snippet. $node->rendered .= ' ' . module_invoke('taxonomy', 'node_update_index', $node); - + $extra = module_invoke_all('node_search_result', $node); - + $results[] = array( 'link' => url('node/' . $item->sid, array('absolute' => TRUE)), 'type' => check_plain(node_type_get_name($node)),