diff --git a/CHANGES.txt b/CHANGES.txt index 9e9c50b..43648e5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,11 @@ Changelog 1.0b6 (unreleased) ------------------ +* Redirect to the comment form action instead of the absolute url when a + comment is posted. This fixes the accidentially triggered file upload when a + comment is posted on a file content object. + [timo] + * We need five:registerPackage to register the i18n folder. [vincentfretin] diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index ba002c3..9443e0c 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -182,10 +182,10 @@ class CommentForm(extensible.ExtensibleForm, form.Form): IStatusMessage(self.context.REQUEST).addStatusMessage( _("Your comment awaits moderator approval."), type="info") - self.request.response.redirect(context.absolute_url()) + self.request.response.redirect(self.action) else: # Redirect to comment (inside a content object page) - self.request.response.redirect(context.absolute_url() + '#' + str(comment_id)) + self.request.response.redirect(self.action + '#' + str(comment_id)) @button.buttonAndHandler(_(u"Cancel")) def handleCancel(self, action):