Fix a data destruction bug when authorities are updated. collab/miker/lp1081641-broader-and-squashed
authorJason Stephenson <jstephenson@mvlc.org>
Fri, 11 Jan 2013 13:49:11 +0000 (08:49 -0500)
committerMike Rylander <mrylander@gmail.com>
Fri, 11 Jan 2013 15:06:17 +0000 (10:06 -0500)
commit3c70d7356d47d1f7bd02efaf72bda2d0a1be1007
treef434dc4542f4a6d077e794bfe1a1c74de3d74e08
parenta5724d614bac3a75af7da6e15c977514529a5c8c
Fix a data destruction bug when authorities are updated.

Modify the two-argument form of vandelay.merge_record_xml to return
the target_marc when the add_rule, preserve_rule, replace_rule and
strip_rule are all empty.

This method is used by authority.propagate_changes and would replace
the bibliographic record's marc with the overlay template when the
above would happen. By returning the biblographic record entry's own
marc in that case, we prevent data destruction.

Additionally, protect bib and authority template overlay functions
in the same manner.

Commit includes an upgrade script for this change as well as
for the previous commit's authority.generate_overlay_template fix.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/012.schema.vandelay.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.function.authority.generate_overlay_template.sql [new file with mode: 0644]