diff --git a/web/sites/all/modules/privatemsg/privatemsg.module b/web/sites/all/modules/privatemsg/privatemsg.module index bf4e5e3..65e841a 100755 --- a/web/sites/all/modules/privatemsg/privatemsg.module +++ b/web/sites/all/modules/privatemsg/privatemsg.module @@ -522,7 +522,7 @@ function privatemsg_thread_load($thread_id, $account = NULL, $start = NULL, $use $conditions['account'] = $account; } - // #2033161 privatemsg_message_load_multiple will load all threads if empty + // #2033161 privatemsg_message_load_multiple will load all threads if empty. $ids = $query->execute()->fetchCol(); if (count($ids)) { $thread['messages'] = privatemsg_message_load_multiple($ids, $conditions); diff --git a/web/sites/all/modules/privatemsg/privatemsg.test b/web/sites/all/modules/privatemsg/privatemsg.test index 33cd243..f7d0a72 100644 --- a/web/sites/all/modules/privatemsg/privatemsg.test +++ b/web/sites/all/modules/privatemsg/privatemsg.test @@ -85,6 +85,10 @@ class PrivatemsgTestCase extends PrivatemsgBaseTestCase { $subject = $this->randomName(20); $body = $this->randomName(50); + // Because of a quirk in the entity_load function, $no_recipient should be involved in another, unrelated thread. + // see https://drupal.org/node/2033161 + $unrelated = privatemsg_new_thread(array($no_recipient), $subject, $body, array('author' => $author)); + $response = privatemsg_new_thread(array($recipient), $subject, $body, array('author' => $author)); $this->drupalLogin($user_no_read_msg);