CatalogAwareness and CopySupport, cut and paste problem
I'm using a product python class that inherits from CatalogAwareness and CopySupport. The automatic indexing and unindexing on creation and deletion works fine. When a cutted object is pasted into another folder, manage_beforeDelete raises Error Type: AttributeError Error Value: aq_acquire. Debugging brought up, that absolute_url() doesn't work when the object is marked as cutted. The acquisitiontree is traversed up to th root-application object. Zope.absolute_url() tries to call self.aq_acquire('REQUEST').script. I didn't overwrite any of the involved methods and have no idea what else could have such a bad influence on the Application object. When a object is explicitly deleted, manage_deforeDelete() works well. I would be very glad if someone could help me out. Thanks, Alex
"König Alexander" wrote:
The automatic indexing and unindexing on creation and deletion works fine. When a cutted object is pasted into another folder, manage_beforeDelete raises
Error Type: AttributeError Error Value: aq_acquire.
Debugging brought up, that absolute_url() doesn't work when the object is marked as cutted. The acquisitiontree is traversed up to th root-application object. Zope.absolute_url() tries to call self.aq_acquire('REQUEST').script.
I have exactly the same problem. I solved it by using absolute_url(1) and tacking on '/' to the beginning in the CatalogAware.url() function. Once you do that you have problems with self.REQUEST not existing, so comment out that line and set script_name or whatever it's called to "". At which point you start wondering why CatalogAware doesn't use the code PortalContent does and way absolute_url is so broken. And what is REQUEST['SCRIPT_NAME'] anyway? -- -= This is NOT a pyramid scheme =- The SNAFU Principle: True communication is possible only between equals Itamar S.T. itamars@ibm.net
From: "Itamar Shtull-Trauring" <itamars@ibm.net> <SNIP>
And what is REQUEST['SCRIPT_NAME'] anyway?
It is the path portion of the URL _before_ the Zope root. This is empty when your Zope site sits directly at the root of your server (as when you serve with ZServer, or rewrite / to your Zope server in Apache). When your site hangs behind a deeper URL however, like http://mysite.url.com/Zope, then, to use this example, SCRIPT_NAME is '/Zope'. Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | The Open Source Web Application Server ---------------------------------------------
From: "Itamar Shtull-Trauring" <itamars@ibm.net> <SNIP>
And what is REQUEST['SCRIPT_NAME'] anyway?
It is the path portion of the URL _before_ the Zope root. This is empty when your Zope site sits directly at the root of your server (as when you serve with ZServer, or rewrite / to your Zope server in Apache). When your site hangs behind a deeper URL however, like http://mysite.url.com/Zope, then, to use this example, SCRIPT_NAME is '/Zope'. Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | The Open Source Web Application Server ---------------------------------------------
participants (3)
-
Itamar Shtull-Trauring -
König Alexander -
Martijn Pieters