Bugzilla – Attachment 192291 Details for
Bug 41746
Add a dev script to insert a new syspref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41746: Bug Deal with end of files (, vs ;)
6b61423.patch (text/plain), 1.57 KB, created by
Jonathan Druart
on 2026-02-02 11:12:04 UTC
(
hide
)
Description:
Bug 41746: Bug Deal with end of files (, vs ;)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-02-02 11:12:04 UTC
Size:
1.57 KB
patch
obsolete
>From 6b61423e2f03ada4f727538ae7cfe75de003ebf0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 2 Feb 2026 10:11:04 +0100 >Subject: [PATCH] Bug 41746: Bug Deal with end of files (, vs ;) > >--- > Koha/Devel/Sysprefs.pm | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/Koha/Devel/Sysprefs.pm b/Koha/Devel/Sysprefs.pm >index fd0ce134284..09e9e13231a 100644 >--- a/Koha/Devel/Sysprefs.pm >+++ b/Koha/Devel/Sysprefs.pm >@@ -137,6 +137,7 @@ sub add_new_pref { > my @sysprefs; > for my $line (@lines) { > chomp $line; >+ next if $line eq ';'; # Removing and adding it later > > # FIXME Explode if already exists? > my $syspref = $self->extract_syspref_from_line($line); >@@ -153,6 +154,7 @@ sub add_new_pref { > $new_syspref->{type} > ) > }; >+ > @sysprefs = sort { > defined $a->{variable} > && defined $b->{variable} >@@ -160,8 +162,16 @@ sub add_new_pref { > cmp( > lc( $b->{variable} ) =~ > s/_/ZZZ/gr ) # mysql sorts underscore last, if you modify this qa-test-tools will need adjustments >+ || defined $a->{variable} > } @sysprefs; >- write_file( $self->{filepath}, join( "\n", map { $_->{line} } @sysprefs ) ); >+ >+ $sysprefs[-1]->{line} =~ s/,$//; >+ if ( $sysprefs[-2]->{line} =~ /[^,]$/ ) { >+ $sysprefs[-2]->{line} .= ','; >+ } >+ push @sysprefs, { line => ';' }; >+ >+ write_file( $self->{filepath}, join( "\n", map { $_->{line} } @sysprefs ) . "\n" ); > } > > 1; >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41746
:
192288
|
192289
|
192290
| 192291 |
192292