[Rt-commit] rt branch, 4.4.1-releng, updated. rt-4.4.1rc1-10-gc6ddc87

Dustin Graves dustin at bestpractical.com
Tue Jun 21 13:28:54 EDT 2016


The branch, 4.4.1-releng has been updated
       via  c6ddc87f0a8b0ddd2d5d7ba8dd41f425a40103a2 (commit)
       via  5e4b627423b954a671a2d12726a91f62cad2a2ce (commit)
      from  8621b21ac7062b46fd0684876ae0f1ee63454f80 (commit)

Summary of changes:
 lib/RT/Queue.pm | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

- Log -----------------------------------------------------------------
commit 5e4b627423b954a671a2d12726a91f62cad2a2ce
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Mon Jun 20 19:56:36 2016 +0000

    Add deprecated-in-4.6 stubs for fields removed from queues in 4.4
    
        InitialPriority, FinalPriority, and DefaultDueIn have been
        reimplemented in terms of the general DefaultValues feature,
        so those methods were removed in 5971ba1ac1. However they did
        not go through a deprecation cycle, so this commit reinstates
        some support for these methods in terms of DefaultValue and
        SetDefaultValue.
    
    Fixes: I#32019

diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index 2a80a6c..012cf20 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -1227,6 +1227,68 @@ sub SetSLA {
     return ($status, $self->loc("Queue's default service level has been changed"));
 }
 
+sub InitialPriority {
+    my $self = shift;
+    RT->Deprecated( Instead => "DefaultValue('InitialPriority')", Remove => '4.6' );
+    return $self->DefaultValue('InitialPriority');
+}
+
+sub FinalPriority {
+    my $self = shift;
+    RT->Deprecated( Instead => "DefaultValue('FinalPriority')", Remove => '4.6' );
+    return $self->DefaultValue('FinalPriority');
+}
+
+sub DefaultDueIn {
+    my $self = shift;
+    RT->Deprecated( Instead => "DefaultValue('Due')", Remove => '4.6' );
+
+    # DefaultDueIn used to be a number of days; so if the DefaultValue is,
+    # say, "3 days" then return 3
+    my $due = $self->DefaultValue('Due');
+    if (defined($due) && $due =~ /^(\d+) days?$/i) {
+        return $1;
+    }
+
+    return $due;
+}
+
+sub SetInitialPriority {
+    my $self = shift;
+    my $value = shift;
+    RT->Deprecated( Instead => "SetDefaultValue", Remove => '4.6' );
+    return $self->SetDefaultValue(
+        Name => 'InitialPriority',
+        Value => $value,
+    );
+}
+
+sub SetFinalPriority {
+    my $self = shift;
+    my $value = shift;
+    RT->Deprecated( Instead => "SetDefaultValue", Remove => '4.6' );
+    return $self->SetDefaultValue(
+        Name => 'FinalPriority',
+        Value => $value,
+    );
+}
+
+sub SetDefaultDueIn {
+    my $self = shift;
+    my $value = shift;
+
+    # DefaultDueIn used to be a number of days; so if we're setting to,
+    # say, "3" then add the word "days" to match the way the new
+    # DefaultValues works
+    $value .= " days" if defined($value) && $value =~ /^\d+$/;
+
+    RT->Deprecated( Instead => "SetDefaultValue", Remove => '4.6' );
+    return $self->SetDefaultValue(
+        Name => 'Due',
+        Value => $value,
+    );
+}
+
 RT::Base->_ImportOverlays();
 
 1;

commit c6ddc87f0a8b0ddd2d5d7ba8dd41f425a40103a2
Merge: 8621b21 5e4b627
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Tue Jun 21 17:28:48 2016 +0000

    Merge branch '4.4.1/queue-deprecations' into 4.4.1-releng


-----------------------------------------------------------------------


More information about the rt-commit mailing list