On 05-08-2009 at 10:47:49 Łukasz Palka <lukasz.pal...@gmail.com> wrote:

I recently started using PHPTAL and Doctrine. Unfrotunatly I cannot access
some properties like:

<div tal:repeat="comment post/Comment">

but this works:

<div tal:repeat="comment php:post.Comment">

After deleting "else" from PHPTAL\Context.php, line: 279:
            // ask __get and discard if it returns null
            /*else*/ if (method_exists($base,'__get') &&
is_callable(array($base, '__get')))
                $tmp = $base->$current;
                if (NULL !== $tmp){
                    $base = $tmp;

it works fine.

This will introduce bugs in code that implements __isset() and __get() properly.

Is this a bug in PHPTAL or maybe Doctrine programmers made something strange
or...? I am not a pro php programmer, so maybe I am wrong :)

IMHO this is bug in the framework - it implements __isset() which returns invalid information.

If __isset() returns false it means that property doesn't exist, PHPTAL believes it and won't try to read "non-existent" property.

I suggest changing the framework so that __isset() always returns true for all properties that are allowed to be read.

regards, Kornel

PHPTAL mailing list

Reply via email to