I also stumbled on the Issue myself with API 1.8.1
The API Shows the last element from the multiselect. The following steps reproduce the Error:
-
Create Custom Category (Test)
-
Assign to an ObjectType (server)
-
Add Field Dialog+ (Multple Select)
-
Edit one Object From the Type and add multiple Values for TestField (TestData1, TestData2) ..
-
Call The Test-Category on the Object and The API delivers only the last Multivalue (TestData2).
I could get all the Multiselect values with the following Patch on
/src/classes/modules/cmdb/dao/category/global/isys_cmdb_dao_category_g_custom_fields.class.php
855,856c855,863
< $l_catentries[$i]
< [$l_field_key] = $l_row['isys_catg_custom_fields_list__field_content'];
---
> if (array_key_exists($l_field_key, $l_catentries[$i])) {
> if (! is_array($l_catentries[$i][$l_field_key])) {
> $l_catentries[$i][$l_field_key] = array($l_catentries[$i][$l_field_key]);
> }
> $l_catentries[$i][$l_field_key][] = $l_row['isys_catg_custom_fields_list__field_content'];
> } else {
> $l_catentries[$i][$l_field_key] = $l_row['isys_catg_custom_fields_list__field_content'];
> }
>