Skip to content

Commit

Permalink
fix(conditin): export broken
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 27, 2020
1 parent b95bdae commit 62b1d69
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions inc/condition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,9 @@ public function export($remove_uuid = false) {
$question = new PluginFormcreatorQuestion();
$question->getFromDB($condition['plugin_formcreator_questions_id']);
$condition['plugin_formcreator_questions_id'] = $question->fields['uuid'];
$containerType = $input['itemtype'];
if (!class_exists($containerType) || !is_subclass_of($containerType, PluginFormcreatorConditionnableInterface::class)) {
return false;
}
$container = new $containerType();
$container->getFromDB($condition['items_id']);
$condition['items_id'] = $container->fields['uuid'];
}
unset($condition[$idToRemove]);
unset($condition['itemtype']);

return $condition;
}
Expand Down
1 change: 0 additions & 1 deletion tests/suite-unit/PluginFormcreatorCondition.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ public function testExport() {

// Test the exported data
$fieldsWithoutID = [
'itemtype',
'plugin_formcreator_questions_id',
'show_condition',
'show_value',
Expand Down

0 comments on commit 62b1d69

Please sign in to comment.