Bug 16941: Can not add new patron in staff client
authorMarc Véron <veron@veron.ch>
Thu, 14 Jul 2016 13:50:22 +0000 (15:50 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 22 Jul 2016 17:07:23 +0000 (17:07 +0000)
To reproduce:
- Go to staff client Home > Patron
- New patron
- Choose a category and fill form, submit
Result: Form reloads, patron data are not saved.

To test:
- Apply patch
- Repeat steps above
- Verify that patron data are saved and the new patron's
  detail page displays
- Try to enter a duplicate patron (e.g. same surname, firstname
  and birthday as above)
- Verify that a duplicate message appears

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
members/memberentry.pl

index 4785691..0987168 100755 (executable)
@@ -228,9 +228,10 @@ if ( ( $op eq 'insert' ) and !$nodouble ) {
         $conditions->{firstname} = $newdata{firstname} if $newdata{firstname};
         $conditions->{dateofbirth} = $newdata{dateofbirth} if $newdata{dateofbirth};
     }
+    $nodouble = 1;
     my $patrons = Koha::Patrons->search($conditions);
     if ( $patrons->count > 0) {
-        $nodouble = 1;
+        $nodouble = 0;
         $check_member = $patrons->next->borrowernumber;
     }
 }