Closed Bug 1066184 Opened 10 years ago Closed 10 years ago

data/params.js should be renamed to data/params.json since the data form is JSON and not JS

Categories

(Bugzilla :: Administration, task)

4.5.5
task
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: dkl, Assigned: dkl)

References

Details

Attachments

(1 file, 1 obsolete file)

Something I should have caught earlier on in the review process but since it is not too late, is that the newly formatted data/params.js should be instead named data/params.json. The data contained inside is in JSON format and the standard extension name is .json

dkl
Attached patch 1066184_1.patch (obsolete) — Splinter Review
Attachment #8488100 - Flags: review?(LpSolit)
Comment on attachment 8488100 [details] [diff] [review]
1066184_1.patch

>--- a/Bugzilla/Config.pm

You forgot to fix the message when we delete the old data/params file:

  say "$old_file has been converted into $old_file.js, using the JSON format.";

It must say "into $old_file.json".


Also, as some installations already upgraded, such as landfill-tip or probably several developer installations, you must add code to update_params() to rename the already converted data/params.js into data/params.json. A trivial

  rename "$old_file.js", "$old_file.json" if -e "$old_file.js";

right before the call to read_param_file() will do it.


>--- a/template/en/default/admin/params/editparams.html.tmpl
>+++ b/template/en/default/admin/params/editparams.html.tmpl

>-   javascript_urls = ['js/params.js', 'js/util.js']
>+   javascript_urls = ['js/params.json', 'js/util.js']

This change must go away. js/params.js and data/params.js are two distinct files. :)


Everything else is fine.
Attachment #8488100 - Flags: review?(LpSolit) → review-
Target Milestone: --- → Bugzilla 5.0
(In reply to Frédéric Buclin from comment #2)

>   rename "$old_file.js", "$old_file.json" if -e "$old_file.js";

You could also write:

  rename "$old_file.js", "$old_file.json" if -e "$old_file.js" && !-e "$old_file.json";

to make sure that an unrelated params.js won't override an existing params.json in the future.
Attached patch 1066184_2.patchSplinter Review
Attachment #8488100 - Attachment is obsolete: true
Attachment #8488185 - Flags: review?(LpSolit)
Comment on attachment 8488185 [details] [diff] [review]
1066184_2.patch

r=LpSolit
Attachment #8488185 - Flags: review?(LpSolit) → review+
Flags: approval?
Flags: approval? → approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   c11b241..84ec7f6  master -> master
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: