[development] drupal_render() reordering form items

Leonard den Ottolander.nl drupal at den.ottolander.nl
Wed Feb 16 17:58:39 UTC 2011


Hi,

I'm trying to create a form with a list of items that I get from a
database table. The query elements are sorted reversely to compensate
for the fact that element_children($form) that I call later in my theme
function starts from the end of the array.

After creating the form array I call drupal_render($form). However it
appears drupal_render() rearranges those form items before it calls my
theme function. This results in a randomly ordered table that I create
from the database elements using theme('table').

Working with Drupal 6.2. Since this is a development site all caching is
currently disabled and I explicitly cleared cached data via
admin/settings/performance as well after I removed table drag items that
I temporarily added. I even disabled, uninstalled, then reinstalled the
module and refilled the table the module uses.

Is there a way to avoid the reordering of (certain) form elements when
calling drupal_render()? Or am I forced to do the ordering in my theme
function?

Regards,
Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research




More information about the development mailing list