Opened 15 years ago
Closed 5 years ago
#7186 closed defect (wontfix)
[PATCH] Don't break on invalid queries
Reported by: | Matthijs Kooijman | Owned by: | obs |
---|---|---|---|
Priority: | normal | Component: | BlackMagicTicketTweaksPlugin |
Severity: | normal | Keywords: | patch |
Cc: | Steven R. Loomis | Trac Release: | 0.11 |
Description
When filtering report results, there might be no results (for example when the query is invalid). Instead, an error message is shown.
Currently, bmtt breaks the page by throwing an exception, preventing the real error message from being shown and confusing the user.
The attached patch makes bmtt check for the presence of the "numrows" value in the "report_views.html" view. If it is not present, nothing is changed.
Attachments (3)
Change History (8)
Changed 15 years ago by
Attachment: | check-numrows.patch added |
---|
comment:1 Changed 14 years ago by
Cannot replicate issue against trac 0.11.7. Can you test against 0.11.7 if you still have issues provide details of your trac.ini and the query you're running.
comment:2 Changed 14 years ago by
Yup, this still happens with 0.11.7. To reproduce, simply create an invalid report. I've tested with a report containing the following query:
SELECT
I'm attaching my trac.ini, though I don't think there is anything relevant in there (in particular the bmtt section is empty).
The exact error I get is:
Trac detected an internal error: KeyError: 'numrows'
comment:3 Changed 14 years ago by
I changed this slightly, to just detect row_groups in teh second section.
Please put this in, so that reports don't break!
I can reproduce this on trac 11.7 with this report select distinct reporter as id, "froms" as blah from ticket
comment:4 Changed 14 years ago by
Cc: | Steven R. Loomis added; anonymous removed |
---|
comment:5 Changed 5 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This plugin is deprecated in Trac 1.4 and later. See migration tips on BlackMagicTicketTweaksPlugin page.
Patch against 0.11 version, r8017