Edgewall Software

Ticket #6977 (closed defect: duplicate)

Opened 10 months ago

Last modified 9 months ago

Can't edit/delete reports having a rendering error

Reported by: fedor@… Owned by: mgood
Priority: low Milestone:
Component: report system Version: 0.11b1
Severity: normal Keywords:
Cc:

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

Change History

Changed 10 months ago by cboos

  • status changed from new to closed
  • resolution set to worksforme

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.

Changed 10 months ago by anonymous

  • status changed from closed to reopened
  • resolution worksforme deleted

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...

Changed 10 months ago by cboos

  • priority changed from high to low
  • summary changed from ValueError: invalid literal for int() with base 10: 'Xstream' to Can't edit/delete reports having a rendering error
  • milestone set to 0.11.1

That's annoying, you're right.

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

Changed 10 months ago by fedor@…

Thanks, that helped!

Changed 9 months ago by cboos

  • status changed from reopened to closed
  • resolution set to duplicate
  • milestone 0.11.1 deleted

Actually a duplicate of #5806.

Add/Change #6977 (Can't edit/delete reports having a rendering error)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from mgood. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.