Bugzilla – Attachment 181457 Details for
Bug 39711
Migrate C4::Contract to object classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39711: Update call to ModContract and improve error handling
Bug-39711-Update-call-to-ModContract-and-improve-e.patch (text/plain), 1.95 KB, created by
Matt Blenkinsop
on 2025-04-24 14:41:05 UTC
(
hide
)
Description:
Bug 39711: Update call to ModContract and improve error handling
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-04-24 14:41:05 UTC
Size:
1.95 KB
patch
obsolete
>From fc858796b5a8e0392807695ae353d1b3aa8d5dc7 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Thu, 24 Apr 2025 15:04:04 +0100 >Subject: [PATCH] Bug 39711: Update call to ModContract and improve error > handling > >--- > admin/aqcontract.pl | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl >index c2d830a7c05..5009a022cf3 100755 >--- a/admin/aqcontract.pl >+++ b/admin/aqcontract.pl >@@ -27,7 +27,6 @@ use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); > use C4::Contract qw( > DelContract >- ModContract > ); > use Koha::DateUtils qw( dt_from_string ); > >@@ -103,16 +102,22 @@ elsif ( $op eq 'cud-add_validate' ) { > } > > if ($is_a_modif) { >- ModContract( >+ my $contractnumber = $input->param('contractnumber'); >+ my $contract = Koha::Acquisition::Contracts->find($contractnumber); >+ if ( !$contract ) { >+ $template->param( blocking_error => "Contract $contractnumber not found" ); >+ output_html_with_http_headers $input, $cookie, $template->output; >+ } >+ >+ $contract->set( > { > contractstartdate => $contractstart_dt, > contractenddate => $contractend_dt, > contractname => scalar $input->param('contractname'), > contractdescription => scalar $input->param('contractdescription'), > booksellerid => scalar $input->param('booksellerid'), >- contractnumber => scalar $input->param('contractnumber'), > } >- ); >+ )->store; > } else { > my $contract = Koha::Acquisition::Contract->new( > { >@@ -124,7 +129,6 @@ elsif ( $op eq 'cud-add_validate' ) { > } > )->store; > } >- > print $input->redirect("/cgi-bin/koha/acquisition/vendors/$booksellerid"); > exit; > >-- >2.48.1
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 39711
:
181453
|
181454
|
181455
|
181456
| 181457 |
181458
|
181459
|
181460
|
181461
|
181580
|
181581
|
181582
|
181583
|
181584
|
181586
|
181587
|
181588