Closed (fixed)
Project:
Fusion
Version:
6.x-1.0-rc1
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
4 Jul 2010 at 06:30 UTC
Updated:
18 Jul 2010 at 22:40 UTC
fusion_core_preprocess_comment() makes the following call to node_load()
$node = node_load($vars['comment']->nid); // Comment is by node author
$vars['author_comment'] = ($vars['comment']->uid == $node->uid) ? TRUE : FALSE;
$comment_classes[] = ($vars['author_comment']) ? 'comment-by-author' : '';
This is an unnecessary performance drain as the node object is already loaded in the comment variables. My proposed change is:
$vars['author_comment'] = ($vars['comment']->uid == $vars['node']->uid) ? TRUE : FALSE; // Comment is by node author
$comment_classes[] = ($vars['author_comment']) ? 'comment-by-author' : '';
Comments
Comment #1
sociotech commenteddylan,
Good catch. I committed the fix to CVS. It will show up in the next dev snapshot and the upcoming 1.0 release.
Thanks.