Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 11 May 2020 10:33:32 +0000 (11:33 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 13 May 2020 09:36:15 +0000 (10:36 +0100)
An errant update from bug 22563 could lead to cases of LOST_RETURNED as
aposed to LOST_RETURN as an account_credit_type. This patch adds code to
deal with those cases to the update for bug 24592

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/updatedatabase.pl

index e12471c..5bbef64 100755 (executable)
@@ -20755,6 +20755,8 @@ if( CheckVersion( $DBversion ) ) {
           credit_type_code = 'LOST_FOUND'
         WHERE
           credit_type_code = 'LOST_RETURN'
+        OR
+          credit_type_code = 'LOST_RETURNED'
     });
 
     # Migrate LOST + RETURNED to LOST + FOUND
@@ -20771,6 +20773,11 @@ if( CheckVersion( $DBversion ) ) {
 
     # Drop LOST_RETURNED credit type
     $dbh->do(qq{
+        DELETE FROM account_credit_types WHERE code = 'LOST_RETURNED'
+    });
+
+    # Drop LOST_RETURN credit type
+    $dbh->do(qq{
         DELETE FROM account_credit_types WHERE code = 'LOST_RETURN'
     });