plone / plone.app.discussion

General commenting system for Plone content
https://pypi.org/project/plone.app.discussion
16 stars 47 forks source link

Replace plone.api code #188

Closed mauritsvanrees closed 2 years ago

mauritsvanrees commented 3 years ago

plone.app.discussion is using plone.api. This should not be done in core Plone code, to avoid circular dependencies. This is only in browser/moderation.py.

In Plone 6, with only Products.CMFPlone and not Plone, the instance actually fails to start:

  File "/Users/maurits/shared-eggs/cp39/plone.app.discussion-4.0.0a2-py3.9.egg/plone/app/discussion/browser/moderation.py", line 6, in <module>
    from plone import api
  File "/Users/maurits/shared-eggs/cp39/plone.api-2.0.0a1-py3.9.egg/plone/api/__init__.py", line 7, in <module>
    from plone.api import relation
  File "/Users/maurits/shared-eggs/cp39/plone.api-2.0.0a1-py3.9.egg/plone/api/relation.py", line 10, in <module>
    from plone.app.iterate.dexterity import ITERATE_RELATION_NAME
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/maurits/shared-eggs/cp39/plone.app.discussion-4.0.0a2-py3.9.egg/plone/app/discussion/browser/configure.zcml", line 16.4-22.10
    File "/Users/maurits/tmp/test/parts/instance/etc/site.zcml", line 16.2-16.23
    File "/Users/maurits/shared-eggs/cp39/Products.CMFPlone-6.0.0a1.dev0-py3.9.egg/Products/CMFPlone/configure.zcml", line 16.2-16.44
    File "/Users/maurits/shared-eggs/cp39/plone.app.discussion-4.0.0a2-py3.9.egg/plone/app/discussion/configure.zcml", line 33.4-33.34
    ModuleNotFoundError: No module named 'plone.app.iterate'

That is also an issue in plone.api, which I will raise there.