Bugzilla – Attachment 58298 Details for
Bug 17692
Can't add library EAN under Plack
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17692 - Can't add library EAN under Plack
Bug-17692---Cant-add-library-EAN-under-Plack.patch (text/plain), 4.42 KB, created by
Jonathan Druart
on 2016-12-20 14:31:39 UTC
(
hide
)
Description:
Bug 17692 - Can't add library EAN under Plack
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-12-20 14:31:39 UTC
Size:
4.42 KB
patch
obsolete
>From f177fb7c13766b066ab0fd8576a8d77d5b79e92b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 15 Dec 2016 11:10:38 +0000 >Subject: [PATCH] Bug 17692 - Can't add library EAN under Plack >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >When adding a library ean under plack, there is an "internal server >error" when running Plack. Tested with Koha 16.11 release. > >Test Plan: >1) Apply this patch >2) Enable Plack >3) Add, Edit and Delete a Library EAN > >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > admin/edi_ean_accounts.pl | 85 +++++++++++++++++++---------------------------- > 1 file changed, 34 insertions(+), 51 deletions(-) > >diff --git a/admin/edi_ean_accounts.pl b/admin/edi_ean_accounts.pl >index f65ab9e..0450e2e 100755 >--- a/admin/edi_ean_accounts.pl >+++ b/admin/edi_ean_accounts.pl >@@ -37,12 +37,12 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > ); > > my $schema = Koha::Database->new()->schema(); >-my $op = $input->param('op'); >-$op ||= 'display'; >+ >+my $id = scalar $input->param('id'); >+my $op = scalar $input->param('op') || 'display'; > > if ( $op eq 'ean_form' ) { >- show_ean(); >- $template->param( ean_form => 1 ); >+ my $e = $schema->resultset('EdifactEan')->find($id); > my @branches = $schema->resultset('Branch')->search( > undef, > { >@@ -50,24 +50,47 @@ if ( $op eq 'ean_form' ) { > order_by => 'branchname', > } > ); >- $template->param( branches => \@branches ); >+ $template->param( >+ ean_form => 1, >+ branches => \@branches, >+ ean => $e, >+ ); > } > elsif ( $op eq 'delete_confirm' ) { >- show_ean(); >- $template->param( delete_confirm => 1 ); >+ my $e = $schema->resultset('EdifactEan')->find($id); >+ $template->param( >+ delete_confirm => 1, >+ ean => $e, >+ ); > } > else { > if ( $op eq 'save' ) { >- my $change = $input->param('id'); >+ my $change = $id; > if ($change) { >- editsubmit(); >+ $schema->resultset('EdifactEan')->find($id)->update( >+ { >+ branchcode => $input->param('branchcode'), >+ description => $input->param('description'), >+ ean => $input->param('ean'), >+ id_code_qualifier => $input->param('id_code_qualifier'), >+ } >+ ); > } > else { >- addsubmit(); >+ my $new_ean = $schema->resultset('EdifactEan')->new( >+ { >+ branchcode => $input->param('branchcode'), >+ description => $input->param('description'), >+ ean => $input->param('ean'), >+ id_code_qualifier => $input->param('id_code_qualifier'), >+ } >+ ); >+ $new_ean->insert(); > } > } > elsif ( $op eq 'delete_confirmed' ) { >- delsubmit(); >+ my $e = $schema->resultset('EdifactEan')->find($id); >+ $e->delete if $e; > } > my @eans = $schema->resultset('EdifactEan')->search( > {}, >@@ -101,43 +124,3 @@ $template->param( > ); > > output_html_with_http_headers( $input, $cookie, $template->output ); >- >-sub delsubmit { >- my $id = $input->param('id'); >- my $e = $schema->resultset('EdifactEan')->find( $id ); >- $e->delete if $e; >- return; >-} >- >-sub addsubmit { >- >- my $new_ean = $schema->resultset('EdifactEan')->new( >- { >- branchcode => $input->param('branchcode'), >- description => $input->param('description'), >- ean => $input->param('ean'), >- id_code_qualifier => $input->param('id_code_qualifier'), >- } >- ); >- $new_ean->insert(); >- return; >-} >- >-sub editsubmit { >- $schema->resultset('EdifactEan')->find( $input->param('id') )->update( >- { >- branchcode => $input->param('branchcode'), >- description => $input->param('description'), >- ean => $input->param('ean'), >- id_code_qualifier => $input->param('id_code_qualifier'), >- } >- ); >- return; >-} >- >-sub show_ean { >- my $id = $input->param('id'); >- my $e = $schema->resultset('EdifactEan')->find( $id ); >- $template->param( ean => $e ); >- return; >-} >-- >2.9.3
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 17692
:
58200
|
58236
| 58298 |
58299