Bug 17380: Graceful resolution of missing reporting tag in merge
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tue, 4 Jul 2017 12:31:21 +0000 (14:31 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 23 Oct 2017 13:56:39 +0000 (15:56 +0200)
commit7aee7d583d019f124f784ce34b978bfd704c1714
tree25f0354b03a6a544494f06d3d27fdfa91786d11d
parentf53b6ec248322706033695ef2928921d0aaa36aa
Bug 17380: Graceful resolution of missing reporting tag in merge

Altough this patch deals with a mostly hypothetical case and this report
makes it practically impossible anymore to merge with records in the
Default framework (having no reporting tag), we can make the code of
sub merge still a bit more robust here.

If you would merge biblio records from one authtype to another and the new
framework would not have a reporting tag, before this patch the result would
be data loss. Merge would handle this request as a delete. This patch makes
merge handle it differently: instead of clearing the biblio records, it
keeps $a and $9 in order to make a future corrective merge possible.

Note: The additional condition on line 1468 for $tags_using_authtype
makes sure that we do not select all fields when the authtype should
unexpectedly be empty string (Default). This prevents crashing on
a "Control fields do not have subfields" error.

Test plan:
[1] Run t/db_dependent/Authorities/Merge.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 434162c1756b16b5fc715fd1cb762aaf8aff7b2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/AuthoritiesMarc.pm
t/db_dependent/Authority/Merge.t