Ticket #13792 (new Bug)
plone.contentmenu fails to render in Archtype-based folders set to inherit locally allowed types from Dexterity-based container
Reported by: | davidjb | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.x |
Component: | Unknown | Version: | 4.3 |
Keywords: | dexterity | Cc: |
Description
I can create a Dexterity based container content type (either with or without the "Folder Addable Constrains" behaviour applied), and add a AT-based folder into such a container. If I then set the locally addable types restrictions on the folder to acquire from the parent, the rendering of the main "Add new" menu fails.
The chain of events are as follows:
- plone.contentmenu fails when trying to access parent.getLocallyAllowedTypes() method in various places in Products.ATContentTypes.lib.constraintypes. This fails with AttributeError being raised in one of numerous locations where this method is attempted to be called -- presumably this is because the AT package seemingly isn't Dexterity-aware.
- plone.contentactions, which called the above menu, now fails during rendering
- plone.contentviews, which featured the above viewlet, subsequently fails during rendering
The end result is a rather unhelpful error:
2013-11-05 20:32:27 ERROR plone.app.viewletmanager rendering of plone.contentviews in plone.contentactions fails: getLocallyAllowedTypes
which obfuscates/swallows much of the above context.
It seems this issue might also be affecting the ability to change the local type restrictions on sub-folders, but this requires more investigation.
I'll happily fix this, but just don't know where to start. Should/can Products.ATContentTypes be able to do an adapter lookup to become compatible with Dexterity, or should Dexterity's behaviour (plone.app.dexterity.behaviors.constrains) for this purpose be modified in some way?
I've worked around this issue in my own Dexterity content type by mimicking what the Archetypes content does and proxying through to the Dexterity behaviour class: https://github.com/collective/collective.spaces/commit/bcdc5d87d4dc85741ddd10bfc6897b59c87b38f8