Closed Bug 162151 Opened 22 years ago Closed 22 years ago

Fix page.cgi's method of finding templates

Categories

(Bugzilla :: Bugzilla-General, defect, P1)

2.17
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: gerv, Assigned: gerv)

References

Details

Attachments

(1 file)

Currently, page.cgi gets its template mappings from localconfig. This is bad, because new installations don't pick up new mappings. The new idea is to have a template/en/default/pages directory. This contains all the pages page.cgi can serve. page.cgi?id=foo.html will look up "html" in the %contenttypes hash, send the appropriate content type, then look for foo.html.tmpl in the pages directory. Gerv
Blocks: 108987
I want to fix bug 146945 first, if possible. This just makes things easier. Gerv
Depends on: 146945
we could even have id=foo&format=html - that may allow a more generic solution. However, formats per se aren't really useful for the page.cgi stuff, since there isn't any processing results to share like there are for the other format thingys.
Indeed. So my idea was to make an id look like a filename, but split it into pieces and use ValidateOutputFormat under the covers to make sure the template file exists etc. and avoid duplicating code. However, I ran into the problem that the file would really have to be called foo-html.html , because of the way ValidateOutputFormat works. So, it would be good to fix that (bug 146945). So, I've posted my proposal for fixing it to the newsgroups. If people like it, we can do that, then this, then get back to the linkify script. <phew> Gerv
Blocks: 158726
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.18
Attached patch Patch v.1 (deleted) — Splinter Review
This should do the trick. Gerv
Comment on attachment 99594 [details] [diff] [review] Patch v.1 You need to pull %pages out of Bugzilla::Config::EXPORT_OK too. r=bbaetz with that change, assuming that you've tested. I also don't like the error message someone will get mistyping a url, but I think that we can let that live until we clean up our error handling stuff.
Attachment #99594 - Flags: review+
Fixed. Checking in page.cgi; /cvsroot/mozilla/webtools/bugzilla/page.cgi,v <-- page.cgi new revision: 1.5; previous revision: 1.4 done Checking in checksetup.pl; /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl new revision: 1.189; previous revision: 1.188 done Checking in template/en/default/global/user-error.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v <-- user-error.html.tmpl new revision: 1.8; previous revision: 1.7 done Checking in Bugzilla/Config.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Config.pm,v <-- Config.pm new revision: 1.4; previous revision: 1.3 done Gerv
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: