Closed (fixed)
Project:
Flag Friend
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 May 2012 at 21:54 UTC
Updated:
4 Jan 2014 at 02:05 UTC
Jump to comment: Most recent
I noticed that when accessing as anonymous user the function
function flag_friend_preprocess_author_pane(&$variables) {
global $user;
$account_id = $variables['account']->uid;
$image_path = $variables['image_path'];
// Accessing the user profile is the only way to be able to see the friend
// flag out-of-the-box so I feel it's pretty safe to use this permisssion.
if ($account_id != 0 && user_access('access user profiles') && $user->uid != $account_id) {
[...]
Just checks if the user owner of the Pane is registered.
This performs unnecessary queries when rendering pages to anonymous users.
This should be:
// Accessing the user profile is the only way to be able to see the friend
// flag out-of-the-box so I feel it's pretty safe to use this permission.
if ($account_id != 0 && $user->uid != 0 && user_access('access user profiles') && $user->uid != $account_id) {
[...]
Comments
Comment #1
sirkitree commentedThanks, fixed in dev
http://drupalcode.org/project/flag_friend.git/commit/42ed39a