Libriotech / koha-illbackend-libris

Koha ILL Backend for Libris ILL (used in Sweden)
3 stars 9 forks source link

Make patron identifier configurable #88

Closed MagnusEnger closed 4 years ago

MagnusEnger commented 4 years ago

This code in cron/get_data_from_libris.pl looks up the patron:

        # The loan is requested by one of our own patrons, so we look up the borrowernumber from the cardnumber
        if ( $req->{'user_id'} ) {
            my $userid = $req->{'user_id'};
            $userid =~ s/ //g;
            say "Looking for user_id=$userid";
            $borrower = Koha::Illbackends::Libris::Base::userid2borrower( $userid );
        } else {
            $borrower = Koha::Patrons->find({ 'borrowernumber' => $ill_config->{ 'unknown_patron' } });
        }

We could introduce a config variable to let libraries choose if they want to to use cardnumber, userid or borrowernumber.

MagnusEnger commented 4 years ago

Fixed by https://github.com/Libriotech/koha-illbackend-libris/commit/3073948285a8a669975460af59c0989a07102a94