Bug 34353: (QA follow-up) Atomicupdate cleanup
- Set the executable bit on the atomicupdate so it passes the QA file_permissions check. - Drop the unused 'say_info' import; only 'say_warning' and 'say_success' are now needed. - Capture the row count from the DELETE so we report 'say_warning' on a re-run (when the syspref is already gone) instead of falsely claiming to have deleted it again. - Add an inline comment explaining the conservative '(is_hidden OR VALUES(is_hidden))' conflict-resolution rule used when a table-settings row already exists alongside the old syspref value. Test plan: 1. Verify the atomicupdate file has the executable bit set. 2. On a database where the syspref is still present, run the atomicupdate. Confirm output reads "Deleted 'SpineLabelShowPrintOnBibDetails' syspref". 3. Run the atomicupdate a second time. Confirm output now reads "'SpineLabelShowPrintOnBibDetails' syspref already removed". 4. Confirm the columns_settings rows are unchanged on re-run. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
8f6daa1b38
commit
1de09a6294
14
installer/data/mysql/atomicupdate/bug_34353-remove_spinelabelshowprintonbibdetails_syspref.pl
Normal file → Executable file
14
installer/data/mysql/atomicupdate/bug_34353-remove_spinelabelshowprintonbibdetails_syspref.pl
Normal file → Executable file
|
|
@ -1,5 +1,5 @@
|
|||
use Modern::Perl;
|
||||
use Koha::Installer::Output qw(say_warning say_success say_info);
|
||||
use Koha::Installer::Output qw(say_warning say_success);
|
||||
|
||||
return {
|
||||
bug_number => "34353",
|
||||
|
|
@ -8,6 +8,10 @@ return {
|
|||
my ($args) = @_;
|
||||
my ( $dbh, $out ) = @$args{qw(dbh out)};
|
||||
|
||||
# If a columns_settings row already exists, OR the migrated value into
|
||||
# the existing is_hidden flag — when the previous syspref and an
|
||||
# existing table-settings override disagree we err on the side of
|
||||
# hiding the column (the old syspref's "Don't show" winning).
|
||||
for my $tablename (qw(holdings_table otherholdings_table)) {
|
||||
$dbh->do(
|
||||
q{INSERT INTO columns_settings
|
||||
|
|
@ -22,8 +26,12 @@ return {
|
|||
);
|
||||
}
|
||||
|
||||
$dbh->do(q{DELETE FROM systempreferences WHERE variable='SpineLabelShowPrintOnBibDetails'});
|
||||
my $deleted = $dbh->do(q{DELETE FROM systempreferences WHERE variable='SpineLabelShowPrintOnBibDetails'});
|
||||
|
||||
say_success( $out, "Deleted 'SpineLabelShowPrintOnBibDetails' syspref" );
|
||||
if ( $deleted && $deleted > 0 ) {
|
||||
say_success( $out, "Deleted 'SpineLabelShowPrintOnBibDetails' syspref" );
|
||||
} else {
|
||||
say_warning( $out, "'SpineLabelShowPrintOnBibDetails' syspref already removed" );
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue