Nico Klasens wrote:
I have some troubles with the getRelations and getRelatedNodes methods in the head. These methods have changed after release 1.8.1 and I get wierd results from them. When I call getRelations("myrole") then I never get a result. I first got a NPE and did a quick fix. This didn't work like I had hoped.
Just checked in a BasicNode which works as I was used to. I found some cases where it didn't work for me 1 calling getRelations(role) and getRelatedNodes(role). This means search in both directions, with type 'object' and specified role. 2 calling getRelations() and getRelatedNodes(). no arguments means search in both directions, with type 'object' and role none. 3 calling getRelations(role, supertype) and getRelatedNodes(role, supertype). This means search in both directions, with type 'supertype' and specified role.
In the end it turned out that it had to do with the check on allowed relations (typerel). The code only allowed descendants of the type and 'object' is the parent. This was also the case for the supertype. The allowed relations also requires a role and when it was not present it failed. Now it checks if there are allowed relations in a certain direction and does the query.
I am still not sure I caught all the cases, but this seems to fix a lot. Nico _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
