From 1478264952780008446dbea09422fc7b2a5f07ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Sch=C3=BCttl=C3=B6ffel?=
 <schuettloeffel@zqs.uni-hannover.de>
Date: Wed, 11 May 2022 09:52:41 +0000
Subject: [PATCH] CourseWizard: better error message on nodata failure, fixes
 #981

Closes #981

Merge request studip/studip!71
---
 app/controllers/course/wizard.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/controllers/course/wizard.php b/app/controllers/course/wizard.php
index c9873dde022..c8da5b1ce3e 100644
--- a/app/controllers/course/wizard.php
+++ b/app/controllers/course/wizard.php
@@ -244,7 +244,8 @@ class Course_WizardController extends AuthenticatedController
         $this->stepnumber = $stepnumber;
         $this->temp_id = $temp_id;
         if (!$this->getValues()) {
-            throw new UnexpectedValueException('no data found');
+            PageLayout::postError(_('Ihre Session ist abgelaufen, bitte erneut anfangen.'));
+            $this->redirect('course/wizard');
         }
         if (isset($_SESSION['coursewizard'][$this->temp_id]['source_id'])) {
             $this->source_course = Course::find($_SESSION['coursewizard'][$this->temp_id]['source_id']);
-- 
GitLab