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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
84982d8b
Commit
84982d8b
authored
Feb 19, 2012
by
Tiago Mello
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 722580: Move 'ReviewBoard' and 'Rietveld' BugUrl sub-classes
to a new 'MoreBugUrl' extension. r/a=LpSolit
parent
8cf99992
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
7 deletions
+96
-7
BugUrl.pm
Bugzilla/BugUrl.pm
+6
-3
Hook.pm
Bugzilla/Hook.pm
+15
-0
Config.pm
extensions/MoreBugUrl/Config.pm
+19
-0
Extension.pm
extensions/MoreBugUrl/Extension.pm
+43
-0
disabled
extensions/MoreBugUrl/disabled
+0
-0
ReviewBoard.pm
extensions/MoreBugUrl/lib/ReviewBoard.pm
+1
-1
Rietveld.pm
extensions/MoreBugUrl/lib/Rietveld.pm
+1
-1
user-error-bug_url_invalid_tracker.html.tmpl
.../hook/global/user-error-bug_url_invalid_tracker.html.tmpl
+10
-0
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+1
-2
No files found.
Bugzilla/BugUrl.pm
View file @
84982d8b
...
...
@@ -12,6 +12,7 @@ use base qw(Bugzilla::Object);
use
Bugzilla::
Util
;
use
Bugzilla::
Error
;
use
Bugzilla::
Constants
;
use
Bugzilla::
Hook
;
use
URI::
QueryParam
;
...
...
@@ -56,8 +57,6 @@ use constant SUB_CLASSES => qw(
Bugzilla::BugUrl::Trac
Bugzilla::BugUrl::MantisBT
Bugzilla::BugUrl::SourceForge
Bugzilla::BugUrl::ReviewBoard
Bugzilla::BugUrl::Rietveld
)
;
###############################
...
...
@@ -121,8 +120,12 @@ sub should_handle {
sub
class_for
{
my
(
$class
,
$value
)
=
@_
;
my
@sub_classes
=
$class
->
SUB_CLASSES
;
Bugzilla::Hook::
process
(
"bug_url_sub_classes"
,
{
sub_classes
=>
\
@sub_classes
});
my
$uri
=
URI
->
new
(
$value
);
foreach
my
$subclass
(
$class
->
SUB_CLASSES
)
{
foreach
my
$subclass
(
@sub_classes
)
{
eval
"use $subclass"
;
die
$@
if
$@
;
return
wantarray
?
(
$subclass
,
$uri
)
:
$subclass
...
...
Bugzilla/Hook.pm
View file @
84982d8b
...
...
@@ -389,6 +389,21 @@ the summary line).
=back
=head2 bug_url_sub_classes
Allows you to add more L<Bugzilla::BugUrl> sub-classes.
See the C<MoreBugUrl> extension to see how things work.
Params:
=over
=item C<sub_classes> - An arrayref of strings which represent L<Bugzilla::BugUrl>
sub-classes.
=back
=head2 buglist_columns
This happens in L<Bugzilla::Search/COLUMNS>, which determines legal bug
...
...
extensions/MoreBugUrl/Config.pm
0 → 100644
View file @
84982d8b
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
package
Bugzilla::Extension::
MoreBugUrl
;
use
strict
;
use
constant
NAME
=>
'MoreBugUrl'
;
use
constant
REQUIRED_MODULES
=>
[
];
use
constant
OPTIONAL_MODULES
=>
[
];
__PACKAGE__
->
NAME
;
extensions/MoreBugUrl/Extension.pm
0 → 100644
View file @
84982d8b
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
package
Bugzilla::Extension::
MoreBugUrl
;
use
strict
;
use
base
qw(Bugzilla::Extension)
;
use
constant
MORE_SUB_CLASSES
=>
qw(
Bugzilla::Extension::MoreBugUrl::ReviewBoard
Bugzilla::Extension::MoreBugUrl::Rietveld
)
;
# We need to update bug_see_also table because both
# Rietveld and ReviewBoard were originally under Bugzilla/BugUrl/.
sub
install_update_db
{
my
$dbh
=
Bugzilla
->
dbh
;
my
$should_rename
=
$dbh
->
selectrow_array
(
q{SELECT 1 FROM bug_see_also
WHERE class IN ('Bugzilla::BugUrl::Rietveld',
'Bugzilla::BugUrl::ReviewBoard')}
);
if
(
$should_rename
)
{
my
$sth
=
$dbh
->
prepare
(
'UPDATE bug_see_also SET class = ?
WHERE class = ?'
);
$sth
->
execute
(
'Bugzilla::Extension::MoreBugUrl::ReviewBoard'
,
'Bugzilla::BugUrl::ReviewBoard'
);
$sth
->
execute
(
'Bugzilla::Extension::MoreBugUrl::Rietveld'
,
'Bugzilla::BugUrl::Rietveld'
);
}
}
sub
bug_url_sub_classes
{
my
(
$self
,
$args
)
=
@_
;
push
@
{
$args
->
{
sub_classes
}
},
MORE_SUB_CLASSES
;
}
__PACKAGE__
->
NAME
;
extensions/MoreBugUrl/disabled
0 → 100644
View file @
84982d8b
Bugzilla/BugUrl
/ReviewBoard.pm
→
extensions/MoreBugUrl/lib
/ReviewBoard.pm
View file @
84982d8b
...
...
@@ -5,7 +5,7 @@
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
package
Bugzilla::BugUrl::
ReviewBoard
;
package
Bugzilla::
Extension::More
BugUrl::
ReviewBoard
;
use
strict
;
use
base
qw(Bugzilla::BugUrl)
;
...
...
Bugzilla/BugUrl
/Rietveld.pm
→
extensions/MoreBugUrl/lib
/Rietveld.pm
View file @
84982d8b
...
...
@@ -5,7 +5,7 @@
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
package
Bugzilla::BugUrl::
Rietveld
;
package
Bugzilla::
Extension::More
BugUrl::
Rietveld
;
use
strict
;
use
base
qw(Bugzilla::BugUrl)
;
...
...
extensions/MoreBugUrl/template/en/default/hook/global/user-error-bug_url_invalid_tracker.html.tmpl
0 → 100644
View file @
84982d8b
[%# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
#%]
<li>A Review Board review request.</li>
<li>An issue in a Rietveld installation.</li>
template/en/default/global/user-error.html.tmpl
View file @
84982d8b
...
...
@@ -254,8 +254,7 @@
<li>A ticket in a Trac installation.</li>
<li>A b[% %]ug in a MantisBT installation.</li>
<li>A b[% %]ug on sourceforge.net.</li>
<li>A Review Board review request.</li>
<li>An issue in a Rietveld installation.</li>
[% Hook.process('bug_url_invalid_tracker') %]
</ul>
[% ELSIF reason == 'id' %]
There is no valid [% terms.bug %] id in that URL.
...
...
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