[development] Peculiar behavior of collapsible fieldset titles

Syscrusher syscrusher at 4th.com
Mon Jul 21 21:27:07 UTC 2008

I've got a set of forms in Drupal 5 that are working correctly but have
an odd cosmetic error that I've been unable to track down. The code
worked in Drupal 4.7.

Basically, I am assigning the title of some collapsible fieldsets
dynamically -- specifically, it's a project number and name that result
from a database query. The title should look like this:

    Subtasks for Project #1234 (Redesign Office LAN)

For some reason, the titles are perfect when the fieldsets are expanded
but empty when collapsed (that is, they look like this):

    Subtasks for # ()

I think I know *what* is happening -- that is, the function that builds
the $form array is being called twice and has the variable unpopulated
one of the two times -- but I'm at a loss to figure out how that could
be happening. The database query not only populates the title of the
fieldset, but also its very presence depends on a row being retrieved.
So I would think that if the database query were somehow being skipped,
the fieldset would be entirely missing, not just empty!

Has anyone seen something like this before? I realize I haven't given
enough detail or code to troubleshoot it entirely -- I'm not asking
someone to do my debugging for me, just looking for someone out there
who has seen something similar and can tell me in general terms what
might be happening.

Thanks if anyone has suggestions.

Kind regards,

Syscrusher <syscrusher at 4th.com>

More information about the development mailing list