Re: Multiple queries to populate drop down list boxes. Updated
Dave Howorth <dhoworth-fDajt2Yx3S8pY9vWkoisglpr/1R2p/[email protected]> Tue, 09 Oct 2012 13:57:31 +0100
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Organization | MRC Laboratory for Molecular Biology |
| Message-ID | <[email protected]> |
Mark Haney wrote:
> Any ideas?
TT has some oddities when you have lists. A list of two or more items is
a list, but a list of one item is just an item. And if the item is an
object or some other structure, then all the things you were doing to
your list (such as size) are instead applied to the item, with confusing
results. So maybe you have that occurring somewhere.
TT is sometimes difficult to debug, due to its habit of just discarding
anything that doesn't work, without producing any messages, and carrying
on. Two things you can do to work around that:
(1) turn on TT debugging (read the manual for details)
(2) add lots of print statements
- in your Perl code in the usual way
- in your TT code by adding extra output text (e.g.
'variable=';variable; )
With those two techniques you'll get a better idea of what is actually
happening.