Custom Ticket Field in .ini did not create a new field

2 views
Skip to first unread message

a3ry...@gmail.com

unread,
Mar 2, 2007, 7:15:09 PM3/2/07
to Trac Users
My group is using Trac 0.10.3. It was a basic installation (no stuff
added by us).

An artist requested a field that would list all of the maps, so he
could search by map for his specific bugs. I read up on how to create
a custom ticket field, so I added the appropriate information into
the .ini - and this seemed to work as a new Select box appeared and it
had all of the maps listed in it. The problem occurred when I tried
to make a report that would list bugs by their level. I kept getting
an error that my custom ticket field was not a column.

I dug around in the db file using sqlite3.exe and discovered that a
new field for my custom ticket field had NOT actually been added into
the custom-ticket table. Instead the name of new field had just been
inserted into the default "name" field and when a map was chosen it
was inserted into the default "value" field. I tried to discover if
this had happened to anyone else, but could not find an instance of
it.

Does anyone know why this would have happened and how to fix it?

Thanks!

Noah Kantrowitz

unread,
Mar 2, 2007, 8:14:14 PM3/2/07
to trac-...@googlegroups.com
On Mar 2, 2007, at 7:15 PM, a3ry...@gmail.com wrote:
> I dug around in the db file using sqlite3.exe and discovered that a
> new field for my custom ticket field had NOT actually been added into
> the custom-ticket table. Instead the name of new field had just been
> inserted into the default "name" field and when a map was chosen it
> was inserted into the default "value" field. I tried to discover if
> this had happened to anyone else, but could not find an instance of
> it.
>
> Does anyone know why this would have happened and how to fix it?

Thats the way it is supposed to work. That table contains all custom
fields. If you added a second custom field you would see two entries
for each ticket (with the name of each field in the "name" column).
You will need to do an inner join to get the data you need.

--Noah

Amanda Kraus

unread,
Mar 2, 2007, 11:02:21 PM3/2/07
to trac-...@googlegroups.com
An inner join?  The help guide says to use an left outer join which is what I attempted (and it failed) - if its supposed to be an inner join the guide should really be changed.

Noah Kantrowitz

unread,
Mar 3, 2007, 12:42:33 AM3/3/07
to trac-...@googlegroups.com
On Mar 2, 2007, at 11:02 PM, Amanda Kraus wrote:

> An inner join? The help guide says to use an left outer join which
> is what I attempted (and it failed) - if its supposed to be an
> inner join the guide should really be changed.

If you want only tickets that have the custom field set (so tickets
made after the field was created), an inner join will work fine. If
you want all tickets, and then the custom records if any exist, you
want an left join. In either case make sure you specified the right
column names ("id" in ticket matched to "ticket" in ticket_custom).

--Noah


Reply all
Reply to author
Forward
0 new messages