From d71ad7c2a7f94c87eead060cda41389a0b6dfbcb Mon Sep 17 00:00:00 2001 From: zonky2 Date: Sat, 24 Feb 2024 15:48:34 +0100 Subject: [PATCH] Add check get category --- src/EventListener/NewsListener.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/EventListener/NewsListener.php b/src/EventListener/NewsListener.php index 5855e5f..6ef025c 100644 --- a/src/EventListener/NewsListener.php +++ b/src/EventListener/NewsListener.php @@ -3,7 +3,7 @@ /* * News Categories bundle for Contao Open Source CMS. * - * @copyright Copyright (c) 2017, Codefog + * @copyright Copyright (c) 2017-2024, Codefog * @author Codefog * @license MIT */ @@ -69,6 +69,10 @@ public function onNewsListCountItems(array $archives, $featured, ModuleNewsList */ public function onNewsListFetchItems(array $archives, $featured, $limit, $offset, ModuleNewsList $module) { + if (empty(Input::get('category'))) { + return false; + } + if (null === ($criteria = $this->getCriteria($archives, $featured, $module))) { return null; }