Skip to content

Commit

Permalink
fix(form): duplication error
Browse files Browse the repository at this point in the history
fix #2448

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Dec 1, 2021
1 parent 3fc877b commit 0ff4596
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1670,16 +1670,16 @@ public function export(bool $remove_uuid = false): array {
$export = $this->fields;

// replace entity id
$export['_entity']
= Dropdown::getDropdownName(Entity::getTable(),
$export['entities_id']);
/** @var Entity */
$entity = Entity::getById($export['entities_id']);
$export['_entity'] = $entity->fields['completename'];

// replace form category id
$export['_plugin_formcreator_category'] = '';
if ($export['plugin_formcreator_categories_id'] > 0) {
$export['_plugin_formcreator_category']
= Dropdown::getDropdownName(PluginFormcreatorCategory::getTable(),
$export['plugin_formcreator_categories_id']);
/** @var PluginFormcreatorCategory */
$formCategory = PluginFormcreatorCategory::getById($export['plugin_formcreator_categories_id']);
if ($formCategory instanceof CommonDBTM) {
$export['_plugin_formcreator_category'] = $formCategory->fiels['completename'];
}

// remove non needed keys
Expand Down

0 comments on commit 0ff4596

Please sign in to comment.