Closed Bug 802586 Opened 12 years ago Closed 12 years ago

config.js.tmpl doesn't display keywords correctly anymore

Categories

(Bugzilla :: Bugzilla-General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: kohei, Assigned: dkl)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

I'd like to retrieve the Bugzilla keywords such can be seen here:
https://bugzilla.mozilla.org/describekeywords.cgi
Nope, I mean https://bugzilla.mozilla.org/config.cgi
But anyway It doesn't have the keyword descriptions.
BzAPI can only give you what Bugzilla gives you. Bugzilla would need to be enhanced to provide this information.

Gerv
Assignee: gerv → general
Component: BzAPI → Bugzilla-General
Product: Webtools → Bugzilla
QA Contact: default-qa
Summary: Provide keywords in the configuration object → Provide keyword descriptions in config.cgi
Version: Trunk → 4.5
Assignee: general → dkl
Status: NEW → ASSIGNED
Attachment #674665 - Flags: review?(gerv)
Comment on attachment 674665 [details] [diff] [review]
Patch to add keyword descriptions to config.js (v1)

dkl: no config.cgi changes?

I don't quite get how this works now... config.cgi sets a "keywords" var, but config.js.tmpl seems to access a "keyword" var! Is it currently broken?

Gerv
(In reply to Gervase Markham [:gerv] from comment #5)
> Comment on attachment 674665 [details] [diff] [review]
> Patch to add keyword descriptions to config.js (v1)
> 
> dkl: no config.cgi changes?
> 
> I don't quite get how this works now... config.cgi sets a "keywords" var,
> but config.js.tmpl seems to access a "keyword" var! Is it currently broken?
> 
> Gerv

Yes. Now that I did some research, config.js.tmpl as been broken wrt keywords since bug 690873 was committed. This patch fixes that issue as well it seems.

dkl
Note that config.cgi already provides all the information needed by BzAPI, see bug 690873. So the original request is WFM (or a dupe of 690873). Also, this patch will be of no help for BzAPI as BzAPI uses config.json.tmpl, not config.js.tmpl.

So I'm morphing this bug to fix the regression introduced by bug 690873.
Depends on: 690873
Keywords: regression
Summary: Provide keyword descriptions in config.cgi → config.js.tmpl doesn't display keywords correctly anymore
Target Milestone: --- → Bugzilla 4.4
Comment on attachment 674665 [details] [diff] [review]
Patch to add keyword descriptions to config.js (v1)

>+var keyword_descs = {
>+[% FOREACH k = keywords %]
>+  {
>+    name:        '[% k.name FILTER js %]',
>+    description: '[% k.description FILTER js %]',
>+  },
>+[% END %]
>+};

What we want is an arrayref of hashrefs, not a hashref of hashrefs. So please write

 var keyword_descs = [
   ...
 ]

on checkin. r=LpSolit with this fix.
Attachment #674665 - Flags: review?(gerv) → review+
Flags: blocking4.4+
Flags: approval4.4+
Flags: approval+
Fixed the brackets on commit.

Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/trunk
modified template/en/default/config.js.tmpl
Committed revision 8445.  

Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/4.4
modified template/en/default/config.js.tmpl
Committed revision 8432.

dkl
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Bug 805770 filed for the original request for BzAPI.

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

Attachment

General

Created:
Updated:
Size: