Bug 18376

Summary: authority framework creation fails under Plack
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: System AdministrationAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: gmcharlt, jonathan.druart, julian.maurice, katrin.fischer, kyle, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 18376 - authority framework creation fails under Plack
[SIGNED OFF] Bug 18376 - authority framework creation fails under Plack
Bug 18376 - authority framework creation fails under Plack
Bug 18376: Do not need to prepare a single statement, use do

Description Fridolin Somers 2017-04-04 07:22:30 UTC
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.
Comment 1 Fridolin Somers 2017-04-04 12:24:52 UTC
Created attachment 61817 [details] [review]
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.
Comment 2 Owen Leonard 2017-05-10 14:45:32 UTC
> You may not be able to reproduce the error with plack.

I could not in kohadevbox.
Comment 3 Katrin Fischer 2017-05-12 06:04:17 UTC
I can see the error, trying to sign off.
Comment 4 Katrin Fischer 2017-05-12 06:07:17 UTC
Created attachment 63401 [details] [review]
[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>
Comment 5 Fridolin Somers 2017-05-16 15:08:52 UTC
Thanks a lot Katrin
Comment 6 Jonathan Druart 2017-05-18 19:45:18 UTC
Created attachment 63544 [details] [review]
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>
Comment 7 Jonathan Druart 2017-05-18 19:45:23 UTC
Created attachment 63545 [details] [review]
Bug 18376: Do not need to prepare a single statement, use do

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2017-05-18 19:46:08 UTC
(In reply to Katrin Fischer from comment #3)
> I can see the error, trying to sign off.

Same, confirmed!
Comment 9 Jonathan Druart 2017-05-18 19:46:35 UTC
Upping the severity a bit as Plack is considered stable.
Comment 10 Kyle M Hall 2017-05-19 13:54:33 UTC
Pushed to master for 17.05, thanks Frido, Jonathan!
Comment 11 Katrin Fischer 2017-05-21 20:58:15 UTC
These patches have been pushed to 16.11.x and will be in 16.11.08.
Comment 12 Julian Maurice 2017-05-22 08:14:09 UTC
Pushed to 3.22.x for 3.22.21
Comment 13 Mason James 2017-05-24 03:10:48 UTC
Pushed to 16.05.x, for 16.05.13 release