[Koha-bugs] [Bug 17502] Add type check to output_pref and use exceptions

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 19 20:34:58 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17502

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #62168|0                           |1
        is obsolete|                            |
  Attachment #62169|0                           |1
        is obsolete|                            |

--- Comment #30 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 62408
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62408&action=edit
Bug 17502: Add type check to output_pref

This patch makes the following changes:
[1] In Koha/DateUtils.pm, sub output_pref:
    Add a test if $dt is really a DateTime before calling method ymd.
    Preventing a crash like:
    Can't locate object method "ymd" via package "dateonly".
    See also BZ 17502/15822.
[2] Adds a few unit tests in t/DateUtils.t.

Test plan:
[1] Run the adjusted unit test t/DateUtils.t

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec at gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

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


More information about the Koha-bugs mailing list