Opened 6 years ago

Closed 6 years ago

#11242 closed (duplicate)

templates: block tag can be nested in if but not in ifequal

Reported by: piotr.findeisen@… Owned by: nobody
Component: Template system Version: master
Severity: Keywords: template, block, if, ifequal
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

(Applies to revision 10865)

Sometimes when template B extends template A, it can't redefine block contents.

The following does not work ('bbb' is displayed or nothing, depending on a and b)

  • a.html
    {% ifequal a b %}
     {% block X %} zzz {% endblock %}
    {% endif %}
    
  • b.html
    {% extends "a.html" %}
    {% block X %} bbb {% endblock %}
    

While this does (ifequal replaced with if):

  • a.html
    {% if a %}
     {% block X %} zzz {% endblock %}
    {% endif %}
    
  • b.html
    {% extends "a.html" %}
    {% block X %} bbb {% endblock %}
    

Change History (2)

comment:1 Changed 6 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This applies also to 1.1 pre-alpha SVN-9536, so it's not a recent regression. I have not checked other versions.

comment:2 Changed 6 years ago by dc

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #10975

Note: See TracTickets for help on using tickets.
Back to Top