TPAC search results: query from clicking author headings includes unnecessary subfields

Bug #2044172 reported by Mackenzie Johnson
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

EG 3.8.0
PostgreSQL 10.something
TPAC

What happens: on a given page of search results, if the 1XX field of a record contains a $2 subfield (the source code for a given authority (usually taken from this list: https://www.loc.gov/standards/sourcelist/name-title.html), then that source code also appears in the author heading string in search result entries. Furthermore, it is included in the search query that happens if one were to click on that name from the results list (not from the facet sidebar), but because the $2 subfield isn't included when generating search results, clicking on the name returns no results -- it should at the very least return the recursive result of the entry that provided the link to click!

I've attached a picture of an example. While you can't see my cursor directly, you can ascertain from the pop-up alt-text that I've highlighted the Author heading in entry 10, which would attempt the query "Le Gallant David naf" as seen in the link in the bottom left corner.

We are experiencing some other display issues with name headings in the TPAC versions of the records themselves, but I'll submit another bug for that one -- the bug here is more important as it is affecting the search process since clicking on a name with a source code goes nowhere even when it should. I hypothesize that linking the name headings to authority records may resolve this issue, but I can't speak to that with any certainty.

Revision history for this message
Mackenzie Johnson (mtjohnsonupei) wrote :
Revision history for this message
Rosie Le Faive (rlefaive) wrote :

I found a hacky way to hide $2 by adding it to the list of excluded subfields in (custom)templates/opac/parts/misc_utils.tt2:

--- a/var/templates_roblib/opac/parts/misc_util.tt2
+++ b/var/templates_roblib/opac/parts/misc_util.tt2
@@ -7,7 +7,7 @@
         FOR node IN xml.findnodes('//*[@tag="' _ target_field _ '"]');
             raw_vals = [];
             core_val = '';
- FOR subnode IN node.findnodes('./*[not(contains("e w 0 4 5 6 7 8 9", @code))]');
+ FOR subnode IN node.findnodes('./*[not(contains("e w 0 2 4 5 6 7 8 9", @code))]');
                 raw_vals.push(subnode.textContent());
             END;
             core_val = raw_vals.join(" ");

------

The resulting behaviour causes an errant ',' at the end of the 1xx field, but at least it is searchable.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.