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
3ab6f0f6
Commit
3ab6f0f6
authored
Aug 24, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 390442: Bugzilla/Template.pm was failing on perl 5.9.5 with "Not a subroutine reference"
Patch By FrÃ
©
dÃ
©
ric Buclin <LpSolit@gmail.com> r=mkanat, a=LpSolit
parent
a91a67ce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
Template.pm
Bugzilla/Template.pm
+7
-13
No files found.
Bugzilla/Template.pm
View file @
3ab6f0f6
...
...
@@ -55,25 +55,19 @@ use base qw(Template);
# Convert the constants in the Bugzilla::Constants module into a hash we can
# pass to the template object for reflection into its "constants" namespace
# (which is like its "variables" namespace, but for constants). To do so, we
# traverse the arrays of exported and exportable symbols, pulling out functions
# (which is how Perl implements constants) and ignoring the rest (which, if
# Constants.pm exports only constants, as it should, will be nothing else).
# traverse the arrays of exported and exportable symbols and ignoring the rest
# (which, if Constants.pm exports only constants, as it should, will be nothing else).
sub
_load_constants
{
my
%
constants
;
foreach
my
$constant
(
@
Bugzilla::Constants::
EXPORT
,
@
Bugzilla::Constants::
EXPORT_OK
)
{
if
(
defined
&
{
$
Bugzilla::Constants::
{
$constant
}})
{
# Constants can be lists, and we can't know whether we're
# getting a scalar or a list in advance, since they come to us
# as the return value of a function call, so we have to
# retrieve them all in list context into anonymous arrays,
# then extract the scalar ones (i.e. the ones whose arrays
# contain a single element) from their arrays.
$constants
{
$constant
}
=
[
&
{
$
Bugzilla::Constants::
{
$constant
}}];
if
(
scalar
(
@
{
$constants
{
$constant
}})
==
1
)
{
$constants
{
$constant
}
=
@
{
$constants
{
$constant
}}[
0
];
if
(
ref
Bugzilla::
Constants
->
$constant
)
{
$constants
{
$constant
}
=
Bugzilla::
Constants
->
$constant
;
}
else
{
my
@list
=
(
Bugzilla::
Constants
->
$constant
);
$constants
{
$constant
}
=
(
scalar
(
@list
)
==
1
)
?
$list
[
0
]
:
\
@list
;
}
}
return
\%
constants
;
...
...
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