Skip to content
Snippets Groups Projects
Commit 6e507d4c authored by Peter Rotich's avatar Peter Rotich
Browse files

locks: Exclude expired locks via constrain

Fixes a bug where a lock icon is shown on tickets listing even when the lock
in question is expired.
parent 934cde36
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,11 @@ if (!$thisstaff->hasPerm(SearchBackend::PERM_EVERYTHING)) {
$tickets->filter(Q::any($visibility));
}
$tickets->constrain(array('lock' => array(
'lock__expire__gt' => SqlFunction::NOW())));
$tickets->annotate(array(
'collab_count' => SqlAggregate::COUNT('thread__collaborators', true),
'attachment_count' => SqlAggregate::COUNT(SqlCase::N()
......
......@@ -319,6 +319,11 @@ $tickets->annotate(array(
->aggregate(array('count' => SqlAggregate::COUNT('entries__id'))),
));
// Make sure we're only getting active locks
$tickets->constrain(array('lock' => array(
'lock__expire__gt' => SqlFunction::NOW())));
?>
<!-- SEARCH FORM START -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment