Subject: | non-sorted serials/parent cause null append error |
Date: | Tue, 21 Jul 2009 14:36:39 -0400 |
To: | <bug-Tree-Numbered-Tools [...] rt.cpan.org> |
From: | "Daniel Higgins" <danielh [...] e2eresolutions.com> |
the module fails with undefined errors if one of the following is true:
1- your list is not ordered by serial:
this is caused by calling ->append in
readArray(), Tree::Numbered will assign a its own serial number, starting
from 0. which just happen to match if your list is sorted (and incidentally,
but I haven't tested this, if your list does not skip any numbers). thus
when calling getSubTree the parentid is the sale as Tree::Numbered's ideal
of the serial
2- your list has serial with dependencies numbers higher than itself
(eg, a node having serial 5 and parentid 10):
this fails because the parent node is not
created yet, so getSubTree returns a null.
the solution is ordering by parentid, which fail because of the first bug
--
Ce message a �t� v�rifi� par MailScanner pour des virus ou des polluriels et rien de
suspect n'a �t� trouv�.
--
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.