From 78553ccd43d8fd0b410b1145a186a1be6cadf009 Mon Sep 17 00:00:00 2001
From: Georgi Mateev <gmateev@exactag.com>
Date: Fri, 13 Aug 2021 17:29:43 +0300
Subject: [PATCH] [BUGFIX] Fixed missing key message

---
 Classes/Controller/RouteController.php | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/Classes/Controller/RouteController.php b/Classes/Controller/RouteController.php
index 466cc35..2f80bc4 100644
--- a/Classes/Controller/RouteController.php
+++ b/Classes/Controller/RouteController.php
@@ -53,7 +53,6 @@ use TYPO3\CMS\Core\Messaging\AbstractMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Site\SiteFinder;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\VersionNumberUtility;
 use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
 use TYPO3\CMS\Extbase\Mvc\Exception\StopActionException;
 use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
@@ -612,25 +611,25 @@ class RouteController extends ActionController {
 				LocalizationUtility::translate('backend.licenseKey.isInDemoMode.header', 'sg_routes'),
 				AbstractMessage::INFO
 			);
-		} elseif (!$hasValidLicense) {
+		} elseif ($keyState === DemoModeService::STATE_LICENSE_NOT_SET) {
 			$description = LocalizationUtility::translate(
-				'backend.licenseKey.invalid.descriptionTYPO3-9', 'sg_routes'
+				'backend.licenseKey.notSet.descriptionTYPO3-9', 'sg_routes'
 			);
 
 			$this->addFlashMessage(
 				$description,
-				LocalizationUtility::translate('backend.licenseKey.invalid.header', 'sg_routes'),
-				AbstractMessage::ERROR
+				LocalizationUtility::translate('backend.licenseKey.notSet.header', 'sg_routes'),
+				AbstractMessage::WARNING
 			);
-		} elseif ($keyState === DemoModeService::STATE_LICENSE_NOT_SET) {
+		} elseif (!$hasValidLicense) {
 			$description = LocalizationUtility::translate(
-				'backend.licenseKey.notSet.descriptionTYPO3-9', 'sg_routes'
+				'backend.licenseKey.invalid.descriptionTYPO3-9', 'sg_routes'
 			);
 
 			$this->addFlashMessage(
 				$description,
-				LocalizationUtility::translate('backend.licenseKey.notSet.header', 'sg_routes'),
-				AbstractMessage::WARNING
+				LocalizationUtility::translate('backend.licenseKey.invalid.header', 'sg_routes'),
+				AbstractMessage::ERROR
 			);
 		}
 
-- 
GitLab