While switching a client project over to Chameleon I ran into a couple
TAL variable scope issues and I also ran into the Missing.MissingValue
issue.  For the variable scope issues, I've uploaded patches for test
coverage that exposes the bugs to LP.

The first issue I ran into was with tal:define variable assignment when
the assignment refers an existing value for the variable in the second
"else" ("|") clause.  This prevents using the TAL pattern where you're
doing metal:use-macro on a macro that checks for existing values of
variables with a default.  This allows you to override the value in the
template that uses the macro.  The example I ran into this was in the
Archetypes "base_*" templates where you can override certain "*_macro"
macros, such as "body_macro", that are used in composing the rendered


The second issue was in using the tal:repeat variables when doing
metal:use-macro where the macro references the repeat variable.  In this
case, the repeat variable is empty:


Finally, I ran into an already reported bug where the Chameleon
machinery tries to do an i18n translation on the Missing.MissingValue
used by Products.ZCatalog when there's no index or metadata value for
the item being indexed:


I've worked around these issues for now but thought I might try and spur
some solutions.  Unfortunately, I know nothing about the internals of
any template engine so my contributions are limited to providing failing
test cases that expose the bugs.


Repoze-dev mailing list

Reply via email to