]> git.koha-community.org Git - koha.git/commit
Bug 26516: Don't accept incorrect values for copyrightdate/publicationyear
authorNick Clemens <nick@bywatersolutions.com>
Wed, 23 Sep 2020 14:42:40 +0000 (14:42 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 16 Nov 2020 13:25:21 +0000 (14:25 +0100)
commite1400890ec8040ced8e3550eddbfd0d4e8af2347
tree1b45856c3b2ec3e276cf4bbe7fd8f20eb106c3c8
parent55835ccfaffef48b924857e18bfd964aebda3a0a
Bug 26516: Don't accept incorrect values for copyrightdate/publicationyear

The previous patch rejects incorrect values when saving to the db specifically for copyrightdate
An error is thrown for the int conversion when it fails

Rather than catching things when saving we can fix the value when generated, simply returning null when parsing
the record

To test:
1 - Add a new record to Koha making sure data is valid except 260$c:
    198-
2 - Save the record
3 - It fails
4 - Apply this patch
5 - Restart all the thigns
6 - Repeat
7 - Success!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Biblio.pm
t/db_dependent/Biblio/TransformMarcToKoha.t