Skip to content

Commit

Permalink
fix(section): duplicate form may lead to bad question id in condition
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jun 13, 2023
1 parent 49f8fc0 commit a6f9c41
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions inc/condition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,8 @@ public static function import(PluginFormcreatorLinker $linker, array $input = []
// set ID for linked objects
$linked = $linker->getObject($input['plugin_formcreator_questions_id'], PluginFormcreatorQuestion::class);
if ($linked === false) {
$linked = new PluginFormcreatorQuestion();
$linked->getFromDBByCrit([
$idKey => $input['plugin_formcreator_questions_id']
]);
if ($linked->isNewItem()) {
$linker->postpone($input[$idKey], $item->getType(), $input, $containerId);
return false;
}
$linker->postpone($input[$idKey], $item->getType(), $input, $containerId);
return false;
}
/** @var CommonDBTM $linked */
$input['plugin_formcreator_questions_id'] = $linked->getID();
Expand Down

0 comments on commit a6f9c41

Please sign in to comment.