Postgres requires the SQL Statements with GROUP BY to be changed, the current SQL leads to error messages.

The changes are minor ones (just all the fields from WHERE have to be added to GROUP BY)
in function userlink_page_everyone()
$sql = 'SELECT u.uid AS uid, u.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {userlink} ul ON n.vid = ul.vid INNER JOIN {users} u ON n.uid = u.uid GROUP BY u.uid';
has to be changed to
$sql = 'SELECT u.uid AS uid, u.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {userlink} ul ON n.vid = ul.vid INNER JOIN {users} u ON n.uid = u.uid GROUP BY u.uid, u.name';

in function userlink_page_category()
$sql = "SELECT tn.tid AS tid, td.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE n.type = 'userlink' AND n.uid = $uid GROUP BY tn.tid";
has to be
$sql = "SELECT tn.tid AS tid, td.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE n.type = 'userlink' AND n.uid = $uid GROUP BY tn.tid, td.name";

$sql = "SELECT tn.tid AS tid, td.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE n.type = 'userlink' GROUP BY tn.tid";
has to be
$sql = "SELECT tn.tid AS tid, td.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE n.type = 'userlink' GROUP BY tn.tid, td.name";

in function userlink_block
$block['content'] = userlink_category_list(db_query_range(db_rewrite_sql("SELECT tn.tid AS tid, td.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE n.type = 'userlink' GROUP BY tn.tid ORDER BY numlinks DESC"), 0, 10));
has to be
$block['content'] = userlink_category_list(db_query_range(db_rewrite_sql("SELECT tn.tid AS tid, td.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE n.type = 'userlink' GROUP BY tn.tid, td.name ORDER BY numlinks DESC"), 0, 10));

$block['content'] = userlink_category_list(db_query_range(db_rewrite_sql("SELECT tn.tid AS tid, td.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE n.uid = $uid AND n.type = 'userlink' GROUP BY tn.tid ORDER BY numlinks DESC"), 0, 5), $uid, $name);
has to be
$block['content'] = userlink_category_list(db_query_range(db_rewrite_sql("SELECT tn.tid AS tid, td.name AS name, COUNT(*) AS numlinks FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE n.uid = $uid AND n.type = 'userlink' GROUP BY tn.tid, td.name ORDER BY numlink DESC"), 0, 5), $uid, $name);

Thanks,
Reinhard

Comments

Pomliane’s picture

Status: Active » Closed (won't fix)

This version of userlink is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.