Modify

Opened 13 months ago

Last modified 13 months ago

#11163 new defect

Code review disappears after making a comment

Reported by: Peter Walhagen <peter.walhagen@…> Owned by: robguttman
Priority: normal Component: CodeReviewerPlugin
Severity: normal Keywords:
Cc: Trac Release: 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.

Attachments (0)

Change History (2)

comment:1 Changed 13 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 13 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.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.