Closed Bug 743655 Opened 13 years ago Closed 13 years ago

Use the new buglist_column_joins hook to remove the hack from Bugzilla/Search.pm

Categories

(Testopia :: API, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aliustek, Assigned: LpSolit)

References

Details

Attachments

(1 file)

Search.pm on Bugzilla 4.2 has changed a lot and Testopia patch for search gets rejected now. make use of hooks to get Bugzilla to include Testopia fields in Search
What was this patch for anyways? >=== modified file 'Bugzilla/Search.pm' >--- Bugzilla/Search.pm 2010-07-05 23:39:24 +0000 >+++ Bugzilla/Search.pm 2010-07-21 16:12:01 +0000 >@@ -274,6 +274,12 @@ > push(@supptables, "LEFT JOIN longdescs AS ldtime " . > "ON ldtime.bug_id = bugs.bug_id"); > } >+ ### Testopia ### >+ if (grep($_ eq 'test_cases', @fields)){ >+ push(@supptables, "LEFT JOIN test_case_bugs AS tcb " . >+ "ON bugs.bug_id = tcb.bug_id "); >+ } >+ ### end Testopia ###
Severity: enhancement → normal
(In reply to rojanu from comment #1) > What was this patch for anyways? It was used to join an external table, test_case_bugs. You should try to find when this code was triggered in 3.x, and run the same query in 4.x, and check if this code is still needed or not. If there is no code relying on tcb (this table alias), then it can safely go away.
It's only required for one single thing, see Extension.pm: $columns->{'test_cases'} = { 'name' => 'tcb.case_id' , 'title' => 'Test Cases' }; We should use hooks defined in Search.pm to avoid the hack. If another hook is needed, then we should fix that (in a separate bug).
Looks like we need a hook in Bugzilla::Search::COLUMN_JOINS. Its description says: # This describes tables that must be joined when you want to display # certain columns in the buglist. So, to fully exploit the buglist_columns hook, we also need another hook in this constant. I will file a separate bug if there isn't one already.
Depends on: 743991
Attached patch patch, v1Splinter Review
This patch benefits from the new buglist_column_joins hook. This means that Testopia will require Bugzilla 4.2.1 to work, not 4.2. I didn't remove the corresponding code from patch-4.0, because it still applies correctly to the 4.0.x codebase, and Bugzilla 4.0.x doesn't have this hook.
Assignee: gregaryh → LpSolit
Status: NEW → ASSIGNED
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/extensions/testopia/trunk/ modified extensions/Testopia/Extension.pm Committed revision 657.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Summary: Update Search.pm on Bugzilla 4.2 to include Testopia cases → Use the new buglist_column_joins hook to remove the hack from Bugzilla/Search.pm
Target Milestone: --- → 2.5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: