my $type_dispatch = {
M => sub {
- warn "OMG HERE\n";
-
# target metarecords
my $mrecs = $e->batch_retrieve_metabib_metarecord([
\@targets,
my $holdable_formats =
$self->compile_holdable_formats($mr->id);
- warn "holdable formats: $holdable_formats\n";
-
push(@hold_data, $data_filler->({
target => $mr,
record => $mr->master_record,
my $e = $self->editor;
my $cgi = $self->cgi;
- warn "MR looking at params param = $_\n" for $cgi->param;
-
# exit early if not needed
return "" unless
grep /metarecord_formats_|metarecord_langs_/,
$ctx->{metarecord_master} = $rec
if $metarecord_master and $metarecord_master eq $rec_id;
+
+ # MR's with multiple constituent records will have a
+ # null value in position 2 of the result set.
+ my ($res_rec) = grep { $_->[0] == $rec_id} @{$results->{ids}};
+ $rec->{mr_has_multi} = !$res_rec->[2];
}
if ($tag_circs) {
# index 1 in the per-record result array is a boolean which
# indicates whether the record in question is in the users
# accessible circ history list
- $rec->{user_circulated} = 1 if $res_rec->[1];
+ my $index = $is_meta ? 3 : 1;
+ $rec->{user_circulated} = 1 if $res_rec->[$index];
}
}
# note: rec.id refers to the record identifier, regardless
# of the type of record. i.e. rec.id = mmr_id ? mmr_id : bre_id
IF rec.mmr_id;
- # metarecords link to record list page
- record_url = mkurl(ctx.opac_root _ '/results',
- {metarecord => rec.mmr_id}, ['page']);
+ IF rec.mr_has_multi;
+ # metarecords link to record list page
+ record_url = mkurl(ctx.opac_root _ '/results',
+ {metarecord => rec.mmr_id}, ['page']);
+ ELSE;
+ # for MR, bre_id refers to the master and in
+ # this case, only, record
+ record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id);
+ END;
hold_type = 'M';
ELSE;
record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id);