Modify

Opened 14 years ago

Closed 10 years ago

#7034 closed defect (fixed)

Error in Section 2:AttributeError: 'NoneType' object has no attribute 'youngest_rev'

Reported by: devexchage@… Owned by: Ryan J Ollos
Priority: normal Component: PeerReviewPlugin
Severity: normal Keywords:
Cc: f_develop@…, Kevin Fenzi, bunk@…, Olemis Lang Trac Release: 0.12

Description (last modified by Ryan J Ollos)

We are currently using 0.12dev version

Preconditions: I do have corresponding Review rights and Plugin is enabled.

Repro steps:

  1. select Peer Review
  2. Select Create Code Review
  3. System is trying to load data in Section: "Step 2: Select the sections to be reviewed." and reports an error:
    Trac detected an internal error:
    
    AttributeError: 'NoneType' object has no attribute 'youngest_rev'
    

Attachments (2)

codereview.patch (1.6 KB) - added by anonymous 14 years ago.
CoderReview patch for 0.12
multiple-repo.patch (2.7 KB) - added by Martin Fiala 12 years ago.
solves repository=None problem in trac 0.12.2

Download all attachments as: .zip

Change History (19)

Changed 14 years ago by anonymous

Attachment: codereview.patch added

CoderReview patch for 0.12

comment:1 Changed 14 years ago by anonymous

Here is a patch for the problem

comment:2 Changed 13 years ago by anonymous

that patch did not work for me.

comment:3 Changed 13 years ago by anonymous

ok, i retract that last statement, i believe i do not know how to apply patches properly. any information about how to do this would be appreciated.

comment:4 Changed 13 years ago by anonymous

Try the following patch. It is not a "nice" patch, as it pulls back some removed template code from Trac. But it can be used as a temporary work-around.

diff -ru 2.2-orig/codereview/peerReviewBrowser.py 2.2-new/codereview/peerReviewBrowser.py
--- 2.2-orig/codereview/peerReviewBrowser.py    2011-04-27 17:04:47.000000000 +0800
+++ 2.2-new/codereview/peerReviewBrowser.py     2011-04-27 17:05:12.000000000 +0800
@@ -87,7 +87,7 @@
         path = req.args.get('path', '/')
         rev = req.args.get('rev')
 
-        repos = self.env.get_repository(req.authname)
+        repos = self.env.get_repository(authname=req.authname)
 
         try:
             node = get_existing_node(self.env, repos, path, rev)
diff -ru 2.2-orig/codereview/peerReviewPerform.py 2.2-new/codereview/peerReviewPerform.py
--- 2.2-orig/codereview/peerReviewPerform.py    2011-04-27 17:04:47.000000000 +0800
+++ 2.2-new/codereview/peerReviewPerform.py     2011-04-27 17:05:13.000000000 +0800
@@ -131,7 +131,7 @@
             return 'error.cs', data, None
 
         #get the respository
-        repos = self.env.get_repository(req.authname)
+        repos = self.env.get_repository(authname=req.authname)
         #get the file attributes
         data['review_path'] = resultFile.Path
         data['review_version'] = resultFile.Version
diff -ru 2.2-orig/codereview/templates/peerReviewBrowser.html 2.2-new/codereview/templates/peerReviewBrowser.html
--- 2.2-orig/codereview/templates/peerReviewBrowser.html        2011-04-27 17:04:47.000000000 +0800
+++ 2.2-new/codereview/templates/peerReviewBrowser.html 2011-04-27 17:05:13.000000000 +0800
@@ -18,6 +18,18 @@
 </py:def>
 
 <div id="content" class="browser">
+  <py:def function="browser_path_links(path_links,rev=None)">
+    <py:for each="idx, part in enumerate(path_links)"><py:with
+        vars="first = idx == 0; last = idx == len(path_links) - 1"><a
+          class="${classes('pathentry', first=first)}"
+          title="${first and _('Go to root directory') or _('View %(folder)s', folder=part.name)}"
+          href="$part.href">$part.name</a><py:if
+        test="not last"><span class="pathentry sep">/</span></py:if></py:with></py:for>
+    <py:if test="rev"><span class="pathentry sep">@</span>
+      <a class="pathentry" href="${href.changeset(rev)}" title="View changeset $rev">$rev</a>
+    </py:if>
+    <br style="clear: both" />
+  </py:def>
        <h2>${browser_path_links(path_links, stickyrev)}</h2>
 
       <div id="jumprev">
@@ -127,4 +139,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

comment:5 Changed 12 years ago by Kevin Fenzi

Cc: Kevin Fenzi added

Neither one of these seems to work here. ;(

trac 0.12.2

I always get the error. ideas or things to try welcome.

comment:6 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)

comment:7 Changed 12 years ago by overflow <fiolorlando@…>

Change the repository name to empty (so it will the default repository).

comment:8 Changed 12 years ago by Kevin Fenzi

Doesn't seem to matter here.

comment:9 Changed 12 years ago by anonymous

Cc: bunk@… added

comment:10 Changed 12 years ago by bunk@…

I can confirm that this plugin doesn't support multiple repositories and as such requires a default repository (I had to restart apache as well). The patches are useless.

comment:11 Changed 12 years ago by Martin Fiala

a combination of both patches worked for me - multiple-repo.patch

Changed 12 years ago by Martin Fiala

Attachment: multiple-repo.patch added

solves repository=None problem in trac 0.12.2

comment:12 Changed 11 years ago by Ryan J Ollos

Cc: Olemis Lang added

#8800 also has a patch for multirepository support.

comment:13 Changed 11 years ago by Ryan J Ollos

Owner: changed from mikechml to Ryan J Ollos
Status: newassigned

comment:14 Changed 11 years ago by Ryan J Ollos

Status: assignednew

comment:15 Changed 10 years ago by Ryan J Ollos

In 13498:

Adapts get_repository calls to 0.12 and later API. Refs #7034.

comment:16 Changed 10 years ago by Ryan J Ollos

In 13500:

Use path_links.html template from Trac. Refs #7034.

comment:17 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

I believe it will work now if a (default) repository is defined. In the future we'll need to add support for multiple repositories.

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.