Skip to content

Commit 4b39371

Browse files
committed
fix(question): fix loss of description
when a description question is moved up / down, t he description is lost Signed-off-by: btry <tbugier@teclib.com>
1 parent 1c466fe commit 4b39371

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

inc/fields/descriptionfield.class.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,17 @@ public static function getName() {
5151
}
5252

5353
public function prepareQuestionInputForSave($input) {
54-
if (isset($input['description']) && empty($input['description'])) {
55-
Session::addMessageAfterRedirect(
56-
__('A description field should have a description:', 'formcreator') . ' ' . $input['name'],
57-
false,
58-
ERROR);
59-
return [];
54+
if (isset($input['description'])) {
55+
if (strlen($input['description']) < 1) {
56+
Session::addMessageAfterRedirect(
57+
__('A description field should have a description:', 'formcreator') . ' ' . $input['name'],
58+
false,
59+
ERROR);
60+
return [];
61+
}
62+
$input['description'] = addslashes($input['description']);
6063
}
61-
$input['description'] = addslashes($input['description']);
64+
6265
return $input;
6366
}
6467

0 commit comments

Comments
 (0)