summaryrefslogtreecommitdiff
path: root/modules/forum
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-11 17:44:47 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-11 17:44:47 +0000
commit7562a8efb36306e96bf4d13b1f97b4573809ab45 (patch)
tree998dfd1d27d9c1a691a83a0c0e37d783d4fc4a44 /modules/forum
parent52195a6b1dd478875a93935df27d7bcacb14f289 (diff)
downloadbrdo-7562a8efb36306e96bf4d13b1f97b4573809ab45.tar.gz
brdo-7562a8efb36306e96bf4d13b1f97b4573809ab45.tar.bz2
#707724 by chx: Rename confusing arguments in field/entity APIs.
Diffstat (limited to 'modules/forum')
-rw-r--r--modules/forum/forum.module42
1 files changed, 21 insertions, 21 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 64bb5f5a8..e21217204 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -495,19 +495,19 @@ function forum_comment_delete($comment) {
/**
* Implements hook_field_storage_pre_insert().
*/
-function forum_field_storage_pre_insert($obj_type, $object, &$skip_fields) {
- if ($obj_type == 'node' && $object->status && _forum_node_check_node_type($object)) {
+function forum_field_storage_pre_insert($entity_type, $entity, &$skip_fields) {
+ if ($entity_type == 'node' && $entity->status && _forum_node_check_node_type($entity)) {
$query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp'));
- foreach ($object->taxonomy_forums as $language) {
+ foreach ($entity->taxonomy_forums as $language) {
foreach ($language as $item) {
$query->values(array(
- 'nid' => $object->nid,
- 'title' => $object->title,
+ 'nid' => $entity->nid,
+ 'title' => $entity->title,
'tid' => $item['tid'],
- 'sticky' => $object->sticky,
- 'created' => $object->created,
+ 'sticky' => $entity->sticky,
+ 'created' => $entity->created,
'comment_count' => 0,
- 'last_comment_timestamp' => $object->created,
+ 'last_comment_timestamp' => $entity->created,
));
}
}
@@ -518,37 +518,37 @@ function forum_field_storage_pre_insert($obj_type, $object, &$skip_fields) {
/**
* Implements hook_field_storage_pre_update().
*/
-function forum_field_storage_pre_update($obj_type, $object, &$skip_fields) {
+function forum_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
$first_call = &drupal_static(__FUNCTION__, array());
- if ($obj_type == 'node' && $object->status && _forum_node_check_node_type($object)) {
+ if ($entity_type == 'node' && $entity->status && _forum_node_check_node_type($entity)) {
// We don't maintain data for old revisions, so clear all previous values
// from the table. Since this hook runs once per field, per object, make
// sure we only wipe values once.
- if (!isset($first_call[$object->nid])) {
- $first_call[$object->nid] = FALSE;
- db_delete('forum_index')->condition('nid', $object->nid)->execute();
+ if (!isset($first_call[$entity->nid])) {
+ $first_call[$entity->nid] = FALSE;
+ db_delete('forum_index')->condition('nid', $entity->nid)->execute();
}
// Only save data to the table if the node is published.
- if ($object->status) {
+ if ($entity->status) {
$query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp'));
- foreach ($object->taxonomy_forums as $language) {
+ foreach ($entity->taxonomy_forums as $language) {
foreach ($language as $item) {
$query->values(array(
- 'nid' => $object->nid,
- 'title' => $object->title,
+ 'nid' => $entity->nid,
+ 'title' => $entity->title,
'tid' => $item['tid'],
- 'sticky' => $object->sticky,
- 'created' => $object->created,
+ 'sticky' => $entity->sticky,
+ 'created' => $entity->created,
'comment_count' => 0,
- 'last_comment_timestamp' => $object->created,
+ 'last_comment_timestamp' => $entity->created,
));
}
}
$query->execute();
// The logic for determining last_comment_count is fairly complex, so
// call _forum_update_forum_index() too.
- _forum_update_forum_index($object->nid);
+ _forum_update_forum_index($entity->nid);
}
}
}