Skip to content

Commit 9b75107

Browse files
Modified the container.form.php file to "clean" the form data (by removing the prefix) before calling updateFieldsValues(), thereby enabling the saving of domtab containers.
1 parent 4fa60d0 commit 9b75107

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

front/container.form.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@
5656
} elseif (isset($_POST['update_fields_values'])) {
5757
$right = PluginFieldsProfile::getRightOnContainer($_SESSION['glpiactiveprofile']['id'], $_POST['plugin_fields_containers_id']);
5858
if ($right > READ) {
59+
$containerID = $_POST['plugin_fields_containers_id'];
60+
$data = [];
61+
foreach ($_REQUEST as $key => $value) {
62+
// if key starts with plugin_fields_<containerID>_ remove the prefix
63+
if (strpos($key, "plugin_fields_{$containerID}_") === 0) {
64+
$new_key = substr($key, strlen("plugin_fields_{$containerID}_"));
65+
$data[$new_key] = $value;
66+
} else {
67+
$data[$key] = $value;
68+
}
69+
}
5970
$container->updateFieldsValues($_REQUEST, $_REQUEST['itemtype'], false);
6071
}
6172
Html::back();

0 commit comments

Comments
 (0)