[Rt-commit] rt branch, 4.4/deprecated-callbacks, created. rt-4.4.0rc2-23-g4c24855
Shawn Moore
shawn at bestpractical.com
Mon Dec 28 13:23:13 EST 2015
The branch, 4.4/deprecated-callbacks has been created
at 4c24855f7512516cad27ff6fcd3bba060e3273a5 (commit)
- Log -----------------------------------------------------------------
commit c9382810ebe631fb1f2f1c8d3cd710fd54ea903a
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Mon Dec 28 18:18:02 2015 +0000
Add a way to deprecate specific callbacks
diff --git a/lib/RT.pm b/lib/RT.pm
index 104cf2e..3a27c95 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -915,6 +915,11 @@ calling it; names the arguments which are deprecated.
Overrides the auto-built phrasing of C<Calling function ____ is
deprecated> with a custom message.
+=item Detail
+
+Provides more context (e.g. callback paths) after the Message but before the
+Stack
+
=item Object
An L<RT::Record> object to print the class and numeric id of. Useful if the
@@ -932,6 +937,7 @@ sub Deprecated {
Remove => undef,
Instead => undef,
Message => undef,
+ Detail => undef,
Stack => 1,
LogLevel => "warn",
@_,
@@ -969,6 +975,8 @@ sub Deprecated {
$msg .= sprintf " Object: %s #%d.", blessed($args{Object}), $args{Object}->id
if $args{Object};
+ $msg .= "\n$args{Detail}\n" if $args{Detail};
+
$msg .= " Call stack:\n$stack" if $args{Stack};
my $loglevel = $args{LogLevel};
diff --git a/lib/RT/Interface/Web/Request.pm b/lib/RT/Interface/Web/Request.pm
index 61cfa70..c07c5e2 100644
--- a/lib/RT/Interface/Web/Request.pm
+++ b/lib/RT/Interface/Web/Request.pm
@@ -55,6 +55,9 @@ use HTML::Mason::PSGIHandler;
use base qw(HTML::Mason::Request::PSGI);
use Params::Validate qw(:all);
+my %deprecated = (
+);
+
sub new {
my $class = shift;
$class->valid_params( %{ $class->valid_params },cgi_request => { type => OBJECT, optional => 1 } );
@@ -131,6 +134,15 @@ sub callback {
}
$cache{ $CacheKey } = $callbacks unless RT->Config->Get('DevelMode');
+
+ if (@{ $callbacks } && $deprecated{$page}{$name}) {
+ RT->Deprecated(
+ Message => "The callback $name on page $page is deprecated",
+ Detail => "Callback list:\n" . join("\n", @{ $callbacks }),
+ Stack => 0,
+ %{ $deprecated{$page}{$name} },
+ );
+ }
}
my @rv;
commit 4c24855f7512516cad27ff6fcd3bba060e3273a5
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Mon Dec 28 18:18:19 2015 +0000
Deprecate /CustomFields/Modify.html callback AfterUpdateCustomFieldValue
This callback needs to be removed because of e38da008 (ajax CFV management)
diff --git a/lib/RT/Interface/Web/Request.pm b/lib/RT/Interface/Web/Request.pm
index c07c5e2..d35833c 100644
--- a/lib/RT/Interface/Web/Request.pm
+++ b/lib/RT/Interface/Web/Request.pm
@@ -56,6 +56,9 @@ use base qw(HTML::Mason::Request::PSGI);
use Params::Validate qw(:all);
my %deprecated = (
+ '/Admin/CustomFields/Modify.html' => {
+ 'AfterUpdateCustomFieldValue' => { Remove => '4.6' },
+ },
);
sub new {
-----------------------------------------------------------------------
More information about the rt-commit
mailing list