diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-03-05 13:41:04 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-03-05 13:41:04 +0000 |
commit | 72df65d1e009137b57132739de68936c9395dca6 (patch) | |
tree | 460cc16ef0b8d2efd27be113f819a134cac93eb6 /modules/comment | |
parent | d058394cf373ca3529ff169db148478fa30aa414 (diff) | |
download | brdo-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.module | 20 |
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); } } |