summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.api.php2
-rw-r--r--modules/node/node.install5
-rw-r--r--modules/node/node.module17
3 files changed, 16 insertions, 8 deletions
diff --git a/modules/node/node.api.php b/modules/node/node.api.php
index 90ffd8b7f..bc2eb65b1 100644
--- a/modules/node/node.api.php
+++ b/modules/node/node.api.php
@@ -1022,7 +1022,7 @@ function hook_node_type_delete($info) {
*/
function hook_delete($node) {
db_delete('mytable')
- ->condition('nid', $nid->nid)
+ ->condition('nid', $node->nid)
->execute();
}
diff --git a/modules/node/node.install b/modules/node/node.install
index 852c1117b..2498091fc 100644
--- a/modules/node/node.install
+++ b/modules/node/node.install
@@ -476,7 +476,7 @@ function _update_7000_node_get_types() {
$extra_types = array_diff($all_types, array_keys($node_types));
foreach ($extra_types as $type) {
- $type_object = new stdClass;
+ $type_object = new stdClass();
$type_object->type = $type;
// In Drupal 6, whether you have a body field or not is a flag in the node
@@ -610,7 +610,6 @@ function node_update_7006(&$sandbox) {
'module' => 'text',
'cardinality' => 1,
'entity_types' => array('node'),
- 'translatable' => TRUE,
);
_update_7000_field_create_field($body_field);
@@ -628,6 +627,8 @@ function node_update_7006(&$sandbox) {
'entity_type' => 'node',
'bundle' => $node_type->type,
'label' => $node_type->body_label,
+ 'description' => isset($node_type->description) ? $node_type->description : '',
+ 'required' => (isset($node_type->min_word_count) && $node_type->min_word_count > 0) ? 1 : 0,
'widget' => array(
'type' => 'text_textarea_with_summary',
'settings' => array(
diff --git a/modules/node/node.module b/modules/node/node.module
index 66e93c737..6c32a2799 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -558,7 +558,6 @@ function node_add_body_field($type, $label = 'Body') {
'field_name' => 'body',
'type' => 'text_with_summary',
'entity_types' => array('node'),
- 'translatable' => TRUE,
);
$field = field_create_field($field);
}
@@ -1404,11 +1403,13 @@ function node_show($node, $message = FALSE) {
drupal_set_title(t('Revision of %title from %date', array('%title' => $node->title, '%date' => format_date($node->revision_timestamp))), PASS_THROUGH);
}
+ // For markup consistency with other pages, use node_view_multiple() rather than node_view().
+ $nodes = node_view_multiple(array($node->nid => $node), 'full');
+
// Update the history table, stating that this user viewed this node.
node_tag_new($node);
- // For markup consistency with other pages, use node_view_multiple() rather than node_view().
- return node_view_multiple(array($node->nid => $node), 'full');
+ return $nodes;
}
/**
@@ -2159,7 +2160,7 @@ function node_block_save($delta = '', $edit = array()) {
}
/**
- * Find the most recent nodes that are available to the current user.
+ * Finds the most recently changed nodes that are available to the current user.
*
* @param $number
* (optional) The maximum number of nodes to find. Defaults to 10.
@@ -2415,7 +2416,10 @@ function node_block_list_alter(&$blocks) {
}
/**
- * A generic function for generating RSS feeds from a set of nodes.
+ * Generates and prints an RSS feed.
+ *
+ * Generates an RSS feed from an array of node IDs, and prints it with an HTTP
+ * header, with Content Type set to RSS/XML.
*
* @param $nids
* An array of node IDs (nid). Defaults to FALSE so empty feeds can be
@@ -3337,6 +3341,9 @@ function node_access_acquire_grants($node, $delete = TRUE) {
* node_access can use this function when doing mass updates due to widespread
* permission changes.
*
+ * Note: Don't call this function directly from a contributed module. Call
+ * node_access_acquire_grants() instead.
+ *
* @param $node
* The $node being written to. All that is necessary is that it contains a
* nid.