[Bug 16996] New: Template process failed: undef error - Can't call method "description"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Bug ID: 16996 Summary: Template process failed: undef error - Can't call method "description" Change sponsored?: --- Product: Koha Version: 16.05 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: miguel.tuimil@xercode.es QA Contact: testopia@bugs.koha-community.org This problem occurs in special conditions with some preferences settings related to the Patron CategoryCode and edit the personal details in the OPAC: 1. Make sure that the categorycode is not hidden in the OPAC in: PatronSelfRegistrationBorrowerUnwantedField or PatronSelfModificationBorrowerUnwantedField 2. Add a required field in PatronSelfRegistrationBorrowerMandatoryField, for example email. 3. Go to Your Personal Details in the OPAC (opac-memberentry.pl) and leave blank the required field of point 2 4. Press "Submit update request" It should display: Software error: Template process failed: undef Error - Can not call method "description" on an undefined value at /usr/share/koha/lib/Koha/Template/Plugin/Categories.pm line 29. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 53959 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53959&action=edit Bug 16996: Do not explode if mandatory fields are missing At the OPAC, if a patron modify his/her information and at least 1 mandatory field is missing, Koha will crash with Template process failed: undef error - Can't call method "description" It is raised by Koha::Template::Plugin::Categories::GetName called with an undefined categorycode. The problem is that the values sent originaly are not sent back to the template if the user missed something. This patch makes that all info are resent to the template in order to show the same form to the user. Test plan: 1. Make sure that the categorycode is not hidden in the OPAC in: PatronSelfRegistrationBorrowerUnwantedField or PatronSelfModificationBorrowerUnwantedField 2. Add a required field in PatronSelfRegistrationBorrowerMandatoryField, for example email. 3. Go to Your Personal Details in the OPAC (opac-memberentry.pl) and leave blank the required field of point 2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|16.05 |master CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|oleonard@myacpl.org |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53959|0 |1 is obsolete| | --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 54011 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54011&action=edit Bug 16996: Do not explode if mandatory fields are missing At the OPAC, if a patron modify his/her information and at least 1 mandatory field is missing, Koha will crash with Template process failed: undef error - Can't call method "description" It is raised by Koha::Template::Plugin::Categories::GetName called with an undefined categorycode. The problem is that the values sent originaly are not sent back to the template if the user missed something. This patch makes that all info are resent to the template in order to show the same form to the user. Test plan: 0. Apply patch 1. Make sure that the categorycode is not hidden in the OPAC in: PatronSelfRegistrationBorrowerUnwantedField or PatronSelfModificationBorrowerUnwantedField 2. Add a required field in PatronSelfRegistrationBorrowerMandatoryField, for example email. 3. Go to Your Personal Details in the OPAC (opac-memberentry.pl) and leave blank the required field of point 2 4. Press "Submit update request" There should be no software error. NOTE: The warns will be floody on the logs. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Works ok, but I assume the warns should not be there? + use Data::Dumper;warn Dumper $borrower; + %borrower = ( %$borrower, %borrower ); + use Data::Dumper;warn Dumper \%borrower; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54011|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 54148 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54148&action=edit Bug 16996: Do not explode if mandatory fields are missing At the OPAC, if a patron modify his/her information and at least 1 mandatory field is missing, Koha will crash with Template process failed: undef error - Can't call method "description" It is raised by Koha::Template::Plugin::Categories::GetName called with an undefined categorycode. The problem is that the values sent originaly are not sent back to the template if the user missed something. This patch makes that all info are resent to the template in order to show the same form to the user. Test plan: 0. Apply patch 1. Make sure that the categorycode is not hidden in the OPAC in: PatronSelfRegistrationBorrowerUnwantedField or PatronSelfModificationBorrowerUnwantedField 2. Add a required field in PatronSelfRegistrationBorrowerMandatoryField, for example email. 3. Go to Your Personal Details in the OPAC (opac-memberentry.pl) and leave blank the required field of point 2 4. Press "Submit update request" There should be no software error. NOTE: The warns will be floody on the logs. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #5 from Marc Véron <veron@veron.ch> --- With patch, it works OK when updating an existing record. However if I want to create a new patron using self registration, I still get "Internal Server Error" What I did: - Mandatory fields: Surname, First name - Category is visible - If not yet done, log out from OPAC - Follow Link "Register here" - Fill in First name only - Fill in Verification - Submit - Getting Message "You have not filled..." - Do not change anything, submit -> "Internal Server Error" plack-error.log says: Template process failed: undef Error - Can not call method "description" on an undefined value at /usr/share/koha/lib/Koha/Template/Plugin/Categories.pm line 29. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 54167 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54167&action=edit Bug 16996: (follow-up) Do not explode if mandatory fields are missing When registering a new patron, if something went wrong, the form is resent to the template but without the categorycode (not a dropdown list anymore, but just displayed as a readonly value # TODO LATER). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54148|0 |1 is obsolete| | --- Comment #7 from Marc Véron <veron@veron.ch> --- Created attachment 54175 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54175&action=edit Bug 16996: Do not explode if mandatory fields are missing At the OPAC, if a patron modify his/her information and at least 1 mandatory field is missing, Koha will crash with Template process failed: undef error - Can't call method "description" It is raised by Koha::Template::Plugin::Categories::GetName called with an undefined categorycode. The problem is that the values sent originaly are not sent back to the template if the user missed something. This patch makes that all info are resent to the template in order to show the same form to the user. Test plan: 0. Apply patch 1. Make sure that the categorycode is not hidden in the OPAC in: PatronSelfRegistrationBorrowerUnwantedField or PatronSelfModificationBorrowerUnwantedField 2. Add a required field in PatronSelfRegistrationBorrowerMandatoryField, for example email. 3. Go to Your Personal Details in the OPAC (opac-memberentry.pl) and leave blank the required field of point 2 4. Press "Submit update request" There should be no software error. NOTE: The warns will be floody on the logs. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marc <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54167|0 |1 is obsolete| | --- Comment #8 from Marc Véron <veron@veron.ch> --- Created attachment 54176 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54176&action=edit Bug 16996: (follow-up) Do not explode if mandatory fields are missing When registering a new patron, if something went wrong, the form is resent to the template but without the categorycode (not a dropdown list anymore, but just displayed as a readonly value # TODO LATER). Signed-off-by: Marc <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54175|0 |1 is obsolete| | --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 54396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54396&action=edit Bug 16996: Do not explode if mandatory fields are missing At the OPAC, if a patron modify his/her information and at least 1 mandatory field is missing, Koha will crash with Template process failed: undef error - Can't call method "description" It is raised by Koha::Template::Plugin::Categories::GetName called with an undefined categorycode. The problem is that the values sent originaly are not sent back to the template if the user missed something. This patch makes that all info are resent to the template in order to show the same form to the user. Test plan: 0. Apply patch 1. Make sure that the categorycode is not hidden in the OPAC in: PatronSelfRegistrationBorrowerUnwantedField or PatronSelfModificationBorrowerUnwantedField 2. Add a required field in PatronSelfRegistrationBorrowerMandatoryField, for example email. 3. Go to Your Personal Details in the OPAC (opac-memberentry.pl) and leave blank the required field of point 2 4. Press "Submit update request" There should be no software error. NOTE: The warns will be floody on the logs. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54176|0 |1 is obsolete| | --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 54397 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54397&action=edit Bug 16996: (follow-up) Do not explode if mandatory fields are missing When registering a new patron, if something went wrong, the form is resent to the template but without the categorycode (not a dropdown list anymore, but just displayed as a readonly value # TODO LATER). Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 16.11, thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |frederic@tamil.fr --- Comment #12 from Frédéric Demians <frederic@tamil.fr> --- Pushed in 16.05. Will be in 16.05.03. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #13 from Julian Maurice <julian.maurice@biblibre.com> --- Pushed to 3.22.x, will be in 3.22.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 --- Comment #14 from Frédéric Demians <frederic@tamil.fr> --- See this: https://lists.katipo.co.nz/pipermail/koha/2016-August/046113.html The bug described here exists in 16.05, but its solution depends on a CSRF related patch which hasn't yet been ported on 16.05 due to dependencies (this has to be discussed). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 --- Comment #15 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 54947 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54947&action=edit [16.05] Bug 16996 Fix a bug introduced in 16.05 Signed-off-by: Frédéric Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Mirko Tietgen <mirko@abunchofthings.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mirko@abunchofthings.net --- Comment #16 from Mirko Tietgen <mirko@abunchofthings.net> --- (In reply to Frédéric Demians from comment #14)
The bug described here exists in 16.05, but its solution depends on a CSRF related patch which hasn't yet been ported on 16.05 due to dependencies (this has to be discussed).
Something beyond these? https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16591#c18 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17235 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Claudio <costalc@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |costalc@gmail.com --- Comment #17 from Claudio <costalc@gmail.com> --- *** Bug 17235 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16996 Felix Hemme <felix.hemme@thulb.uni-jena.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |felix.hemme@thulb.uni-jena. | |de -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org