Comment 2 for bug 837522

Revision history for this message
Mike Rylander (mrylander) wrote :

For those wanting to look into this, a short test plan is:

  * Create a new ACS with, say, 'A' for a thesaurus code
  * Restart services (too-aggressive caching somewhere -- still hunting that)
  * Create+Edit to make an authority record for that ACS (don't give it a proper Subj)
  * Link a bib to this authority record
  * Edit the authority record
  * BOOM -- bib is replaced by an empty authority overlay template because
    a) the record has no mapped thesaurus, meaning
    b) there's not auto-linked control_set for the record, which means
    c) an empty Replace rule is be generated -- which is broken, and then means
    d) the overlay is seen as a replacement, not a rule-based update

The branch makes a best-guess at the control_set by looking at (what LoC and, in practice, everyone else, considers) the main entry (a field in the 100-199 range) and finds an ACS that uses that authority field. It's not perfect (they can overlap), but the recommendation in the documentation is to avoid overlapping authority fields, so it's GoodEnough(tm).

If we can't find an ACS this way, we instead return a safe no-op overlay that says "replace 901c" ... which is then overwritten by the update trigger.