Modify

Opened 6 years ago

Last modified 23 months ago

#8003 new defect

AnnouncementSystem failed then no Components are defined

Reported by: Victor S. Sverdlin Owned by:
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

Then "component" list is empty the plugin falls with error:

2010-10-29 16:13:39,008 Trac[api] ERROR: AnnouncementSystem failed.
Traceback (most recent call last):
  File "build/bdist.freebsd-8.0-STABLE-i386/egg/announcerplugin/api.py", line 351, in _real_send
    x for x in sp.get_subscriptions_for_event(evt) if x
  File "build/bdist.freebsd-8.0-STABLE-i386/egg/announcerplugin/api.py", line 351, in <genexpr>
    x for x in sp.get_subscriptions_for_event(evt) if x
  File "build/bdist.freebsd-8.0-STABLE-i386/egg/announcerplugin/subscribers/ticket_components.py", line 25, in get_subscriptions_for_event
    for subscriber in self._get_membership(ticket['component']):
  File "build/bdist.freebsd-8.0-STABLE-i386/egg/announcerplugin/subscribers/ticket_components.py", line 39, in _get_membership
    """, ('announcer_joinable_component_' + component, "1"))
TypeError: cannot concatenate 'str' and 'NoneType' objects

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by Robert Corsaro

Disable the joinable components plugin. I'll leave the ticket open as we should check this case, but it makes no sense to have the joinable components plugin enabled if you don't use components. (unless it's just that none have been created yet, i guess).

comment:2 Changed 6 years ago by Victor S. Sverdlin

Excuse me my next question - I am new to trac. I cant see joinable components in ini file nor in admin panel. How to disable it?

comment:3 Changed 6 years ago by Danny Sauer

This code in ticket_components.py

    def get_subscriptions_for_event(self, event):
        if event.realm == 'ticket':
            ticket = event.target
            if event.category in ('changed', 'created', 'attachment added'):
                for subscriber in self._get_membership(ticket['component']):
                    self.log.debug("TicketComponentSubscriber added '%s " \
                            "(%s)' for component '%s'"%(
                            subscriber[1], subscriber[2], ticket['component']))
                    yield subscriber

should probably use a default value for the component rather than just trusting that there is a component value set. That would suppress this failure even if the component subscriber, err, component was enabled (which is the default, IIRC). Personally, I'd add a get_ticket_component method rather than directly referencing the array, but the details are less important. :)

comment:4 Changed 23 months ago by Ryan J Ollos

Owner: Robert Corsaro deleted

Modify Ticket

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.