Summary: | Koha::Objects->find should find if the key is an empty string | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | brendan, f.demians, julian.maurice |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15270 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14539 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | 15381 | ||
Bug Blocks: | |||
Attachments: |
Bug 15473: Make Koha::Objects->find accepts 0 and '' as a key
[SIGNED-OFF] Bug 15473: Make Koha::Objects->find accepts 0 and '' as a key Bug 15473: Make Koha::Objects->find accepts 0 and '' as a key |
Description
Jonathan Druart
2016-01-05 15:15:15 UTC
Created attachment 46266 [details] [review] Bug 15473: Make Koha::Objects->find accepts 0 and '' as a key This bug has been found after bug 15381 was pushed: If you go on authorities/authorities.pl, you expect a form to create a authorities with a "Default" authority type. Now, it explodes: Can't call method "authtypetext" on an undefined value at /home/koha/src/authorities/authorities.pl line 665. Koha::Objects->find does not want to search if the key does not exist (undef, '', 0). But actually it should only be a coward if it is not defined. Moreover this is the default behavior of the DBIx::Class find method. Test plan: prove t/db_dependent/Koha/Objects.t should return green and GET /cgi-bin/koha/authorities/authorities.pl should not make everything explode. *** Bug 15470 has been marked as a duplicate of this bug. *** Created attachment 46269 [details] [review] [SIGNED-OFF] Bug 15473: Make Koha::Objects->find accepts 0 and '' as a key This bug has been found after bug 15381 was pushed: If you go on authorities/authorities.pl, you expect a form to create a authorities with a "Default" authority type. Now, it explodes: Can't call method "authtypetext" on an undefined value at /home/koha/src/authorities/authorities.pl line 665. Koha::Objects->find does not want to search if the key does not exist (undef, '', 0). But actually it should only be a coward if it is not defined. Moreover this is the default behavior of the DBIx::Class find method. Test plan: prove t/db_dependent/Koha/Objects.t should return green and GET /cgi-bin/koha/authorities/authorities.pl should not make everything explode. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Find this after signing 15470 :) Test pass, new auth (Default) created, no errors. Created attachment 46423 [details] [review] Bug 15473: Make Koha::Objects->find accepts 0 and '' as a key This bug has been found after bug 15381 was pushed: If you go on authorities/authorities.pl, you expect a form to create a authorities with a "Default" authority type. Now, it explodes: Can't call method "authtypetext" on an undefined value at /home/koha/src/authorities/authorities.pl line 665. Koha::Objects->find does not want to search if the key does not exist (undef, '', 0). But actually it should only be a coward if it is not defined. Moreover this is the default behavior of the DBIx::Class find method. Test plan: prove t/db_dependent/Koha/Objects.t should return green and GET /cgi-bin/koha/authorities/authorities.pl should not make everything explode. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Find this after signing 15470 :) Test pass, new auth (Default) created, no errors. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to Master - thanks Patch pushed to 3.22.x, will be in 3.22.2 |