Skip to content

Commit 2d9a02a

Browse files
committed
fix: TU
1 parent 851e992 commit 2d9a02a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inc/question.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ private function checkBeforeSave($input) : array {
402402
* @return array the modified $input array
403403
*/
404404
public function prepareInputForAdd($input) {
405-
if (!empty($input['default_values'])) {
405+
if (!in_array($input['fieldtype'], ['checkboxes', 'multiselect'])) {
406406
$input['default_values'] = str_replace('\r\n', '', $input['default_values']);
407407
}
408408

@@ -456,7 +456,7 @@ public function prepareInputForAdd($input) {
456456
public function prepareInputForUpdate($input) {
457457
// global $DB;
458458

459-
if (!empty($input['default_values'])) {
459+
if (!in_array($input['fieldtype'], ['checkboxes', 'multiselect'])) {
460460
$input['default_values'] = str_replace('\r\n', '', $input['default_values']);
461461
}
462462
if (!$this->skipChecks) {

0 commit comments

Comments
 (0)