diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ed7dc0c..95c806d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fix model subform not displayed after page reload - Rename visibility field label to "Is Private" +- Restored group selection in mappings - Fix special caracters malformed in translations ## [2.15.3] - 2025-12-22 diff --git a/inc/commoninjectionlib.class.php b/inc/commoninjectionlib.class.php index dbb90373..77bdc432 100644 --- a/inc/commoninjectionlib.class.php +++ b/inc/commoninjectionlib.class.php @@ -1673,14 +1673,14 @@ private function effectiveAddOrUpdate($injectionClass, $item, $values, $add = tr // handle new format for group type specification // restricting to group_item relations only - if (($key === "groups_id_tech" || $key === "groups_id") && $option['table'] == getTableForItemType(Group::class) && !empty($option) && isset($option['joinparams']['beforejoin']['table']) && $option['joinparams']['beforejoin']['table'] === getTableForItemType(Group_Item::class) && isset($option['joinparams']['beforejoin']['joinparams']['condition']['NEWTABLE.type'])) { - $value = $option['joinparams']['beforejoin']['joinparams']['condition']['NEWTABLE.type']; + if (($key === "groups_id_tech" || $key === "groups_id" || $key === "groups_id_normal") && $option['table'] == getTableForItemType(Group::class) && !empty($option) && isset($option['joinparams']['beforejoin']['table']) && $option['joinparams']['beforejoin']['table'] === getTableForItemType(Group_Item::class) && isset($option['joinparams']['beforejoin']['joinparams']['condition']['NEWTABLE.type'])) { + $group_type = $option['joinparams']['beforejoin']['joinparams']['condition']['NEWTABLE.type']; // depending on the type, set the correct field (_groups_id_tech => array or _groups_id => array) - // and unset the old one (groups_id_tech => int or groups_id => int) - if ($value == Group_Item::GROUP_TYPE_TECH) { + // and unset the old one (groups_id_tech => int or groups_id => int or groups_id_normal => int) + if ($group_type == Group_Item::GROUP_TYPE_TECH) { $toinject["_groups_id_tech"] = [$value]; } else { - $toinject["_groups"] = [$value]; + $toinject["_groups_id"] = [$value]; } unset($toinject[$key]); } diff --git a/inc/computerinjection.class.php b/inc/computerinjection.class.php index 6cf84e64..481352a1 100644 --- a/inc/computerinjection.class.php +++ b/inc/computerinjection.class.php @@ -71,6 +71,9 @@ public function getOptions($primary_type = '') //Specific to location $tab[3]['linkfield'] = 'locations_id'; + //Specific to groups (simple group, not technical) + $tab[71]['linkfield'] = 'groups_id_normal'; + //specific for antiviruses $tab[167]['name'] = __('Antivirus name', 'datainjection');