Skip to content

Commit afba7b2

Browse files
committed
fix(dropdownfield): update subtype broken
1 parent 7b707ff commit afba7b2

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

ajax/question_design.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
http_response_code(400);
3737
exit();
3838
}
39-
if (!isset($_REQUEST['fieldtype'])) {
39+
if (empty($_REQUEST['id']) && !isset($_REQUEST['fieldtype'])) {
4040
http_response_code(400);
4141
exit();
4242
}
@@ -63,11 +63,10 @@
6363

6464
$question->fields['values'] = json_encode($values);
6565
$field = PluginFormcreatorFields::getFieldInstance(
66-
$_REQUEST['fieldtype'],
66+
$_REQUEST['fieldtype'] ?? $question->fields['fieldtype'],
6767
$question
6868
);
69-
$question->fields['fieldtype'] = '';
70-
if ($field !== null) {
69+
if (empty($_REQUEST['id']) && !isset($_REQUEST['fieldtype'])) {
7170
$question->fields['fieldtype'] = $_REQUEST['fieldtype'];
7271
}
7372
$question->showForm($question->getID());

0 commit comments

Comments
 (0)