[Zope-dev] Expressions like <dtml-var this url> bail out cont
rary to intuition -- proposed fix enclosed
Martijn Pieters
mj@digicool.com
Sun, 13 Feb 2000 06:01:29 -0500
From: Jarkko Kniivilä [mailto:jarkko.kniivila@ambientfactor.fi]
>
> While upgrading a Zope 2.1.0 beta installation recently to 2.1.3, I
> discovered that a recent change made to 'DT_Var.py' rendered DTML
> expressions like <dtml-var this url> and &dtml.url-this;
> inoperative. I had
> been relying on them for a default action url on my forms (in
> DTML methods).
> Especially the entity reference syntax is quite a nice
> abbreviation for the
> more explicit <dtml-var "this().absolute_url()"> which still
> continues to
> work.
>
> The enclosed fix simply acknowledges that 'this' isn't a ZODB
> namespace
> object but a method encapsulating python 'self' and thus
> always needs to be
> invoked. I'm not quite on the top of things why the previous
> behavior was
> changed in the first place (Jim? Anyone?).
>
> I'll file this to the Collector if there's no objection by
> you. Copyright to
> the patch is hereby transfered to Digital Creations to be used freely.
Breaking access to this().abosulte_url() in the above way was probably
not intentional. Yes, please put it in the Collector, as it may get lost
otherwise.
--
Martijn Pieters, Software Engineer
| Digital Creations http://www.digicool.com
| Creators of Zope http://www.zope.org
| mailto:mj@digicool.com ICQ: 4532236
| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
-------------------------------------------