From 0b9e9895a1f6f465cecb7bd46ddca51592dcd505 Mon Sep 17 00:00:00 2001 From: Eric Gesemann Date: Tue, 12 Mar 2024 14:31:53 +0100 Subject: [PATCH] fix getTagModel return type --- src/Util/FormatterUtil.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Util/FormatterUtil.php b/src/Util/FormatterUtil.php index c6460b4d..27f896cd 100644 --- a/src/Util/FormatterUtil.php +++ b/src/Util/FormatterUtil.php @@ -10,6 +10,7 @@ use Contao\DataContainer; use Contao\Date; use Contao\Environment; +use Contao\Model; use Contao\StringUtil as Str; use Contao\System; use Contao\Validator; @@ -168,7 +169,7 @@ function (array|string|null $v) use ( } } - if ($inputType === 'cfgTags' && $tagModel = $this->getTagModel()) + if ($inputType === 'cfgTags' && ($tagModel = $this->getTagModel())) { $collection = $tagModel->findBy(['source=?', 'id = ?'], [$data['eval']['tagsManager'], $value]); $value = null; @@ -242,7 +243,7 @@ private function prepareServices(): array return [$system, $controller]; } - private function getTagModel(): ?TagModel + private function getTagModel(): ?Model { if (class_exists(TagModel::class)) { return $this->framework->getAdapter(TagModel::class);