Skip to content

Commit cd54e74

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 9f4371a commit cd54e74

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
@@ -57,6 +57,17 @@
5757
} elseif (isset($_POST['update_fields_values'])) {
5858
$right = PluginFieldsProfile::getRightOnContainer($_SESSION['glpiactiveprofile']['id'], $_POST['plugin_fields_containers_id']);
5959
if ($right > READ) {
60+
$containerID = $_POST['plugin_fields_containers_id'];
61+
$data = [];
62+
foreach ($_REQUEST as $key => $value) {
63+
// if key starts with plugin_fields_<containerID>_ remove the prefix
64+
if (strpos($key, "plugin_fields_{$containerID}_") === 0) {
65+
$new_key = substr($key, strlen("plugin_fields_{$containerID}_"));
66+
$data[$new_key] = $value;
67+
} else {
68+
$data[$key] = $value;
69+
}
70+
}
6071
$container->updateFieldsValues($_REQUEST, $_REQUEST['itemtype'], false);
6172
}
6273
Html::back();

0 commit comments

Comments
 (0)