Commit 24dfdf8f authored by Yuliya Bozhko's avatar Yuliya Bozhko Committed by Aaron Wells
Browse files

Fix for comments pagination with showcomment option (Bug #1384529)



Change-Id: If5991307ca8065c48f1309bcfc37f62df0dd12a5
Signed-off-by: default avatarYuliya Bozhko <yuliya.bozhko@totaralms.com>
parent e3f6f83d
......@@ -381,7 +381,8 @@ class ArtefactTypeComment extends ArtefactType {
ORDER BY a.ctime', array($showcomment));
$last = end($ids);
if ($last == $showcomment) {
$rank = key($ids);
// Add 1 because array index starts from 0 and therefore key value is offset by 1.
$rank = key($ids) + 1;
$result->forceoffset = $offset = ((ceil($rank / $limit) - 1) * $limit);
$result->showcomment = $showcomment;
}
......
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