Skip to content

Commit cfcbea3

Browse files
committed
fix(section): duplication of conditions: bad itemtype
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 73fca7b commit cfcbea3

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

inc/condition.class.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
129129
}
130130
}
131131
$input['plugin_formcreator_questions_id'] = $linked->getID();
132-
$input['itemtype'] = $linked->getType();
133132

134133
// Add or update condition
135134
$originalId = $input[$idKey];
@@ -177,7 +176,6 @@ public function export($remove_uuid = false) {
177176
$condition['plugin_formcreator_questions_id'] = $question->fields['uuid'];
178177
}
179178
unset($condition[$idToRemove]);
180-
unset($condition['itemtype']);
181179

182180
return $condition;
183181
}

inc/question.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,13 +937,13 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
937937
foreach ($input['_conditions'] as $condition) {
938938
PluginFormcreatorCondition::import($linker, $condition, $itemId);
939939
}
940-
$field = PluginFormcreatorFields::getFieldInstance(
941-
$input['fieldtype'],
942-
$item
943-
);
944940
}
945941

946942
// Import parameters
943+
$field = PluginFormcreatorFields::getFieldInstance(
944+
$input['fieldtype'],
945+
$item
946+
);
947947
if (isset($input['_parameters'])) {
948948
$parameters = $field->getParameters();
949949
foreach ($parameters as $fieldName => $parameter) {

inc/section.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function export($remove_uuid = false) {
316316
}
317317
}
318318

319-
// get question conditions
319+
// get section conditions
320320
$section['_conditions'] = [];
321321
$condition = new PluginFormcreatorCondition();
322322
$all_conditions = $condition->getConditionsFromItem($this);

0 commit comments

Comments
 (0)