You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-06-25 07:49:46

videnov
Member
Registered: 2021-06-25
Posts: 2

GenericObject: Global assets some fields not displayed

Hi everyone,

We are using the genericobject plugin (Objects management) to keep other assets in GLPI - for example we have this new object 'Case':

glpi4.png

glpi5.png



For one of the items here are the fields with their information:

glpi2.png



When we go to Assets -> Case, we see that the fields Group, Status, Manufacturer and User show correctly the information:

glpi3.png



The problem is that when viewing Assets -> Global, that information (Group, Status, Manufacturer and User) is missing:

glpi1.png


There are no errors reported in debug mode.
System spec: GLPI 9.5.5, Genericobjects 2.11.0

Offline

#2 2022-05-17 22:49:19

emmanuel.halbout
Member
Registered: 2022-05-17
Posts: 1

Re: GenericObject: Global assets some fields not displayed

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

#3 2022-05-18 08:18:04

videnov
Member
Registered: 2021-06-25
Posts: 2

Re: GenericObject: Global assets some fields not displayed

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:
glpi-user1r.jpg



Standard GLPI object
glpi-user2r.png


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

Board footer

Powered by FluxBB