Opened 6 months ago

# Code review disappears after making a comment

Reported by: Owned by: Peter Walhagen robguttman normal CodeReviewerPlugin normal 1.0

### Description

I've encountered a problem where the code review plugin stops working after submitting a comment in the changeset. Changing status works fine, just when adding a comment the possibility to view or change comments and status in the changeset view disappears.

The status is still visible in the ticket if a commit reference to the ticket is given.

I have tested this on a win7 machine + firefox and internet explorer.

### comment:1 Changed 6 months ago by Peter Walhagen

Some additional info + a solution that works for me:

When I look at the source code of the web site when I am in a changeset where the plugin has stopped working and looking in the generated coderev.html by navigating from

<script type="text/javascript" charset="utf-8" src="/trac/coderev/coderev.html"></script>


the comment (hello world) has some linebreaks that seems to be the problem:

var get_review = function(){
...
summary.html_summary = "&lt;p&gt;
\nhello world&lt;br /&gt;
\n&lt;/p&gt;
\n";
...
}


If I make the following change to model.py :

model.py

row 207: 'html_summary': self._wiki_to_html(summary),

==>

row 207: 'html_summary': self._wiki_to_html(summary).replace('\n','').replace('\r',''),



I get instead in coderev.html :

var get_review = function(){
...
summary.html_summary = "&lt;p&gt;\nhello world&lt;br /&gt;\n&lt;/p&gt;\n";
...
}


and now the plugin works!

I dont know if this is a problem with my browser or that I'm on a windows machine but with the fix in model.py it works.

### comment:2 Changed 6 months ago by anonymous

It is always before \n so it is probably windows adding a \r before \n when submitting the form and then it is not stringified.

### Modify Ticket

Change Properties