Modify

Opened 11 years ago

Closed 9 years ago

#11163 closed defect (fixed)

Code review disappears after making a comment

Reported by: Peter Walhagen <peter.walhagen@…> Owned by: Ryan J Ollos
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 (7)

comment:1 Changed 11 years ago by Peter Walhagen <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 11 years 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.

comment:3 Changed 9 years ago by Ryan J Ollos

Owner: changed from Rob Guttman to Ryan J Ollos
Status: newaccepted

comment:4 Changed 9 years ago by Ryan J Ollos

In 14638:

1.0.0dev: Fixes issue with code review disappearing. Refs #11163.

comment:5 Changed 9 years ago by Ryan J Ollos

In 14652:

1.0.0dev: Fixed error in [14638]. Refs #11163.

Further revisions are needed though because code reviews still disappear.

comment:6 Changed 9 years ago by Ryan J Ollos

In 14654:

1.0.0dev: Fix regression in [14638]. Refs #11163.

Review.changeset is an integer.

comment:7 Changed 9 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 14679:

1.0.0dev: Fixed status saved message incorrectly shown.

Fixes #11163.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.