From 18621fab8291b1a5d9dca5a06873486a5b8051ef Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Thu, 20 Nov 2025 10:27:07 +0100 Subject: [PATCH] Fix(Core): Fix `add` operations when a linked object already exists before the plugin container fields are created. --- CHANGELOG.md | 2 ++ inc/container.class.php | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96342acb..ad8a0dc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +- Fix `add` operations when a linked object already exists before the plugin container fields are created. + ### Fixed - Fix left side menu url (with `DIR_MARKETPLACE`) diff --git a/inc/container.class.php b/inc/container.class.php index f0febac9..16d249c5 100644 --- a/inc/container.class.php +++ b/inc/container.class.php @@ -1780,6 +1780,7 @@ public static function preItemUpdate(CommonDBTM $item) self::preItem($item); if (array_key_exists('_plugin_fields_data', $item->input)) { $data = $item->input['_plugin_fields_data']; + $data['itemtype'] = $item::class; $data['entities_id'] = $item->isEntityAssign() ? $item->getEntityID() : 0; //update data $container = new self();