"default" keyword behaves like "nothing" with tal:replace in 2.10

Bug #143895 reported by Sascha Welter
2
Affects Status Importance Assigned to Milestone
Zope 2
Won't Fix
Medium
Unassigned
zope.tal
Invalid
Low
Unassigned

Bug Description

In a tag that uses something like tal:replace="context/notexistant|default" the default keyword is treated like the "nothing" keyword, i.e. the tag in question is not in the resulting source.

**** My testcase (in a blank ZPT):

[<img src="http://127.0.0.1:8080/misc_/PageTemplates/zpt.gif"
tal:replace="structure here/notexists|default" />]

[<img src="http://127.0.0.1:8080/misc_/PageTemplates/zpt.gif"
tal:replace="structure default" />]

[<img src="http://127.0.0.1:8080/misc_/PageTemplates/zpt.gif"
tal:replace="default" />]

**** Expected behaviour:
In 2.9 these render to 3 little zpt.gif icons in []. Rendered source:

[<img src="http://127.0.0.1:8080/misc_/PageTemplates/zpt.gif" />]

[<img src="http://127.0.0.1:8080/misc_/PageTemplates/zpt.gif" />]

[<img src="http://127.0.0.1:8080/misc_/PageTemplates/zpt.gif" />]

**** What I got:
In 2.10.3 this renders to the following html source:

[]

[]

[]

Please see attached diff for a test to reproduce the matter.

Tags: bug zope
Revision history for this message
Sascha Welter (betabug) wrote :
Revision history for this message
Andreas Jung (ajung) wrote :

I think this belongs into the Zope 3 tracker since it's the Zope 3 ZPT engine

Revision history for this message
Philipp von Weitershausen (philikon) wrote :

If it used to work in Zope 2.9 and no longer does in Zope 2.10, it's a Zope 2 BBB foul and belongs here.

Revision history for this message
Tres Seaver (tseaver) wrote :

The patch supplying the new failing test still applies cleanly against the 2.12 branch
and trunk, via:

 $ cd /path/to/z212/src
 $ patch -p1 < /tmp/default_replace_text.patch

Fixing the bug *may* involve a change to zope.tal or zope.tales.

Changed in zope2:
status: New → Confirmed
Revision history for this message
Tres Seaver (tseaver) wrote :

Any fix to this bug is going to be made by releasing a new version of zope.tal.

Changed in zope2:
status: Confirmed → Won't Fix
Tres Seaver (tseaver)
Changed in zope.tal:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.tal project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.tal.

Changed in zope.tal:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.