Bug 18376 - authority framework creation fails under Plack
authorFridolin Somers <fridolin.somers@biblibre.com>
Tue, 4 Apr 2017 12:17:15 +0000 (14:17 +0200)
committerJulian Maurice <julian.maurice@biblibre.com>
Mon, 22 May 2017 08:12:22 +0000 (10:12 +0200)
commitc2029975a29933ad8b914262b1b24fc5672c398b
tree0d950cb7abc1577e109e2f4cd4aedd08b9782073
parent4843687625e0d0e68a583966715ced137d11b228
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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6a82ff4b8907f17fb17af3201ab6e96320a995bf)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 3d37ed539f76005fe55f71f35def5c86d56db859)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
admin/auth_tag_structure.pl