Need a new hook to update Bugzilla::Search::COLUMN_JOINS

RESOLVED FIXED in Bugzilla 4.2

Status

()

Bugzilla
Extensions
--
enhancement
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: rojanu, Assigned: rojanu)

Tracking

unspecified
Bugzilla 4.2
Bug Flags:
approval +
approval4.2 +

Details

Attachments

(1 attachment, 2 obsolete attachments)

3.51 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Assignee)

Description

5 years ago
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
Attachment #613587 - Flags: review?(LpSolit)

Comment 1

5 years ago
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. :)
Attachment #613587 - Flags: review?(LpSolit) → review-

Updated

5 years ago
Status: NEW → ASSIGNED
Summary: Request: Need a new hook to update search COLUMN_JOINS → Need a new hook to update search COLUMN_JOINS
Target Milestone: --- → Bugzilla 4.2

Comment 2

5 years ago
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.
(Assignee)

Comment 3

5 years ago
Created attachment 613635 [details] [diff] [review]
Column Joins Hook v2
Attachment #613587 - Attachment is obsolete: true
Attachment #613598 - Attachment is obsolete: true
Attachment #613635 - Flags: review?(LpSolit)

Comment 4

5 years ago
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.
Attachment #613635 - Flags: review?(LpSolit) → review+

Updated

5 years ago
Flags: approval4.2+
Flags: approval+
Keywords: relnote

Comment 5

5 years ago
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.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Summary: Need a new hook to update search COLUMN_JOINS → Need a new hook to update Bugzilla::Search::COLUMN_JOINS

Comment 6

5 years ago
Added to relnotes for 4.2.1.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.