Last Comment Bug 743991 - Need a new hook to update Bugzilla::Search::COLUMN_JOINS
: Need a new hook to update Bugzilla::Search::COLUMN_JOINS
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Extensions (show other bugs)
: unspecified
: All All
: -- enhancement (vote)
: Bugzilla 4.2
Assigned To: rojanu
: default-qa
Mentors:
Depends on:
Blocks: 743655
  Show dependency treegraph
 
Reported: 2012-04-10 07:13 PDT by rojanu
Modified: 2012-04-17 12:27 PDT (History)
1 user (show)
LpSolit: approval+
LpSolit: approval4.2+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Column Joins Hook (2.55 KB, patch)
2012-04-10 07:13 PDT, rojanu
LpSolit: review-
Details | Diff | Review
WIP (3.11 KB, patch)
2012-04-10 07:33 PDT, Frédéric Buclin
no flags Details | Diff | Review
Column Joins Hook v2 (3.51 KB, patch)
2012-04-10 09:15 PDT, rojanu
LpSolit: review+
Details | Diff | Review

Description rojanu 2012-04-10 07:13:39 PDT
Created attachment 613587 [details] [diff] [review]
Column Joins Hook

Need a new hook to update Search.pm COLUMN_JOINS to make Testopia work with 4.2
Comment 1 Frédéric Buclin 2012-04-10 07:29:10 PDT
Comment on attachment 613587 [details] [diff] [review]
Column Joins Hook

>=== modified file 'Bugzilla/Hook.pm'

>+=head2 search_column_joins

For consistency with other hooks, it should be named buglist_column_joins.


>+See L<Bugzilla::Search/COLUMN_JOINS> for reference and see
>+the code in the example extension.

This is not an optimal description. You shouldn't have to look at the internals of Bugzilla to understand what to do. I was working on this too, so I will attach what I wrote so that you can reuse it.



>=== modified file 'extensions/Example/Extension.pm'

>+sub search_columns_joins {

A working example would be better. I will attach what I wrote.


Globally looks good. :)
Comment 2 Frédéric Buclin 2012-04-10 07:33:36 PDT
Created attachment 613598 [details] [diff] [review]
WIP

This is the patch I was working on. Yours has the advantage to cache the data, so this is a good idea. I'm simply attaching my patch so that you can copy the description for the hook, as well as a working example for the Example extension. You will have to adapt it slightly to match your hook, but you get the idea.
Comment 3 rojanu 2012-04-10 09:15:38 PDT
Created attachment 613635 [details] [diff] [review]
Column Joins Hook v2
Comment 4 Frédéric Buclin 2012-04-10 11:32:24 PDT
Comment on attachment 613635 [details] [diff] [review]
Column Joins Hook v2

>=== modified file 'Bugzilla/Hook.pm'

>+=item C<field> - A read-only string with the name of the column.

There is no "field" argument in this hook.


>+L<Bugzilla::Search>. This hasref contains names of the columns as keys and 

s/hasref/hashref/.


>=== removed file 'extensions/Example/disabled'

Must be removed from the patch.


Your patch works fine, thanks. r=LpSolit

I will fix some nits on checkin.
Comment 5 Frédéric Buclin 2012-04-10 11:38:25 PDT
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Hook.pm
modified Bugzilla/Search.pm
modified extensions/Example/Extension.pm
Committed revision 8177.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/Hook.pm
modified Bugzilla/Search.pm
modified extensions/Example/Extension.pm
Committed revision 8064.
Comment 6 Frédéric Buclin 2012-04-17 12:27:15 PDT
Added to relnotes for 4.2.1.

Note You need to log in before you can comment on or make changes to this bug.