[ZCM] [ZC] 1730/ 4 Resolve "aq_parent is not Available in ZPT when Content-Type is not text/html"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Fri Mar 25 14:45:13 EST 2005


Issue #1730 Update (Resolve) "aq_parent is not Available in ZPT when Content-Type is not text/html"
 Status Resolved, Zope/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1730

==============================================================
= Resolve - Entry #4 by efge on Mar 25, 2005 2:45 pm

 Status: Pending => Resolved

Fixed in 2.7 branch and trunk.

http://svn.zope.org/Zope/trunk/lib/python/Products/PageTemplates/Expressions.py?rev=29685&r1=28963&r2=29685

________________________________________
= Comment - Entry #3 by efge on Mar 25, 2005 2:35 pm

Hm that's actually a bug in aq_acquire when it is passed a unicode u'aq_parent' name.

________________________________________
= Comment - Entry #2 by efge on Mar 25, 2005 1:23 pm

Confirmed, traceback is:

    * Module ZPublisher.Publish, line 101, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 39, in call_object
    * Module Shared.DC.Scripts.Bindings, line 306, in __call__
    * Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
    * Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec
    * Module Products.PageTemplates.PageTemplate, line 96, in pt_render
      <ZopePageTemplate at /f/pt>
    * Module TAL.TALInterpreter, line 190, in __call__
    * Module TAL.TALInterpreter, line 234, in interpret
    * Module TAL.TALInterpreter, line 484, in do_insertText_tal
    * Module Products.PageTemplates.TALES, line 227, in evaluateText
    * Module Products.PageTemplates.TALES, line 221, in evaluate
      URL: /f/pt
      Expression: standard:u'here/aq_parent'
      Names:

{'container': <Folder instance at 40520350>,
 'context': <Folder instance at 40520350>,
 'default': <Products.PageTemplates.TALES.Default instance at 0x40aa358c>,
 'here': <Folder instance at 40520350>,
 'loop': <SafeMapping instance at 40f557f0>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x40aa306c>,
 'nothing': None,
 'options': {'args': ()},
 'repeat': <SafeMapping instance at 40f557f0>,
 'request': <HTTPRequest, URL=http://localhost:8080/f/pt>,
 'root': <Application instance at 40f2ce00>,
 'template': <ZopePageTemplate at /f/pt>,
 'traverse_subpath': [],
 'user': root}

    * Module Products.PageTemplates.Expressions, line 172, in __call__
    * Module Products.PageTemplates.Expressions, line 160, in _eval
    * Module Products.PageTemplates.Expressions, line 116, in _eval
      __traceback_info__: here
    * Module Products.PageTemplates.Expressions, line 311, in restrictedTraverse
      __traceback_info__: {'path': [u'aq_parent'], 'TraversalRequestNameStack': []}

AttributeError: aq_parent

________________________________________
= Request - Entry #1 by Anonymous User on Mar 21, 2005 8:45 am

bug is similar to 
http://www.zope.org/Collectors/Zope/436

To replicate the error create Folder. inside it create a Page Template with a text:
------------------------------------
<test xmlns:tal="http://xml.zope.org/namespaces/tal">
  <parent tal:content="here/aq_parent"
   tal:on-error="error">parent</parent>
</test>
------------------------------------
If Content-Type is set to "text/html" the code will work. If Content-Type is set to "text/xml" (or anything besides text/html) the error: "aq_parent not found in u'here/aq_parent'" will be displayed.
------------------------------------
Note: if "here/aq_parent" is replaced with "python:here.aq_parent" the code works fine for any Content-Type.
==============================================================



More information about the Zope-Collector-Monitor mailing list