Description
Marc Véron
2016-07-21 16:32:36 UTC
Lines from plack-error.log: Variable "$cache" is not available at (...)/admin/marctagstructure.pl line 360. Variable "$frameworkcode" is not available at /home/marc/koha/admin/marctagstructure.pl line 362. Variable "$cache" is not available at (...)/admin/marctagstructure.pl line 360. Variable "$frameworkcode" is not available at (...)a/admin/marctagstructure.pl line 362. Can't call method "clear_from_cache" on an undefined value at /home/marc/koha/admin/marctagstructure.pl line 360. Created attachment 53612 [details] [review] Bug 16955: Internal Server Error while populating new framework While populating a new framework, an internal server error occurs. (Error occurs with plack enabled) Steps to reproduce: - Go to Home > Administration > MARC frameworks - Add framework e.g. TEST, submit - In List of frameworks, go to framework TEST, Actions, MARC Structure - Create framework for... : Select DEFAULT Result: Internal Server Error (rest of screen blank) This patch fixes a variable scope issue and moves 4 lines that should be inside a loop. To test: - Apply patch - Verify that code changes make sense - Try to recreate error *** Bug 16987 has been marked as a duplicate of this bug. *** Created attachment 53815 [details] [review] Bug 16955: Internal Server Error while populating new framework While populating a new framework, an internal server error occurs. (Error occurs with plack enabled) Steps to reproduce: - Go to Home > Administration > MARC frameworks - Add framework e.g. TEST, submit - In List of frameworks, go to framework TEST, Actions, MARC Structure - Create framework for... : Select DEFAULT Result: Internal Server Error (rest of screen blank) This patch fixes a variable scope issue and moves 4 lines that should be inside a loop. To test: - Apply patch - Verify that code changes make sense - Try to recreate error Signed-off-by: Josef Moravec <josef.moravec@gmail.com> There was a wrong c/p here (you can blame me), the last 2 lines are using $frameworkcode instead of $newframeworkcode. Moreover the 4 clear_from_cache calls are inside the while loop, which means that we are clearing the cache 4 times per subfield (!). Finally these calls are actually not needed :) As we are creating a new framework, the cache should be empty... (In reply to Jonathan Druart from comment #6) > Moreover the 4 clear_from_cache calls are inside the while loop, which means > that we are clearing the cache 4 times per subfield (!). Ha, it is added by this patch. Hi Jonathan, Sorry, I have no time at the mmoment to fix this. Can you provide an alternative patch? Thanks Marc Created attachment 53874 [details] [review] Bug 16955: Do not clear from cache when adding a new framework There are several issues with these lines: 1/ $cache is not defined correctly and it not visible inside duplicate_framework 2/ $frameworkcode is a wrong c/p, it should be $newframeworkcode 3/ these calls are not needed. As we are creating a new framework, the cache should be empty... This patch will simply remove these calls Test plan: Duplicate a framework and confirm that you do not get any error in your logs. Created attachment 54086 [details] [review] Bug 16955: Do not clear from cache when adding a new framework There are several issues with these lines: 1/ $cache is not defined correctly and it not visible inside duplicate_framework 2/ $frameworkcode is a wrong c/p, it should be $newframeworkcode 3/ these calls are not needed. As we are creating a new framework, the cache should be empty... This patch will simply remove these calls Test plan: Duplicate a framework and confirm that you do not get any error in your logs. Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Created attachment 54387 [details] [review] Bug 16955: Do not clear from cache when adding a new framework There are several issues with these lines: 1/ $cache is not defined correctly and it not visible inside duplicate_framework 2/ $frameworkcode is a wrong c/p, it should be $newframeworkcode 3/ these calls are not needed. As we are creating a new framework, the cache should be empty... This patch will simply remove these calls Test plan: Duplicate a framework and confirm that you do not get any error in your logs. Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Pushed to master for 16.11, thanks Jonathan! Pushed in 16.05. Will be in 16.05.03. Pushed to 3.22.x, will be in 3.22.10 |