From 8f6daa1b38f15533f510c53cf51133ec768b3078 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 27 Apr 2026 08:07:07 +0100 Subject: [PATCH] Bug 34353: (QA follow-up) Migrate spinelabel for both holdings tables The catalogue_detail.inc include is shared by both the holdings_table and otherholdings_table tabs, so the column visibility migration must seed both. Without this, sites that previously had 'SpineLabelShowPrintOnBibDetails' set to "Don't show" would still see the spine-label column appear in the other-holdings tab. Also mark 'spinelabel' as is_hidden by default in admin/columns_settings.yml for both tables, so fresh installs (where the atomicupdate doesn't run) match the previous syspref default of 0 (Don't show). Test plan: 1. Reset the database, do not apply the parent patch yet. 2. With the syspref still present, set it to "Don't show" and save. 3. Apply the parent patch and this follow-up, then update the database. 4. Navigate to a record with items in both 'Holdings' and 'Other holdings' tabs. 5. Verify the 'Spine label' column is hidden in BOTH tabs. 6. Reset the database again. Set the syspref to "Show", save, then apply patches and update the database. 7. Verify the 'Spine label' column is visible in BOTH tabs. Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass --- admin/columns_settings.yml | 2 ++ ...spinelabelshowprintonbibdetails_syspref.pl | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 73c32babac..a438baa164 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -562,6 +562,7 @@ modules: columnname: course_reserves - columnname: spinelabel + is_hidden: 1 - columnname: actions cannot_be_toggled: 1 @@ -635,6 +636,7 @@ modules: columnname: course_reserves - columnname: spinelabel + is_hidden: 1 - columnname: actions cannot_be_toggled: 1 diff --git a/installer/data/mysql/atomicupdate/bug_34353-remove_spinelabelshowprintonbibdetails_syspref.pl b/installer/data/mysql/atomicupdate/bug_34353-remove_spinelabelshowprintonbibdetails_syspref.pl index 32f79b6b32..183f10236f 100644 --- a/installer/data/mysql/atomicupdate/bug_34353-remove_spinelabelshowprintonbibdetails_syspref.pl +++ b/installer/data/mysql/atomicupdate/bug_34353-remove_spinelabelshowprintonbibdetails_syspref.pl @@ -8,16 +8,19 @@ return { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; - $dbh->do( - q{INSERT INTO columns_settings - (module, page, tablename, columnname, cannot_be_toggled, is_hidden) - VALUES - ('catalogue', 'detail', 'holdings_table', 'spinelabel', 0, - (SELECT IFNULL( - (SELECT NOT value FROM systempreferences WHERE variable='SpineLabelShowPrintOnBibDetails'), - 0))) - ON DUPLICATE KEY UPDATE is_hidden=(is_hidden OR VALUES(is_hidden))} - ); + for my $tablename (qw(holdings_table otherholdings_table)) { + $dbh->do( + q{INSERT INTO columns_settings + (module, page, tablename, columnname, cannot_be_toggled, is_hidden) + VALUES + ('catalogue', 'detail', ?, 'spinelabel', 0, + (SELECT IFNULL( + (SELECT NOT value FROM systempreferences WHERE variable='SpineLabelShowPrintOnBibDetails'), + 0))) + ON DUPLICATE KEY UPDATE is_hidden=(is_hidden OR VALUES(is_hidden))}, + undef, $tablename + ); + } $dbh->do(q{DELETE FROM systempreferences WHERE variable='SpineLabelShowPrintOnBibDetails'});