#10975 closed defect (fixed)
KeyError: 'type' is generated on the reports page if no types exist
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Component: | BlackMagicTicketTweaksPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
blackmagic.py line 153 assumes that the key types
exists in dict data["fields"]
. This is not the case if no types are specified in the given trac environment.
This is easily reproducible by clicking "Custom Query" under "View Tickets" when no types have been configured.
This error can be fixed by prefacing the for loop on line 153 with:
if "type" in data["fields"]:
Attachments (0)
Change History (9)
comment:1 Changed 12 years ago by
Owner: | changed from obs to Ryan J Ollos |
---|---|
Status: | new → assigned |
comment:2 Changed 12 years ago by
Oops! Include the 1st line after the for loop as well. It also includes data["fields"]["types"]
.
comment:5 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 follow-up: 7 Changed 11 years ago by
This error has been corrected in this ticket! Or I am wrong? I downloaded and installed the current version, but also restarted Apache. But the error continues:
Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/web/main. py", line 497, in _dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/web/main. py", line 224, in dispatch self._post_process_request(req, *resp) File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/web/main. py", line 338, in _post_process_request resp = f.post_process_request(req, *resp) File "/usr/local/lib/python2.7/dist-packages/BlackMagicTicketTweaks-0.12r1-py2 .7.egg/blackmagic/blackmagic.py", line 99, in post_process_request data["numrows"]-=self.blockedTickets; KeyError: 'numrows'
My Trac1.0.
Thanks
comment:7 follow-up: 8 Changed 11 years ago by
Replying to ivanelson:
This error has been corrected in this ticket! Or I am wrong?
The issue reported in comment:description is different than the issue you are reporting. It should be fairly easy to fix though. Let's make a separate ticket for the issue you are reporting.
comment:8 follow-up: 9 Changed 11 years ago by
Replying to rjollos:
Replying to ivanelson:
This error has been corrected in this ticket! Or I am wrong?
The issue reported in comment:description is different than the issue you are reporting. It should be fairly easy to fix though. Let's make a separate ticket for the issue you are reporting.
You will open the Ticket? Or I can create the Ticket?
comment:9 Changed 11 years ago by
Replying to ivanelson:
Replying to rjollos:
Replying to ivanelson:
This error has been corrected in this ticket! Or I am wrong?
The issue reported in comment:description is different than the issue you are reporting. It should be fairly easy to fix though. Let's make a separate ticket for the issue you are reporting.
You will open the Ticket? Or I can create the Ticket?
Ticket opened: https://trac-hacks.org/ticket/11140
Sounds easy enough to fix. If it's as straightforward as you suggest, I should have a fix committed shortly ;)