summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-03-05 13:41:04 +0000
committerDries Buytaert <dries@buytaert.net>2010-03-05 13:41:04 +0000
commit72df65d1e009137b57132739de68936c9395dca6 (patch)
tree460cc16ef0b8d2efd27be113f819a134cac93eb6 /modules/comment
parentd058394cf373ca3529ff169db148478fa30aa414 (diff)
downloadbrdo-72df65d1e009137b57132739de68936c9395dca6.tar.gz
brdo-72df65d1e009137b57132739de68936c9395dca6.tar.bz2
- Patch #731426 by fago: recursed entity loading didn't work.
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.module20
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index a150d2188..f72fad9ca 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1602,17 +1602,19 @@ function comment_load($cid) {
* special handling for comment objects.
*/
class CommentController extends DrupalDefaultEntityController {
- protected function buildQuery() {
- parent::buildQuery();
+
+ protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {
+ $query = parent::buildQuery($ids, $conditions, $revision_id);
// Specify additional fields from the user and node tables.
- $this->query->innerJoin('node', 'n', 'base.nid = n.nid');
- $this->query->addField('n', 'type', 'node_type');
- $this->query->innerJoin('users', 'u', 'base.uid = u.uid');
- $this->query->addField('u', 'name', 'registered_name');
- $this->query->fields('u', array('uid', 'signature', 'picture', 'data'));
+ $query->innerJoin('node', 'n', 'base.nid = n.nid');
+ $query->addField('n', 'type', 'node_type');
+ $query->innerJoin('users', 'u', 'base.uid = u.uid');
+ $query->addField('u', 'name', 'registered_name');
+ $query->fields('u', array('uid', 'signature', 'picture', 'data'));
+ return $query;
}
- protected function attachLoad(&$comments) {
+ protected function attachLoad(&$comments, $revision_id = FALSE) {
// Setup standard comment properties.
foreach ($comments as $key => $comment) {
$comment = drupal_unpack($comment);
@@ -1621,7 +1623,7 @@ class CommentController extends DrupalDefaultEntityController {
$comment->node_type = 'comment_node_' . $comment->node_type;
$comments[$key] = $comment;
}
- parent::attachLoad($comments);
+ parent::attachLoad($comments, $revision_id);
}
}