#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)
Change History (7)
comment:1 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
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 , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
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.
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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.