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

(-)a/Koha/Patron.pm (-4 / +3 lines)
Lines 394-401 sub delete { Link Here
394
            if ( C4::Context->preference('ListOwnershipUponPatronDeletion') eq 'transfer' ) {
394
            if ( C4::Context->preference('ListOwnershipUponPatronDeletion') eq 'transfer' ) {
395
                my $userenv = C4::Context->userenv();
395
                my $userenv = C4::Context->userenv();
396
                my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0;
396
                my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0;
397
                my @publiclists = Koha::Virtualshelves->get_public_shelves;
397
                my @publiclists = Koha::Virtualshelves->get_public_shelves->as_list;
398
                my @sharedlists = Koha::Virtualshelves->get_shared_shelves({ borrowernumber => $self->borrowernumber });
398
                my @sharedlists = Koha::Virtualshelves->get_shared_shelves({ borrowernumber => $self->borrowernumber })->as_list;
399
                foreach my $plist ( @publiclists ) {
399
                foreach my $plist ( @publiclists ) {
400
                    if ( $plist->owner == $self->borrowernumber ) {
400
                    if ( $plist->owner == $self->borrowernumber ) {
401
                        my $unique_name = $plist->shelfname . '_' . $self->borrowernumber;
401
                        my $unique_name = $plist->shelfname . '_' . $self->borrowernumber;
Lines 412-418 sub delete { Link Here
412
412
413
            # Delete any remaining lists that this user is an owner of (always private lists,
413
            # Delete any remaining lists that this user is an owner of (always private lists,
414
            # only public and shared lists if ListOwnershipUponPatronDeletion = delete)
414
            # only public and shared lists if ListOwnershipUponPatronDeletion = delete)
415
            $_->delete for Koha::Virtualshelves->search({ owner => $self->borrowernumber });
415
            $_->delete for Koha::Virtualshelves->search({ owner => $self->borrowernumber })->as_list;
416
416
417
            # We cannot have a FK on borrower_modifications.borrowernumber, the table is also used
417
            # We cannot have a FK on borrower_modifications.borrowernumber, the table is also used
418
            # for patron selfreg
418
            # for patron selfreg
419
- 

Return to bug 11889