From 24ccb3e831a3025436c2dbace7e6d8845999526e Mon Sep 17 00:00:00 2001
From: Torsten Oppermann <torsten@sgalinski.de>
Date: Fri, 22 Dec 2017 11:37:20 +0100
Subject: [PATCH] [TASK] Fixing a bug with the teasers

---
 Classes/Service/FrontendFilterService.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Classes/Service/FrontendFilterService.php b/Classes/Service/FrontendFilterService.php
index 374ca864..8126955f 100644
--- a/Classes/Service/FrontendFilterService.php
+++ b/Classes/Service/FrontendFilterService.php
@@ -28,6 +28,8 @@ namespace SGalinski\SgJobs\Service;
 
 use SGalinski\SgJobs\Domain\Repository\JobRepository;
 use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
+use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 
@@ -59,6 +61,12 @@ class FrontendFilterService {
 				, $queryBuilder->expr()->eq('a.company', 'b.uid')
 			);
 
+		$queryBuilder
+			->getRestrictions()
+			->removeAll()
+			->add(GeneralUtility::makeInstance(DeletedRestriction::class))
+			->add(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
+
 		if ($filters['filterCountry'] !== '0' && $filters['filterCountry'] !== NULL) {
 			$statement->andWhere(
 				$queryBuilder->expr()->eq(
-- 
GitLab