Skip to content

Commit 7d6e09d

Browse files
fix: Editing types correction (#11288)
1 parent fe09c59 commit 7d6e09d

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

components/ILIAS/Survey/Editing/class.ilSurveyEditorGUI.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function questionsObject(): void
228228
$ilToolbar->setFormAction($this->ctrl->getFormAction($this));
229229
$types = new ilSelectInputGUI($this->lng->txt("create_new"), "sel_question_types");
230230
$types->setOptions($qtypes);
231-
$ilToolbar->addStickyItem($types, "");
231+
$ilToolbar->addStickyItem($types, false);
232232

233233
$this->gui->button(
234234
$this->lng->txt("svy_create_question"),
@@ -422,7 +422,7 @@ protected function insertQuestions(
422422
}
423423
}
424424
if (!$insert_id && preg_match("/^cb_qb_(\d+)$/", $target, $matches)) {
425-
$ids = $this->object->getQuestionblockQuestionIds($matches[1]);
425+
$ids = $this->object->getQuestionblockQuestionIds((int) $matches[1]);
426426
if (count($ids)) {
427427
if ($insert_mode === 0) {
428428
$insert_id = $ids[0];
@@ -695,7 +695,7 @@ public function changeDatatypeObject(): void
695695
{
696696
$ilUser = $this->user;
697697

698-
$ilUser->writePref('svy_insert_type', $this->request->getDataType());
698+
$ilUser->writePref('svy_insert_type', (string) $this->request->getDataType());
699699

700700
switch ($this->request->getDataType()) {
701701
case 2:
@@ -897,7 +897,7 @@ protected function initQuestionblockForm(
897897
if ($a_question_ids) {
898898
foreach ($a_question_ids as $q_id) {
899899
$hidden = new ilHiddenInputGUI("qids[]");
900-
$hidden->setValue($q_id);
900+
$hidden->setValue((string) $q_id);
901901
$form->addItem($hidden);
902902
}
903903
}
@@ -919,9 +919,9 @@ public function saveDefineQuestionblockObject(): void
919919
$form = $this->initQuestionblockForm($block_id);
920920
if ($form->checkInput()) {
921921
$title = $form->getInput("title");
922-
$show_questiontext = $form->getInput("show_questiontext");
923-
$show_blocktitle = $form->getInput("show_blocktitle") ;
924-
$compress_view = $form->getInput("compress_view") ;
922+
$show_questiontext = (bool) $form->getInput("show_questiontext");
923+
$show_blocktitle = (bool) $form->getInput("show_blocktitle");
924+
$compress_view = (bool) $form->getInput("compress_view");
925925
if ($block_id) {
926926
$this->object->modifyQuestionblock(
927927
$block_id,
@@ -1034,7 +1034,10 @@ public function saveHeadingObject(): void
10341034
$form = $this->initHeadingForm($q_id);
10351035
if ($form->checkInput()) {
10361036
$heading = $this->purifier->purify($form->getInput("heading"));
1037-
$this->object->saveHeading($heading, $form->getInput("insertbefore"));
1037+
$this->object->saveHeading(
1038+
$heading,
1039+
(int) $form->getInput("insertbefore")
1040+
);
10381041
$this->ctrl->redirect($this, "questions");
10391042
}
10401043

components/ILIAS/SurveyQuestionPool/Questions/class.SurveyQuestionGUI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ protected function initEditForm(): ilPropertyFormGUI
274274

275275
// obligatory
276276
$shuffle = new ilCheckboxInputGUI($this->lng->txt("obligatory"), "obligatory");
277-
$shuffle->setValue(1);
277+
$shuffle->setValue("1");
278278
$shuffle->setRequired(false);
279279
$form->addItem($shuffle);
280280

@@ -339,7 +339,7 @@ protected function saveForm(): bool
339339
$this->purifier->purify($form->getInput("question"))
340340
);
341341

342-
$this->object->setObligatory($form->getInput("obligatory"));
342+
$this->object->setObligatory((bool) $form->getInput("obligatory"));
343343

344344
$this->importEditFormValues($form);
345345

0 commit comments

Comments
 (0)