Opened 18 years ago
Last modified 17 years ago
#4116 closed defect
tickets query breaks if custom ticket checkbox field is set, then cleared — at Initial Version
Reported by: | Owned by: | Matthew Good | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | report system | Version: | 0.10 |
Severity: | major | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
A quick summary is that when trying to execute a tickets query, I get the error: "AssertError: Unable to set Empty component query.num_matches_group." This happens after I clear a previously checked checkbox that is a custom ticket field.
I'll record the scenario first, and the python error trace will be given at the end.
First, I added a custom ticket field, by adding this to my trac.ini:
[ticket-custom] product_backlog = checkbox product_backlog.label = Is Product Backlog? ptoduct_backlog.value = 0
Then I defined on a wiki page the following query:
Product-Backlog Work Items, by Milestone
The query works unless I do the following steps:
- Add a ticket, setting my custom ticket checkbox to checked
- Update the ticket by UNCHECKING my custom ticket checkbox
At this point I notice that the ticket change log gets this appended:
11/9/2006 11:02:49 AM changed by xxx ¶
- product_backlog deleted.
I would have expected to see "product_backlog set to 0", but maybe this is irrelevant.
When I try to run my query now, it breaks. (But it had worked earlier after I had just added the ticket with checkbox checked, step 1 of the 2 above.0
Here is the error trace:
Traceback (most recent call last):
File "C:\bin\Python2.4\Lib\site-packages\trac\web\main.py", line 356, in dispatch_request
dispatcher.dispatch(req)
File "C:\bin\Python2.4\Lib\site-packages\trac\web\main.py", line 224, in dispatch
resp = chosen_handler.process_request(req)
File "C:\bin\Python2.4\Lib\site-packages\trac\ticket\query.py", line 443, in process_request
self.display_html(req, query)
File "C:\bin\Python2.4\Lib\site-packages\trac\ticket\query.py", line 608, in display_html
req.hdfquery.num_matches_group = num_matches_group
File "C:\bin\Python2.4\Lib\site-packages\trac\web\clearsilver.py", line 195, in setitem
self.set_value(name, value, True)
File "C:\bin\Python2.4\Lib\site-packages\trac\web\clearsilver.py", line 243, in set_value
add_value(name, value)
File "C:\bin\Python2.4\Lib\site-packages\trac\web\clearsilver.py", line 235, in add_value
add_value('%s.%s' % (prefix, k), value[k])
File "C:\bin\Python2.4\Lib\site-packages\trac\web\clearsilver.py", line 219, in add_value
set_str(prefix, int(value))
File "C:\bin\Python2.4\Lib\site-packages\trac\web\clearsilver.py", line 213, in set_str
self.hdf.setValue(prefix.encode('utf-8'), str(value))
Error: Traceback (innermost last):
File "neo_hdf.c", line 783, in hdf_set_value() File "neo_hdf.c", line 773, in _set_value()
AssertError: Unable to set Empty component query.num_matches_group.
Now if I update the ticket again and RE-CHECK the custom checkbox, I see the following added to the ticket history, and my query works again.
11/9/2006 11:06:01 AM changed by xxx ¶
- product_backlog set to 1.