Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#8905 closed (fixed)

Error in default comment preview template

Reported by: Ville Säävuori Owned by: nobody
Component: contrib.comments Version: 1.0
Severity: Keywords: comments, templates
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In django/contrib/comments/templates/comments/preview.html row 31 name attribute of the submit button is wrong. The name should be 'preview' not 'submit'. This makes preview template to submit the comment every time no matter which button is used.

Correct HTML for the preview button:

<input type="submit" name="preview" class="submit-preview" value="Preview">

Also, most of the texts in the default comment templates are not marked as translatable, but that is a matter of another ticket.

Attachments (1)

8905.diff (2.8 KB ) - added by Thejaswi Puthraya 16 years ago.
git-patch against latest checkout

Download all attachments as: .zip

Change History (7)

comment:1 by Ville Säävuori, 16 years ago

Resolution: invalid
Status: newclosed

On a closer look, this was clearly a PEBKAC from my part. The comment processing view expects to see "preview" in the post data. If I change the form submit text, it fails.

comment:2 by Guilherme M. Gondim <semente@…>, 16 years ago

Resolution: invalid
Status: closedreopened

But we can't rename the value? I need translate, but if change the value "Preview" I can't use this feature. Anyway, I don't think that this is a translation question, I think that the input name for preview need to be "preview" and for post, need to be "post" and not "submit" in both... as before of refactoring... with that I can use the tag button too.

comment:3 by Malcolm Tredinnick, 16 years ago

Triage Stage: UnreviewedAccepted

Yes, this is a bug. We shouldn't be overloading the name like that and differentiating on the value, since, as noted, the values need to be marked for translation. Using distinct names to determine which action was selected is the normal way in HTML forms.

by Thejaswi Puthraya, 16 years ago

Attachment: 8905.diff added

git-patch against latest checkout

comment:4 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: reopenedclosed

(In [9119]) Add internationalisation support to the comment templates. Fixed #8868, #8905

Thanks to zgoda for a patch that did most of the internationalisation part.

comment:5 by Malcolm Tredinnick, 16 years ago

(In [9126]) [1.0.X] Add internationalisation support to the comment templates. Fixed #8868, #8905

Thanks to zgoda for a patch that did most of the internationalisation part.

Backport of r9119 from trunk.

comment:6 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top