From 4a6352376ec41820ecdb1ad777aa7fdebb7ade6e Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 24 Oct 2024 08:45:15 +0000 Subject: [PATCH] Bug 23295: DBRev 24.06.00.040 Signed-off-by: Katrin Fischer --- Koha.pm | 2 +- ...d_RestrictPatronsWithFailedNotices_syspref.pl | 16 ---------------- .../240600040.pl} | 10 +++++++++- 3 files changed, 10 insertions(+), 18 deletions(-) delete mode 100755 installer/data/mysql/atomicupdate/bug_23295-add_RestrictPatronsWithFailedNotices_syspref.pl rename installer/data/mysql/{atomicupdate/bug_23295-add_system_restriction_types.pl => db_revs/240600040.pl} (55%) diff --git a/Koha.pm b/Koha.pm index e43656ff02..1b4f4856d0 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "24.06.00.039"; +$VERSION = "24.06.00.040"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_23295-add_RestrictPatronsWithFailedNotices_syspref.pl b/installer/data/mysql/atomicupdate/bug_23295-add_RestrictPatronsWithFailedNotices_syspref.pl deleted file mode 100755 index 02dd9d24e0..0000000000 --- a/installer/data/mysql/atomicupdate/bug_23295-add_RestrictPatronsWithFailedNotices_syspref.pl +++ /dev/null @@ -1,16 +0,0 @@ -use Modern::Perl; - -return { - bug_number => "23295", - description => "Automatically debar patrons if SMS or email notice fail", - up => sub { - my ($args) = @_; - my ( $dbh, $out ) = @$args{qw(dbh out)}; - - $dbh->do( - q{ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('RestrictPatronsWithFailedNotices', '0', NULL, 'If enabled then when SMS and email notices fail sending at the Koha level then a debarment will be applied to a patrons account', 'YesNo') } - ); - - say $out "Added system preference 'RestrictPatronsWithFailedNotices'"; - }, -}; diff --git a/installer/data/mysql/atomicupdate/bug_23295-add_system_restriction_types.pl b/installer/data/mysql/db_revs/240600040.pl similarity index 55% rename from installer/data/mysql/atomicupdate/bug_23295-add_system_restriction_types.pl rename to installer/data/mysql/db_revs/240600040.pl index fe27c24523..f2f30c1bb1 100755 --- a/installer/data/mysql/atomicupdate/bug_23295-add_system_restriction_types.pl +++ b/installer/data/mysql/db_revs/240600040.pl @@ -7,13 +7,21 @@ return { up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('RestrictPatronsWithFailedNotices', '0', NULL, 'If enabled then when SMS and email notices fail sending at the Koha level then a debarment will be applied to a patrons account', 'YesNo') } + ); + + say_success ( $out, "Added new system preference 'RestrictPatronsWithFailedNotices'" ); + try { $dbh->do( q{INSERT IGNORE INTO restriction_types (code, display_text, is_system, is_default) VALUES ('NOTICE_FAILURE_SUSPENSION', 'Notice failure suspension', 1, 0)} ); - say_success( $out, "Added a new system restriction_types 'NOTICE_FAILURE_SUSPENSION'" ); + say_success( $out, "Added new system restriction type 'NOTICE_FAILURE_SUSPENSION'" ); } catch { say_failure( $out, "Database modification failed with errors: $_" ); }; + }, }; -- 2.39.5