[OPEN-ILS-GENERAL] EG 2.0: problem Marc2bre - Global Flags "Maintain 001-003-035 according MARC" and "TCN=Internal ID"

Dan Scott dan at coffeecode.net
Wed Feb 16 18:36:25 EST 2011


On Fri, Feb 11, 2011 at 04:36:04PM +0100, Repke de Vries wrote:
> 
> Command-line importing with marc2bre + pg_loader [1] in EG RC2
> Virtual Image, the import went fine but the Global Flags settings
> "Maintain 001-003-035 according MARC" = TRUE and "Cat: Use Internal
> ID for TCN Value" = TRUE are being ignored.
> 
> In other words:  I am getting a Record ID and TCN that are
> derivatives of the control number in the imported 001 field: wrong.

Well, the results for the record ID are what I would expect and want. By
saying "give me the value of 001 for my record IDs" in marc2bre.pl with
--idfield 001, that sets the record ID to whatever number is in 001.
This is extremely useful if you have separate records for holdings, etc,
that point to an existing record ID that you need to sync them up with
during your migration.

The TCN though... I took a look at where cat.bib.use_id_for_tcn actually
gets used, and it's only in the Perl O:A:Cat::BibCommon module. Which
doesn't get called by any of the in-database ingest code that is used in
2.0, it would only be called when you're working with the GUI.

A simple/simplistic way to fix this in the short term would be to run
(after importing all of your bib records):

UPDATE biblio.record_entry SET tcn_value = id;

I would consider this a bug, though, as the expectation when you set
"Cat: Use internal ID for TCN value" to TRUE is for that to be the case
no matter how you get the records into the system. In which case, a
minor tweak to the maintain_901 or maintain_control_number triggers
should suffice (maintain_901 because it occurs before
maintain_control_number, although perhaps that order should be
reversed anyway to ensure that maintain_901 inserts the correct values
in the correct spots...)


More information about the Open-ils-general mailing list