You are not logged in.
Hi everyone,
We are using the genericobject plugin (Objects management) to keep other assets in GLPI - for example we have this new object 'Case':
For one of the items here are the fields with their information:
When we go to Assets -> Case, we see that the fields Group, Status, Manufacturer and User show correctly the information:
The problem is that when viewing Assets -> Global, that information (Group, Status, Manufacturer and User) is missing:
There are no errors reported in debug mode.
System spec: GLPI 9.5.5, Genericobjects 2.11.0
Offline
Hi Videnov.
This is quite an old topic, but I've met the same issue with GLPI 9.5.4 and genericobject 2.11.0
After a quite long debugging I've found a kind of fix.
.. BE CAREFUL ! It worked for me, but it's no official fix! I would suggest to make a full backup and, if possible, proceed to many tests of non-regression before applying in a production environment ..
File to edit: /inc/search.class.php, line 5529 (GLPI 9.5.4)
Inside the function giveItem, change the following condition
FROM:
// Search option may not exists in subtype
// This is the case for "Inventory number" for a Software listed from ReservationItem search
$subtype_so = &self::getOptions($data["TYPE"]);
if (!array_key_exists($ID, $subtype_so)) {
return '';
}
TO:
// Search option may not exists in subtype
// This is the case for "Inventory number" for a Software listed from ReservationItem search
$subtype_so = &self::getOptions($data["TYPE"]);
if ($itemtype != 'AllAssets' && !array_key_exists($ID, $subtype_so)) {
return '';
}
I only added this $itemtype != 'AllAssets' && into the if condition.
To explain: I've noticed that for some columns, the execution was passing through this
return '';
Basically, I've simply forced to avoid it when displaying the "AllAssets" search.
Hope this is gonna work for you too.
Manu.
Last edited by emmanuel.halbout (2022-05-17 22:50:37)
Offline
Hi Manu,
Thank you going to the trouble to reply in such detail to my posting.
Your fix indeed works for the global listing. This is fixed in GLPI 10 as well.
Another, more serious problem, you will encounter is that, for any assets defined with GenericObject, you cannot do mass-setting of User. This is not fixed in GLPI 10.
For example you have a list of things that you want to assign to someone, you can do it item by item by changing the User field in them.
But, when trying to do it for a couple of them, with Action -> Update -> User you only see yourself in the dropdown menu.
For standard GLPI items this works well, you can see all users in the dropdown menu.
GenericObject:
Standard GLPI object
The difference is in the POST form data for getDropdownUsers.php, for GenericObjects "right" is "id", and for GLPI objects "right" is "all".
That's as far as we got into debugging of that.
If you have any ideas we will gladly test them.
Offline