Implemented suggestion #52913 (thanks to Paul Golmann)
authorjdegroot <jdegroot@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 19 Nov 2013 15:42:30 +0000 (15:42 +0000)
committerjdegroot <jdegroot@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 19 Nov 2013 15:42:30 +0000 (15:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/roq_newsevent/trunk@81637 735d13b6-9817-0410-8766-e36946ffe9aa

Classes/Controller/EventController.php

index 2c94e1a..3f1ac0a 100644 (file)
@@ -202,7 +202,13 @@ class Tx_RoqNewsevent_Controller_EventController extends Tx_News_Controller_News
         $this->settings = $this->initializeSettings($this->settings);
 
         if (is_null($event)) {
-            $previewNewsId = ((int)$this->settings['singleNews'] > 0) ? $this->settings['singleNews'] : $this->request->getArgument('news');
+            if ((int)$this->settings['singleNews'] > 0) {
+                $previewNewsId = $this->settings['singleNews'];
+            } elseif ($this->request->hasArgument('news_preview')) {
+                $previewNewsId = $this->request->getArgument('news_preview');;
+            } else {
+                $previewNewsId = $this->request->getArgument('news');
+            }
 
             if ($this->settings['previewHiddenRecords']) {
                 $event = $this->eventRepository->findByUid($previewNewsId, FALSE);
@@ -211,6 +217,10 @@ class Tx_RoqNewsevent_Controller_EventController extends Tx_News_Controller_News
             }
         }
 
+        if (is_null($event) && isset($this->settings['detail']['errorHandling'])) {
+            $this->handleNoNewsFoundError($this->settings['detail']['errorHandling']);
+        }
+
         $this->view->assignMultiple(array(
             'newsItem' => $event,
             'currentPage' => (int)$currentPage,
@@ -218,6 +228,6 @@ class Tx_RoqNewsevent_Controller_EventController extends Tx_News_Controller_News
 
         Tx_News_Utility_Page::setRegisterProperties($this->settings['detail']['registerProperties'], $event);
     }
-
 }
+
 ?>
\ No newline at end of file