Show people "liked this" link not show users if users not upload avatar.
In file heartbeat/modules/heartbeat_plugins/includes/heartbeatflagplugin.inc, I found this:

$result = db_query("SELECT u.name, files.uri, f.uid FROM {file_managed} files INNER JOIN {users} u ON u.picture = files.fid INNER JOIN {flag_content} f ON f.uid = u.uid WHERE content_id = :uaid AND content_type = 'heartbeat_activity' ", array(':uaid' => $uaid));

Query above isn't select users if user haven't picture. How to fix this issue?

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

duynguyen’s picture

My solution is change INNER JOIN users and file_managed to LEFT JOIN

$result = db_query("SELECT u.name, files.uri, f.uid FROM {users} u LEFT JOIN {file_managed} files ON u.picture = files.fid INNER JOIN {flag_content} f ON f.uid = u.uid WHERE content_id = :uaid AND content_type = 'heartbeat_activity' ", array(':uaid' => $uaid));
thehong’s picture

Duy, you please provide patch.

duynguyen’s picture

Status: Active » Needs review
FileSize
996 bytes

This my patch

duynguyen’s picture

Issue summary: View changes

updte description