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
This commit is contained in:
Timo Stollenwerk 2011-01-24 08:37:43 +00:00
parent f44cb442eb
commit 543b9d47c5
4 changed files with 39 additions and 33 deletions

View File

@ -1,6 +1,14 @@
Changelog 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) 1.0RC1 (2011-01-22)
------------------- -------------------

View File

@ -45,8 +45,9 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
super(DiscussionSettingsEditForm, self).updateFields() super(DiscussionSettingsEditForm, self).updateFields()
self.fields['globally_enabled'].widgetFactory = \ self.fields['globally_enabled'].widgetFactory = \
SingleCheckBoxFieldWidget SingleCheckBoxFieldWidget
self.fields['moderation_enabled'].widgetFactory = \ # p.a.discussion > 2.0 only
SingleCheckBoxFieldWidget #self.fields['moderation_enabled'].widgetFactory = \
# SingleCheckBoxFieldWidget
self.fields['anonymous_comments'].widgetFactory = \ self.fields['anonymous_comments'].widgetFactory = \
SingleCheckBoxFieldWidget SingleCheckBoxFieldWidget
self.fields['show_commenter_image'].widgetFactory = \ self.fields['show_commenter_image'].widgetFactory = \
@ -65,14 +66,8 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
_(u"Moderator Email Notification") _(u"Moderator Email Notification")
self.widgets['user_notification_enabled'].label = \ self.widgets['user_notification_enabled'].label = \
_(u"User Email Notification") _(u"User Email Notification")
# p.a.discussion > 2.0 only
# Hide the moderation_enabled widget. We need plone.app.controlpanel #self.widgets['moderation_enabled'].mode = interfaces.HIDDEN_MODE
# > 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
@button.buttonAndHandler(_('Save'), name='save') @button.buttonAndHandler(_('Save'), name='save')
def handleSave(self, action): def handleSave(self, action):
@ -117,8 +112,9 @@ class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper):
if 'one_state_workflow' not in wf and \ if 'one_state_workflow' not in wf and \
'comment_review_workflow' not in wf: 'comment_review_workflow' not in wf:
output.append("moderation_custom") output.append("moderation_custom")
elif settings.moderation_enabled: # p.a.discussion > 2.0 only
output.append("moderation_enabled") #elif settings.moderation_enabled:
# output.append("moderation_enabled")
# Anonymous comments # Anonymous comments
if settings.anonymous_comments: if settings.anonymous_comments:

View File

@ -44,20 +44,21 @@ class IDiscussionSettings(Interface):
default=False, default=False,
) )
moderation_enabled = schema.Bool( # p.a.discussion > 2.0 only
title=_(u"label_moderation_enabled", # moderation_enabled = schema.Bool(
default="Enable comment moderation"), # title=_(u"label_moderation_enabled",
description=_(u"help_moderation_enabled", # default="Enable comment moderation"),
default=u"If selected, comments will enter a 'Pending' state " # description=_(u"help_moderation_enabled",
"in which they are invisible to the public. A user " # default=u"If selected, comments will enter a 'Pending' state "
"with the 'Review comments' permission ('Reviewer' or " # "in which they are invisible to the public. A user "
"'Manager') can approve comments to make them visible " # "with the 'Review comments' permission ('Reviewer' or "
"to the public. If you want to enable a custom " # "'Manager') can approve comments to make them visible "
"comment workflow, you have to go to the types " # "to the public. If you want to enable a custom "
"control panel."), # "comment workflow, you have to go to the types "
required=False, # "control panel."),
default=False, # required=False,
) # default=False,
# )
text_transform = schema.Choice( text_transform = schema.Choice(

View File

@ -54,13 +54,14 @@ class RegistryTest(PloneTestCase):
self.assertEquals(self.registry['plone.app.discussion.interfaces.' + self.assertEquals(self.registry['plone.app.discussion.interfaces.' +
'IDiscussionSettings.anonymous_comments'], False) 'IDiscussionSettings.anonymous_comments'], False)
def test_moderation_enabled(self): # p.a.discussion > 2.0 only
# Check globally_enabled record # def test_moderation_enabled(self):
self.failUnless('moderation_enabled' in IDiscussionSettings) # # Check globally_enabled record
self.assertEquals( # self.failUnless('moderation_enabled' in IDiscussionSettings)
self.registry['plone.app.discussion.interfaces.' + # self.assertEquals(
'IDiscussionSettings.moderation_enabled'], # self.registry['plone.app.discussion.interfaces.' +
False) # 'IDiscussionSettings.moderation_enabled'],
# False)
def test_text_transform(self): def test_text_transform(self):
self.failUnless('text_transform' in IDiscussionSettings) self.failUnless('text_transform' in IDiscussionSettings)