From a729a8eddbf96d94d4fb9325559a48078bdc1136 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 3 Jan 2022 20:37:22 +0000 Subject: [PATCH] [COMPONENT][Collection] Pass current actor and their top language to query, if not otherwise specified --- components/Collection/Util/Controller/Collection.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/Collection/Util/Controller/Collection.php b/components/Collection/Util/Controller/Collection.php index ca605c65a8..3ab7bf7514 100644 --- a/components/Collection/Util/Controller/Collection.php +++ b/components/Collection/Util/Controller/Collection.php @@ -5,12 +5,16 @@ declare(strict_types = 1); namespace Component\Collection\Util\Controller; use App\Core\Controller; +use App\Entity\Actor; +use App\Util\Common; use Component\Feed\Feed; class Collection extends Controller { public function query(string $query, ?string $language = null, ?Actor $actor = null) { + $actor ??= Common::actor(); + $language ??= $actor->getTopLanguage()->getLocale(); return Feed::query($query, $this->int('page') ?? 1, $language, $actor); } }