Opened 17 years ago
Closed 17 years ago
#7229 closed defect (fixed)
TicketQueryMacro not working properly with "col=..." params
| Reported by: | anonymous | Owned by: | Christian Boos |
|---|---|---|---|
| Priority: | highest | Milestone: | 0.11 |
| Component: | ticket system | Version: | 0.11rc1 |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
The macro
[[TicketQuery(format=table, milestone=milestone1, col=id)]]
correctly shows a one-column table for the selected tickets. but the macro
[[TicketQuery(format=table, milestone=milestone1,col=milestone)]]
shows the error
`Error: Macro TicketQuery(format=table, milestone=milestone1, col=milestone) failed
invalid literal for int() with base 10: 'milestone1'`
Systematics: the col param seems to work for numeric fields but not for text fields.
Attachments (1)
Change History (7)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
| Priority: | normal → highest |
|---|---|
| Status: | new → assigned |
The correct syntax for the above query would be:
[[TicketQuery(format=table, milestone=testmilestone, col=id|time)]]
The TracQuery page could certainly benefit from more samples.
The error you had with format=table&milestone=testmilestone&col=id&col=time is due to another problem (interference between format (new since 0.11) and the support for "0.10-style" arguments).
I'm working on the fix.
comment:3 by , 17 years ago
Please find attached a patch against 0.11-stable for the bug outlined in the ticket's description. The error is in query.py:283 which assumes that the 'id' field is always the first in the query's column list. What the patch does:
- fix the Query constructor in query.py to guarantee that the 'id' field is always present. Insert it at position 0 in the column's list if it's not already in the columns list ('id' is always needed for perm checks anyway).
- fix the loop in query.py:283 to respect 'id' not being the first column
- fix query_results.html to respect 'id' not being the first column
follow-up: 5 comment:4 by , 17 years ago
| Summary: | TicketQueryMacro not working properly with "col=..." params → [PATCH]TicketQueryMacro not working properly with "col=..." params |
|---|
comment:5 by , 17 years ago
| Summary: | [PATCH]TicketQueryMacro not working properly with "col=..." params → TicketQueryMacro not working properly with "col=..." params |
|---|
[PATCH] is only for new ticket.
comment:6 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |



Some more strange stuff:
1) How is one supposed to specify columns in the result table ?
2) To circumvent 1) I tried to use the macro
Query filter requires field and constraints separated by a "="`