Koha-clms/t/db_dependent/Koha
Jonathan Druart e4175ee89d 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>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 6cf157f993)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-01-15 09:02:36 +01:00
..
Item/Search Bug 11425: Add unit tests 2014-11-04 19:10:28 -03:00
Patron Bug 14836: (QA followup) Add missing transaction 2015-11-05 11:05:31 -03:00
Cities.t Bug 15081: (followup) Make test files using TestBuilder handle their transactions 2015-11-04 12:32:57 -03:00
GetDailyQuote.t
…
GetKohaAuthorisedValuesMapping.t Bug 14057: Inventory is painfully slow 2015-05-06 10:40:23 -03:00
IsKohaFieldLinked.t Bug 12874: A DB field without a default mapping is set to a default value on editing 2014-10-11 12:57:11 -03:00
Objects.t Bug 15473: Make Koha::Objects->find accepts 0 and '' as a key 2016-01-15 09:02:36 +01:00