[dev] Problem with subgroups and Datatrees

Alfonso Marí­n Marí­n almarin at um.es
Fri Dec 7 13:58:24 UTC 2007


Hello,

I'm trying to create subgroups (called "B") of a group (called "A") and 
i have this error:

"B" was not created: Already exists.

Following the execution trace, i see in Datatree.php:953

         if ($object == DATATREE_ROOT) {
             return true;
         }

When $object is "-1:A:B" and DATATREE_ROOT is "-1", that comparison 
return true,

I think that comparisons sould be done with strcmp...


Anyway, if i do the replace (i use strcmp), i still having problems:
My first group (A), has DB values:
	datatree_id:110
	datatree_name: A
	datatree_parents: " "
If i try to enter B (subgroup of A), i get 2 NEW entries in DB:
	datatree_id:112
	datatree_name: A
	datatree_parents: ":-1"
	datatree_id:113
	datatree_name: B
	datatree_parents: ":-1:112"
	
An then, i have 3 groups: A with a subgroup B and a empty A group...

¿Any suggestion?

Thanks in advance
Alfonso



More information about the dev mailing list