[Koha-bugs] [Bug 15473] Koha::Objects->find should find if the key is an empty string

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 5 16:37:04 CET 2016


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15473

Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #46266|0                           |1
        is obsolete|                            |

--- Comment #3 from Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> ---
Created attachment 46269
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46269&action=edit
[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 at gmail.com>
Find this after signing 15470 :)
Test pass, new auth (Default) created, no errors.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list