Bugzilla – Attachment 96395 Details for
Bug 24215
Warnings about guarantor relationships show ARRAY errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24215: Correct display of guarantor relationship errors
Bug-24215-Correct-display-of-guarantor-relationshi.patch (text/plain), 2.36 KB, created by
Jonathan Druart
on 2019-12-18 08:05:23 UTC
(
hide
)
Description:
Bug 24215: Correct display of guarantor relationship errors
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-18 08:05:23 UTC
Size:
2.36 KB
patch
obsolete
>From 5836997057ba72810cd4d333c2d4e56c54063443 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 11 Dec 2019 11:33:51 +0000 >Subject: [PATCH] Bug 24215: Correct display of guarantor relationship errors > >Test plan: >1) Add some bad data to your borrower_relationships table. ( add or > update a relationship such that the 'relationship' field contains a > value not listed in the corresponding system preference. >2) Go to the about system information page and note the nasty display of > ARRAY(whatever) >3) Apply the patch >4) Repeat step 2 and note that a list of bad values is now displayed > instead. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > about.pl | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > >diff --git a/about.pl b/about.pl >index 14be586170..b9c5c5fe2d 100755 >--- a/about.pl >+++ b/about.pl >@@ -474,7 +474,7 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; > > $bad_relationships_count = $bad_relationships_count->[0]->[0]; > >- my @existing_relationships = $dbh->selectall_arrayref(q{ >+ my $existing_relationships = $dbh->selectall_arrayref(q{ > SELECT DISTINCT(relationship) > FROM ( > SELECT relationship FROM borrower_relationships WHERE relationship IS NOT NULL >@@ -485,17 +485,16 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; > my %valid_relationships = map { $_ => 1 } split( /,|\|/, C4::Context->preference('borrowerRelationship') ); > $valid_relationships{ _bad_data } = 1; # we handle this case in another way > >- my @wrong_relationships = grep { !$valid_relationships{ $_->[0] } } @existing_relationships; >- >- if ( @wrong_relationships or $bad_relationships_count ) { >+ my $wrong_relationships = [ grep { !$valid_relationships{ $_->[0] } } @{$existing_relationships} ]; >+ if ( $wrong_relationships or $bad_relationships_count ) { > > $template->param( > warnRelationships => 1, > ); > >- if ( @wrong_relationships ) { >+ if ( $wrong_relationships ) { > $template->param( >- wrong_relationships => \@wrong_relationships >+ wrong_relationships => $wrong_relationships > ); > } > if ($bad_relationships_count) { >-- >2.11.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 24215
:
96195
|
96208
| 96395 |
96396