Last Comment Bug 467324 - PROJECT specific template directory is ignored
: PROJECT specific template directory is ignored
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Bugzilla-General (show other bugs)
: 3.2
: All All
: -- normal (vote)
: Bugzilla 3.2
Assigned To: Max Kanat-Alexander
: default-qa
:
Mentors:
Depends on: 374227
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-01 00:31 PST by Jochen Wiedmann
Modified: 2013-02-20 20:33 PST (History)
5 users (show)
LpSolit: approval+
LpSolit: approval3.2+
mkanat: blocking3.2.1+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
v1 (667 bytes, patch)
2008-12-01 23:56 PST, Max Kanat-Alexander
LpSolit: review+
Details | Diff | Splinter Review

Description Jochen Wiedmann 2008-12-01 00:31:37 PST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111217 Fedora/3.0.4-1.fc10 Firefox/3.0.4
Build Identifier: 

According to the docs (and working in 3.0) the order to search for templates is:

    template/$language/$project
    template/$language/custom
    template/$language/default

In 3.2, the former is no longer working, because 


Reproducible: Always

Steps to Reproduce:
1. Create a bugzilla installation with multiple databases, using the PROJECT variable. In what follows, assume that FOO is one of these projects.
2. Copy file tempate/en/default/index.html.tmpl to template/en/FOO/index.html.tmpl
3. Make a modification that should reflect in the source code, for example
   extend the style_urls variable.
4. Run

     PROJECT=FOO perl checksetup.pl
5. Go to the home page of the FOO project.

Actual Results:  
When loading the home page, your changes are not visible in the HTML source code.

Expected Results:  
When loading the home page, your changes should be visible.

Proposed patch:

--- bugzilla-3.2.orig/Bugzilla/Install/Util.pm	2008-04-03 21:05:38.000000000 +0200
+++ bugzilla-3.2/Bugzilla/Install/Util.pm	2008-12-01 09:19:44.000000000 +0100
@@ -261,12 +261,13 @@
 sub _add_language_set {
     my ($array, $lang, $templatedir) = @_;
     
+    my @add;
     $templatedir ||= bz_locations()->{'templatedir'};
-    my @add = ("$templatedir/$lang/custom", "$templatedir/$lang/default");
-    
     my $project = bz_locations->{'project'};
     push(@add, "$templatedir/$lang/$project") if $project;
     
+    push(@add, "$templatedir/$lang/custom", "$templatedir/$lang/default");
+    
     foreach my $dir (@add) {
         #if (-d $dir) {
             trick_taint($dir);
Comment 1 Frédéric Buclin 2008-12-01 10:49:38 PST
Max, is this a regression due to bug 374227?
Comment 2 Max Kanat-Alexander 2008-12-01 15:49:00 PST
If this is in fact the case, then yes, it must be a regression from that bug, but I'm extremely surprised that nobody caught it before...
Comment 3 Vitaly Fedrushkov 2008-12-01 23:16:32 PST
Patch tested and confirmed by mozilla.support.bugzilla user:

http://groups.google.com/group/mozilla.support.bugzilla/browse_thread/thread/081db00ee6543987

(In reply to comment #2)
> If this is in fact the case, then yes, it must be a regression from that bug,
> but I'm extremely surprised that nobody caught it before...

Would testopia help here?  Or is it time to deploy such instance on landfill, too?
Comment 4 Max Kanat-Alexander 2008-12-01 23:32:44 PST
(In reply to comment #3)
> Would testopia help here?  Or is it time to deploy such instance on landfill,
> too?

  No, testopia would not help, it's just a system for tracking test runs. We could use some test, though, and I could set something up as a Tinderbox client, if LpSolit has some idea as to how we'd do the test.
Comment 5 Christian Masopust 2008-12-01 23:39:47 PST
as status is still unconfirmed... 

i can confirm that this bug is also happening here at my installation and
the batch above solves it.
Comment 6 Max Kanat-Alexander 2008-12-01 23:56:11 PST
Created attachment 350931 [details] [diff] [review]
v1

Here is a simpler version of Jochen's patch.
Comment 7 Christian Masopust 2008-12-02 00:28:25 PST
all right, i also can confirm that this siplier patch works fine here.
thanks a lot!
Comment 8 Frédéric Buclin 2008-12-02 09:44:00 PST
Comment on attachment 350931 [details] [diff] [review]
v1

Yes, this correctly fixes the problem. r=LpSolit
Comment 9 Max Kanat-Alexander 2008-12-06 11:51:16 PST
tip:

Checking in Bugzilla/Install/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm,v  <--  Util.pm
new revision: 1.15; previous revision: 1.14
done

3.2:

Checking in Bugzilla/Install/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm,v  <--  Util.pm
new revision: 1.14.2.1; previous revision: 1.14
done
Comment 10 Oscar Glez 2012-10-29 09:14:40 PDT
I have the same problem in Release 4.2.3 stable.

Util.pm file is different than this.

Is necesary to reopen this bug?
Comment 11 Michael Cronenworth 2013-02-20 20:33:35 PST
I created bug 843457 to track this issue in Bugzilla 4.2. Please CC yourself to the new bug.

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