From 6aff5f361a11e029a635f8a5c26def3d3149458d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 25 Mar 2026 10:12:39 +0100 Subject: [PATCH] Bug 35380: (QA follow-up) Minor code quality fixes - Add order_by => ['name'] to record_sources fetch in marc-overlay-rules.pl so filter dropdown options are consistently sorted - Add COMMENT to record_sources.is_system column in kohastructure.sql to match convention of other columns in that table - Remove commented-out Data::Dumper debug lines from biblios.t - Remove redundant explicit object deletes inside subtests that are already wrapped in txn_rollback; the rollback undoes them anyway Signed-off-by: Martin Renvoize --- admin/marc-overlay-rules.pl | 2 +- installer/data/mysql/kohastructure.sql | 2 +- t/db_dependent/api/v1/biblios.t | 8 -------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/admin/marc-overlay-rules.pl b/admin/marc-overlay-rules.pl index e472ffdaa4..840d0757fb 100755 --- a/admin/marc-overlay-rules.pl +++ b/admin/marc-overlay-rules.pl @@ -126,7 +126,7 @@ my $categories = Koha::Patron::Categories->search_with_library_limits( )->unblessed; my @record_sources = - map { $_->{name} } @{ Koha::RecordSources->search->unblessed }; + map { $_->{name} } @{ Koha::RecordSources->search( {}, { order_by => ['name'] } )->unblessed }; $template->param( rules => $rules, diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index ada8472dcc..bb1a44a280 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -5679,7 +5679,7 @@ CREATE TABLE `record_sources` ( `record_source_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary key for the `record_sources` table', `name` text NOT NULL COMMENT 'User defined name for the record source', `can_be_edited` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'If records from this source can be edited', - `is_system` tinyint(1) NOT NULL DEFAULT 0, + `is_system` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'If this record source is system-defined and cannot be deleted', PRIMARY KEY (`record_source_id`), UNIQUE KEY `name` (`name`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/t/db_dependent/api/v1/biblios.t b/t/db_dependent/api/v1/biblios.t index 846ea07105..836bf8fbd5 100755 --- a/t/db_dependent/api/v1/biblios.t +++ b/t/db_dependent/api/v1/biblios.t @@ -1939,8 +1939,6 @@ subtest 'put() tests' => sub { } => $marc )->status_is(200); - $locked_biblio->delete(); - }; subtest 'put() with overlay_context' => sub { @@ -1979,9 +1977,6 @@ subtest 'put() tests' => sub { |; - #use Data::Dumper; - #warn Dumper($incoming_record_xml); - my $record_source = $builder->build_object( { class => 'Koha::RecordSources', value => { can_be_edited => 1, is_system => 0 } } ); @@ -2042,9 +2037,6 @@ subtest 'put() tests' => sub { 'new title', 'Title has been changed' ); - $biblio->delete(); - $record_source->delete(); - $rule->delete(); }; $schema->storage->txn_rollback;