ZPatterns bug: Customizers don't rename well
ZPatterns 0-4-1snap1 Zope 2.2.1 To reproduce the error, do this: Create a Folder with Customizer support Give it a Customizer Rename that Customizer Press the "Customizers" tab in the folder Zope Error Error Type: AttributeError Error Value: __customizerRegistry__ Traceback (innermost last): File /lib/python/ZPublisher/Publish.py, line 222, in publish_module File /lib/python/ZPublisher/Publish.py, line 187, in publish File /lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook File /lib/python/ZPublisher/Publish.py, line 171, in publish File /lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_main) File /lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_main) File /lib/python/App/special_dtml.py, line 120, in __call__ (Object: manage_main) (Info: /lib/python/Products/ZPatterns/www/PlugInGroup.dtml) File /lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: manage_main) File /lib/python/App/special_dtml.py, line 120, in __call__ (Object: manage_below) (Info: /lib/python/Products/ZPatterns/www/showCustomizers.dtml) File /lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: manage_below) File /lib/python/DocumentTemplate/DT_In.py, line 630, in renderwob (Object: manage_registry) File /lib/python/Products/ZPatterns/Customizers.py, line 63, in manage_registry AttributeError: (see above) The error occurs because the rename method redirects to: http://puffin.cat-box.net:7080/test/Customizers_ Pressing the "customizers" tab yields the url: http://puffin.cat-box.net:7080/test/Customizers_/Customizers_/manage_workspa... -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net
At 07:32 PM 8/29/00 +0100, Steve Alexander wrote:
To reproduce the error, do this:
Create a Folder with Customizer support Give it a Customizer Rename that Customizer Press the "Customizers" tab in the folder
Zope Error
Error Type: AttributeError Error Value: __customizerRegistry__
What's happening is that the new manage_renameObjects (plural) function doesn't have a masking method in PlugInGroup. These masking methods serve to alter the URL base used for the management tabs, so that a PlugInGroup's management tabs will point to the parent PlugInContainer's methods, and not to nonexistent methods of itself. The resulting error is a harmless side effect of this URL confusion; you can simply click your way back into the right place and everything will work fine. Meanwhile, I'm adding the following method to the PlugInGroup class for the next release of ZPatterns: def manage_renameObjects(self, ids, new_ids, REQUEST=None): """Rename several sub-objects""" self.aq_inner.aq_parent.manage_renameObjects(id,new_ids) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1, URL=REQUEST.URL1+'/manage_workspace') This should fix the problem, although I have not yet tested that it in fact does so.
At 06:15 PM 8/30/00 -0500, Phillip J. Eby wrote:
Meanwhile, I'm adding the following method to the PlugInGroup class for the next release of ZPatterns:
def manage_renameObjects(self, ids, new_ids, REQUEST=None): """Rename several sub-objects""" self.aq_inner.aq_parent.manage_renameObjects(id,new_ids) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1, URL=REQUEST.URL1+'/manage_workspace')
That should actually say: self.aq_inner.aq_parent.manage_renameObjects(ids,new_ids) And I've now confirmed that it does indeed fix the URL messups.
Mostly bugfixes and internal reorganizations, some very minor feature additions. This thing is finally beginning to stabilize a bit. Wish me luck on getting some time to document SkinScript... :) Meanwhile, my department is about to embark on a significant production product using ZPatterns, and I hope to funnel some of its design and/or code out as a ZPatterns example. Wish me luck on that, too. Anyway, 0.4.2a1 can be found in its usual place at: http://www.zope.org/Members/pje/ZPatterns/
participants (2)
-
Phillip J. Eby -
Steve Alexander