Closed
Bug 1119114
Opened 9 years ago
Closed 9 years ago
bzapi/configuration returns empty flag_types if no bug or attachment flag types are defined
Categories
(bugzilla.mozilla.org :: Extensions, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gps, Assigned: dkl)
Details
Attachments
(1 file)
5.52 KB,
patch
|
Details | Diff | Splinter Review |
As part of writing tests for bzexport against a local, Dockerized BMO instance, I discovered that the bzapi/configuration endpoint will return an empty array for flag_types if there are no flag types defined for either the "bugs" or "attachment" sub-type. I'm pretty close to having a working patch. I should have it uploaded in a few minutes once I page Template::Toolkit back into my brain.
Reporter | ||
Comment 1•9 years ago
|
||
Reporter | ||
Comment 2•9 years ago
|
||
Sorry I couldn't provide a fully working patch. I gave up. I imagine a Template::Toolkit guru could whip up a proper fix in seconds.
Assignee | ||
Comment 3•9 years ago
|
||
Comment on attachment 8545692 [details] [diff] [review] A lead to the proper fix Review of attachment 8545692 [details] [diff] [review]: ----------------------------------------------------------------- Will take a look at this. ::: extensions/BzAPI/template/en/default/config.json.tmpl @@ +143,5 @@ > "flag_type": [ > + [% cft = component.flag_types %] > + [% flag_types = [] %] > + [% flag_types = flag_types.merge(cft.exists(bug) ? cft.bug(is_active=>1) : []) %] > + [% flag_types = flag_types.merge(cft.exists(attachment) ? cft.attachment(is_active=>1) : [] %] Close. A fixed version would look like. - [% flag_types = - component.flag_types(is_active=>1).bug.merge(component.flag_types(is_active=>1).attachment) %] + [% cft = component.flag_types %] + [% flag_types = [] %] + [% flag_types = flag_types.merge(cft(is_active=>1).exists(bug) ? cft(is_active=>1).bug : []) %] + [% flag_types = flag_types.merge(cft(is_active=>1).exists(attachment) ? cft(is_active=>1).attachment : []) %]
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → dkl
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•9 years ago
|
||
Committed a slightly different version which fixes the issue.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•9 years ago
|
||
This is live now.
Updated•5 years ago
|
Component: Extensions: BzAPI Compatibility → Extensions
You need to log in
before you can comment on or make changes to this bug.
Description
•