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 (-29 lines)
Lines 192-217 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
            $self->updated_on(undef)   unless $self->updated_on;
201
202
            # Set default values if not set
203
            $self->sms_provider_id(undef) unless $self->sms_provider_id;
204
            $self->guarantorid(undef)     unless $self->guarantorid;
205
206
            # If flags == 0 or flags == '' => no permission
207
            $self->flags(undef) unless $self->flags;
208
209
            # tinyint or int
210
            $self->gonenoaddress(0)  unless $self->gonenoaddress;
211
            $self->login_attempts(0) unless $self->login_attempts;
212
            $self->privacy_guarantor_checkouts(0) unless $self->privacy_guarantor_checkouts;
213
            $self->lost(0)           unless $self->lost;
214
215
            unless ( $self->in_storage ) {    #AddMember
195
            unless ( $self->in_storage ) {    #AddMember
216
196
217
                # Generate a valid userid/login if needed
197
                # Generate a valid userid/login if needed
Lines 237-245 sub store { Link Here
237
                  :                                                   undef;
217
                  :                                                   undef;
238
                $self->privacy($default_privacy);
218
                $self->privacy($default_privacy);
239
219
240
                unless ( defined $self->privacy_guarantor_checkouts ) {
241
                    $self->privacy_guarantor_checkouts(0);
242
                }
243
220
244
                # Make a copy of the plain text password for later use
221
                # Make a copy of the plain text password for later use
245
                $self->plain_text_password( $self->password );
222
                $self->plain_text_password( $self->password );
Lines 260-270 sub store { Link Here
260
            }
237
            }
261
            else {    #ModMember
238
            else {    #ModMember
262
239
263
                # Come from ModMember, but should not be possible (?)
264
                $self->dateenrolled(undef) unless $self->dateenrolled;
265
                $self->dateexpiry(undef)   unless $self->dateexpiry;
266
267
268
                my $self_from_storage = $self->get_from_storage;
240
                my $self_from_storage = $self->get_from_storage;
269
                # 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
270
                # Moved from ModMember to prevent regressions
242
                # Moved from ModMember to prevent regressions
271
- 

Return to bug 21610