2707: Unable to publish a review with comments on a screenshot
- Fixed
- Review Board
matt.******@gmai***** (Google Code) (Is this you? Claim this profile.) | |
|
|
Sept. 29, 2012 |
What version are you running? 1.6.11 What's the URL of the page containing the problem? http://reviewboard.example.com/r/26265/diff/#index_header What steps will reproduce the problem? 1. Publish a review request with a screenshot 2. Add a comment on the screenshot 3. Click "Edit Review" in the "You have a pending review" header 4. Click "Publish Review" What is the expected output? What do you see instead? I expect to be returned to the main page for the review request showing my new review. Instead I'm left on the "View Diff" page with the "You have a pending review" header showing. In the Javascript console I get the error "Uncaught TypeError: Cannot read property 'checked' of undefined" from reviews.js on line 1438. What operating system are you using? What browser? Windows 7, Chrome Please provide any additional information below. It appears that the Javascript code is looking for the "Open an issue" checkbox, but the comments on screenshots do not seem to have the "Open an issue" checkbox like the comments on code do.
I just tested with 1.7 beta 1 and this issue appears to be fixed there. The Open an Issue checkbox shows up on comments on images there.
The following workaround fixed it for me (which was enough to restore functionality for my users while a real fix is implemented): diff --git a/reviewboard/htdocs/media/rb/js/reviews.js b/reviewboard/htdocs/media/rb/js/reviews.js index 9888b4a..53e675b 100644 --- a/reviewboard/htdocs/media/rb/js/reviews.js +++ b/reviewboard/htdocs/media/rb/js/reviews.js @@ -1435,7 +1435,8 @@ $.reviewForm = function(review) { $(".comment-editable", dlg).each(function() { var editable = $(this); var comment = editable.data('comment'); - var issueOpened = editable.next()[0].checked; + var issueOpened_ = editable.next()[0]; + var issueOpened = issueOpened_ ? issueOpened_.checked : false; if (editable.inlineEditor("dirty") || issueOpened != comment.issue_opened) {