Ticket #58 (bug)
Opened 2 years ago
Last modified 2 years ago
'NoneType' object has no attribute 'getPhysicalPath' qPloneResolvUID
Status: closed (fixed)
| Reported by: | landure | Assigned to: | fenix |
|---|---|---|---|
| Priority: | major | Component: | qPloneResolveUID |
| Keywords: | qPloneResolvUID | Cc: | |
It seems that this bug appear when there is no object associed to the UID (deleted object). also there is no bug tracker for qPloneResolvUID so i post in general.
bellow is the error report.
Time 2006/10/16 12:17:22.703 GMT+2 User Name (User Id) admin (admin) Request URL http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines/richdocument_view Exception Type AttributeError? Exception Value 'NoneType' object has no attribute 'getPhysicalPath'
Traceback (innermost last):
- Module ZPublisher.Publish, line 115, in publish
- Module ZPublisher.mapply, line 88, in mapply
- Module ZPublisher.Publish, line 41, in call_object
- Module Shared.DC.Scripts.Bindings, line 311, in call
- Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
- Module Products.CMFCore.FSPageTemplate, line 195, in _exec
- Module Products.CMFCore.FSPageTemplate, line 134, in pt_render
- Module Products.PageTemplates?.PageTemplate?, line 104, in pt_render <FSPageTemplate at /patrick-adler/richdocument_view used for /patrick-adler/les-voix/voix-parlees-masculines>
- Module TAL.TALInterpreter, line 238, in call
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 749, in do_useMacro
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 457, in do_optTag_tal
- Module TAL.TALInterpreter, line 442, in do_optTag
- Module TAL.TALInterpreter, line 437, in no_tag
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 780, in do_defineSlot
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 457, in do_optTag_tal
- Module TAL.TALInterpreter, line 442, in do_optTag
- Module TAL.TALInterpreter, line 437, in no_tag
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 728, in do_defineMacro
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 772, in do_defineSlot
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 457, in do_optTag_tal
- Module TAL.TALInterpreter, line 442, in do_optTag
- Module TAL.TALInterpreter, line 437, in no_tag
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 728, in do_defineMacro
- Module TAL.TALInterpreter, line 281, in interpret
- Module TAL.TALInterpreter, line 507, in do_setLocal_tal
- Module Products.PageTemplates?.TALES, line 221, in evaluate URL: file:RichDocument/skins/RichDocument/richdocument_view.pt Line 8, Column 4 Expression: <PythonExpr? here.CookedBody(stx_level=2)> Names:
{'container': <PloneSite? at /patrick-adler>,
'context': <RichDocument? at /patrick-adler/les-voix/voix-parlees-masculines>, 'default': <Products.PageTemplates?.TALES.Default instance at 0xb723abac>, 'here': <RichDocument? at /patrick-adler/les-voix/voix-parlees-masculines>, 'loop': <Products.PageTemplates?.TALES.SafeMapping? object at 0xb2eba80c>, 'modules': <Products.PageTemplates?.ZRPythonExpr._SecureModuleImporter instance at 0xb71e862c>, 'nothing': None, 'options': {'args': ()}, 'repeat': <Products.PageTemplates?.TALES.SafeMapping? object at 0xb2eba80c>, 'request': <HTTPRequest, URL=http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines/richdocument_view>, 'root': <Application at >, 'template': <FSPageTemplate at /patrick-adler/richdocument_view used for /patrick-adler/les-voix/voix-parlees-masculines>, 'traverse_subpath': [], 'user': <PropertiedUser? 'admin'>}
- Module Products.PageTemplates?.ZRPythonExpr, line 47, in call traceback_info: here.CookedBody(stx_level=2)
- Module Python expression "here.CookedBody(stx_level=2)", line 1, in <expression>
- Module Products.ATContentTypes.content.document, line 115, in CookedBody?
- Module Products.Archetypes.ClassGen?, line 58, in generatedAccessor
- Module Products.Archetypes.Field, line 1293, in get
- Module Products.Archetypes.BaseUnit?, line 104, in transform
- Module Products.PortalTransforms?.TransformEngine?, line 183, in convertTo
- Module Products.PortalTransforms?.chain, line 46, in convert
- Module Products.PortalTransforms?.Transform, line 183, in convert
- Module Products.qPloneResolveUID.transforms.ruid_to_url, line 53, in convert
- Module Products.qPloneResolveUID.transforms.ruid_to_url, line 46, in mapRUID_URL
- Module Products.CMFCore.URLTool, line 88, in getRelativeContentURL
- Module Products.CMFCore.URLTool, line 81, in getRelativeContentPath
AttributeError?: 'NoneType' object has no attribute 'getPhysicalPath'
Display traceback as text
REQUEST form -C cookies dtpref_rows '15' dtpref_cols '100%' tree-s 'eJzT0MgpMOQKVneEA1dbda4CI67EkgJjLj0AeGcHew' lazy items SESSION <bound method SessionDataManager?.getSessionData of <SessionDataManager? at /session_data_manager>> other _oai_cache {-1292869588: <Products.CMFCore.ActionInformation?.oai instance at 0xb2f02f4c>} TraversalRequestNameStack? [] LANGUAGE 'fr' AUTHENTICATED_USER <PropertiedUser? 'admin'> URL 'http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines/richdocument_view' _pts_is_rtl False SERVER_URL 'http://localhost:9685' LANGUAGE_TOOL <Products.PloneLanguageTool?.LanguageTool?.LanguageBinding? instance at 0xb2f1150c> AUTHENTICATION_PATH traverse_subpath [] _ec_cache {-1292869588: <Products.PageTemplates?.TALES.Context instance at 0xb2f0246c>} _pts_catalog_names_plone_fr ['0-Sovam.i18n-sovam-plone-fr.po', 'Daviderie_Skin.i18n-daviderie-plone-fr.po', 'PloneTranslations?.i18n-archetypes-fr.po', 'PloneTranslations?.i18n-plone-fr.po', 'RedirectionTool?.i18n-RedirectionTool-plone-fr.po', 'RichDocument?.i18n-richdocument-plone-fr.po', 'LoginHistory?.i18n-LoginHistory-plone-en.po', 'PloneTranslations?.i18n-archetypes-en.po', 'PloneTranslations?.i18n-plone-en.po', 'UniversalSodexho_clientInterface.i18n-universal-sodexho-client-interface-plone-en.po'] PUBLISHED <FSPageTemplate at /patrick-adler/richdocument_view used for /patrick-adler/les-voix/voix-parlees-masculines> _pts_negotiator_cache_language {('sq', 'zh-cn', 'it', 'uk', 'en', 'bg', 'tr', 'kn', 'zh-hk', 'zh', 'cy', 'fi', 'ru', 'sv', 'lt', 'el', 'hy', 'mi', 'id', 'ca', 'vi', 'hu', 'bn', 'ro', 'nn', 'cs', 'hr', 'da', 'ja', 'sm', 'et', 'ka', 'nl', 'zh-tw', 'no', 'fa', 'hi', 'my', 'pt-br', 'af', 'to', 'sl', 'de', 'fr', 'es', 'ta', 'pl', 'eo', 'he', 'sk', 'sr-latn', 'ar', 'ko', 'te', 'pt', 'eu', 'sr', 'ca-fr', 'ca-es', 'es-pe', 'ca-ad', 'fr-ch', 'de-lu', 'ko-kr', 'es-ec', 'zh-cn', 'en-ca', 'es-uy', 'es-cl', 'de-at', 'es-co', 'zh-hk', 'en-bz', 'zh', 'ca-it', 'es-sv', 'it-it', 'de-ch', 'no-bok', 'ja-jp', 'tr-tr', 'es-es', 'es-pa', 'en-us', 'eu-es', 'zh-sg', 'nn-no', 'nl-be', 'en-za', 'fr-mc', 'de-li', 'es-hn', 'es-cr', 'nb', 'en-jm', 'es-ni', 'es-mx', 'en-tt', 'en-zw', 'es-gt', 'nb-no', 'it-ch', 'hr-hr', 'es-pr', 'en-ie', 'es-py', 'fr-lu', 'bs', 'en-au', 'hr-ba', 'fr-be', 'es-bo', 'zh-mo', 'es-ve', 'sh', 'fr-fr', 'de-de', 'en-nz', 'es-ar', 'en-ph', 'no-nyn', 'es-us', 'es-do', 'en-gb', 'sv-fi', 'fr-ca'): 'fr'} ACTUAL_URL 'http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines/view' URL0 http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines/richdocument_view URL1 http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines URL2 http://localhost:9685/patrick-adler/les-voix URL3 http://localhost:9685/patrick-adler URL4 http://localhost:9685 BASE0 http://localhost:9685 BASE1 http://localhost:9685 BASE2 http://localhost:9685/patrick-adler BASE3 http://localhost:9685/patrick-adler/les-voix BASE4 http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines BASE5 http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines/richdocument_view environ HTTP_COOKIE 'dtpref_rows="15"; dtpref_cols="100%"; tree-s="eJzT0MgpMOQKVneEA1dbda4CI67EkgJjLj0AeGcHew"' SERVER_SOFTWARE 'Zope/(Zope 2.9.2-, python 2.4.3, linux2) ZServer/1.1 Plone/2.5' SCRIPT_NAME REQUEST_METHOD 'GET' PATH_INFO '/patrick-adler/les-voix/voix-parlees-masculines/view' SERVER_PROTOCOL 'HTTP/1.1' channel.creation_time 1160993318 CONNECTION_TYPE 'keep-alive' HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' HTTP_USER_AGENT 'Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7' HTTP_REFERER 'http://localhost:9685/patrick-adler' SERVER_NAME '0.0.0.0' REMOTE_ADDR '127.0.0.1' PATH_TRANSLATED '/patrick-adler/les-voix/voix-parlees-masculines/view' SERVER_PORT '9685' HTTP_HOST 'localhost:9685' HTTP_ACCEPT 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' GATEWAY_INTERFACE 'CGI/1.1' HTTP_ACCEPT_LANGUAGE 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' HTTP_ACCEPT_ENCODING 'gzip,deflate' HTTP_KEEP_ALIVE '300'
and below is the event log :
2006-10-16T12:17:22 ERROR Zope.SiteErrorLog? http://localhost:9685/patrick-adler/les-voix/voix-parlees-masculines/richdocument_view Traceback (most recent call last):
File "/usr/lib/zope2.9/lib/python2.4/site-packages/ZPublisher/Publish.py", line 115, in publish
request, bind=1)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/ZPublisher/mapply.py", line 88, in mapply
if debug is not None: return debug(object,args,context)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/ZPublisher/Publish.py", line 41, in call_object
result=apply(object,args) # Type s<cr> to step into published object.
File "/usr/lib/zope2.9/lib/python2.4/site-packages/Shared/DC/Scripts/Bindings.py", line 311, in call
return self._bindAndExec(args, kw, None)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/Shared/DC/Scripts/Bindings.py", line 348, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/var/lib/zope2.9/instance/plone-2.5/Products/CMFCore/FSPageTemplate.py", line 195, in _exec
result = self.pt_render(extra_context=bound_names)
File "/var/lib/zope2.9/instance/plone-2.5/Products/CMFCore/FSPageTemplate.py", line 134, in pt_render
result = FSPageTemplate.inheritedAttribute('pt_render')(
File "/usr/lib/zope2.9/lib/python2.4/site-packages/Products/PageTemplates/PageTemplate.py", line 104, in pt_render
tal=not source, strictinsert=0)()
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 238, in call
self.interpret(self.program)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 749, in do_useMacro
self.interpret(macro)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 457, in do_optTag_tal
self.do_optTag(stuff)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 442, in do_optTag
return self.no_tag(start, program)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 437, in no_tag
self.interpret(program)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 780, in do_defineSlot
self.interpret(block)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 457, in do_optTag_tal
self.do_optTag(stuff)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 442, in do_optTag
return self.no_tag(start, program)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 437, in no_tag
self.interpret(program)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 728, in do_defineMacro
self.interpret(macro)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 772, in do_defineSlot
self.interpret(slot)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 457, in do_optTag_tal
self.do_optTag(stuff)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 442, in do_optTag
return self.no_tag(start, program)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 437, in no_tag
self.interpret(program)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 728, in do_defineMacro
self.interpret(macro)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 281, in interpret
handlers[opcode](self, args)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/TAL/TALInterpreter.py", line 507, in do_setLocal_tal
self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/usr/lib/zope2.9/lib/python2.4/site-packages/Products/PageTemplates/TALES.py", line 221, in evaluate
return expression(self)
File "/usr/lib/zope2.9/lib/python2.4/site-packages/Products/PageTemplates/ZRPythonExpr.py", line 47, in call
return eval(code, g, {})
File "Python expression "here.CookedBody(stx_level=2)"", line 1, in <expression> File "/var/lib/zope2.9/instance/plone-2.5/Products/ATContentTypes/content/document.py", line 115, in CookedBody?
return self.getText()
File "/var/lib/zope2.9/instance/plone-2.5/Products/Archetypes/ClassGen.py", line 58, in generatedAccessor
return schema[name].get(self, **kw)
File "/var/lib/zope2.9/instance/plone-2.5/Products/Archetypes/Field.py", line 1293, in get
encoding=kwargs.get('encoding',None))
File "/var/lib/zope2.9/instance/plone-2.5/Products/Archetypes/BaseUnit.py", line 104, in transform
filename=self.filename)
File "/var/lib/zope2.9/instance/plone-2.5/Products/PortalTransforms/TransformEngine.py", line 183, in convertTo
result = transform.convert(orig, data, context=context, usedby=usedby, **kwargs)
File "/var/lib/zope2.9/instance/plone-2.5/Products/PortalTransforms/chain.py", line 46, in convert
data = transform.convert(orig, data, **kwargs)
File "/var/lib/zope2.9/instance/plone-2.5/Products/PortalTransforms/Transform.py", line 183, in convert
return self._v_transform.convert(*args, **kwargs)
File "/var/lib/zope2.9/instance/plone-2.5/Products/qPloneResolveUID/transforms/ruid_to_url.py", line 53, in convert
ruid_url = self.mapRUID_URL(unique_ruid, kwargs['context'])
File "/var/lib/zope2.9/instance/plone-2.5/Products/qPloneResolveUID/transforms/ruid_to_url.py", line 46, in mapRUID_URL
ruid_url[ruid] = pu.getRelativeUrl(rc.lookupObject(ruid.replace('resolveuid/', )))
File "/var/lib/zope2.9/instance/plone-2.5/Products/CMFCore/URLTool.py", line 88, in getRelativeContentURL
return '/'.join( self.getRelativeContentPath(content) )
File "/var/lib/zope2.9/instance/plone-2.5/Products/CMFCore/URLTool.py", line 81, in getRelativeContentPath
content_path = content.getPhysicalPath() AttributeError?: 'NoneType' object has no attribute 'getPhysicalPath'
Attachments
Change History
10/16/06 05:50:46: Modified by landure
10/16/06 07:26:25: Modified by myroslav
- owner changed from myroslav to fenix.
- component changed from General to qPloneResolveUID.
It look like you are failing to provide URL when there is no object behind the UID (the resolveuid/UID should be left intact then). Create the test for the bug that fails, correct bug and check that test is not failing anymore, please.
10/18/06 09:28:15: Modified by landure
- attachment qploneresolveuid-noobject.patch added.
This patch correct the bug. (from version 0.1)
12/20/06 05:59:49: Modified by fenix
- status changed from new to assigned.
12/20/06 07:26:32: Modified by fenix
- status changed from assigned to closed.
- resolution set to fixed.
fixed in [714] revision

Bellow is the patch to correct this problem
--- /home/landure/qPloneResolveUID/transforms/ruid_to_url.py 2006-09-28 18:06:17.000000000 +0200 +++ qPloneResolveUID/transforms/ruid_to_url.py 2006-10-16 12:45:49.000000000 +0200 @@ -43,7 +43,9 @@