Gitlab@AEI Hannover will go down for maintenance on 2020-09-21 at 4:00 UTC. The service will be unavailable for up to 24 hours. If you have questions about this please contact atlas_admin@aei.mpg.de

Commit de0bac0e authored by Oliver Behnke's avatar Oliver Behnke

Drupal: fixed regression in df966c74

* The original commit fixed the goto/pagination for admins/mods but broke it for regular users
* We need to handle *both* user groups differently (i.e. conditionally include hidden comments)
parent e5c69dc7
......@@ -1668,11 +1668,17 @@ function boinccore_url_pagination_handler($type, $object_id = NULL) {
if ($comment_order == COMMENT_ORDER_NEWEST_FIRST) {
$gt_lt = '>';
}
// don't filter hidden comments for admins/mods
$include_hidden = '';
if (in_array('administrator', array_values($user->roles)) ||
in_array('moderator', array_values($user->roles))) {
$include_hidden = 'OR status = 1';
}
// See how many comments there are before (or after) this comment...
$comment_offset = db_result(db_query('
SELECT COUNT(*) FROM {comments}
WHERE nid = %d AND (status = 0 OR status = 1) AND timestamp %s %d',
$object->nid, $gt_lt, $object->timestamp));
WHERE nid = %d AND (status = 0 %s) AND timestamp %s %d',
$object->nid, $include_hidden, $gt_lt, $object->timestamp));
if ($comment_offset) {
// Get the number of comments per page
if ($user->comments_per_page) {
......
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