You are not logged in.
Pages: 1
Topic closed
I previously reported one of the symptoms of this here: http://www.glpi-project.org/forum/viewt … p?id=32322
Problem:
Moving an entity node clears values in glpi_entities, ancestors_cache column for the moved entities.
Symptoms:
1. the one reported in the link above;
2. user can not change entity to one in the moved node if the profile rights are assigned recursive at the parent node.
Workaround:
Database update.
First, select:
select * from glpi_entities;
Note that the ancestors_cache for all the moved entities are cleared (set to NULL)
Note the parent entities tree, write down the entities IDs.
Update each moved entity by setting the ancestors_cache right
Example:
This fixes the entity with the parents: 0, 1, 4 (IDs should be provided in the correct order):
update glpi_entities set ancestors_cache = '{"0":"0","1":"1","4":"4"}' where id = 5
Last edited by geoalbi (2013-05-10 15:38:57)
Offline
ancestors_cache will be updated on next acces to it through : getAncestorsOf('glpi_entities', $ID)
MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI : Support Contribute References Freshmeat
Offline
ancestors_cache will be updated on next acces to it through : getAncestorsOf('glpi_entities', $ID)
I don't understand when: I put a var_dump ($query) and die() in getAncestorsOf clicked a lot in the entities menu and it is never called.
I tried to figure out, but I don't get it:
When an entity is created:
- the new entity is created with ancestors_cache and sons_cache NULL;
- ancestors_cache and sons_cache for all the other entities are updated;
Moving an entity sets ancestors_cache to NULL for all child entities of the moved one.
If I got this right, regenerateTreeUnderID() in commontreedropdown.class.php should regenerate the ancestors_cache, but it always sets it to NULL. Example of the querry generated:
"UPDATE `glpi_entities` SET `completename`='test > subtest', `ancestors_cache` = NULL, `level` = '2' WHERE `id`= '8'"
I don't know how to better explain this (other than learning PHP and fixing it myself), but not being able to select an entity where the user has authorization inherited recursively is a critical issue.
I have a setup where departments are entities and technicians are supposed to create tickets within each entity. Once an entity tree was moved, the technicians are no longer able to select the subentities under that tree. They can see them, but not select them.
Last edited by geoalbi (2013-05-21 16:49:17)
Offline
Pages: 1
Topic closed