[koha-commits] main Koha release repository branch master updated. v19.11.00-1559-g3533aacef8

Git repo owner gitmaster at git.koha-community.org
Tue Mar 31 16:44:22 CEST 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".

The branch, master has been updated
       via  3533aacef8772d43a471b558c4ae581b63a90ee7 (commit)
      from  9c383aa286fee5a29c6f084873f2eb6644bad64f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3533aacef8772d43a471b558c4ae581b63a90ee7
Author: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Date:   Tue Mar 31 15:58:21 2020 +0200

    Bug 22001: Set unsafe only if RaiseError is not set
    
    Sooooo....
    
    That was tricky, and the solution looks trivial.
    However it's not.
    We have unsafe set for "historical reason".
    Having it on when RaiseError is on have the effect of overwritting the
    DBIC error handler.
    
    The problem is:
    t/db_dependent/Circulation/MarkIssueReturned.t (and other tests) is failing with:
    
      # expecting: Koha::Exceptions::Object::BadValue
      # found: DBIx::Class::Exception ({UNKNOWN}: Can't locate object method "rethrow" via package "DBD::mysql::st execute failed: Incorrect datetime value: 'bad_date' for column 'returndate' at row 1 [for Statement "UPDATE `issues` SET `returndate` = ? WHERE ( `issue_id` = ? )" with ParamValues: 0='bad_date', 1=238] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line
    
    In Koha::Object->store, the exception is not a DBIx::Class::Exception object (as we except), but
    a string (on which we cannot call rethrow).
    
    Swithing unsafe off restores the expected behavior.
    To make sure the UI will not be affected, it is only turned off when
    RaiseError is set.
    
    The situation is still wrong (for UI), from the POD https://metacpan.org/pod/DBIx::Class::Storage::DBI (/unsafe)
    """
    Note that your custom settings can cause Storage to malfunction, especially if you set a HandleError handler that suppresses exceptions and/or disable RaiseError.
    """
    
    And also https://metacpan.org/release/DBIx-Class/source/lib/DBIx/Class/Storage/DBI.pm#L1531
    
    Many thanks Tomas for the digging exploration!
    
    We need to turn RaiseError and remove the unsafe flag, for UI as well,
    but that should be done at the beginning of a dev cycle.
    
    Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-----------------------------------------------------------------------

Summary of changes:
 Koha/Database.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
main Koha release repository


More information about the koha-commits mailing list