Make handleComment method store comment attributes from form extenders. This allows us to extend the comment form with external add-ons.

svn path=/plone.app.discussion/trunk/; revision=50059
This commit is contained in:
Timo Stollenwerk 2011-05-26 21:37:37 +00:00
parent 1c2f1865a1
commit 1ea5f0cdb4
2 changed files with 18 additions and 11 deletions

View File

@ -4,6 +4,10 @@ Changelog
2.0.4 (Unreleased)
------------------
- Make handleComment method store comment attributes from form extenders. This
allows us to extend the comment form with external add-ons.
[timo]
2.0.3 (2011-06-19)
------------------

View File

@ -152,6 +152,13 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
None)
captcha.validate(data['captcha'])
# Create a comment
comment = createObject('plone.Comment')
comment.text = text
for attribute in self.fields.keys():
setattr(comment, attribute, data[attribute])
# Fetch data from request
if 'text' in data:
text = data['text']
@ -178,10 +185,6 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
conversation_to_reply_to = conversation.get(data['in_reply_to'])
replies = IReplies(conversation_to_reply_to)
# Create the comment
comment = createObject('plone.Comment')
comment.text = text
portal_membership = getToolByName(self.context, 'portal_membership')
can_reply = getSecurityManager().checkPermission('Reply to item',