Skip to content

Commit

Permalink
When installing plone.app.discussion enable comments globally.
Browse files Browse the repository at this point in the history
In 6.1 you have to explicitly install the add-on in the Add-ons control panel.
If you do that, then you obviously want discussions to be enabled globally.
I think this also helps for the Volto case, where a Discussion control panel is missing, so in Plone 6.0 you cannot even properly enable comments.
  • Loading branch information
mauritsvanrees committed Sep 2, 2024
1 parent 9648d82 commit feb6196
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
3 changes: 2 additions & 1 deletion news/211.breaking
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Move this package in the space of Plone Core add-ons.
It now depends on Products.CMFPlone and is no longer installed by default.
It is still available in the default Plone distribution, but can be omitted in customizations.
[jensens]
Installing this in the Add-ons control panel will enable comments globally.
[jensens]
2 changes: 1 addition & 1 deletion plone/app/discussion/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class IDiscussionSettings(Interface):
"objects before users will be able to post comments.",
),
required=False,
default=False,
default=True,
)

anonymous_comments = schema.Bool(
Expand Down
9 changes: 0 additions & 9 deletions plone/app/discussion/testing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.robotframework.testing import REMOTE_LIBRARY_ROBOT_TESTING
from plone.app.testing import applyProfile
from plone.app.testing import FunctionalTesting
Expand All @@ -8,9 +7,7 @@
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.app.testing import TEST_USER_PASSWORD
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from zope.component import queryUtility


try:
Expand Down Expand Up @@ -105,12 +102,6 @@ class PloneAppDiscussionRobot(PloneAppDiscussion):
REMOTE_LIBRARY_ROBOT_TESTING,
)

def setUpPloneSite(self, portal):
applyProfile(portal, "plone.app.discussion:default")
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings)
settings.globally_enabled = True


PLONE_APP_DISCUSSION_ROBOT_FIXTURE = PloneAppDiscussionRobot()
PLONE_APP_DISCUSSION_FIXTURE = PloneAppDiscussion()
Expand Down
2 changes: 1 addition & 1 deletion plone/app/discussion/tests/test_controlpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_globally_enabled(self):
"plone.app.discussion.interfaces."
+ "IDiscussionSettings.globally_enabled"
],
False,
True,
)

def test_anonymous_comments(self):
Expand Down

0 comments on commit feb6196

Please sign in to comment.