Description
Adolfo Rodríguez Taboada
2022-07-19 11:03:20 UTC
Created attachment 137860 [details] [review] Detect duplicate authorities using Link authorities automatically This patch fixes LinkBibHeadingsToAuthorities so it detects duplicate authorities using "Link authorities automatically" To test 1 Make sure the system preference AutoCreateAuthorities is turned to don't generate 2 Create a duplicate authority and check that search in Authorities module returns both. For example, two Personal Name (Smith, John) 3 Create a new record and fill the entry point with the same text of the authorities you just created. For example 100$a Smith, John 4 Click "Link authorities automatically" and you will obtain the following message "No matching authority found." 5 Apply patch, restart services 6 Click "Link authorities automatically" and you will obtain the following message "More than one local match found. Possibly a duplicate authority!" Don't forget to switch the status to "Needs Signoff", once you have a patch attached for testing! Created attachment 138518 [details] [review] Bug 31185 - Link authorities automatically doesn't detect duplicate authorities Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com> Please don't forget to set Assignee! :) Created attachment 139857 [details] [review] Bug 31185: Link authorities automatically doesn't detect duplicate authorities This patch fixes LinkBibHeadingsToAuthorities so it detects duplicate authorities using "Link authorities automatically" To test 1 Make sure the system preference AutoCreateAuthorities is turned to don't generate 2 Create a duplicate authority and check that search in Authorities module returns both. For example, two Personal Name (Smith, John) 3 Create a new record and fill the entry point with the same text of the authorities you just created. For example 100$a Smith, John 4 Click "Link authorities automatically" and you will obtain the following message "No matching authority found." 5 Apply patch, restart services 6 Click "Link authorities automatically" and you will obtain the following message "More than one local match found. Possibly a duplicate authority!" Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> I have added the bug description and test plan to the commit message according to our guidelines. Also happy to sign off on this, but we'll need a unit test covering this change for it to pass QA. Please let us know if we can help with that! Yikes, there are hardly any tests for LinkBibHeadingsToAuthorities at the moment :( I'd love to see this one move forward.. but I'm not sure I can pick up adding the tests myself. Created attachment 150610 [details] [review] Bug 31185: Unit test I added a unit test, but I discovered that if AutoCreateAuthorities is on, we won't report multiple matches. I think we should? Feel free to adjust test expectations if not, but I suspect it reveals a problem Created attachment 150762 [details] [review] New patch version The test expectations are correct, it should report multiple matches if AutoCreateAuthorities is on as it's an issue must be dealt with no matter the value of that preference. This is an updated version of the patch that reports multiple matches in both scenarios. Thanks for the unit test! I am sorry, but this doesn't apply: Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 31185: Unit test error: sha1 information is lacking or useless (t/db_dependent/Biblio.t). error: could not build fake ancestor Patch failed at 0001 Bug 31185: Unit test hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-31185-Unit-test-xmcWMx.patch Please also make sure to include a bug description and a test plan in the commit message when re-submitting. Created attachment 152507 [details] [review] Bug 31185: Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 152508 [details] [review] Bug 31185: Link authorities automatically doesn't detect duplicate authorities Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> All now working as expected and passing the test Nick wrote (thanks for that Nick). I'm happy to say this seems solid now. I've rebased and am happy to PQA. Note, you might want to look into using git-bz Adolfo, it really helps with uploading the patches etc. Pushed to master for 23.11. Nice work everyone, thanks! Thanks for all the hard work! Pushed to 23.05.x for the next release Doesn't apply on 22.11.x. Not backporting. |