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 2015-11-24 13:46:45

henderson
Member
Registered: 2015-11-24
Posts: 6

Unable to manage Entities (0.90)

So it seems there is a rare typo at search.class.php ? Or am I wrong?

You're unable to manage Entities if your second created entity (with id=1) had been removed. (need to relogin to update $_SESSION)
BvvJo.jpg


search.class.php (1312)
         // Display column Headers for toview items
         $metanames = array();
         foreach ($data['data']['cols'] as $key => $val) {
...(1386)
         // Display Loop
         foreach ($data['data']['rows'] as $rowkey => $row) {
... (1410)
               if (($data['itemtype'] == 'Entity')
                     && !in_array($val["id"], $_SESSION["glpiactiveentities"])) {
                  $tmpcheck = " ";
...

Arrays

var_dump($val);
array (size=5)
  'itemtype' => string 'Entity' (length=6)
  'id' => int 1
  'name' => string 'Complete name' (length=13)
  'meta' => int 0
  'searchopt' => 
    array (size=7)
      'table' => string 'glpi_entities' (length=13)
      'field' => string 'completename' (length=12)
      'name' => string 'Complete name' (length=13)
      'datatype' => string 'itemlink' (length=8)
      'massiveaction' => boolean false
      'linkfield' => string 'completename' (length=12)
      'joinparams' => 
        array (size=0)
var_dump($_SESSION["glpiactiveentities"]);
array (size=36)
  0 => int 0
  46 => int 46
  9 => int 9
  11 => int 11
  10 => int 10
  13 => int 13
  12 => int 12
  14 => int 14
  15 => int 15
  16 => int 16
  17 => int 17
  18 => int 18
  19 => int 19
  26 => int 26
  25 => int 25
  28 => int 28
  27 => int 27
  29 => int 29
  30 => int 30
  31 => int 31
  32 => int 32
  33 => int 33
  34 => int 34
  35 => int 35
  36 => int 36
  37 => int 37
  38 => int 38
  20 => int 20
  21 => int 21
  22 => int 22
  23 => int 23
  24 => int 24
  44 => int 44
  43 => int 43
  42 => int 42
  45 => int 45

Fix ????

--- a/original/glpi-0.90/inc/search.class.php
+++ b/var/www/domains/data/inc/search.class.php
@@ -1409,7 +1409,7 @@ class Search {
                $tmpcheck = "";

                if (($data['itemtype'] == 'Entity')
-                     && !in_array($val["id"], $_SESSION["glpiactiveentities"])) {
+                     && !in_array($row["id"], $_SESSION["glpiactiveentities"])) {
                   $tmpcheck = " ";

                } else if (($data['item'] instanceof CommonDBTM)

Please confirm my suggestion

Last edited by henderson (2015-11-24 13:57:48)

Offline

#2 2015-11-24 16:00:28

henderson
Member
Registered: 2015-11-24
Posts: 6

Re: Unable to manage Entities (0.90)

When I'm trying to remove an Entity
DqFPj.jpg

Offline

Board footer

Powered by FluxBB