Already happened for volume/title hold, but target map checking wasn't
checking to see if the current copy was shelved.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
ahcm => {
field => 'hold',
fkey => 'id'
+ },
+ acp => {
+ field => 'id',
+ fkey => 'current_copy',
+ type => 'left' # there may be no current_copy
}
}
},
'+ahcm' => {
target_copy => $self->copy->id
},
+ '+acp' => {
+ '-or' => [
+ {id => undef}, # left-join copy may be nonexistent
+ {status => {'!=' => OILS_COPY_STATUS_ON_HOLDS_SHELF}},
+ ]
+ }
},
order_by => {ahr => {request_time => {direction => 'asc'}}},
limit => 1