Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3993 closed defect (fixed)

TypeError: unsupported operand type(s) for +: 'Undefined' and 'unicode'

Reported by: tdkim@… Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: report system Version: devel
Severity: trivial Keywords: report
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

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

System Information

Python 2.4.3 (#1, Jul 23 2006, 16:24:25)
[GCC 4.0.2 20051125 (Red Hat 4.0.2-8)]
Subversion 1.3.2
SQLite 3.3.6
pysqlite 2.3.2

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 377, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 248, in dispatch
    content_type, data)
  File "/usr/local/lib/python2.4/site-packages/trac/web/chrome.py", line 483, in render_response
    return stream.render(method, doctype=doctype)
  File "build/bdist.linux-i686/egg/genshi/core.py", line 146, in render
  File "build/bdist.linux-i686/egg/genshi/output.py", line 200, in __call__
  File "build/bdist.linux-i686/egg/genshi/output.py", line 488, in __call__
  File "build/bdist.linux-i686/egg/genshi/output.py", line 436, in __call__
  File "build/bdist.linux-i686/egg/genshi/core.py", line 207, in _ensure
  File "build/bdist.linux-i686/egg/genshi/filters.py", line 313, in __call__
  File "build/bdist.linux-i686/egg/genshi/template.py", line 1111, in _match
  File "build/bdist.linux-i686/egg/genshi/filters.py", line 331, in __call__
  File "build/bdist.linux-i686/egg/genshi/filters.py", line 313, in __call__
  File "build/bdist.linux-i686/egg/genshi/template.py", line 1086, in _match
  File "build/bdist.linux-i686/egg/genshi/template.py", line 885, in _eval
  File "build/bdist.linux-i686/egg/genshi/template.py", line 895, in _eval
  File "build/bdist.linux-i686/egg/genshi/eval.py", line 95, in evaluate
  File "/usr/local/share/trac/templates/report_view.html", line 50, in <Expression u"row.__style__ and row_style+row.__style__+";"">
    <tr py:for="cell_group in row.cell_groups"
TypeError: unsupported operand type(s) for +: 'Undefined' and 'unicode'

Query string

This is my query string.

SELECT p.value AS __color__,
   t.milestone|| ' 릴리즈' AS __group__,
   (CASE status 
      WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;'
      ELSE (CASE owner WHEN '$USER' THEN 'font-weight: bold' END)
    END) AS __style__,
   id AS ticket, summary, component, status, 
   resolution,version, t.type AS type, priority, owner,
   changetime AS modified,
   time AS _time,reporter AS _reporter
  FROM ticket t,enum p
  WHERE p.name=t.priority AND p.type='priority'
  ORDER BY (milestone IS NULL), milestone, (status = 'closed'), 
        (CASE status WHEN 'closed' THEN modified ELSE (-1)*p.value END) DESC

Attachments (0)

Change History (4)

comment:1 by Christian Boos, 18 years ago

Owner: changed from Matthew Good to Christian Boos

Thanks for the report, that row_style must be something I forgot during the migration from Clearsilver.

comment:2 by Christian Boos, 18 years ago

Hm, I guess it's simply a matter of removing it…

Can you please try this?

  • report_view.html

     
    5252                     td_attrs = fullrow and {'class': 'fullrow', 'colspan': 100} or {}"
    5353            class="${row.__color__ and 'color'+row.__color__+'-' or ''}${row.__idx__ % 2 and 'odd' or 'even'}"
    5454            style="${row.__bgcolor__ and 'background: '+row.__bgcolor__+';'
    55             }${row.__fgcolor__ and row_style+'color: '+row.__fgcolor__+';'
    56             }${row.__style__ and row_style+row.__style__+';'
     55            }${row.__fgcolor__ and 'color: '+row.__fgcolor__+';'
     56            }${row.__style__ and row.__style__+';'
    5757            }${fullrow and ';border: none; padding: 0;' or ''}">
    5858
    5959            <py:for each="cell in cell_group">

comment:3 by tdkim@…, 18 years ago

I tested the patch. The patch works perfectly. Thank you.

comment:4 by Christian Boos, 18 years ago

Resolution: fixed
Severity: normaltrivial
Status: newclosed

Patch applied in r4011.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.