From ff1a02063038b9f79e9229102f1b9344d5a41a5a Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 9 Oct 2008 10:19:07 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSldapObject=20::=20updateRelationsCache()?= =?UTF-8?q?=20=09->=20Utilisation=20d'un=20nouvel=20objet=20pour=20faire?= =?UTF-8?q?=20le=20cache=20plutot=20que=20$this.=20Cela=20=09=09=20posait?= =?UTF-8?q?=20des=20probl=C3=A8mes=20dans=20la=20mise=20=C3=A0=20jour=20de?= =?UTF-8?q?=20relation=20sinon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/class/class.LSldapObject.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trunk/includes/class/class.LSldapObject.php b/trunk/includes/class/class.LSldapObject.php index bbb71ed9..0867d4db 100644 --- a/trunk/includes/class/class.LSldapObject.php +++ b/trunk/includes/class/class.LSldapObject.php @@ -1036,15 +1036,18 @@ class LSldapObject { function updateRelationsCache() { $this -> _relationsCache=array(); if (is_array($this->config['relations'])) { + $type = $this -> getType(); + $me = new $type(); + $me -> loadData($this -> getDn()); foreach($this->config['relations'] as $relation_name => $relation_conf) { if ( isset($relation_conf['list_function']) ) { if ($GLOBALS['LSsession'] -> loadLSobject($relation_conf['LSobject'])) { $obj = new $relation_conf['LSobject'](); if ((method_exists($obj,$relation_conf['list_function']))&&(method_exists($obj,$relation_conf['getkeyvalue_function']))) { - $list = $obj -> $relation_conf['list_function']($this); + $list = $obj -> $relation_conf['list_function']($me); if (is_array($list)) { // Key Value - $key = $obj -> $relation_conf['getkeyvalue_function']($this); + $key = $obj -> $relation_conf['getkeyvalue_function']($me); $this -> _relationsCache[$relation_name] = array( 'list' => $list,