Bugzilla – Attachment 30602 Details for
Bug 12626
SQLHelper replacement - C4::Acquisition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12626: SQLHelper replacement - C4::Acquisition
SIGNED-OFF-Bug-12626-SQLHelper-replacement---C4Acq.patch (text/plain), 2.69 KB, created by
Bernardo Gonzalez Kriegel
on 2014-08-07 21:45:25 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12626: SQLHelper replacement - C4::Acquisition
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-08-07 21:45:25 UTC
Size:
2.69 KB
patch
obsolete
>From 1aae713105356840c0a7cfe8cb34efc3baaf7dc8 Mon Sep 17 00:00:00 2001 >From: Yohann Dufour <dufour.yohann@gmail.com> >Date: Tue, 22 Jul 2014 13:48:03 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 12626: SQLHelper replacement - > C4::Acquisition > >With this patch, the subroutine NewOrder uses DBIx::Class instead of C4::SQLHelper. > >Test plan: >1) Apply the patch > >2) Execute the unit tests by launching : >prove t/db_dependent/Acquisition.t > >3) The result has to be a success without error or warning : >t/db_dependent/Acquisition.t .. ok >All tests successful. >Files=1, Tests=79, 2 wallclock secs ( 0.04 usr 0.01 sys + 1.80 cusr 0.09 csys = 1.94 CPU) >Result: PASS > >4) Log in the koha intranet and create a new order in the acquition module > >5) The creation has to be a success > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >Test pass, new order created without problem, no koha-qa errors >--- > C4/Acquisition.pm | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 0cff235..5fc45c7 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -28,7 +28,6 @@ use C4::Suggestions; > use C4::Biblio; > use C4::Contract; > use C4::Debug; >-use C4::SQLHelper qw(InsertInTable UpdateInTable); > use C4::Bookseller qw(GetBookSellerFromId); > use C4::Templates qw(gettemplate); > >@@ -1273,18 +1272,19 @@ sub NewOrder { > croak "Mandatory parameter $key missing" unless $orderinfo->{$key}; > } > >- if ( defined $orderinfo->{subscription} && $orderinfo->{'subscription'} eq 'yes' ) { >- $orderinfo->{'subscription'} = 1; >- } else { >- $orderinfo->{'subscription'} = 0; >- } > $orderinfo->{'entrydate'} ||= C4::Dates->new()->output("iso"); > if (!$orderinfo->{quantityreceived}) { > $orderinfo->{quantityreceived} = 0; > } > >- my $ordernumber=InsertInTable("aqorders",$orderinfo); >- if (not $orderinfo->{parent_ordernumber}) { >+ # get only the columns of Aqorder >+ my $schema = Koha::Database->new()->schema; >+ my $columns = ' '.join(' ', $schema->source('Aqorder')->columns).' '; >+ my $new_order = { map { $columns =~ / $_ / ? ($_ => $orderinfo->{$_}) : () } keys(%$orderinfo) }; >+ >+ my $rs = $schema->resultset('Aqorder'); >+ my $ordernumber = $rs->create($new_order)->id; >+ if (not $new_order->{parent_ordernumber}) { > my $sth = $dbh->prepare(" > UPDATE aqorders > SET parent_ordernumber = ordernumber >@@ -1292,7 +1292,7 @@ sub NewOrder { > "); > $sth->execute($ordernumber); > } >- return ( $orderinfo->{'basketno'}, $ordernumber ); >+ return ( $new_order->{'basketno'}, $ordernumber ); > } > > >-- >1.7.9.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 12626
:
29953
|
30093
|
30188
|
30602
|
30893