Bugzilla – Attachment 29673 Details for
Bug 12265
Improve Z39.50 servers administration (incl DBIx)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12265: [QA Follow-up] - Improve usage of find
PASSED-QA-Bug-12265-QA-Follow-up---Improve-usage-o.patch (text/plain), 2.18 KB, created by
Kyle M Hall (khall)
on 2014-07-14 11:48:05 UTC
(
hide
)
Description:
[PASSED QA] Bug 12265: [QA Follow-up] - Improve usage of find
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-07-14 11:48:05 UTC
Size:
2.18 KB
patch
obsolete
>From 11eb01b11ff48f7cc466bc2a0ac769579bcd6754 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 14 Jul 2014 07:36:07 -0400 >Subject: [PATCH] [PASSED QA] Bug 12265: [QA Follow-up] - Improve usage of find > >When finding a row by its primary key, it is not necessary to >pass a hashref, only the primary key value itself is required. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > admin/z3950servers.pl | 14 +++++++------- > 1 files changed, 7 insertions(+), 7 deletions(-) > >diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl >index b4011e6..edfcf5c 100755 >--- a/admin/z3950servers.pl >+++ b/admin/z3950servers.pl >@@ -55,29 +55,29 @@ my $schema = Koha::Database->new()->schema(); > # First process a confirmed delete, or save a validated record > > if( $op eq 'delete_confirmed' && $id ) { >- my $server=$schema->resultset('Z3950server')->find( { id => $id } ); >- if( $server ) { >+ my $server = $schema->resultset('Z3950server')->find($id); >+ if ( $server ) { > $server->delete; > $template->param( msg_deleted => 1, msg_add => $server->name ); > } else { > $template->param( msg_notfound => 1, msg_add => $id ); > } >- $id=0; >-} elsif( $op eq 'add_validated' ) { >+ $id = 0; >+} elsif ( $op eq 'add_validated' ) { > my @fields=qw/host port db userid password rank syntax encoding timeout > recordtype checked/; > my $formdata = _form_data_hashref( $input, \@fields ); > #add name from servername (an input with name="name" gave problems) > $formdata->{name} = $input->param('servername'); > if( $id ) { >- my $server= $schema->resultset('Z3950server')->find( { id => $id } ); >- if( $server ) { >+ my $server = $schema->resultset('Z3950server')->find($id); >+ if ( $server ) { > $server->update( $formdata ); > $template->param( msg_updated => 1, msg_add => $formdata->{name} ); > } else { > $template->param( msg_notfound => 1, msg_add => $id ); > } >- $id=0; >+ $id = 0; > } else { > $schema->resultset('Z3950server')->create( $formdata ); > $template->param( msg_added => 1, msg_add => $formdata->{name} ); >-- >1.7.2.5
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 12265
:
28281
|
28325
|
28326
|
28718
|
29670
|
29671
|
29672
| 29673