Closed Bug 288527 Opened 20 years ago Closed 20 years ago

Precompilation of templates doesn't work

Categories

(Bugzilla :: User Accounts, defect)

2.19.2
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: gerv, Assigned: gerv)

Details

Attachments

(1 file, 1 obsolete file)

The checksetup.pl "precompilation" of templates doesn't actually precompile them
right - for example, it misses out important things like constants. This means
that the templates thereby produced don't work properly, and you have to
recompile them the "proper" way to get them to work.

The correct fix is probably to get checksetup.pl using Bugzilla/Template
properly to do the precompilation.
CCing people who are familiar with TT internals. 

Gerv
Attached patch Patch v.0 (obsolete) — Splinter Review
This approach doesn't seem to work. I don't know if that's because of the
missing vars, or because I've coded it wrong.

Precompiling templates ...
Name: index.html.tmpl
Use of uninitialized value in pattern match (m//) at (eval 46) line 4.
Use of uninitialized value in pattern match (m//) at (eval 46) line 4.

I'm out of time again - it's past midnight :-(

Gerv
Comment on attachment 179222 [details] [diff] [review]
Patch v.0

Thats because you're processing the tmeplate, which won't do what you want. You
have to go theough the Provider, and just ->fetch them. (You can get to the
provider object from the Template)

I'm not 100% sure that you can do this; some of the VARIABLES in
Bugzilla::Template aren't defined within checksetup

You'll have to check whether the PRE_PROCESS template runs even if you grab the
Provider; it shouldn't.
Attachment #179222 - Flags: review-
Attached patch Patch v.1Splinter Review
Having dug around in the TT docs: how's this? It fixes the problem...

Of course, given that the entire checksetup process including precompilation
takes about five seconds on my machine, one would be justified in asking: why
do we bother?

Gerv
Attachment #179222 - Attachment is obsolete: true
Attachment #179380 - Flags: review?(bbaetz)
Comment on attachment 179380 [details] [diff] [review]
Patch v.1

If a diff of the compiled template dir before/after doesn't show anything, this
is fine.

We bother because we have to delete teh directory on checksetup otherwise (if
we sue compiled templates), and simultanious access (ie until the data is
written out by one of hte apache processes) would be slow. Of course, thats a
lot less important now that bugzilla is a faster machine....
Attachment #179380 - Flags: review?(bbaetz) → review+
Apart from the templates which caused this bug to be filed, a diff of old and
new compiled data directories indeed shows no difference.

Gerv
Flags: blocking2.20?
Flags: approval?
It takes 5 seconds of Gerv's machine.  It takes about 15 seconds on mecha
(probably only because there's 2 million other things also running on it).  It
takes about 30 seconds on my pathetic laptop, and about a minute on landfill.
Flags: blocking2.20?
Flags: blocking2.20+
Flags: approval?
Flags: approval+
Target Milestone: --- → Bugzilla 2.20
I'd like to point out that it looks like the eval("use Template") should
probably be replaced with eval("use Bugzilla::Template") and then the "require"
should go away.
Status: NEW → ASSIGNED
Fixed.

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.384; previous revision: 1.383
done
Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.25; previous revision: 1.24
done

Gerv
Status: ASSIGNED → RESOLVED
Closed: 20 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: