My favorites | Sign in
Project Home Wiki Issues
New issue   Search
for
  Advanced search   Search tips
Issue 1636: unterminated string literal JS error prevents loading diff lines corresponding to comments containing newlines
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  chip...@gmail.com
Closed:  May 2010


Sign in to add a comment
 
Reported by lon...@gmail.com, May 3, 2010
*NOTE: Do not post confidential information in this bug report.*

What version are you running?
1.5 beta 1 (but also observed on the demo site, 1.5 beta 2)

What's the URL of the page containing the problem?
http://demo.reviewboard.org/r/50/diff/#index_header

What steps will reproduce the problem?
1.in the diff view, add comment that contains newline characters
(multi<enter>line<enter>comment for instance)
2.save the comment, click on "Edit Review"
3.the comment is correctly displayed, but not the context diffs.  It's
spinning forever.

Firefox reports: GET
http://demo.reviewboard.org/r/50/reviews/draft/inline-form/
GET http://demo.reviewboard.org/r/50/reviews/draft/inline-form/
	
200 OK
		231ms	
jquery....min.js (line 19)
unterminated string literal
[Break on this error] "multi\n

Google Chrome reports some ILLEGAL error

What is the expected output? What do you see instead?

Inline diffs are not shown.  The spinner spins forever.


What operating system are you using? What browser?

Windows.  Firefox, Google Chrome

Please provide any additional information below.

I'll submit a review, but the diffs are simple, thanks to Django:

diff --git a/reviewboard/templates/reviews/review_draft_inline_form.html
b/reviewboard/templates/reviews/review_draft_inline_form.h
index 06f9259..5452d80 100644
--- a/reviewboard/templates/reviews/review_draft_inline_form.html
+++ b/reviewboard/templates/reviews/review_draft_inline_form.html
@@ -98,7 +98,7 @@
                 null,
 {% endif %}
                 {{comment.first_line}}, {{comment.last_line}},
-                "{{comment.text}}"));
+                "{{comment.text|escapejs}}"));
         $("#edit-diff-comment-{{comment.id}}").click(function() {
             editor.inlineEditor("startEdit");
         });


Comment 1 by project member chip...@gmail.com, May 5, 2010
Committed to master (046ba74)
Status: Fixed
Owner: chipx86
Labels: -Priority-Medium Priority-Critical Milestone-Release1.5 Component-Reviews
Sign in to add a comment

Powered by Google Project Hosting