From 200cc8292020cc4495dc161277f575fc0ecb9bfc Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 2 Jan 2024 15:57:31 +0000 Subject: [PATCH] Bug 35681: [TEST ONLY]: This is a dummy dbrev to force an update This patch adds an atomic update file and also an equivilent db_rev and increments the Koha.pm version too. Use it to test the output of updatedatebase, run via console or via the browser. Test plan 1) Start KTD without the patches applied. 2) Apply this test patch 3) Run the detabase updates via the console and confirm it looks reasonable and is colored. 4) Reset the database version in ktd `koha-mysql kohadev` `UPDATE systempreferences SET value = '23.1200002';` 5) Run the database updates via the browser; `http://localhost:8081/cgi-bin/koha/installer/install.pl?step=3&op=updatestructure` 6) Confirm the presence of weird looking escape characters on screen. 7) Apply the next patch and run through steps 3 to 5 again, this time confirming the browser output looks good. Signed-off-by: Pedro Amorim --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_35681.pl | 18 ++++++++++++++++++ installer/data/mysql/db_revs/231200003.pl | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_35681.pl create mode 100755 installer/data/mysql/db_revs/231200003.pl diff --git a/Koha.pm b/Koha.pm index acb0ca9ab9..d904cde577 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 = "23.12.00.002"; +$VERSION = "23.12.00.003"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_35681.pl b/installer/data/mysql/atomicupdate/bug_35681.pl new file mode 100755 index 0000000000..12b71b7828 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35681.pl @@ -0,0 +1,18 @@ +use Modern::Perl; + +use Term::ANSIColor; + +return { + bug_number => "35681", + description => "Test Atomic update output", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + say $out colored("Something in red is a warning", 'red'); + say $out colored("Somthing in yellow is a call to action", 'yellow'); + say $out colored("Something in blue is for information only", 'blue'); + say $out colored("You could use 'WHITE' too?", 'white'); + say $out "Or leave color off and stick to default"; + }, +}; diff --git a/installer/data/mysql/db_revs/231200003.pl b/installer/data/mysql/db_revs/231200003.pl new file mode 100755 index 0000000000..90a7a9908e --- /dev/null +++ b/installer/data/mysql/db_revs/231200003.pl @@ -0,0 +1,18 @@ +use Modern::Perl; + +use Term::ANSIColor; + +return { + bug_number => "35681", + description => "Test DB Rev output", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + say $out colored("Something in red is a warning", 'red'); + say $out colored("Somthing in yellow is a call to action", 'yellow'); + say $out colored("Something in blue is for information only", 'blue'); + say $out colored("You could use 'WHITE' too?", 'white'); + say $out "Or leave color off and stick to default"; + }, +}; -- 2.30.2