Fix a data destruction bug when authorities are updated.
authorJason Stephenson <jstephenson@mvlc.org>
Fri, 11 Jan 2013 13:49:11 +0000 (08:49 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Fri, 11 Jan 2013 17:57:04 +0000 (12:57 -0500)
commit2fee9f9693b382c999a62be75604d0bc2752fe0e
tree13395c93a1235c4c7d0fba61cee9656ede3f324f
parent59fa7d1b6df7453b68d0da218220c902f5ec0fcd
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/002.schema.config.sql
Open-ILS/src/sql/Pg/012.schema.vandelay.sql
Open-ILS/src/sql/Pg/upgrade/0750.function.authority.generate_overlay_template.sql [new file with mode: 0644]