Closed Bug 467324 Opened 12 years ago Closed 12 years ago

PROJECT specific template directory is ignored

Categories

(Bugzilla :: Bugzilla-General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: jochen.wiedmann, Assigned: mkanat)

References

Details

Attachments

(1 file)

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);
Max, is this a regression due to bug 374227?
Flags: blocking3.2.1?
Target Milestone: --- → Bugzilla 3.2
Version: unspecified → 3.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...
Depends on: 374227
Flags: blocking3.2.1? → blocking3.2.1+
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?
(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.
as status is still unconfirmed... 

i can confirm that this bug is also happening here at my installation and
the batch above solves it.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: testcase?
Attached patch v1Splinter Review
Here is a simpler version of Jochen's patch.
Assignee: general → mkanat
Status: NEW → ASSIGNED
Attachment #350931 - Flags: review?(LpSolit)
all right, i also can confirm that this siplier patch works fine here.
thanks a lot!
Comment on attachment 350931 [details] [diff] [review]
v1

Yes, this correctly fixes the problem. r=LpSolit
Attachment #350931 - Flags: review?(LpSolit) → review+
Flags: approval3.2+
Flags: approval+
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
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Flags: testcase?
I have the same problem in Release 4.2.3 stable.

Util.pm file is different than this.

Is necesary to reopen this bug?
I created bug 843457 to track this issue in Bugzilla 4.2. Please CC yourself to the new bug.
You need to log in before you can comment on or make changes to this bug.