Created attachment 23201 [details] [review] Add the overwriteSubfieldsOnMerge preference. This patch adds the "overwriteSubfieldsOnMerge" preference. If it is activated, all of the biblio's subfields will be overwritten when doing an authority merge. This means that subfields that exist in the biblio, but not in the authority will be deleted in the biblio when doing the merge. Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Frédérick, Why don't you check the pref overwriteSubfieldsOnMerge value in the merge routine? Could you provide a test plan please?
I checked in our codebase, and we have a special merge script which needs to forces the $overwrite parameter to 1 to do its job correctly. I guess this is why the check wasn't done in the merge routine. I agree there is room for improvement. We could do the pref check in the merge routine and allow a parameter which could overrides the system pref. Test plan : Preparation : * Create a test authority. For example, lets create a PERSON authority with this value : 100$a : "Bruce Wayne" * Rebuild the Zebra authority index. (rebuild_zebra.pl -a) * Create a new biblio record and link it to the newly created authority by clicking the icon right of the 600$a field and searching for the "Bruce Wayne" authority. * Add the "2014" value in the 600$d field of the biblio record before saving the biblio record. This is the value we will use to check the behavior of the new system preference. * Rebuild the Zebra biblio index. (rebuild_zebra.pl -b) Test 1 : * Set the "overwriteSubfieldsOnMerge" system preference to "Don't overwrite". * Edit the "Bruce Wayne" authority, change 100$a value to "Batman". * Save the authority and go check the test biblio record. The 600$a field should now be "Batman", and the 600$d should still be "2014". Test 2 : * Set the "overwriteSubfieldsOnMerge" system preference to "Overwrite". * Edit the "Batman" authority, change the 100$a value back to "Bruce Wayne". * Save the authority and go check the test biblio record. The 600$a field should now be "Bruce Wayne", and the 600$d should now be empty. The additional subfield was overwritten this time.
Created attachment 25377 [details] [review] New version of the patch adding the overwriteSubfieldsOnMerge preference. Here is a new version which checks for the preference in the merge subroutine. Also : For the test case to work, you need to also set the "dontmerge" system preference to "Do automatically update attached biblios...".
Created attachment 25404 [details] [review] Bug 11315 : Add the overwriteSubfieldsOnMerge preference. If it is activated, all of the biblio's subfields will be overwritten when doing an authority merge. This means that subfields that exist in the biblio, but not in the authority will be deleted in the biblio when doing the merge. Sponsored-by: CCSR ( http://www.ccsr.qc.ca ) Test plan : Preparation : * Set dontmerge system preference to "Do automatically update attached biblios..." * Create a test authority. For example, lets create a PERSON authority with this value : 100$a : "Bruce Wayne" * Rebuild the Zebra authority index. (rebuild_zebra.pl -a) * Create a new biblio record and link it to the newly created authority by clicking the icon right of the 600$a field and searching for the "Bruce Wayne" authority. * Add the "2014" value in the 600$d field of the biblio record before saving the biblio record. This is the value we will use to check the behavior of the new system preference. * Rebuild the Zebra biblio index. (rebuild_zebra.pl -b) Test 1 : * Set the "overwriteSubfieldsOnMerge" system preference to "Don't overwrite". * Edit the "Bruce Wayne" authority, change 100$a value to "Batman". * Save the authority and go check the test biblio record. The 600$a field should now be "Batman", and the 600$d should still be "2014". Test 2 : * Set the "overwriteSubfieldsOnMerge" system preference to "Overwrite". * Edit the "Batman" authority, change the 100$a value back to "Bruce Wayne". * Save the authority and go check the test biblio record. The 600$a field should now be "Bruce Wayne", and the 600$d should now be empty. The additional subfield was overwritten this time. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Hi Frederick, can you please provide unit tests? It also looks like the database update is not correct - it's using the wrong version check and the update message is missing the beginning and the bug number. Could you please provide a follow up?
Created attachment 30940 [details] [review] Bug 11315 - Fixed issues in updatedatabase.pl
Created attachment 30941 [details] [review] Bug 11315 - Added unit tests for the modified sub in AuthoritiesMarc.pm new file: t/AuthoritiesMarc.t
Looks like it is close to the purpose of Bug 5572
Created attachment 58234 [details] [review] Bug 11315 : Add the overwriteSubfieldsOnMerge preference. If it is activated, all of the biblio's subfields will be overwritten when doing an authority merge. This means that subfields that exist in the biblio, but not in the authority will be deleted in the biblio when doing the merge. Sponsored-by: CCSR ( http://www.ccsr.qc.ca ) Test plan : Preparation : * Set dontmerge system preference to "Do automatically update attached biblios..." * Create a test authority. For example, lets create a PERSON authority with this value : 100$a : "Bruce Wayne" * Rebuild the Zebra authority index. (rebuild_zebra.pl -a) * Create a new biblio record and link it to the newly created authority by clicking the icon right of the 600$a field and searching for the "Bruce Wayne" authority. * Add the "2014" value in the 600$d field of the biblio record before saving the biblio record. This is the value we will use to check the behavior of the new system preference. * Rebuild the Zebra biblio index. (rebuild_zebra.pl -b) Test 1 : * Set the "overwriteSubfieldsOnMerge" system preference to "Don't overwrite". * Edit the "Bruce Wayne" authority, change 100$a value to "Batman". * Save the authority and go check the test biblio record. The 600$a field should now be "Batman", and the 600$d should still be "2014". Test 2 : * Set the "overwriteSubfieldsOnMerge" system preference to "Overwrite". * Edit the "Batman" authority, change the 100$a value back to "Bruce Wayne". * Save the authority and go check the test biblio record. The 600$a field should now be "Bruce Wayne", and the 600$d should now be empty. The additional subfield was overwritten this time. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 58235 [details] [review] Bug 11315 - Added unit tests for the modified sub in AuthoritiesMarc.pm new file: t/AuthoritiesMarc.t
I am putting this one in the merge omnibus bug 17908. The pref overwriteSubfieldsOnMerge is called AuthCleanBiblios on 5572. I thought of a name like AuthorityMergeMode. The loose mode would not touch, the strict mode would clear/overwrite. I am not sure if the loose mode conflicts with cataloguing rules btw..
Temporarily blocked: see omnibus bug 17908. See also bug 17909 and 17913.
Can be closed now: see omnibus bug 17908 and especially 17913 *** This bug has been marked as a duplicate of bug 17913 ***