mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
References: Fixed references count/list recycle bin interaction
Count and reference list would get references then attempt to load entities, which could fail to load if in the recycle bin. This updates the queries to effectively ignore references for items we can't see (in recycle bin). Added test to cover. For #4918
This commit is contained in:
@ -41,7 +41,8 @@ class ReferenceFetcher
|
||||
{
|
||||
$baseQuery = Reference::query()
|
||||
->where('to_type', '=', $entity->getMorphClass())
|
||||
->where('to_id', '=', $entity->id);
|
||||
->where('to_id', '=', $entity->id)
|
||||
->whereHas('from');
|
||||
|
||||
return $this->permissions->restrictEntityRelationQuery(
|
||||
$baseQuery,
|
||||
|
Reference in New Issue
Block a user