diff --git a/CHANGELOG.md b/CHANGELOG.md index 39363e25..5fd0843a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fix item creation with null value for mandatory fields - Fix search crash when two containers share a dropdown field with the same name. - Fix handle native GLPI dropdown types when binding additional fields to form destination +- Remove redundant null coalescing on container label preparation. + ## [1.24.2] - 2026-06-30 diff --git a/inc/container.class.php b/inc/container.class.php index 979a5a09..10bab408 100644 --- a/inc/container.class.php +++ b/inc/container.class.php @@ -241,6 +241,7 @@ public static function installBaseData(Migration $migration, $version) $update_data = [ 'id' => $container['id'], 'itemtypes' => $itemtypes, + 'label' => $container['label'], ]; if ($container_name !== $container['name']) { $update_data['name'] = $container_name; @@ -648,7 +649,12 @@ public function defineTabs($options = []) public function prepareInputForUpdate($input) { - return PluginFieldsToolbox::prepareLabel($input); + // if label not empty, prepare name from label + if (isset($input['label']) && !empty($input['label'])) { + $input['label'] = PluginFieldsToolbox::sanitizeLabel((string) $input['label']); + } + + return $input; } public function prepareInputForAdd($input)