From 8e7e3a24fbfe463fdfc918129533c531cec270e1 Mon Sep 17 00:00:00 2001
From: Kevin Ditscheid <kevin.ditscheid@sgalinski.de>
Date: Tue, 29 Jan 2019 11:47:00 +0100
Subject: [PATCH] [BUGFIX] Remove sys_language_uid from pages where-clause in 8
 LTS

---
 Classes/Utility/BackendNewsUtility.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Classes/Utility/BackendNewsUtility.php b/Classes/Utility/BackendNewsUtility.php
index 99d9277..6958469 100644
--- a/Classes/Utility/BackendNewsUtility.php
+++ b/Classes/Utility/BackendNewsUtility.php
@@ -90,9 +90,13 @@ class BackendNewsUtility {
 	 */
 	public static function getAlternativePageOptions(): array {
 		$options = [];
+		$andWhere = ' AND sys_language_uid IN (0,-1)';
+		if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '9.0.0', '<')) {
+			$andWhere = '';
+		}
 		/** @var array $rootOptionRows */
 		$rootOptionRows = self::getRecordsByField(
-			'pages', 'is_siteroot', 1, ' AND sys_language_uid IN (0,-1)', '', 'sorting'
+			'pages', 'is_siteroot', 1, $andWhere, '', 'sorting'
 		);
 		if ($rootOptionRows) {
 			foreach ($rootOptionRows as $row) {
-- 
GitLab