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
1237c19f
You need to sign in or sign up before continuing.
Commit
1237c19f
authored
Feb 20, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 531577: Fix the paths that single-file extensions (like extensions/Foo.pm)
look for their tempaltes and libraries in. r=mkanat, a=mkanat (module owner)
parent
70a3ca18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
Extension.pm
Bugzilla/Extension.pm
+16
-1
Util.pm
Bugzilla/Install/Util.pm
+3
-0
No files found.
Bugzilla/Extension.pm
View file @
1237c19f
...
...
@@ -147,7 +147,13 @@ sub load_all {
sub
modify_inc
{
my
(
$class
,
$file
)
=
@_
;
__do_call
(
$class
,
'package_dir'
,
$file
);
# Note that this package_dir call is necessary to set things up
# for my_inc, even if we didn't take its return value.
my
$package_dir
=
__do_call
(
$class
,
'package_dir'
,
$file
);
# Don't modify @INC for extensions that are just files in the extensions/
# directory. We don't want Bugzilla's base lib/CGI.pm being loaded as
# Bugzilla::Extension::Foo::CGI or any other confusing thing like that.
return
if
$package_dir
eq
bz_locations
->
{
'extensionsdir'
};
unshift
(
@INC
,
sub
{
__do_call
(
$class
,
'my_inc'
,
@_
)
});
}
...
...
@@ -194,6 +200,15 @@ use constant enabled => 1;
sub
lib_dir
{
my
$invocant
=
shift
;
my
$package_dir
=
__do_call
(
$invocant
,
'package_dir'
);
# For extensions that are just files in the extensions/ directory,
# use the base lib/ dir as our "lib_dir". Note that Bugzilla never
# uses lib_dir in this case, though, because modify_inc is prevented
# from modifying @INC when we're just a file in the extensions/ directory.
# So this particular code block exists just to make lib_dir return
# something right in case an extension needs it for some odd reason.
if
(
$package_dir
eq
bz_locations
()
->
{
'extensionsdir'
})
{
return
bz_locations
->
{
'ext_libpath'
};
}
return
File::
Spec
->
catdir
(
$package_dir
,
'lib'
);
}
...
...
Bugzilla/Install/Util.pm
View file @
1237c19f
...
...
@@ -196,6 +196,9 @@ sub extension_template_directory {
my
$extension
=
shift
;
my
$class
=
ref
(
$extension
)
||
$extension
;
my
$base_dir
=
extension_package_directory
(
$class
);
if
(
$base_dir
eq
bz_locations
->
{
'extensionsdir'
})
{
return
bz_locations
->
{
'templatedir'
};
}
return
"$base_dir/template"
;
}
...
...
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