Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion inc/container.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
$update_data = [
'id' => $container['id'],
'itemtypes' => $itemtypes,
'label' => $container['label'],
];
if ($container_name !== $container['name']) {
$update_data['name'] = $container_name;
Expand Down Expand Up @@ -648,7 +649,12 @@

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'] ?? ''));

Check failure on line 654 in inc/container.class.php

View workflow job for this annotation

GitHub Actions / GLPI 11.0.x - php:8.2 - mariadb:10.6 / Continuous integration

Offset 'label' on non-empty-array<string, mixed> on left side of ?? always exists and is not nullable.

Check failure on line 654 in inc/container.class.php

View workflow job for this annotation

GitHub Actions / GLPI 11.0.x - php:8.5 - mariadb:11.8 / Continuous integration

Offset 'label' on non-empty-array<string, mixed> on left side of ?? always exists and is not nullable.
}
Comment thread
stonebuzz marked this conversation as resolved.

return $input;
}

public function prepareInputForAdd($input)
Expand Down
Loading