Edgewall Software
Modify

Ticket #6271 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Error is not reported for invalid SQL in report queries.

Reported by: tjorvi@… Owned by: cboos
Priority: normal Milestone: 0.11
Component: ticket system Version: devel
Severity: trivial Keywords:
Cc:
Release Notes:
API 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

Change History

comment:1 Changed 4 years ago by cboos

  • Owner changed from jonas to cboos
  • Severity changed from normal to trivial

You're right. Thanks for the report & patch!

comment:2 Changed 4 years ago by cboos

  • Status changed from new to assigned

(well, incidentally I already fixed it in the context-refactoring branch, waiting for the merge)

comment:3 Changed 4 years ago by cboos

  • Resolution set to fixed
  • Status changed from assigned to closed

Now in trunk (r6139).

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.