On 02-12-2009 at 22:44:19 Ekke Vasli <ekke.va...@skype.net> wrote:

EXPECTED OUTPUT (and as of 1.1.16 and 1.2.0):
<div>page-a:<div>Value from the first blocks</div>page-b:<div>Valuebis from subpage block</div></div>

REAL OUTPUT (1.2.1):
<div>page-a:<span>a value should go here</span>page-b:<div>Valuebis from subpage block</div></div>

PROBLEM:
Metal:fill-slot values are not carried over from within nested macro calls any more, unable to find another way to achieve the same result. Is this intentional behavior?

It does work with tal:define global / replace structure but it is not as elegant solution as slots. Any better ideas how work around it?

If it isn't on purpose, a simple patch fixes it back to 1.2.0 way (and then pls could above test be included in testsuite too?): diff -r PHPTAL-1.2.1/PHPTAL/Context.php /apache2/php/lib/php/PHPTAL/ Context.php
165a166,169
 >         if ($this->_parentContext) {
> return $this->_parentContext->hasSlot($key); // setting slots in any context
 >         }
 >

That's an excellent bug report, thanks!


The problem isn't in callbacks (phew!), but in Context::hasSlot() implementation. It should be:


   public function hasSlot($key)
    {
return isset($this->_slots[$key]) || ($this->_parentContext && $this->_parentContext->hasSlot($key));
    }


The fix is in SVN.

--
regards, Kornel

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to