Bug 41649: Set magnetic_media in SIP responses
The `magnetic_media` flag was never set, it can be set from `sip_media_type` if it's present. `sip_media_type` is set via the Authorized Values system. Checkins will not be sorted correctly by Biblioteca without this flag. Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Marcus Michel <marcus.michel@rbkc.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
03dd4cf862
commit
303deda8d3
|
|
@ -106,7 +106,12 @@ sub new {
|
|||
my $it = $item->effective_itemtype;
|
||||
$self->{itemtype} = $it;
|
||||
my $itemtype = Koha::Database->new()->schema()->resultset('Itemtype')->find($it);
|
||||
$self->{sip_media_type} = $itemtype->sip_media_type() if $itemtype;
|
||||
if ($itemtype) {
|
||||
$self->{sip_media_type} = $itemtype->sip_media_type;
|
||||
if ( defined( $self->{sip_media_type} ) && $self->{sip_media_type} =~ m/^(00[4578]|010)/ ) {
|
||||
$self->{magnetic_media} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# check if its on issue and if so get the borrower
|
||||
my $issue = Koha::Checkouts->find( { itemnumber => $item->itemnumber } );
|
||||
|
|
|
|||
|
|
@ -756,7 +756,7 @@ sub handle_checkin {
|
|||
$resp .= 'U';
|
||||
}
|
||||
|
||||
$resp .= $status->alert ? 'Y' : 'N';
|
||||
$resp .= ( $status->alert || $item->magnetic_media ) ? 'Y' : 'N';
|
||||
$resp .= timestamp;
|
||||
$resp .= add_field( FID_INST_ID, $inst_id, $server );
|
||||
$resp .= add_field( FID_ITEM_ID, $item_id, $server );
|
||||
|
|
|
|||
Loading…
Reference in New Issue