Skip to content

Commit a6f9c41

Browse files
committed
fix(section): duplicate form may lead to bad question id in condition
1 parent 49f8fc0 commit a6f9c41

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

inc/condition.class.php

+2-8
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,8 @@ public static function import(PluginFormcreatorLinker $linker, array $input = []
153153
// set ID for linked objects
154154
$linked = $linker->getObject($input['plugin_formcreator_questions_id'], PluginFormcreatorQuestion::class);
155155
if ($linked === false) {
156-
$linked = new PluginFormcreatorQuestion();
157-
$linked->getFromDBByCrit([
158-
$idKey => $input['plugin_formcreator_questions_id']
159-
]);
160-
if ($linked->isNewItem()) {
161-
$linker->postpone($input[$idKey], $item->getType(), $input, $containerId);
162-
return false;
163-
}
156+
$linker->postpone($input[$idKey], $item->getType(), $input, $containerId);
157+
return false;
164158
}
165159
/** @var CommonDBTM $linked */
166160
$input['plugin_formcreator_questions_id'] = $linked->getID();

0 commit comments

Comments
 (0)