Opened 17 years ago
Closed 17 years ago
#6271 closed defect (fixed)
Error is not reported for invalid SQL in report queries.
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | ticket system | Version: | devel |
Severity: | trivial | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Instead of reporting an error, trac act as if the report executed correctly but returned no results.
This seems to be because of a parameter mismatch between the exception handler in ReportModule._render_view()
, and the report_view.html
template.
report_view.html
is expecting report.message
to contain error messages, but _render_view
is sending message
.
Here is a patch that solves the problem in one fashion:
Index: trac/ticket/report.py =================================================================== --- trac/ticket/report.py (revision 6114) +++ trac/ticket/report.py (working copy) @@ -279,8 +279,8 @@ try: cols, results = self.execute_report(req, db, id, sql, args) except Exception, e: - data['message'] = _('Report execution failed: %(error)s', - error=to_unicode(e)) + data['report'] = {'message':_('Report execution failed: %(error)s', + error=to_unicode(e))} return 'report_view.html', data, None sort_col = req.args.get('sort', '')
Attachments (0)
Change History (3)
comment:1 by , 17 years ago
Owner: | changed from | to
---|---|
Severity: | normal → trivial |
comment:2 by , 17 years ago
Status: | new → assigned |
---|
(well, incidentally I already fixed it in the context-refactoring branch, waiting for the merge)
You're right. Thanks for the report & patch!