It does not pass, but I figured out what make this happens, insert a
tal:define in the template :

<tal:block phptal:tales="php" *define="dummy 'dummy'"*>

  <!--! definition of macro with a slot -->
  <p metal:define-macro="the-macro">
    The macro : <tt metal:define-slot="the-slot">the slot</tt>
  </p>

  <!--! call macro with default slot -->
  <tal:block metal:use-macro="the-macro" />

  <!--! call macro and fill the slot -->
  <tal:block metal:use-macro="the-macro">
    <tt metal:fill-slot="the-slot">something else</tt>
  </tal:block>

  <!--! call macro with default slot : this FAIL -->
  <tal:block metal:use-macro="the-macro" />

</tal:block>

And now this adds a $tpl->pushContext() call, then the slot is filled in the
parent too, I see the line :

// setting slots in any context (probably violates TAL, but works around bug
with tal:define popping context after fillslot)

2010/10/12 Kornel Lesiński <kor...@aardvarkmedia.co.uk>

> On 12 Oct 2010, at 11:08, Bicou wrote:
>
> > When calling metal:use-macro multiple times, default slots don't get
> reinitialized.
>
> I've tested version in SVN and it passes test you've sent. Can you verify?
>
> svn co https://svn.motion-twin.com/phptal/trunk phptal
>
> --
> regards, Kornel
>
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to