Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#6977 closed defect (duplicate)

Can't edit/delete reports having a rendering error

Reported by: fedor@… Owned by: Matthew Good
Priority: low Milestone:
Component: report system Version: 0.11b1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I was editing a query changing it from the following:

SELECT t.id AS ticket, t.summary, t.type, t.priority, t.status, t.owner, t.time AS created, c1.value AS min, c2.value AS max 
  FROM ticket t, ticket_custom c1, ticket_custom c2 
  WHERE t.id = c1.ticket AND t.id = c2.ticket 
  AND c1.name = 'est_min_hrs' 
  AND c2.name = 'est_max_hrs' 
  AND (t.component LIKE 'xstream' 
  or t.owner LIKE 'henrik@xstream.dk')
  ORDER BY priority, time

into the following:

SELECT t.id AS ticket, t.summary, t.type, t.priority, t.status, 
  t.owner, t.component AS created, c1.value AS min, c2.value AS max 
  FROM ticket t, ticket_custom c1, ticket_custom c2 
  WHERE t.id = c1.ticket AND t.id = c2.ticket 
  AND c1.name = 'est_min_hrs' 
  AND c2.name = 'est_max_hrs' 
  AND (t.component LIKE 'xstream' 
  or t.owner LIKE 'henrik@xstream.dk')
  ORDER BY priority, time

Changing t.time to t.component. For some reason it seems to be interpreting or assuming an integer value, where there is a string value? But that's just my 50 cents.

How to Reproduce

While doing a GET operation on /report/13, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'id': u'13'}

System Information

Trac 0.11b1
Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)]
setuptools 0.6c7
SQLite 3.5.2
pysqlite 2.4.0
Genshi 0.4.4
Subversion 1.4.5 (r25188)

Python Traceback

Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\trac\web\main.py", line 398, in _dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python25\Lib\site-packages\trac\web\main.py", line 217, in dispatch
    data, content_type)
  File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 683, in render_template
    return stream.render(method, doctype=doctype)
  File "C:\Python25\lib\site-packages\genshi\core.py", line 154, in render
    return encode(generator, method=method, encoding=encoding)
  File "C:\Python25\lib\site-packages\genshi\output.py", line 45, in encode
    output = u''.join(list(iterator))
  File "C:\Python25\lib\site-packages\genshi\output.py", line 274, in __call__
    for kind, data, pos in stream:
  File "C:\Python25\lib\site-packages\genshi\output.py", line 519, in __call__
    for kind, data, pos in stream:
  File "C:\Python25\lib\site-packages\genshi\output.py", line 679, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "C:\Python25\lib\site-packages\genshi\output.py", line 459, in __call__
    for ev in stream:
  File "C:\Python25\lib\site-packages\genshi\core.py", line 212, in _ensure
    for event in stream:
  File "C:\Python25\lib\site-packages\genshi\core.py", line 212, in _ensure
    for event in stream:
  File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 735, in _strip_accesskeys
    for kind, data, pos in stream:
  File "C:\Python25\lib\site-packages\genshi\core.py", line 212, in _ensure
    for event in stream:
  File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 724, in _generate
    for kind, data, pos in stream:
  File "C:\Python25\lib\site-packages\genshi\template\markup.py", line 252, in _include
    for event in stream:
  File "C:\Python25\lib\site-packages\genshi\template\markup.py", line 322, in _match
    content = list(self._include(content, ctxt))
  File "C:\Python25\lib\site-packages\genshi\template\markup.py", line 252, in _include
    for event in stream:
  File "C:\Python25\lib\site-packages\genshi\template\markup.py", line 297, in _match
    for event in stream:
  File "C:\Python25\lib\site-packages\genshi\template\markup.py", line 286, in _strip
    event = stream.next()
  File "C:\Python25\lib\site-packages\genshi\template\markup.py", line 242, in _exec
    for event in stream:
  File "C:\Python25\lib\site-packages\genshi\template\base.py", line 421, in _eval
    result = data.evaluate(ctxt)
  File "C:\Python25\lib\site-packages\genshi\template\eval.py", line 136, in evaluate
    return eval(self.code, _globals, {'data': data})
  File "C:\Python25\lib\site-packages\trac\ticket\templates\report_view.html", line 115, in <Expression u"cell.value != 'None' and format_date(int(cell.value)) or '--'">
    <td class="date" py:attrs="td_attrs">${cell.value != 'None' and format_date(int(cell.value)) or '--'}
ValueError: invalid literal for int() with base 10: 'Xstream'

Attachments (0)

Change History (5)

comment:1 by Christian Boos, 17 years ago

Resolution: worksforme
Status: newclosed

The t.component AS created part is the problematic one. created, as well as modified and date are used as indicators for a date type. I'll update the TracReports page to make that explicit … well, it does already (TracReports#Automaticallyformattedcolumns).

So simply pick another alias for t.component.

comment:2 by anonymous, 17 years ago

Resolution: worksforme
Status: closedreopened

Thanks, but the error prevents me from editing the report, so I cannot change the alias of the report in question. Of course, I made a new report without the alias, but I cannot get rid of the broken report in the web interface, because of the error message…

comment:3 by Christian Boos, 17 years ago

Milestone: 0.11.1
Priority: highlow
Summary: ValueError: invalid literal for int() with base 10: 'Xstream'Can't edit/delete reports having a rendering error

That's annoying, you're right.

The usual workaround is to append ?action=edit to the report URL.

comment:4 by fedor@…, 17 years ago

Thanks, that helped!

comment:5 by Christian Boos, 17 years ago

Milestone: 0.11.1
Resolution: duplicate
Status: reopenedclosed

Actually a duplicate of #5806.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matthew Good.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Matthew Good to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.