Bug 22717: (bug 20287 follow-up) Fix Google OpenId auto registration
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sat, 27 Apr 2019 00:49:14 +0000 (20:49 -0400)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 8 May 2019 14:09:10 +0000 (15:09 +0100)
Silly bug caused by:
  commit ef410fd62f279a10687636a4f26babb2c91ecadc
  Bug 20287: Replace occurrences of AddMember with Koha::Patron->new->store->borrowernumber

Constructors take a hashref!

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 59b740613e7a72bf6e5283c2876bad9444a7ef6a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

opac/svc/auth/googleopenidconnect

index 2cb4c9e..14568a0 100755 (executable)
@@ -196,7 +196,7 @@ elsif ( defined $query->param('code') ) {
                     if (defined $patron_category && defined $library) {
                         my $password = undef;
                         # TODO errors handling!
-                        my $borrower = Koha::Patron->new(
+                        my $borrower = Koha::Patron->new({
                             firstname    => $firstname,
                             surname      => $surname,
                             email        => $email,
@@ -204,7 +204,7 @@ elsif ( defined $query->param('code') ) {
                             branchcode   => $branchcode,
                             userid       => $userid,
                             password     => $password
-                        )->store;
+                        })->store;
                     } else {
                         $error_feedback = 'The GoogleOpenIDConnectDefaultBranch or GoogleOpenIDConnectDefaultCategory system preferences are not configured properly. Please contact the library with this error message.';
                     }