I have a problem since upgrading to Zope210x that I hope, concerns "Development 

I use a call to "custom-internal" pagetemplates in one of my products (actually 
they are plugins). 

With Zope 2.9.6, in my product I use: 

return _config.myPT(context={'here':self, 'request':REQUEST}) 

_config. is a module which initialize myPT as a PageTemplate and read-it in 
like so: 

f = open(aPlugin + '/' + myPT) 
myPT = PageTemplate() 

This always worked! 

Now, with Zope 2.10.2svn, and the new PageTemplate machinery, this call doesn't 
work anymore. My custom pagetemplates are full of "here" statements in their 
TAL expressions and they are not recognized anymore: 

Here's the log: 

Exception Type KeyError 
Exception Value 'here' 

Traceback (innermost last): 

* Module ZPublisher.Publish, line 119, in publish 
* Module ZPublisher.mapply, line 88, in mapply 
* Module ZPublisher.Publish, line 42, in call_object 
* Module Products.SlashAdmin.SlashAdmin, line 1204, in edit_form 
* Module zope.pagetemplate.pagetemplate, line 96, in __call__ 
* Module zope.pagetemplate.pagetemplate, line 117, in pt_render 
* Module zope.tal.talinterpreter, line 271, in __call__ 
* Module zope.tal.talinterpreter, line 346, in interpret 
* Module zope.tal.talinterpreter, line 534, in do_optTag_tal 
* Module zope.tal.talinterpreter, line 516, in no_tag 
* Module zope.tal.talinterpreter, line 346, in interpret 
* Module zope.tal.talinterpreter, line 745, in do_insertStructure_tal 
* Module zope.tales.tales, line 696, in evaluate 
Line 1, Column 0 
Expression: <PathExpr standard:'here/slash_header'> 

{'args': (), 
'default': <object object at 0x2b149c76a200>, 
'loop': {}, 
'nothing': None, 
'options': {'context': {'here': <SlashAdmin at /testpt/browse used for 
'request': <HTTPRequest, URL=http://intranet/DOMAINES/browse/edit_form>}}, 
'repeat': {}, 
'template': <zope.pagetemplate.pagetemplate.PageTemplate object at 
'usage': <zope.pagetemplate.pagetemplate.TemplateUsage object at 

* Module zope.tales.expressions, line 217, in __call__ 
* Module zope.tales.expressions, line 194, in _eval 
* Module zope.tales.expressions, line 118, in _eval 

I have tried many combinations like using extra_context, combining self.. etc.. 
But I don't follow what changed between Zope version that could affect that. 

Surely the "context" key of "options" key (!) does not work as before. 

Can someone help? 



Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to