Modify

Opened 14 years ago

Last modified 5 years ago

#8688 new defect

Creating a ticket with the plugin enabled causes an error

Reported by: a.nehmer@… Owned by:
Priority: normal Component: TicketModifiedFilesPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

Error: AttributeError: 'NoneType' object has no attribute 'close'

StackTrace:

Datei "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", Zeile 511, in _dispatch_request
  dispatcher.dispatch(req)
Datei "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", Zeile 258, in dispatch
  content_type)
Datei "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/chrome.py", Zeile 840, in render_template
  stream |= self._filter_stream(req, method, filename, stream, data)
Datei "/usr/lib/python2.6/site-packages/Genshi-0.6-py2.6.egg/genshi/core.py", Zeile 132, in __or__
  return Stream(_ensure(function(self)), serializer=self.serializer)
Datei "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/chrome.py", Zeile 991, in inner
  data)
Datei "/usr/lib/python2.6/site-packages/TicketModifiedFiles-1.00-py2.6.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", Zeile 75, in filter_stream
  numconflictingtickets = self.__process_ticket_request(req, True)
Datei "/usr/lib/python2.6/site-packages/TicketModifiedFiles-1.00-py2.6.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", Zeile 194, in __process_ticket_request
  repos.close()

The error seems to occur due to an not specified default repository as self.env.get_repository() returns None

Attachments (3)

TicketModifiedFiles.png (16.0 KB) - added by anonymous 13 years ago.
ErrorWithChanges.txt (8.9 KB) - added by seribralcrow@… 13 years ago.
Python trace with new error
ManageRepositories.png (49.0 KB) - added by Ryan J Ollos 13 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 13 years ago by seribralcrow@…

I am having the same issue. Is anyone still actively working on the plugin?

comment:2 Changed 13 years ago by Ryan J Ollos

Description: modified (diff)
Trac Release: 0.110.12

comment:3 in reply to:  1 Changed 13 years ago by Ryan J Ollos

Owner: changed from Emilien Klein to Ryan J Ollos

Replying to seribralcrow@gmail.com:

I am having the same issue. Is anyone still actively working on the plugin?

Are you also running Trac 0.12? I suspect this is a Trac 0.12 issue that is due to changes in the API with the addition of multi-repository support.

comment:4 Changed 13 years ago by Ryan J Ollos

I'm not able to reproduce. Do you have a default repository specified for your Trac installation?

comment:5 Changed 13 years ago by Ryan J Ollos

The link to the list of modified files was not being injected below the Change History since the Genshi Transformer was not finding a match in Trac 0.12. In Trac 0.12, the div with id changelog is now wrapped in a div with no id. A fix that seems to work fine for both Trac 0.11 and Trac 0.12 is to match just the div with id changelog, rather than looking for a div with id changelog nested immediately below the div with id content.

comment:6 Changed 13 years ago by Ryan J Ollos

(In [11457]) Refs #8688: Modified Genshi transformer so that it can find a match in Trac 0.12 and inject the modified files link below the Change History, as it does in Trac 0.11. This change should preserve the functionality in Trac 0.11.

Changed 13 years ago by anonymous

Attachment: TicketModifiedFiles.png added

comment:7 Changed 13 years ago by anonymous

Following [11457], you should see something like this:

comment:8 Changed 13 years ago by anonymous

I am running trac 0.12. I do not have a default repo listed either. Is this an issue. I uploaded the new code and I am getting a new error.

AttributeError: 'NoneType' object has no attribute 'get_changeset'

I will attach a file that contains the python trace in it.

Changed 13 years ago by seribralcrow@…

Attachment: ErrorWithChanges.txt added

Python trace with new error

Changed 13 years ago by Ryan J Ollos

Attachment: ManageRepositories.png added

comment:9 Changed 13 years ago by Ryan J Ollos

The multirepository feature is new to me, but I most recently set it up on my Trac installation following the instructions at t:TracRepositoryAdmin. It seems that the default repository can be specified in either trac.in or via the webadmin panel. Here is what the webadmin panel on my installation shows:

comment:10 Changed 13 years ago by seribralcrow@…

Making my repo the default entry did fix this. I don’t think this is a bug but I will ask the question any way. When I did a resync after changing the repository the changesets are no longer associated with a given ticket. Is there a command I need to run to get them to re-associate?

comment:11 in reply to:  10 Changed 13 years ago by Ryan J Ollos

Replying to seribralcrow@gmail.com:

Is there a command I need to run to get them to re-associate?

You might want to take a look at these steps, if you haven't read through them already: t:TracRepositoryAdmin#Migration. You may need to add an alias to the main repository.

comment:12 Changed 11 years ago by abrown

Will this plugin be modified to work with the latest versions of Trac that allow multiple repositories?

comment:13 Changed 11 years ago by Ryan J Ollos

It's not very high on my priority list. I'd gladly take a patch though.

comment:14 Changed 5 years ago by Ryan J Ollos

Owner: Ryan J Ollos deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.