diff --git a/components/ILIAS/Survey/Editing/class.ilSurveyEditorGUI.php b/components/ILIAS/Survey/Editing/class.ilSurveyEditorGUI.php index bcf727814e8e..292db5938553 100755 --- a/components/ILIAS/Survey/Editing/class.ilSurveyEditorGUI.php +++ b/components/ILIAS/Survey/Editing/class.ilSurveyEditorGUI.php @@ -228,7 +228,7 @@ public function questionsObject(): void $ilToolbar->setFormAction($this->ctrl->getFormAction($this)); $types = new ilSelectInputGUI($this->lng->txt("create_new"), "sel_question_types"); $types->setOptions($qtypes); - $ilToolbar->addStickyItem($types, ""); + $ilToolbar->addStickyItem($types, false); $this->gui->button( $this->lng->txt("svy_create_question"), @@ -422,7 +422,7 @@ protected function insertQuestions( } } if (!$insert_id && preg_match("/^cb_qb_(\d+)$/", $target, $matches)) { - $ids = $this->object->getQuestionblockQuestionIds($matches[1]); + $ids = $this->object->getQuestionblockQuestionIds((int) $matches[1]); if (count($ids)) { if ($insert_mode === 0) { $insert_id = $ids[0]; @@ -695,7 +695,7 @@ public function changeDatatypeObject(): void { $ilUser = $this->user; - $ilUser->writePref('svy_insert_type', $this->request->getDataType()); + $ilUser->writePref('svy_insert_type', (string) $this->request->getDataType()); switch ($this->request->getDataType()) { case 2: @@ -897,7 +897,7 @@ protected function initQuestionblockForm( if ($a_question_ids) { foreach ($a_question_ids as $q_id) { $hidden = new ilHiddenInputGUI("qids[]"); - $hidden->setValue($q_id); + $hidden->setValue((string) $q_id); $form->addItem($hidden); } } @@ -919,9 +919,9 @@ public function saveDefineQuestionblockObject(): void $form = $this->initQuestionblockForm($block_id); if ($form->checkInput()) { $title = $form->getInput("title"); - $show_questiontext = $form->getInput("show_questiontext"); - $show_blocktitle = $form->getInput("show_blocktitle") ; - $compress_view = $form->getInput("compress_view") ; + $show_questiontext = (bool) $form->getInput("show_questiontext"); + $show_blocktitle = (bool) $form->getInput("show_blocktitle"); + $compress_view = (bool) $form->getInput("compress_view"); if ($block_id) { $this->object->modifyQuestionblock( $block_id, @@ -1034,7 +1034,10 @@ public function saveHeadingObject(): void $form = $this->initHeadingForm($q_id); if ($form->checkInput()) { $heading = $this->purifier->purify($form->getInput("heading")); - $this->object->saveHeading($heading, $form->getInput("insertbefore")); + $this->object->saveHeading( + $heading, + (int) $form->getInput("insertbefore") + ); $this->ctrl->redirect($this, "questions"); } diff --git a/components/ILIAS/SurveyQuestionPool/Questions/class.SurveyQuestionGUI.php b/components/ILIAS/SurveyQuestionPool/Questions/class.SurveyQuestionGUI.php index 214c8f1bae11..1040bcec7fdc 100755 --- a/components/ILIAS/SurveyQuestionPool/Questions/class.SurveyQuestionGUI.php +++ b/components/ILIAS/SurveyQuestionPool/Questions/class.SurveyQuestionGUI.php @@ -274,7 +274,7 @@ protected function initEditForm(): ilPropertyFormGUI // obligatory $shuffle = new ilCheckboxInputGUI($this->lng->txt("obligatory"), "obligatory"); - $shuffle->setValue(1); + $shuffle->setValue("1"); $shuffle->setRequired(false); $form->addItem($shuffle); @@ -339,7 +339,7 @@ protected function saveForm(): bool $this->purifier->purify($form->getInput("question")) ); - $this->object->setObligatory($form->getInput("obligatory")); + $this->object->setObligatory((bool) $form->getInput("obligatory")); $this->importEditFormValues($form);