Skip to content

Commit

Permalink
fix(form): export of entity / category name
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed Nov 5, 2021
1 parent 896194b commit e14a585
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 @@ -1805,16 +1805,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 e14a585

Please sign in to comment.