Download & Extend

karma form nested inside comment edit form breaks HTML and preview/submit buttons in IE

Project:Karma
Version:5.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When previewing an edited comment in IE, a user cannot click the Preview or Submit buttons. This is because the karma_comment function spits out the karma rating form even during edit operations. The result of this is that, contrary to good HTML, an HTML form is being nested *inside* another, like this:

<form action="/comment/edit/31759"  method="post" id="comment-form">
.....
<form action="/comment/edit/31759"  method="post" id="karma-rating-form-comment-31759" class="karma-rate-comment">

......

</form>

.....
</form>

Not only that, but there are two >input type="submit"< tags in there too.

The attached patch file addresses this by checking for the 'edit' argument as arg(1), and if a comment is being edited/previewed, then it will not render the Karma form.

Users' can't rate their own posts anyway, so why even render it when a user is viewing/editing/previewing their own comment at all?

Hope this helps.

AttachmentSize
karma_module_preview_bug.patch1019 bytes

Comments

#1

Status:needs review» fixed

Yep, this was an oversight. Fixed.

#2

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

nobody click here