[Zope] <dtml-with "portal_url.getPortalObject()"> gives AttributeError

Dieter Maurer dieter at handshake.de
Sun Nov 9 03:22:29 EST 2003


Marc Lindahl wrote at 2003-11-7 19:46 -0500:
 > I'm trying to keep around some legacy code, in zope 2.5.1 (CMF 1.3)
 > 
 > trying to surround a block with <dtml-with 
 > "portal_url.getPortalObject()"> so I reference root level folders.  I 
 > get the error:
 > 
 > Error Type: TALESError
 > Error Value: exceptions.AttributeError on getPortalObject

Almost surely, "portal_url" in not the object you expect.
I expect it to be a string in the code above.

Note that the "portal_url" object yields a string as soon
as it is called. And it is *very* easy to call an object
unintentionally both in ZPT and DTML.

The code snippet above does not call "portal_url" but something
in the context may already have when "portal_url" was bound.

-- 
Dieter



More information about the Zope mailing list