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:58:24 +0000 (12:58 -0500)
commit56dfac8d77fd0e309ca3bf09946389abecd652c2
treeec81db7ce36846fc7b5d2053ed7ce7d9368f1438
parent8ceb28247f531da78f12a15916bc85fd7122baeb
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]