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 <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2026-04-27 08:07:07 +01:00 committed by Lucas Gass
parent 994feda588
commit 8f6daa1b38
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 15 additions and 10 deletions

View File

@ -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

View File

@ -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'});