X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/2700/head:/app/Actions/ViewService.php diff --git a/app/Actions/ViewService.php b/app/Actions/ViewService.php index 51a60d96e..f04384536 100644 --- a/app/Actions/ViewService.php +++ b/app/Actions/ViewService.php @@ -65,7 +65,7 @@ class ViewService { $skipCount = $count * $page; $query = $this->permissionService - ->filterRestrictedEntityRelations($this->view, 'views', 'viewable_id', 'viewable_type', $action) + ->filterRestrictedEntityRelations($this->view->newQuery(), 'views', 'viewable_id', 'viewable_type', $action) ->select('*', 'viewable_id', 'viewable_type', DB::raw('SUM(views) as view_count')) ->groupBy('viewable_id', 'viewable_type') ->orderBy('view_count', 'desc');