From 81dcdeaea324e2f30c56b55734e7fc85b7a12d8d Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 29 Oct 2010 10:43:46 +0000 Subject: [PATCH] Disable the plone.app.registry check on schema elements, so no error is raised on upgrades. This fixes https://dev.plone.org/plone/ticket/11195. Refs #11195 svn path=/plone.app.discussion/trunk/; revision=40868 --- CHANGES.txt | 4 ++++ plone/app/discussion/browser/captcha.py | 2 +- plone/app/discussion/browser/comments.py | 8 ++++---- plone/app/discussion/browser/validator.py | 2 +- plone/app/discussion/comment.py | 4 ++-- plone/app/discussion/conversation.py | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a55d90a..5ea8026 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,10 @@ Changelog 1.0b11 (unreleased) ------------------- +- Disable the plone.app.registry check on schema elements, so no error is + raised on upgrades. This fixes https://dev.plone.org/plone/ticket/11195. + [timo] + - Remove the too generic id attribute of the comment form. [timo] diff --git a/plone/app/discussion/browser/captcha.py b/plone/app/discussion/browser/captcha.py index 4c09a91..ede8fc0 100644 --- a/plone/app/discussion/browser/captcha.py +++ b/plone/app/discussion/browser/captcha.py @@ -52,7 +52,7 @@ class CaptchaExtender(extensible.FormExtender): self.form = form registry = queryUtility(IRegistry) - settings = registry.forInterface(IDiscussionSettings) + settings = registry.forInterface(IDiscussionSettings, check=False) self.captcha = settings.captcha portal_membership = getToolByName(self.context, 'portal_membership') self.isAnon = portal_membership.isAnonymousUser() diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index a6f88c7..41ca894 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -86,7 +86,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form): # XXX: Author notification code #registry = queryUtility(IRegistry) - #settings = registry.forInterface(IDiscussionSettings) + #settings = registry.forInterface(IDiscussionSettings, check=False) #if not settings.user_notification_enabled: # self.widgets['author_notification'].mode = interfaces.HIDDEN_MODE @@ -114,7 +114,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form): # Captcha check for anonymous users (if Captcha is enabled and # anonymous commenting is allowed) registry = queryUtility(IRegistry) - settings = registry.forInterface(IDiscussionSettings) + settings = registry.forInterface(IDiscussionSettings, check=False) portal_membership = getToolByName(self.context, 'portal_membership') if settings.captcha != 'disabled' and \ settings.anonymous_comments and \ @@ -239,7 +239,7 @@ class CommentsViewlet(ViewletBase): transforms = getToolByName(self, 'portal_transforms') targetMimetype = 'text/html' registry = queryUtility(IRegistry) - settings = registry.forInterface(IDiscussionSettings) + settings = registry.forInterface(IDiscussionSettings, check=False) mimetype = settings.text_transform return transforms.convertTo(targetMimetype, text, @@ -346,7 +346,7 @@ class CommentsViewlet(ViewletBase): def show_commenter_image(self): # Check if showing commenter image is enabled in the registry registry = queryUtility(IRegistry) - settings = registry.forInterface(IDiscussionSettings) + settings = registry.forInterface(IDiscussionSettings, check=False) return settings.show_commenter_image def is_anonymous(self): diff --git a/plone/app/discussion/browser/validator.py b/plone/app/discussion/browser/validator.py index 8e38e6d..01bea7b 100644 --- a/plone/app/discussion/browser/validator.py +++ b/plone/app/discussion/browser/validator.py @@ -46,7 +46,7 @@ class CaptchaValidator(validator.SimpleFieldValidator): super(CaptchaValidator, self).validate(value) registry = queryUtility(IRegistry) - settings = registry.forInterface(IDiscussionSettings) + settings = registry.forInterface(IDiscussionSettings, check=False) if settings.captcha in ('captcha', 'recaptcha', 'norobots'): captcha = getMultiAdapter((aq_inner(self.context), self.request), diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 08ae949..9d6fa12 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -194,7 +194,7 @@ def notify_user(obj, event): # pragma: no cover # Check if user notification is enabled registry = queryUtility(IRegistry) - settings = registry.forInterface(IDiscussionSettings) + settings = registry.forInterface(IDiscussionSettings, check=False) if not settings.user_notification_enabled: return @@ -238,7 +238,7 @@ def notify_moderator(obj, event): # Check if moderator notification is enabled registry = queryUtility(IRegistry) - settings = registry.forInterface(IDiscussionSettings) + settings = registry.forInterface(IDiscussionSettings, check=False) if not settings.moderator_notification_enabled: return diff --git a/plone/app/discussion/conversation.py b/plone/app/discussion/conversation.py index 8ad6c72..1887e9e 100644 --- a/plone/app/discussion/conversation.py +++ b/plone/app/discussion/conversation.py @@ -100,7 +100,7 @@ class Conversation(Traversable, Persistent, Explicit): # Fetch discussion registry registry = queryUtility(IRegistry) - settings = registry.forInterface(IDiscussionSettings) + settings = registry.forInterface(IDiscussionSettings, check=False) # Check if discussion is allowed globally if not settings.globally_enabled: