Comment 7 for bug 712490

Revision history for this message
Bill Erickson (berick) wrote :

If I'm reading the code right, the problem appears to be that the DB function vandelay.replace_field() performs the replacement action in 2 steps, one to remove the controlled subfields, followed by another to add them back with the new values. Since the add action is decoupled from the remove action, the controlled subfields are simply added to the end of the marc field.

Presumably vandelay.replace_field() will need to morph into something a little smarter, like vandelay.strip_field() or vandelay.add_field(), which parse the record in search of data to affect.

I think it might also be possible to extend vandelay.strip_field() and teach it to apply a replacement value to each would-be-deleted subfield instead of deleting them.