From 6ca44dced19024b15ecd850cac61b15e19396c01 Mon Sep 17 00:00:00 2001 From: Maximilian Becker Date: Fri, 5 May 2023 09:15:25 +0200 Subject: [PATCH] 36296: Instant Error trying to access test: unserialize(): Argument #1 ($data) must be of type string, null given --- .../class.ilObjTestScoreSettingsDatabaseRepository.php | 2 +- Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Modules/Test/classes/ScoreReporting/class.ilObjTestScoreSettingsDatabaseRepository.php b/Modules/Test/classes/ScoreReporting/class.ilObjTestScoreSettingsDatabaseRepository.php index a868440f940d..3d843b91491c 100644 --- a/Modules/Test/classes/ScoreReporting/class.ilObjTestScoreSettingsDatabaseRepository.php +++ b/Modules/Test/classes/ScoreReporting/class.ilObjTestScoreSettingsDatabaseRepository.php @@ -97,7 +97,7 @@ protected function doSelect(string $where_part): ilObjTestScoreSettings ->withPrintBestSolutionWithResult((bool) $row['print_bs_with_res']) ->withShowExamIdInTestResults((bool) $row['examid_in_test_res']) ->withExportSettings((int) $row['exportsettings']) - ->withTaxonomyFilterIds(unserialize($row['result_tax_filters'])), + ->withTaxonomyFilterIds(unserialize((string)$row['result_tax_filters'])), (new ilObjTestSettingsGamification($test_id)) ->withHighscoreEnabled((bool) $row['highscore_enabled']) ->withHighscoreAnon((bool) $row['highscore_anon']) diff --git a/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php b/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php index b9f88c3eb7f3..e150fbe03fbb 100644 --- a/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php +++ b/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php @@ -1003,7 +1003,11 @@ private function addTestRunProperties(ilPropertyFormGUI $form) $duration->setShowHours(true); $duration->setShowMinutes(true); - $pw_time_array = explode(':', $this->testOBJ->getPassWaiting()); + $pw_time_array = ["00", "000", "00", "00", "00"]; + if($this->testOBJ->getPassWaiting() !== '') { + $pw_time_array = explode(':', $this->testOBJ->getPassWaiting()); + } + $duration->setMonths((int) $pw_time_array[0]); $duration->setDays((int) $pw_time_array[1]); $duration->setHours((int) $pw_time_array[2]);