Opened 11 years ago

Last modified 11 years ago

#11026 closed defect

Traceback when succ and pred are not configured — at Initial Version

Reported by: Ryan J Ollos Owned by: Chris Nelson
Priority: normal Component: TracJsGanttPlugin
Severity: normal Keywords:
Cc: pete Trac Release:

Description

I just installed the plugin in a dev environment and haven't specified any configuration yet. On line 2508 of tracpm.py, entries in linkfieldname are set to None if the field hasn't been configured, but then there is no check as to whether the dictionary entry is None before trying to use it.

  • tracjsganttplugin/0.11/tracjsgantt/tracpm.py

    diff --git a/tracjsganttplugin/0.11/tracjsgantt/tracpm.py b/tracjsganttplugin/0.
    index 4d4b4e2..86eb6fb 100644
    a b class TicketRescheduler(Component): 
    25052505        # FIXME - this is a really gross and fragile way to do it but
    25062506        # it'll due for now.
    25072507        linkFieldNames = {}
    2508         for linkField in [ 'parent', 'pred', 'succ']:
     2508        for linkField in ['parent', 'pred', 'succ']:
    25092509            if not self.pm.isCfg(linkField):
    25102510                linkFieldNames[linkField] = None
    25112511            elif self.pm.isField(linkField):
    class TicketRescheduler(Component): 
    25272527               
    25282528            # Predecessors and successors
    25292529            for linkField in ['pred', 'succ']:
    2530                   t[linkFieldNames[linkField]] = \
    2531                         [tid for tid in t[linkFieldNames[linkField]]
     2530                if linkFieldNames[linkField]:
     2531                    t[linkFieldNames[linkField]] = \
     2532                        [tid for tid in t[linkFieldNames[linkField]]
    25322533                         if tid in ticketsByID]
    25332534
    25342535        return tickets

Change History (0)

Note: See TracTickets for help on using tickets.