[Bps-public-commit] rt-extension-automaticassignment branch move-to-module-runtime created. 1.00-1-g66c5f98
BPS Git Server
git at git.bestpractical.com
Sun Apr 23 22:50:55 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-automaticassignment".
The branch, move-to-module-runtime has been created
at 66c5f98984587fea975b051fedf2f2d7d5fff5f1 (commit)
- Log -----------------------------------------------------------------
commit 66c5f98984587fea975b051fedf2f2d7d5fff5f1
Author: Jason Crome <jcrome at bestpractical.com>
Date: Sun Apr 23 18:48:15 2023 -0400
Migrate to Module::Runtime from UNIVERSAL::require
The latter of these two modules was deprecated; by removing
UNIVERSAL::require from RT in 5.0.4, code in this extension that relied
on it would fail to run. This commit removes the dependency on
deprecated code.
diff --git a/html/Admin/Queues/AutomaticAssignment.html b/html/Admin/Queues/AutomaticAssignment.html
index 707eb96..060765e 100644
--- a/html/Admin/Queues/AutomaticAssignment.html
+++ b/html/Admin/Queues/AutomaticAssignment.html
@@ -16,8 +16,9 @@
% for my $filter (@filters) {
% my $class = "RT::Extension::AutomaticAssignment::Filter::$filter";
-% unless ($class->require) {
-% RT->Logger->error("Couldn't load class '$class': $@");
+% my ($ok, $msg) = RT::StaticUtil::RequireModule( $class );
+% unless ( $ok ) {
+% RT->Logger->error("Couldn't load class '$class': $msg");
% $m->abort;
% }
<option value="<% $filter %>"><% $class->Description %></option>
@@ -65,8 +66,9 @@
% for my $chooser (@choosers) {
% my $class = "RT::Extension::AutomaticAssignment::Chooser::$chooser";
-% unless ($class->require) {
-% RT->Logger->error("Couldn't load class '$class': $@");
+% my ($ok, $msg) = RT::StaticUtil::RequireModule( $class );
+% unless ( $ok ) {
+% RT->Logger->error("Couldn't load class '$class': $msg");
% $m->abort;
% }
<option <% $name eq $chooser ? "selected" : "" %> value="<% $chooser %>"><% $class->Description %></option>
diff --git a/html/Admin/Queues/Elements/SortableBox b/html/Admin/Queues/Elements/SortableBox
index 1d31928..32a0d24 100644
--- a/html/Admin/Queues/Elements/SortableBox
+++ b/html/Admin/Queues/Elements/SortableBox
@@ -17,8 +17,9 @@ else {
$class = "RT::Extension::AutomaticAssignment::Chooser::$class_name";
}
-unless ($class->require) {
- RT->Logger->error("Couldn't load class '$class': $@");
+my ($ok, $msg) = RT::StaticUtil::RequireModule( $class );
+unless ( $ok ) {
+ RT->Logger->error("Couldn't load class '$class': $msg");
$m->abort;
}
diff --git a/lib/RT/Extension/AutomaticAssignment.pm b/lib/RT/Extension/AutomaticAssignment.pm
index e10fd74..7f0c2d7 100644
--- a/lib/RT/Extension/AutomaticAssignment.pm
+++ b/lib/RT/Extension/AutomaticAssignment.pm
@@ -16,7 +16,8 @@ sub _LoadedClass {
my $name = shift;
my $class = "RT::Extension::AutomaticAssignment::${namespace}::$name";
- $class->require or die $UNIVERSAL::require::ERROR;
+ my ($ok, $msg) = RT::StaticUtil::RequireModule( $class );
+ die $msg unless $ok;
return $class;
}
@@ -142,8 +143,9 @@ sub _SetConfigForQueue {
next unless grep { $_ eq $name } RT->Config->Get('AutomaticAssignmentFilters');
my $class = "RT::Extension::AutomaticAssignment::Filter::$name";
- unless ($class->require) {
- RT->Logger->error("Couldn't load class '$class': $@");
+ my ($ok, $msg) = RT::StaticUtil::RequireModule( $class );
+ unless ( $ok ) {
+ RT->Logger->error("Couldn't load class '$class': $msg");
return (0, "Couldn't load class '$class'");
}
@@ -159,8 +161,9 @@ sub _SetConfigForQueue {
next unless grep { $_ eq $name } RT->Config->Get('AutomaticAssignmentChoosers');
my $class = "RT::Extension::AutomaticAssignment::Chooser::$name";
- unless ($class->require) {
- RT->Logger->error("Couldn't load class '$class': $@");
+ my ($ok, $msg) = RT::StaticUtil::RequireModule( $class );
+ unless ( $ok ) {
+ RT->Logger->error("Couldn't load class '$class': $msg");
return (0, "Couldn't load class '$class'");
}
-----------------------------------------------------------------------
hooks/post-receive
--
rt-extension-automaticassignment
More information about the Bps-public-commit
mailing list