}
sub map_authority_headings_to_results {
- my ($self, $linked, $results, $auth_ids, $authority_field_name) = @_;
+ my ($self, $linked, $results, $auth_ids, $authority_field_name, @params) = @_;
# Use the linked authority records' control sets to find and pick
# out non-main-entry headings. Build the headings and make a
];
}
+ my $abl_join = {};
+ if (my $mattype = $params[7]) { # KCLS JBAS-1929
+ $abl_join = {
+ mraf => {
+ field => 'id',
+ fkey => 'bib',
+ filter => {
+ attr => 'mattype',
+ value => $mattype
+ }
+ }
+ };
+ }
+
# Get linked-bib counts for each of those authorities, and put THAT
# information into place in the data structure.
my $counts = $self->editor->json_query({
"authority"
]
},
- from => {abl => {}},
+ from => {abl => $abl_join},
where => {
"+abl" => {
authority => [
# case $self->editor->event should always point to the reason for failure).
# $results must be an arrayref of result rows from the DB's metabib.browse()
sub flesh_browse_results {
- my ($self, $results) = @_;
+ my ($self, $results, @params) = @_;
for my $authority_field_name ( qw/authorities sees/ ) {
for my $r (@$results) {
where => {"+are" => {id => \@auth_ids}}
}) or return;
- $self->map_authority_headings_to_results($linked, $results, \@auth_ids, $authority_field_name);
+ $self->map_authority_headings_to_results(
+ $linked, $results, \@auth_ids, $authority_field_name, @params);
}
}
$self->ctx->{browse_error} = 1;
return;
- } elsif (not $self->flesh_browse_results($results)) {
+ } elsif (not $self->flesh_browse_results($results, @params)) {
$logger->warn(
"error in browse (flesh): " . $self->editor->event->{textcode}
);