View | Details | Raw Unified | Return to bug 21610
Collapse All | Expand All

(-)a/Koha/ItemType.pm (-12 lines)
Lines 37-54 Koha::ItemType - Koha Item type Object class Link Here
37
37
38
=cut
38
=cut
39
39
40
sub store {
41
    my ($self) = @_;
42
43
    $self->rentalcharge(undef)       if $self->rentalcharge eq '';
44
    $self->defaultreplacecost(undef) if $self->defaultreplacecost eq '';
45
    $self->processfee(undef)         if $self->processfee eq '';
46
    $self->notforloan(0) unless $self->notforloan;
47
    $self->hideinopac(0) unless $self->hideinopac;
48
49
    return $self->SUPER::store;
50
}
51
52
=head3 image_location
40
=head3 image_location
53
41
54
=cut
42
=cut
(-)a/Koha/Patron.pm (-32 lines)
Lines 192-220 sub store { Link Here
192
192
193
            $self->trim_whitespaces;
193
            $self->trim_whitespaces;
194
194
195
            # We don't want invalid dates in the db (mysql has a bad habit of inserting 0000-00-00)
196
            $self->dateofbirth(undef)  unless $self->dateofbirth;
197
            $self->debarred(undef)     unless $self->debarred;
198
            $self->date_renewed(undef) unless $self->date_renewed;
199
            $self->lastseen(undef)     unless $self->lastseen;
200
201
            if ( defined $self->updated_on and not $self->updated_on ) {
202
                $self->updated_on(undef);
203
            }
204
205
            # Set default values if not set
206
            $self->sms_provider_id(undef) unless $self->sms_provider_id;
207
            $self->guarantorid(undef)     unless $self->guarantorid;
208
209
            # If flags == 0 or flags == '' => no permission
210
            $self->flags(undef) unless $self->flags;
211
212
            # tinyint or int
213
            $self->gonenoaddress(0)  unless $self->gonenoaddress;
214
            $self->login_attempts(0) unless $self->login_attempts;
215
            $self->privacy_guarantor_checkouts(0) unless $self->privacy_guarantor_checkouts;
216
            $self->lost(0)           unless $self->lost;
217
218
            unless ( $self->in_storage ) {    #AddMember
195
            unless ( $self->in_storage ) {    #AddMember
219
196
220
                # Generate a valid userid/login if needed
197
                # Generate a valid userid/login if needed
Lines 240-248 sub store { Link Here
240
                  :                                                   undef;
217
                  :                                                   undef;
241
                $self->privacy($default_privacy);
218
                $self->privacy($default_privacy);
242
219
243
                unless ( defined $self->privacy_guarantor_checkouts ) {
244
                    $self->privacy_guarantor_checkouts(0);
245
                }
246
220
247
                # Make a copy of the plain text password for later use
221
                # Make a copy of the plain text password for later use
248
                $self->plain_text_password( $self->password );
222
                $self->plain_text_password( $self->password );
Lines 263-273 sub store { Link Here
263
            }
237
            }
264
            else {    #ModMember
238
            else {    #ModMember
265
239
266
                # Come from ModMember, but should not be possible (?)
267
                $self->dateenrolled(undef) unless $self->dateenrolled;
268
                $self->dateexpiry(undef)   unless $self->dateexpiry;
269
270
271
                my $self_from_storage = $self->get_from_storage;
240
                my $self_from_storage = $self->get_from_storage;
272
                # FIXME We should not deal with that here, callers have to do this job
241
                # FIXME We should not deal with that here, callers have to do this job
273
                # Moved from ModMember to prevent regressions
242
                # Moved from ModMember to prevent regressions
274
- 

Return to bug 21610