Bug 21596: Handle empty string for flags when storing a patron
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 17 Oct 2018 22:53:47 +0000 (19:53 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 18 Oct 2018 14:17:40 +0000 (14:17 +0000)
Incorrect integer value: '' for column 'flags'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha/Patron.pm

index 4c9f955..523f745 100644 (file)
@@ -201,6 +201,9 @@ sub store {
             $self->sms_provider_id(undef) unless $self->sms_provider_id;
             $self->guarantorid(undef)     unless $self->guarantorid;
 
+            # If flags == 0 or flags == '' => no permission
+            $self->flags(undef) unless $self->flags;
+
             unless ( $self->in_storage ) {    #AddMember
 
                 # Generate a valid userid/login if needed