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 41-47 my $location = 'My Location'; Link Here
41
41
42
subtest 'General Add, Get and Del tests' => sub {
42
subtest 'General Add, Get and Del tests' => sub {
43
43
44
    plan tests => 10;
44
    plan tests => 14;
45
45
46
    # Start transaction
46
    # Start transaction
47
    $dbh->{AutoCommit} = 0;
47
    $dbh->{AutoCommit} = 0;
Lines 78-83 subtest 'General Add, Get and Del tests' => sub { Link Here
78
    is( $getitem->{location}, $location, "The location should not have been modified" );
78
    is( $getitem->{location}, $location, "The location should not have been modified" );
79
    is( $getitem->{permanent_location}, 'my permanent location', "The permanent_location should not have modified" );
79
    is( $getitem->{permanent_location}, 'my permanent location', "The permanent_location should not have modified" );
80
80
81
    ModItem({ location => $location }, $bibnum, $itemnumber);
82
    $getitem = GetItem($itemnumber);
83
    is( $getitem->{location}, $location, "The location should have been set to correct location" );
84
    is( $getitem->{permanent_location}, $location, "The permanent_location should have been set to location" );
85
86
    ModItem({ location => 'CART' }, $bibnum, $itemnumber);
87
    $getitem = GetItem($itemnumber);
88
    is( $getitem->{location}, 'CART', "The location should have been set to CART" );
89
    is( $getitem->{permanent_location}, $location, "The permanent_location should not have been set to CART" );
90
81
    $dbh->rollback;
91
    $dbh->rollback;
82
};
92
};
83
93
84
- 

Return to bug 14811