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)
committerDan Scott <dscott@laurentian.ca>
Wed, 23 Jan 2013 05:16:05 +0000 (00:16 -0500)
commit1a45be77ba799f6a27bc669faabb63fe4a988ed6
tree3c98cc552007db069f9ffa2dee635103e7fbe046
parent8d327a99ca730c030edce557f9c598fe591a3f16
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>
Conflicts:
Open-ILS/src/sql/Pg/002.schema.config.sql
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]