[Rt-commit] rt branch, 4.4/remove-lifecycle-on-merge, created. rt-4.2.5-200-ga137b18

Alex Vandiver alexmv at bestpractical.com
Tue Sep 9 16:31:32 EDT 2014


The branch, 4.4/remove-lifecycle-on-merge has been created
        at  a137b18af6f98e788afbc08b2ad3eb92ef9c54f6 (commit)

- Log -----------------------------------------------------------------
commit a137b18af6f98e788afbc08b2ad3eb92ef9c54f6
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Sep 9 16:24:12 2014 -0400

    Remove the unnecessary "on merge" lifecycle property
    
    Lifecycles inexplicably have an on_merge property.  Since a merged
    ticket cannot be found via searches or charts, its status is irrelevant.
    The original change to set the status of a merged ticket was 30bbc418,
    which provides no rationale for doing so.
    
    Remove the extra setting, which merely serves to add unnecessary
    complexity to lifecycles.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index dbcd8e3..9572886 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2587,12 +2587,6 @@ If you (or your code) doesn't specify a status when creating a ticket,
 RT will use the this status. See also L</Statuses available during
 ticket creation>.
 
-=item on_merge
-
-When tickets are merged, the status of the ticket that was merged
-away is forced to this value.  It should be one of inactive statuses;
-'resolved' or its equivalent is most probably the best candidate.
-
 =item approved
 
 When an approval is accepted, the status of depending tickets will
@@ -2755,7 +2749,6 @@ Set(%Lifecycles,
 
         defaults => {
             on_create => 'new',
-            on_merge  => 'resolved',
             approved  => 'open',
             denied    => 'rejected',
             reminder_on_open     => 'open',
@@ -2800,7 +2793,6 @@ Set(%Lifecycles,
 
         defaults => {
             on_create => 'new',
-            on_merge => 'resolved',
             reminder_on_open     => 'open',
             reminder_on_resolve  => 'resolved',
         },
diff --git a/lib/RT/Lifecycle/Ticket.pm b/lib/RT/Lifecycle/Ticket.pm
index bd0bfc5..40a5cbb 100644
--- a/lib/RT/Lifecycle/Ticket.pm
+++ b/lib/RT/Lifecycle/Ticket.pm
@@ -67,18 +67,6 @@ sub Queues {
     return $queues;
 }
 
-=head3 DefaultOnMerge
-
-Returns the status that should be used when tickets
-are merged.
-
-=cut
-
-sub DefaultOnMerge {
-    my $self = shift;
-    return $self->DefaultStatus('on_merge');
-}
-
 =head3 ReminderStatusOnOpen
 
 Returns the status that should be used when reminders are opened.
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 618fb22..1ef7532 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -1750,20 +1750,6 @@ sub _MergeInto {
         return ( 0, $self->loc("Merge failed. Couldn't set IsMerged") );
     }
 
-    my $force_status = $self->LifecycleObj->DefaultOnMerge;
-    if ( $force_status && $force_status ne $self->__Value('Status') ) {
-        my ( $status_val, $status_msg )
-            = $self->__Set( Field => 'Status', Value => $force_status );
-
-        unless ($status_val) {
-            $RT::Handle->Rollback();
-            $RT::Logger->error(
-                "Couldn't set status to $force_status. RT's Database may be inconsistent."
-            );
-            return ( 0, $self->loc("Merge failed. Couldn't set Status") );
-        }
-    }
-
     # update all the links that point to that old ticket
     my $old_links_to = RT::Links->new($self->CurrentUser);
     $old_links_to->Limit(FIELD => 'Target', VALUE => $self->URI);
diff --git a/t/lifecycles/utils.pl b/t/lifecycles/utils.pl
index 4dbba23..cd167d6 100644
--- a/t/lifecycles/utils.pl
+++ b/t/lifecycles/utils.pl
@@ -13,7 +13,6 @@ Set(\%Lifecycles,
         inactive => [qw(resolved rejected deleted)],
         defaults => {
             on_create => 'new',
-            on_merge => 'resolved',
         },
         transitions => {
             ''       => [qw(new open resolved)],
@@ -46,7 +45,6 @@ Set(\%Lifecycles,
         inactive => ['delivered'],
         defaults => {
             on_create => 'ordered',
-            on_merge => 'delivered',
         },
         transitions => {
             ''        => ['ordered'],

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


More information about the rt-commit mailing list