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

(-)a/C4/Items.pm (-1 / +5 lines)
Lines 2048-2054 sub _do_column_fixes_for_mod { Link Here
2048
        (not defined $item->{'withdrawn'} or $item->{'withdrawn'} eq '')) {
2048
        (not defined $item->{'withdrawn'} or $item->{'withdrawn'} eq '')) {
2049
        $item->{'withdrawn'} = 0;
2049
        $item->{'withdrawn'} = 0;
2050
    }
2050
    }
2051
    if (exists $item->{'location'} && !$item->{'permanent_location'}) {
2051
    if (exists $item->{location}
2052
        and $item->{location} ne 'CART'
2053
        and $item->{location} ne 'PROC'
2054
        and not $item->{permanent_location}
2055
    ) {
2052
        $item->{'permanent_location'} = $item->{'location'};
2056
        $item->{'permanent_location'} = $item->{'location'};
2053
    }
2057
    }
2054
    if (exists $item->{'timestamp'}) {
2058
    if (exists $item->{'timestamp'}) {
(-)a/t/db_dependent/Items.t (-2 / +11 lines)
Lines 38-44 my $location = 'My Location'; Link Here
38
38
39
subtest 'General Add, Get and Del tests' => sub {
39
subtest 'General Add, Get and Del tests' => sub {
40
40
41
    plan tests => 10;
41
    plan tests => 14;
42
42
43
    # Start transaction
43
    # Start transaction
44
    $dbh->{AutoCommit} = 0;
44
    $dbh->{AutoCommit} = 0;
Lines 75-80 subtest 'General Add, Get and Del tests' => sub { Link Here
75
    is( $getitem->{location}, $location, "The location should not have been modified" );
75
    is( $getitem->{location}, $location, "The location should not have been modified" );
76
    is( $getitem->{permanent_location}, 'my permanent location', "The permanent_location should not have modified" );
76
    is( $getitem->{permanent_location}, 'my permanent location', "The permanent_location should not have modified" );
77
77
78
    ModItem({ location => $location }, $bibnum, $itemnumber);
79
    $getitem = GetItem($itemnumber);
80
    is( $getitem->{location}, $location, "The location should have been set to correct location" );
81
    is( $getitem->{permanent_location}, $location, "The permanent_location should have been set to location" );
82
83
    ModItem({ location => 'CART' }, $bibnum, $itemnumber);
84
    $getitem = GetItem($itemnumber);
85
    is( $getitem->{location}, 'CART', "The location should have been set to CART" );
86
    is( $getitem->{permanent_location}, $location, "The permanent_location should not have been set to CART" );
87
78
    $dbh->rollback;
88
    $dbh->rollback;
79
};
89
};
80
90
81
- 

Return to bug 14811