@@ -171,7 +171,7 @@ public function getDesignHtml() {
171
171
$ sectionId = $ this ->fields [PluginFormcreatorSection::getForeignKeyField ()];
172
172
$ fieldType = 'PluginFormcreator ' . ucfirst ($ this ->fields ['fieldtype ' ]) . 'Field ' ;
173
173
$ field = new $ fieldType ($ this );
174
-
174
+
175
175
$ html .= '<div class="grid-stack-item" '
176
176
. ' data-itemtype=" ' . self ::class . '" '
177
177
. ' data-id=" ' .$ questionId .'" '
@@ -226,10 +226,8 @@ public function getRenderedHtml($canEdit = true, $value = []) {
226
226
if (!$ field ->isPrerequisites ()) {
227
227
return '' ;
228
228
}
229
- if (isset ($ _SESSION ['formcreator ' ]['data ' ]['formcreator_field_ ' . $ this ->getID ()])) {
230
- $ field ->parseAnswerValues ($ _SESSION ['formcreator ' ]['data ' ]['formcreator_field_ ' . $ this ->getID ()]);
231
- } else if (count ($ value ) > 0 ) {
232
- $ field ->parseAnswerValues ($ value );
229
+ if (isset ($ _SESSION ['formcreator ' ]['data ' ])) {
230
+ $ field ->parseAnswerValues ($ _SESSION ['formcreator ' ]['data ' ]);
233
231
} else {
234
232
$ field ->deserializeValue ($ this ->fields ['default_values ' ]);
235
233
}
@@ -340,7 +338,7 @@ private function checkBeforeSave($input) {
340
338
341
339
// Might need to merge $this->fields and $input, $input having precedence
342
340
// over $this->fields
343
- $ input ['default_values ' ] = $ this ->field ->serializeValue ();
341
+ // $input['default_values'] = $this->field->serializeValue();
344
342
345
343
return $ input ;
346
344
}
@@ -380,9 +378,6 @@ public function prepareInputForAdd($input) {
380
378
} else {
381
379
$ input ['row ' ] = $ maxRow + 1 ;
382
380
}
383
- // if (!isset($input['height'])) {
384
- // $input['height'] = '1';
385
- // }
386
381
387
382
// generate a unique id
388
383
if (!isset ($ input ['uuid ' ])
@@ -413,7 +408,7 @@ public function prepareInputForUpdate($input) {
413
408
return false ;
414
409
}
415
410
416
- // generate a uSnique id
411
+ // generate a unique id
417
412
if (!isset ($ input ['uuid ' ])
418
413
|| empty ($ input ['uuid ' ])) {
419
414
if (!isset ($ this ->fields ['uuid ' ]) && $ this ->fields ['uuid ' ] != $ input ['uuid ' ]) {
@@ -467,9 +462,9 @@ protected function serializeDefaultValue($input) {
467
462
return $ input ;
468
463
}
469
464
470
- /**
465
+ /**
471
466
* Update size or position of the question
472
- * @param array $input
467
+ * @param array $input
473
468
* @return boolean false on error
474
469
*/
475
470
public function change ($ input ) {
@@ -632,7 +627,7 @@ public function post_purgeItem() {
632
627
// 'row' => ['>', $row],
633
628
// $sectionFk => $this->fields[$sectionFk]
634
629
// ]
635
- // );
630
+ // );
636
631
}
637
632
638
633
// Always show questions with conditional display on the question being deleted
0 commit comments