[Rt-commit] rt branch, 4.2/upgrade-from-3.8-errors, updated. rt-4.1.23-6-g7056a93

Kevin Falcone falcone at bestpractical.com
Thu Sep 5 12:56:55 EDT 2013


The branch, 4.2/upgrade-from-3.8-errors has been updated
       via  7056a9388780c698c50d4556053a5724aaf0e438 (commit)
       via  474aaf6c11be96e4a1cbeff115d3c489cc1397e9 (commit)
      from  2adb0fa77629629ef9799573137c1c655e346828 (commit)

Summary of changes:
 etc/upgrade/4.0.0rc7/content | 2 +-
 etc/upgrade/4.1.20/content   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 474aaf6c11be96e4a1cbeff115d3c489cc1397e9
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Sep 5 12:48:14 2013 -0400

    Handle more formats of the Forward template.
    
    The original version added in 3.7.15 said "This is forward...of a
    ticket" which I changed in 3.8.6 when we split the Templates into
    Forward and Forward Ticket.  However, I failed to account for the
    missing newline and didn't go back and match the upgrade script with the
    current initialdata.
    
    This now matches on a user who installed or ugpraded from an early 3.8
    as well as a user who installed on 4.0.
    
    In either case, this is easily manually fixed, but we should try really
    hard to fix it for the user.

diff --git a/etc/upgrade/4.1.20/content b/etc/upgrade/4.1.20/content
index 5c323b2..afed9c3 100644
--- a/etc/upgrade/4.1.20/content
+++ b/etc/upgrade/4.1.20/content
@@ -24,9 +24,9 @@ our @Initial = (
         $forward_template->Load('Forward');
         $forward_template->SetDescription('Forwarded message');
 
-        if ( $forward_template->Content eq q{
-This is a forward of transaction #{$Transaction->id} of ticket #{ $Ticket->id }
-} ) {
+        if ( $forward_template->Content =~
+                m/^\n*This is (a )?forward of transaction #\{\s*\$Transaction->id\s*\} of (a )?ticket #\{\s*\$Ticket->id\s*\}\n*$/
+            ) {
             $forward_template->SetContent(q{
 
 { $ForwardTransaction->Content =~ /\S/ ? $ForwardTransaction->Content : "This is a forward of transaction #".$Transaction->id." of ticket #". $Ticket->id }

commit 7056a9388780c698c50d4556053a5724aaf0e438
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Sep 5 12:55:43 2013 -0400

    $queue->Lifecycle is now the DB column, which is undef on upgrade
    
    This caused a warning about comparing undef to 'approvals'.
    
    When this script was originally written, Lifecycle was an object and
    Lifecycle->Name was '' so it was safe.  With the change in 4.2 of
    Lifecycle being the column, this started warning.

diff --git a/etc/upgrade/4.0.0rc7/content b/etc/upgrade/4.0.0rc7/content
index bad39d4..4fd63e7 100644
--- a/etc/upgrade/4.0.0rc7/content
+++ b/etc/upgrade/4.0.0rc7/content
@@ -12,7 +12,7 @@ our @Initial = (
             return 1;
         }
 
-        return 1 if $queue->Lifecycle eq 'approvals';
+        return 1 if $queue->Lifecycle && $queue->Lifecycle eq 'approvals';
 
         my ($status, $msg) = $queue->SetLifecycle('approvals');
         unless ( $status ) {

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


More information about the Rt-commit mailing list