[Zope-CMF] Re: Conflict between PortalFolder and CMFBTreeFolder

yuppie y.2005- at wcm-solutions.de
Mon Jun 20 03:05:02 EDT 2005


Hi Christian!


Christian Heimes wrote:
> CMF 1.5's implementation of PortalFolder conflicts with CMFBTreeFolder.
> 
> CMF 1.4:
> class PortalFolder(DynamicType, CMFCatalogAware, Folder)
> 
> CMF 1.5:
> class PortalFolder(DynamicType, CMFCatalogAware, OrderedFolder)
> 
> BTreeFolder2:
> class CMFBTreeFolder(BTreeFolder2Base, PortalFolder)
> 
> traceback:
>   File 
> "/opt/zope/instances/plone21z28cmf15/Products/ATContentTypes/content/base.py", 
> line 312, in processForm
>     self.setId(new_id)
>   File "/opt/zope/instances/plone21/Products/Archetypes/BaseObject.py", 
> line 231, in setId
>     parent.manage_renameObject(
>   File 
> "/opt/zope/releases/Zope-2_8-branch/lib/python/OFS/OrderSupport.py", 
> line 255, in manage_renameObject
>     old_position = self.getObjectPosition(id)
>   File 
> "/opt/zope/releases/Zope-2_8-branch/lib/python/OFS/OrderSupport.py", 
> line 222, in getObjectPosition
>     return ids.index(id)
> AttributeError: 'OOBTreeItems' object has no attribute 'index'
> 
> 
> As you can see CMFBTreeFolder doesn't work any more because PortalFolder 
> is now subclassed from OrderedFolder. The changes to PortalFolder are 
> *not* backward compatible. IMO they should be reverted and an 
> OrderedPortalFolder class should be created for people how like to have 
> ordered folders in CMF.

First of all CMF 1.5.2 has to be backwards compatible to CMF 1.5.0 and 
1.5.1, so reverting that change is no option.

I propose to override manage_renameObject in PortalFolder with code that 
works for OrderedFolder *and* CMFBTreeFolder.


Cheers,
	Yuppie



BTW: I'm not at all happy with the fact that Zope 2.8 ships with 
CMFBTreeFolder. That circular dependency is a pain to maintain. Maybe we 
should move CMFBTreeFolder to a CMF product.



More information about the Zope-CMF mailing list