Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
6663e68a
Commit
6663e68a
authored
Sep 26, 2013
by
Simon Green
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 893589 - 004template.t fails when templates in extension directory
r=dkl, a=simon
parent
c68746c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
004template.t
t/004template.t
+10
-6
Files.pm
t/Support/Files.pm
+4
-4
Templates.pm
t/Support/Templates.pm
+12
-4
No files found.
t/004template.t
View file @
6663e68a
...
...
@@ -37,17 +37,21 @@ my $fh;
}
# Check to make sure all templates that are referenced in Bugzilla
# exist in the proper place in the English template directory.
# exist in the proper place in the English template
or extension
directory.
# All other languages may or may not include any template as Bugzilla will
# fall back to English if necessary.
foreach my $file (@referenced_files) {
my $path = File::Spec->catfile($english_default_include_path, $file);
if (-e $path) {
ok(1, "$path exists");
} else {
ok(0, "$path cannot be located --ERROR");
my $found = 0;
foreach my $path (@english_default_include_paths) {
my $pathfile = File::Spec->catfile($path, $file);
if (-e $pathfile) {
$found = 1;
last;
}
}
ok($found, "$file found");
}
foreach my $include_path (@include_paths) {
...
...
t/Support/Files.pm
View file @
6663e68a
...
...
@@ -16,11 +16,11 @@ use File::Find;
find
(
sub
{
push
(
@files
,
$
File::Find::
name
)
if
$_
=~
/\.pm$/
;},
'Bugzilla'
);
push
(
@files
,
'extensions/create.pl'
);
my
@extensions
=
glob
(
'extensions/*'
);
foreach
my
$extension
(
@extensions
)
{
# Skip disabled extensions
next
if
-
e
"$extension/disabled"
;
@extensions
=
grep
{
$_
ne
'extensions/create.pl'
&&
!
-
e
"$_/disabled"
}
glob
(
'extensions/*'
);
foreach
my
$extension
(
@extensions
)
{
find
(
sub
{
push
(
@files
,
$
File::Find::
name
)
if
$_
=~
/\.pm$/
;},
$extension
);
}
...
...
t/Support/Templates.pm
View file @
6663e68a
...
...
@@ -12,9 +12,9 @@ use strict;
use
lib
't'
;
use
base
qw(Exporter)
;
@
Support::Templates::
EXPORT
=
qw(@languages @include_paths
$english_default_include_path
qw(@languages @include_paths
@english_default_include_paths
%include_path @referenced_files %actual_files $num_actual_files)
;
use
vars
qw(@languages @include_paths
$english_default_include_path
use
vars
qw(@languages @include_paths
@english_default_include_paths
%include_path @referenced_files %actual_files $num_actual_files)
;
use
Bugzilla
;
...
...
@@ -34,10 +34,18 @@ use File::Spec;
# All include paths
@include_paths
=
();
# English default include path
$english_default_include_path
=
# English default include path
s
push
@english_default_include_paths
,
File::
Spec
->
catdir
(
bz_locations
()
->
{
'templatedir'
},
'en'
,
'default'
);
# And the extensions too
foreach
my
$extension
(
@
Support::Files::
extensions
)
{
my
$dir
=
File::
Spec
->
catdir
(
$extension
,
'template'
,
'en'
,
'default'
);
if
(
-
e
$dir
)
{
push
@english_default_include_paths
,
$dir
;
}
}
# Files which are referenced in the cgi files
@referenced_files
=
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment