Modify

Opened 3 years ago

Last modified 3 years ago

#8003 new defect

AnnouncementSystem failed then no Components are defined

Reported by: victor_sverdlin Owned by: doki_pen
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 (3)

comment:1 Changed 3 years ago by doki_pen

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 3 years ago by victor_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 3 years ago by dannysauer

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. :)

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.