collective / collective.exportimport

Export and import content and other data from and to Plone
GNU General Public License v2.0
15 stars 17 forks source link

Relations import should use plone.api.relation when available #54

Closed mauritsvanrees closed 2 years ago

mauritsvanrees commented 2 years ago

Currently collective.relationhelpers is used. When I add this package in a Plone 6 site, startup fails with a configuration conflict:

zope.configuration.config.ConfigurationConflictError: Conflicting configuration actions
  For: ('view', (<InterfaceClass Products.CMFPlone.interfaces.siteroot.IPloneSiteRoot>, <InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer>), 'inspect-relations', <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>)
    File "/Users/maurits/shared-eggs/cp39/Products.CMFPlone-6.0.0a1.dev0-py3.9.egg/Products/CMFPlone/controlpanel/browser/configure.zcml", line 326.2-332.8
        <browser:page
            name="inspect-relations"
            for="Products.CMFPlone.interfaces.IPloneSiteRoot"
            class=".relations.RelationsInspectControlpanel"
            template="relations_inspect.pt"
            permission="Products.CMFPlone.InspectRelations"
            />
    File "/Users/maurits/shared-eggs/cp39/collective.relationhelpers-1.5-py3.9.egg/collective/relationhelpers/configure.zcml", line 9.2-15.8
        <browser:page
            name="inspect-relations"
            for="Products.CMFPlone.interfaces.IPloneSiteRoot"
            class=".api.InspectRelationsControlpanel"
            template="relations_inspect.pt"
            permission="cmf.ManagePortal"
            />
  For: ('view', (<InterfaceClass Products.CMFPlone.interfaces.siteroot.IPloneSiteRoot>, <InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer>), 'rebuild-relations', <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>)
    File "/Users/maurits/shared-eggs/cp39/Products.CMFPlone-6.0.0a1.dev0-py3.9.egg/Products/CMFPlone/controlpanel/browser/configure.zcml", line 334.2-340.8
        <browser:page
            name="rebuild-relations"
            for="Products.CMFPlone.interfaces.IPloneSiteRoot"
            class=".relations.RelationsRebuildControlpanel"
            template="relations_rebuild.pt"
            permission="cmf.ManagePortal"
            />
    File "/Users/maurits/shared-eggs/cp39/collective.relationhelpers-1.5-py3.9.egg/collective/relationhelpers/configure.zcml", line 17.2-23.8
        <browser:page
            name="rebuild-relations"
            for="Products.CMFPlone.interfaces.IPloneSiteRoot"
            class=".api.RebuildRelationsControlpanel"
            template="relations_rebuild.pt"
            permission="cmf.ManagePortal"
            />

Alternatively, collective.relationhelpers should be fixed to not fail in this case.

fredvd commented 2 years ago

@mauritsvanrees ah these are the control panel views from c.relationhelpers that where added to plone 6 core by I think @loechel at/after the relations sprint this spring.

doe we have a "have plone6" zcml condition yet?

mauritsvanrees commented 2 years ago

do we have a "have plone6" zcml condition yet?

Yes, have plone-60 would do it, which is defined in CMFPlone/meta.zcml.

fredvd commented 2 years ago

Added the zcml comdition to collective.relarionhelpers to not register the views on plone60

mauritsvanrees commented 2 years ago

Thanks.