biblio.extract_metabib_field_entry returns invalid authority data in some cases

Bug #1758328 reported by Josh Stompro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

EG 2.10, but code looks similar in Master.

The biblio.extract_metabib_field_entry function will return incorrect authority results when a browse field with authority is processed before a non browse field is processed. The output_row.authority variable is only cleared/nulled in the browse processing block, so the value sticks around when a non browse field is processed.

This doesn't cause any side effects because the authority data is only used for browse fields, it just looks strange and possibly increases the amount of data passed around. Fixing it would just save someone else from puzzling over it in the future.

I think an easy fix would be to move the output_row.authority =: NULL; line to before the browse processing block so it get cleared for every field processed.

Testing it is a little tricky since it depends on the order the metatbib fields are returned, in addition to the bib data.

Here is one example from our system. The authority record ID for "Interpersonal relations" 165337, in the first row, which is a browse field (3rd bool is true), is repeated for the following 4 fields that are non browse fields, and then finally reset for the last one that again is a browse field.

--works on 2.10, function is different
-- on newer versions of EG.
select biblio.extract_metabib_field_entry(60230::bigint,' '::text);
"extract_metabib_field_entry"
"(subject,14,f,t,t,60230,""Interpersonal relations"",165337,""interpersonal relations"")"
"(subject,-14,t,f,f,60230,""Interpersonal relations"",165337,)"
"(subject,14,f,t,f,60230,""Families -- Interpersonal relations"",165337,)"
"(series,1,f,t,f,60230,""American girl today; 1"",165337,)"
"(title,6,f,t,f,60230,""Lindsey #1"",165337,)"
"(author,8,f,t,t,60230,""Atkinson, Chryssa."",189261,""atkinson chryssa"")"

Josh

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :
tags: added: cat-authority
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.