mirror of
https://github.com/flarum/core.git
synced 2025-08-03 15:07:53 +02:00
Fix subsequent pages of results not working properly
This commit is contained in:
@@ -69,7 +69,7 @@ class PinStickiedDiscussionsToTop
|
|||||||
if (empty($gambits)) {
|
if (empty($gambits)) {
|
||||||
$sticky = clone $query;
|
$sticky = clone $query;
|
||||||
$sticky->where('is_sticky', true);
|
$sticky->where('is_sticky', true);
|
||||||
$sticky->limit = $sticky->offset = $sticky->orders = null;
|
$sticky->orders = null;
|
||||||
|
|
||||||
$query->union($sticky);
|
$query->union($sticky);
|
||||||
|
|
||||||
@@ -89,6 +89,9 @@ class PinStickiedDiscussionsToTop
|
|||||||
$query->unionOrders = array_merge($query->unionOrders, $query->orders);
|
$query->unionOrders = array_merge($query->unionOrders, $query->orders);
|
||||||
$query->unionLimit = $query->limit;
|
$query->unionLimit = $query->limit;
|
||||||
$query->unionOffset = $query->offset;
|
$query->unionOffset = $query->offset;
|
||||||
|
|
||||||
|
$query->limit = $sticky->limit = $query->offset + $query->limit;
|
||||||
|
$query->offset = $sticky->offset = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user