Bugzilla – Attachment 63401 Details for
Bug 18376
authority framework creation fails under Plack
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 18376 - authority framework creation fails under Plack
SIGNED-OFF-Bug-18376---authority-framework-creatio.patch (text/plain), 2.84 KB, created by
Katrin Fischer
on 2017-05-12 06:07:17 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 18376 - authority framework creation fails under Plack
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2017-05-12 06:07:17 UTC
Size:
2.84 KB
patch
obsolete
>From 1b245d43d1978dc9705a8357404c45dba7e447d4 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 4 Apr 2017 14:17:15 +0200 >Subject: [PATCH] [SIGNED OFF] Bug 18376 - authority framework creation fails > under Plack > >With plack, when creating a new authority framework from another, you get the error : >Can't call method "prepare" on an undefined value at (...)/src/admin/auth_tag_structure.pl line 267. > >Looks like plack does not like when the var $dbh from the script is called inside a sub. > >This patch adds a local var $dbh inside sub duplicate_auth_framework(), like in sub StringSearch(). > >Also correctes a redefine of my $sth. > >Test plan: >- Go to Administration > Authority types >- Create a new type >- On this new type click on Actions > MARC Structure >- Select another type and click OK >=> You must get a table filled with the tag structure >Check with and without plack >You may not be able to reproduce the error with plack. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > admin/auth_tag_structure.pl | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl >index fbe69de..0832d14 100755 >--- a/admin/auth_tag_structure.pl >+++ b/admin/auth_tag_structure.pl >@@ -160,10 +160,10 @@ if ($op eq 'add_form') { > # called by delete_confirm, used to effectively confirm deletion of data in DB > } elsif ($op eq 'delete_confirmed') { > unless (C4::Context->config('demo') eq 1) { >- my $sth = $dbh->prepare("delete from auth_tag_structure where tagfield=? and authtypecode=?"); >- $sth->execute($searchfield,$authtypecode); >- my $sth = $dbh->prepare("delete from auth_subfield_structure where tagfield=? and authtypecode=?"); >- $sth->execute($searchfield,$authtypecode); >+ my $sth_tag = $dbh->prepare("delete from auth_tag_structure where tagfield=? and authtypecode=?"); >+ $sth_tag->execute($searchfield,$authtypecode); >+ my $sth_sub = $dbh->prepare("delete from auth_subfield_structure where tagfield=? and authtypecode=?"); >+ $sth_sub->execute($searchfield,$authtypecode); > } > my $tagfield = $input->param('tagfield'); > print $input->redirect("/cgi-bin/koha/admin/auth_tag_structure.pl?searchfield=$tagfield&authtypecode=$authtypecode"); >@@ -248,6 +248,7 @@ sub StringSearch { > sub duplicate_auth_framework { > my ($newauthtype,$oldauthtype) = @_; > # warn "TO $newauthtype FROM $oldauthtype"; >+ my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from auth_tag_structure where authtypecode=?"); > $sth->execute($oldauthtype); > my $sth_insert = $dbh->prepare("insert into auth_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, authtypecode) values (?,?,?,?,?,?,?)"); >-- >2.7.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 18376
:
61817
|
63401
|
63544
|
63545