Forum OpenACS Development: Re: category::get_children sort by tree order

Collapse
Posted by Dave Bauer on
Can you please also just fix it in general!?

It does a db_list then a foreach on the list to put the output into a list!

Then it checks for empty string on the output instead of llength 0.

I am also not sure why the result is "0" instead of just an empty list if there aren't any children. That seems weird.

Collapse
Posted by Gustaf Neumann on
the xo* packages do not use this function, the proposed changes won't break anything here. The suggestions of dave sound very reasonable.

-gustaf neumann

Collapse
Posted by Ryan Gallimore on
Dave, I'd be happy to clean up the proc while I'm at it. Thanks for the response, Gustaf.

Only planner and learning-content packages use category::get_children. In a few places, they do an lsort -increasing on the children ids. A sort of the children in the proc would only affect these existing calls (the children would be sorted twice).

Collapse
Posted by Ryan Gallimore on
I've committed to HEAD the changes to category::get_children. The proc is cleaner and returns a sorted list of categories.