From 543b9d47c5724b6cb7bb8990de365f7ba5b25ad3 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 24 Jan 2011 08:37:43 +0000 Subject: [PATCH] Remove moderation_enabled setting from registry to avoid migration problems to 1.0RC1. Refs #11419. svn path=/plone.app.discussion/branches/1.x/; revision=47031 --- CHANGES.txt | 8 +++++ plone/app/discussion/browser/controlpanel.py | 20 +++++-------- plone/app/discussion/interfaces.py | 29 ++++++++++--------- .../app/discussion/tests/test_controlpanel.py | 15 +++++----- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3d01bc4..75bb182 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,14 @@ Changelog ========= +1.0RC2 (2011-01-24) +------------------- + +- Remove moderation_enabled setting from registry to avoid migration problems + to 1.0RC1. This fixes http://dev.plone.org/plone/ticket/11419. + [timo] + + 1.0RC1 (2011-01-22) ------------------- diff --git a/plone/app/discussion/browser/controlpanel.py b/plone/app/discussion/browser/controlpanel.py index 41c47a4..86fec5e 100644 --- a/plone/app/discussion/browser/controlpanel.py +++ b/plone/app/discussion/browser/controlpanel.py @@ -45,8 +45,9 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm): super(DiscussionSettingsEditForm, self).updateFields() self.fields['globally_enabled'].widgetFactory = \ SingleCheckBoxFieldWidget - self.fields['moderation_enabled'].widgetFactory = \ - SingleCheckBoxFieldWidget + # p.a.discussion > 2.0 only + #self.fields['moderation_enabled'].widgetFactory = \ + # SingleCheckBoxFieldWidget self.fields['anonymous_comments'].widgetFactory = \ SingleCheckBoxFieldWidget self.fields['show_commenter_image'].widgetFactory = \ @@ -65,14 +66,8 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm): _(u"Moderator Email Notification") self.widgets['user_notification_enabled'].label = \ _(u"User Email Notification") - - # Hide the moderation_enabled widget. We need plone.app.controlpanel - # > 2.1b1 in order to make sure that the proper events are fired when - # the workflow for discussion items is changed in the types control - # panel. Though, Plone 3 and 4.0 ship with an older version of - # p.a.controlpanel that do not fire this event properly. - # http://dev.plone.org/plone/changeset/46270/plone.app.controlpanel/trunk - self.widgets['moderation_enabled'].mode = interfaces.HIDDEN_MODE + # p.a.discussion > 2.0 only + #self.widgets['moderation_enabled'].mode = interfaces.HIDDEN_MODE @button.buttonAndHandler(_('Save'), name='save') def handleSave(self, action): @@ -117,8 +112,9 @@ class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper): if 'one_state_workflow' not in wf and \ 'comment_review_workflow' not in wf: output.append("moderation_custom") - elif settings.moderation_enabled: - output.append("moderation_enabled") + # p.a.discussion > 2.0 only + #elif settings.moderation_enabled: + # output.append("moderation_enabled") # Anonymous comments if settings.anonymous_comments: diff --git a/plone/app/discussion/interfaces.py b/plone/app/discussion/interfaces.py index 1259c0c..adb57e4 100644 --- a/plone/app/discussion/interfaces.py +++ b/plone/app/discussion/interfaces.py @@ -44,20 +44,21 @@ class IDiscussionSettings(Interface): default=False, ) - moderation_enabled = schema.Bool( - title=_(u"label_moderation_enabled", - default="Enable comment moderation"), - description=_(u"help_moderation_enabled", - default=u"If selected, comments will enter a 'Pending' state " - "in which they are invisible to the public. A user " - "with the 'Review comments' permission ('Reviewer' or " - "'Manager') can approve comments to make them visible " - "to the public. If you want to enable a custom " - "comment workflow, you have to go to the types " - "control panel."), - required=False, - default=False, - ) +# p.a.discussion > 2.0 only +# moderation_enabled = schema.Bool( +# title=_(u"label_moderation_enabled", +# default="Enable comment moderation"), +# description=_(u"help_moderation_enabled", +# default=u"If selected, comments will enter a 'Pending' state " +# "in which they are invisible to the public. A user " +# "with the 'Review comments' permission ('Reviewer' or " +# "'Manager') can approve comments to make them visible " +# "to the public. If you want to enable a custom " +# "comment workflow, you have to go to the types " +# "control panel."), +# required=False, +# default=False, +# ) text_transform = schema.Choice( diff --git a/plone/app/discussion/tests/test_controlpanel.py b/plone/app/discussion/tests/test_controlpanel.py index 39b029d..f3f925b 100644 --- a/plone/app/discussion/tests/test_controlpanel.py +++ b/plone/app/discussion/tests/test_controlpanel.py @@ -54,13 +54,14 @@ class RegistryTest(PloneTestCase): self.assertEquals(self.registry['plone.app.discussion.interfaces.' + 'IDiscussionSettings.anonymous_comments'], False) - def test_moderation_enabled(self): - # Check globally_enabled record - self.failUnless('moderation_enabled' in IDiscussionSettings) - self.assertEquals( - self.registry['plone.app.discussion.interfaces.' + - 'IDiscussionSettings.moderation_enabled'], - False) +# p.a.discussion > 2.0 only +# def test_moderation_enabled(self): +# # Check globally_enabled record +# self.failUnless('moderation_enabled' in IDiscussionSettings) +# self.assertEquals( +# self.registry['plone.app.discussion.interfaces.' + +# 'IDiscussionSettings.moderation_enabled'], +# False) def test_text_transform(self): self.failUnless('text_transform' in IDiscussionSettings)