Skip to content

Commit

Permalink
fix(question): fix loss of description
Browse files Browse the repository at this point in the history
when a description question is moved up / down, t he description is lost

Signed-off-by: btry <tbugier@teclib.com>
  • Loading branch information
btry committed May 29, 2018
1 parent 1c466fe commit 4b39371
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions inc/fields/descriptionfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ public static function getName() {
}

public function prepareQuestionInputForSave($input) {
if (isset($input['description']) && empty($input['description'])) {
Session::addMessageAfterRedirect(
__('A description field should have a description:', 'formcreator') . ' ' . $input['name'],
false,
ERROR);
return [];
if (isset($input['description'])) {
if (strlen($input['description']) < 1) {
Session::addMessageAfterRedirect(
__('A description field should have a description:', 'formcreator') . ' ' . $input['name'],
false,
ERROR);
return [];
}
$input['description'] = addslashes($input['description']);
}
$input['description'] = addslashes($input['description']);

return $input;
}

Expand Down

0 comments on commit 4b39371

Please sign in to comment.