Ticket #7686 (closed Bug: fixed)

Opened 4 years ago

Last modified 3 years ago

AttributeError: getPhysicalPath when clicking on Collection in folder_contents view

Reported by: jjaroli Owned by: hannosch
Priority: minor Milestone: 3.3
Component: Infrastructure Keywords:
Cc: hoss

Description (last modified by hannosch) (diff)

When I switch to a folder_contents view to a folder, and click on a collection, it gives the following error message while tries to reach the {id of the collection item}/folder_contents URL.

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.Five.browser.metaconfigure, line 417, in __call__
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  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 891, in do_useMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  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 949, in do_defineSlot
  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 Products.PageTemplates.Expressions, line 221, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: index
   - Line 40, Column 8
   - Expression: <PathExpr standard:'view/contents_table'>
   - Names:
      {'container': <ATTopic at /Plone/blog/nyitolap>,
       'context': <ATTopic at /Plone/blog/nyitolap>,
       'default': <object object at 0xb7c9f528>,
       'here': <ATTopic at /Plone/blog/nyitolap>,
       'loop': {},
       'nothing': None,
       'options': {'args': (<Products.Five.metaclass.SimpleViewClass from /opt/Plone-3.0.4/zinstance/lib/python/plone/app/content/browser/foldercontents.pt object at 0xb234c74c>,)},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xb17fb4ac>,
       'request': <HTTPRequest, URL=http://Plone.hu/blog/nyitolap/folder_contents>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0xb188d3cc>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'Plone'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /opt/Plone-3.0.4/zinstance/lib/python/plone/app/content/browser/foldercontents.pt object at 0xb234c74c>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0xb18500cc>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 161, in _eval
  Module Products.PageTemplates.Expressions, line 123, in render
  Module plone.app.content.browser.foldercontents, line 28, in contents_table
  Module plone.app.content.browser.foldercontents, line 104, in __init__
  Module plone.memoize.instance, line 45, in memogetter
  Module plone.app.content.browser.foldercontents, line 131, in items
  Module Products.ATContentTypes.content.topic, line 433, in queryCatalog
  Module Products.ATContentTypes.content.topic, line 402, in buildQuery
  Module Products.ATContentTypes.criteria.relativepath, line 99, in getCriteriaItems
AttributeError: getPhysicalPath

I just started a brand new site with these settings:

  • Plone 3.0.4
  • CMF-2.1.0
  • Zope (Zope 2.10.5-final, python 2.4.4, linux2)
  • Python 2.4.4 (#1, Jan 3 2008, 09:10:07) [GCC 4.0.0 20050519 (Red Hat 4.0.0-8)]
  • PIL 1.1.6

Change History

comment:1 Changed 4 years ago by hannosch

  • Owner changed from somebody to alecm
  • Component changed from Unknown to Content Types
  • Description modified (diff)

comment:2 Changed 4 years ago by hannosch

  • Status changed from new to closed
  • Resolution set to worksforme

There is something very wrong going on with your site. The code line in question should get the portal root object and call getPhysicalPath on it. This should never fail.

I can only suspect that using 'Plone' as the user and site id lead to a conflict with some internal code. Since Plone is a trademarked word, it is not advisable to use it for anything in your site.

I fail to see how this could be a general problem and not specific to your site though.

comment:3 Changed 3 years ago by ta5ae

  • Status changed from closed to reopened
  • Resolution worksforme deleted

I see this issue as well. I first noticed it for a live 3.1.1 site, but I isolated the issue and have replicated it on a fresh 3.1.7 site (Zope 2.10.6-final, python 2.4.4, freebsd6)

  1. Create a fresh Plone site
  2. Add a collection
  3. Add a Location criteria
  4. Select 'Relative path'
  5. Use the default .. setting
  6. Navigate back to the collection to show the folder contents view, {id of the collection item}/folder_contents

My traceback included below:

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.Five.browser.metaconfigure, line 417, in __call__
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  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 891, in do_useMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  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 949, in do_defineSlot
  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 Products.PageTemplates.Expressions, line 221, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: index
   - Line 63, Column 8
   - Expression: <PathExpr standard:'view/contents_table'>
   - Names:
      {'container': <ATTopic at /test/test-1>,
       'context': <ATTopic at /test/test-1>,
       'default': <object object at 0x8192528>,
       'here': <ATTopic at /test/test-1>,
       'loop': {},
       'nothing': None,
       'options': {'args': (<Products.Five.metaclass.SimpleViewClass from /usr/local/zope/buildout/charity/eggs/plone.app.content-1.3-py2.4.egg/plone/app/content/browser/foldercontents.pt object at 0x11fc974c>,)},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x11fc922c>,
       'request': <HTTPRequest, URL=http://d.10.dallas.highspeedrails.com/test/test-1/folder_contents>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0x11fc9e0c>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /usr/local/zope/buildout/charity/eggs/plone.app.content-1.3-py2.4.egg/plone/app/content/browser/foldercontents.pt object at 0x11fc974c>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0x11fc9aac>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 161, in _eval
  Module Products.PageTemplates.Expressions, line 123, in render
  Module plone.app.content.browser.foldercontents, line 28, in contents_table
  Module plone.app.content.browser.foldercontents, line 91, in __init__
  Module plone.memoize.instance, line 45, in memogetter
  Module plone.app.content.browser.foldercontents, line 118, in items
  Module Products.ATContentTypes.content.topic, line 433, in queryCatalog
  Module Products.ATContentTypes.content.topic, line 402, in buildQuery
  Module Products.ATContentTypes.criteria.relativepath, line 99, in getCriteriaItems
AttributeError: getPhysicalPath


comment:4 Changed 3 years ago by ta5ae

NB: Using the absolute version of the Location criteria resolved my issue in 3.1.1.

comment:5 Changed 3 years ago by jonstahl

  • Milestone changed from 3.1.3 to 3.3

comment:6 Changed 3 years ago by hannosch

  • Milestone changed from 3.3 to 3.x

comment:7 Changed 3 years ago by hannosch

  • Owner changed from alecm to hannosch
  • Status changed from reopened to new

I was able to reproduce the bug now. Thanks for the detailed description!

comment:8 Changed 3 years ago by hannosch

  • Status changed from new to closed
  • Resolution set to fixed

(In [25513]) Changed the folder contents tables to deal properly with the Acquisition context of self.context. In Five's browser views, you need to do aq_inner(self.context). This closes #7686.

comment:9 Changed 3 years ago by hannosch

  • Component changed from Content Types to Infrastructure

comment:10 Changed 3 years ago by hannosch

  • Milestone changed from 3.x to 3.3

comment:11 Changed 3 years ago by hoss

  • Cc hoss added
Note: See TracTickets for help on using tickets.