Skip to content

Commit 0ff4596

Browse files
committed
fix(form): duplication error
fix #2448 Signed-off-by: Thierry Bugier <[email protected]>
1 parent 3fc877b commit 0ff4596

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

inc/form.class.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -1670,16 +1670,16 @@ public function export(bool $remove_uuid = false): array {
16701670
$export = $this->fields;
16711671

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

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

16851685
// remove non needed keys

0 commit comments

Comments
 (0)