The following code in C4/SIP/ILS/Patron.pm: $kp = Koha::Patrons->find( { cardnumber => $patron_id } ) or Koha::Patrons->find( { userid => $patron_id } ); should be (using || instead of or): $kp = Koha::Patrons->find( { cardnumber => $patron_id } ) || Koha::Patrons->find( { userid => $patron_id } ); It will never try to match a patron by userid. This is a bug according to Perl documentation here: https://perldoc.perl.org/perlop.html#Logical-or-and-Exclusive-Or
Created attachment 72502 [details] [review] Replaces "or" with "||" in variable assignment
Created attachment 72539 [details] [review] Patch with signoff Signed off - added CR to commit message to avoid auto wrapping added a line to clarify what was being fixed
Confirmed that lookup by userid was not being executed and that reverting the or to || does correct that and restores the code to a working lookup. People should beware of prettifying the code by replacing operators with operators that are not equivalent. Specially as in this case when the buggy change is hidden in a large commit which is not explicit about making the change
Created attachment 72556 [details] [review] Bug 20348: SIP2 patron identification fails to use userid Replaces "or" with "||" in variable assignment second attempt to retrieve borrower was not being executed due to changed precedence Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Caused by commit 2b90ea2cb0e5e976de7ddef0151ae83d8ac578e6 Bug 17829: Move GetMember to Koha::Patron
Patch pushed to master for 18.05 Thanks Jose for your first patch in!
Hooray for Jose! This also needs to go into the stable branch, please.
*** Bug 10372 has been marked as a duplicate of this bug. ***
Awesome work all! Pushed to stable for 17.11.04
Not in 17.05.x since Bug 17829 not in it