[Templates] Single-object list being treated as hash bug/feature
apv
apv@sedition.com
Wed, 30 May 2007 00:29:45 -0700
If we're counting hands, it's a bug. This change broke a lot of my =20
code and has no built-in work-around like ".list" to make getting =20
around it easy.
=96Ashley
--=20
On May 29, 2007, at 11:53 PM, Jess Robinson wrote:
>
> Hi Andy,
>
> I've mentioned and poked at this several times since around =20
> November, when TT 2.16 came out and produced this problem.
>
> I'd like, if possible, an official response on whether this is a) a =20=
> bug, and will be fixed (eventually), or b) a feature, in which case =20=
> please tell me the workaround.
>
> The short description is: If my TT code calls a method that should =20
> return a list of objects, and only gets one, it helpfully de-=20
> listifies. This is fine except when I wanted to loop around the =20
> result, which treats the single object as a hash and gives me the =20
> key/value pairs.
>
> For a better description see: http://template-toolkit.org/pipermail/=20=
> templates/2006-November/009115.html
>
> For the patch with TEST I sent, see:
> http://template-toolkit.org/pipermail/templates/2006-November/=20
> 009115.html
>
> This fixed it for the perl stash, someone else will need to poke =20
> the XS one..
>
> Where it's turning up is in the SQL::Translator tests, which fail =20
> for all TT versions > 2.15.. I added a skip to ignore them if TT =3D=3D =
=20
> 2.16, but that has now started failing since subsequent releases =20
> still have the bug/feature.
>
> Thanks,
> Jess
>
>
> _______________________________________________
> templates mailing list
> templates@template-toolkit.org
> http://lists.template-toolkit.org/mailman/listinfo/templates