Commit e61d892f authored by catch's avatar catch

Issue #1844146 by Berdir: Fixed comment_load() call in...

Issue #1844146 by Berdir: Fixed comment_load() call in template_preprocess_comment() re-loads comment parent entities because of disabled static cache.
parent e87beb03
......@@ -1354,8 +1354,7 @@ function comment_delete_multiple($cids) {
* @param array $cids
* (optional) An array of entity IDs. If omitted, all entities are loaded.
* @param bool $reset
* Whether to reset the internal static entity cache. Note that the static
* cache is disabled by default.
* (optional) Whether to reset the internal static entity cache.
*
* @return array
* An array of comment objects, indexed by comment ID.
......@@ -1373,14 +1372,13 @@ function comment_load_multiple(array $cids = NULL, $reset = FALSE) {
* @param int $cid
* The ID of the comment to be loaded.
* @param bool $reset
* Whether to reset the internal static entity cache. Note that the static
* cache is disabled by default.
* (optional) Whether to reset the internal static entity cache.
*
* @return
* The comment object.
*/
function comment_load($cid, $reset = FALSE) {
return entity_load('comment', $cid);
return entity_load('comment', $cid, $reset);
}
/**
......
......@@ -33,7 +33,6 @@
* uri_callback = "comment_uri",
* fieldable = TRUE,
* translatable = TRUE,
* static_cache = FALSE,
* route_base_path = "admin/structure/types/manage/{bundle}/comment",
* bundle_prefix = "comment_node_",
* entity_keys = {
......
......@@ -146,7 +146,7 @@ function postComment($node, $comment, $subject = '', $contact = NULL) {
}
if (isset($match[1])) {
$entity = comment_load($match[1]);
$entity = comment_load($match[1], TRUE);
return $entity;
}
}
......
......@@ -327,7 +327,7 @@ function testUserDelete() {
$this->assertFalse(node_load($node->nid, TRUE), 'Node of the user has been deleted.');
$this->assertFalse(node_revision_load($revision), 'Node revision of the user has been deleted.');
$this->assertTrue(node_load($revision_node->nid, TRUE), "Current revision of the user's node was not deleted.");
$this->assertFalse(comment_load($comment->id()), 'Comment of the user has been deleted.');
$this->assertFalse(comment_load($comment->id(), TRUE), 'Comment of the user has been deleted.');
// Confirm that the confirmation message made it through to the end user.
$this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), "Confirmation message displayed to user.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment