From b3357ab31b54c8cdf810e72dfc7bf74321178c53 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 20 Mar 2026 11:34:57 +0000 Subject: [PATCH] Bug 41834: Fix GetDelimiterChoices after options column removed from sysprefs.sql We removed the `options` column from all sysprefs.sql INSERT statements, leaving CSVDelimiter.options as NULL in the DB. This broke GetDelimiterChoices() which relied on that column for the list of valid delimiter choices, resulting in empty dropdowns across all report pages and an uninitialized value warning in the test suite. Fix by hardcoding the choices (matching admin.pref) and reading the current value via C4::Context->preference() instead of a raw DB query. Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- C4/Reports.pm | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/C4/Reports.pm b/C4/Reports.pm index b0e55ec48f..ad07e44a9f 100644 --- a/C4/Reports.pm +++ b/C4/Reports.pm @@ -49,18 +49,10 @@ This will return a list of all the available delimiters. =cut sub GetDelimiterChoices { - my $dbh = C4::Context->dbh; + my $default = C4::Context->preference('CSVDelimiter'); - my $sth = $dbh->prepare( " - SELECT options, value - FROM systempreferences - WHERE variable = 'CSVDelimiter' - " ); - - $sth->execute(); - - my ( $choices, $default ) = $sth->fetchrow; - my @dels = split /\|/, $choices; + # NOTE: The below list should match the corresponding options in the .pref file + my @dels = ( ';', 'tabulation', ',', '/', '\\', '#' ); return { values => \@dels,