Bugzilla – Attachment 9385 Details for
Bug 8025
Patron attribute not selected if value is zero
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 8025: corrects the return of a zero value for authorised values
SIGNED-OFF-Bug-8025-corrects-the-return-of-a-zero-.patch (text/plain), 1.75 KB, created by
Owen Leonard
on 2012-05-01 19:32:14 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 8025: corrects the return of a zero value for authorised values
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2012-05-01 19:32:14 UTC
Size:
1.75 KB
patch
obsolete
>From c9c2b65c0c12c52ea51dbcf8cdcea77a983b3a4b Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Mon, 30 Apr 2012 10:05:07 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 8025: corrects the return of a zero value > for authorised values >Content-Type: text/plain; charset="utf-8" > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Koha.pm | 23 +++++++++++++---------- > 1 files changed, 13 insertions(+), 10 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 0192989..a028937 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -1008,22 +1008,25 @@ C<$opac> If set to a true value, displays OPAC descriptions rather than normal o > > sub GetAuthorisedValues { > my ($category,$selected,$opac) = @_; >- my @results; >+ my @results; > my $dbh = C4::Context->dbh; > my $query = "SELECT * FROM authorised_values"; > $query .= " WHERE category = '" . $category . "'" if $category; > $query .= " ORDER BY category, lib, lib_opac"; > my $sth = $dbh->prepare($query); > $sth->execute; >- while (my $data=$sth->fetchrow_hashref) { >- if ($selected && $selected eq $data->{'authorised_value'} ) { >- $data->{'selected'} = 1; >- } >- if ($opac && $data->{'lib_opac'}) { >- $data->{'lib'} = $data->{'lib_opac'}; >- } >- push @results, $data; >- } >+ while (my $data=$sth->fetchrow_hashref) { >+ if ( (defined($selected)) && ($selected eq $data->{'authorised_value'}) ) { >+ $data->{'selected'} = 1; >+ } >+ else { >+ $data->{'selected'} = 0; >+ } >+ if ($opac && $data->{'lib_opac'}) { >+ $data->{'lib'} = $data->{'lib_opac'}; >+ } >+ push @results, $data; >+ } > #my $data = $sth->fetchall_arrayref({}); > return \@results; #$data; > } >-- >1.7.5.4
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 8025
:
9363
| 9385