#9756 closed (fixed)
Recent changes to for tag (adding empty clause) leave context stack imbalanced when iterable is empty
Reported by: | Sean Legassick | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When the iterable passed to the for tag is empty, the ForNode.render method returns without calling context.pop (which it should as context.push is called previously in the method). The attached patch fixes this and adds code to the template tag regression tests that checks that context stack is left balanced after every tag test.
Attachments (1)
Change History (6)
by , 16 years ago
Attachment: | for-tag-leaves-imbalanced-context-stack.patch added |
---|
comment:1 by , 16 years ago
milestone: | post-1.0 |
---|
comment:2 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 16 years ago
Ah, explains why an nested forloop with an empty iterable causes the .first
-attribute of his parent loop to be true incorrectly. Just bumped into this one, nice to see it fixed! :-)
Note:
See TracTickets
for help on using tickets.
Milestone post-1.0 deleted