Seeking advice: Further development of custom fields patch

Jochen Wiedmann jochen.wiedmann at gmail.com
Mon Aug 22 06:20:34 UTC 2005


Hi,

I have picked up the custom fields patch by Myk Melez and ported it to 
2.20rc2. (See https://bugzilla.mozilla.org/attachment.cgi?id=192726 for
my ported version.) So far it seems to work fine.

I would now like to extend the patch with the abilities to search for a 
custom field and to choose the custom field as a result column in the 
search result. Before beginning, I would like to seek advice for my 
work. Obviously it could save me quite some hours of studying the 
sources, if someone with a detailed knowledge could drop me some hints.

My first impression is as follows:

1.) I would consider it sufficient to change the "Advanced Search" page.
     Adding the "custom fields" there would mean changing the script
     query.cgi and the template search-advanced.html.tmpl.

     To provide the required data, I would copy Myk's changes from
     show_bug.cgi to query.cgi. In other words, I'd fill a variable
     $var->{'fields'} with the custom field definitions. Ideally, I'd
     also modify PrefillForm to handle default values. The changes in
     search-advanced.html.tmpl would match those for edit.html.tmpl.

2.) Looking into Search.pm, it seems that I could simplify the job
     by selecting suitable names for the form fields. Perhaps, that
     would allow to reuse some of the chart handling code.

3.) In buglist.cgi, I would have to invoke DefineColumn() for any
     custom field. A suitable column ID would be "custom.fieldname",
     with fieldname being the custom fields column name. A column
     name would be "bugs.fieldname", because the custom fields are
     part of the bugs table. Title would be the custom fields
     description.

     Currently I do have no idea, whether this would already be
     sufficient for generating the query. The result generation
     seems relatively straightforward: In the loop called "Results
     Retrieval, I would create an entry $bug->{'fields'}, again
     following Myk's patch for show_bug.cgi. Same for the template
     displaying the result.

Any hint, suggestion, comment, or other help highly appreciated by


Jochen




More information about the developers mailing list