]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1535376 - add support for upstream phabricator to the see-also fields
authordklawren <dklawren@users.noreply.github.com>
Fri, 15 Mar 2019 18:52:54 +0000 (14:52 -0400)
committerGitHub <noreply@github.com>
Fri, 15 Mar 2019 18:52:54 +0000 (14:52 -0400)
Bugzilla/BugUrl.pm
Bugzilla/BugUrl/Phabricator.pm [new file with mode: 0644]
template/en/default/global/user-error.html.tmpl

index e6c68416cf0ca8ff2a526767a53a5ae4a0abb46b..1e68434aa248413e9293fbd5aef758eed2ed391d 100644 (file)
@@ -70,6 +70,7 @@ use constant SUB_CLASSES => qw(
   Bugzilla::BugUrl::WebCompat
   Bugzilla::BugUrl::ServiceNow
   Bugzilla::BugUrl::Splat
+  Bugzilla::BugUrl::Phabricator
 );
 
 ###############################
diff --git a/Bugzilla/BugUrl/Phabricator.pm b/Bugzilla/BugUrl/Phabricator.pm
new file mode 100644 (file)
index 0000000..b805248
--- /dev/null
@@ -0,0 +1,41 @@
+# 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::BugUrl::Phabricator;
+
+use 5.10.1;
+use strict;
+use warnings;
+use base qw(Bugzilla::BugUrl);
+
+###############################
+####        Methods        ####
+###############################
+
+sub should_handle {
+  my ($class, $uri) = @_;
+  # https://admin.phacility.com/PHI\d+
+  # https://secure.phabricator.com/T\d+
+  # https://secure.phabricator.com/D\d+
+  return ($uri->path =~ m#/(PHI|D|T)\d+$#) ? 1 : 0;
+}
+
+sub _check_value {
+  my $class = shift;
+
+  my $uri = $class->SUPER::_check_value(@_);
+
+  # Make sure there are no query parameters.
+  $uri->query(undef);
+
+  # And remove any # part if there is one.
+  $uri->fragment(undef);
+
+  return $uri;
+}
+
+1;
index 29b358b2b68b57252d81d0a82e6abcf678b63acd..40ac8c5b0382ce6e5a485509a8583514c0048b41 100644 (file)
         <li>An issue on webcompat.com.</li>
         <li>A request on ServiceNow.</li>
         <li>A ticket on hellosplat.com.</li>
+        <li>A revision, support ticket, or task in Phabricator.</li>
       </ul>
     [% ELSIF reason == 'id' %]
       There is no valid [% terms.bug %] id in that URL.