When linking biblio to authorities, matching authorities search is made with 'AuthidAsc' sort order hardcoded. This patch allows to set sort order in LinkerOptions syspref (HeadingAsc, HeadingDsc, AuthidAsc or AuthidDsc). Without option, sort order 'AuthidAsc' is used like previsously. This is useful for FirstMatch or LastMatch linkers where results order is important. PS : This solves a problem with some headings. ie : headings "History" and "History of art". The linker search for "History" will return both headings. With linker FistMatch and "HeadingAsc" sort order, the heading "History" will be first and so will match.
Created attachment 13442 [details] [review] Proposed patch
Comment on attachment 13442 [details] [review] Proposed patch Forget, patch not work.
I changed for a 'CheckValidity' option. When present in LinkerOptions, the authorities found by linker will be checked for validity by comparing a to z subfields values between authority field and biblio field. This is based on C4::Biblio->_check_valid_auth_link behavior. I could not use this method because like said in method comment, this method can not be moved and I could not add a dependency to C4::Biblio in C4::Linker::Default.
Created attachment 13481 [details] [review] Proposed patch (main) Patch adding CheckValidity option. Small other changes : In C4::AuthoritiesMarc->GetAuthorizedHeading() : a 'k' was missing in a to z list. In C4::Biblio_>_check_valid_auth_link() : I added test of strings used in equal to avoid warning in logs.
Created attachment 13482 [details] [review] Proposed patch (follow-up 1) Follow up patch containing only perltidy formatting.
Created attachment 13483 [details] [review] Proposed patch (follow-up 2) Small additional correction : GetAuthorizedHeading was missing in exported methods of C4::AuthoritiesMarc.
(In reply to comment #6) > Created attachment 13483 [details] [review] > Proposed patch (follow-up 2) > > Small additional correction : > GetAuthorizedHeading was missing in exported methods of C4::AuthoritiesMarc. This export was present in Bug 7475 (Teach matching rules to handle authorities) but was removed, certainly unwanted, by Bug 8523 (Display auth hierarchies w/all marcflavours).
Created attachment 13487 [details] [review] Proposed patch (main) I revized patch for performance and for a more clear syntax.
(In reply to comment #8) > Created attachment 13487 [details] [review] > Proposed patch (main) > > I revised patch for performance and for a more clear syntax. Patch adding CheckValidity option. + Search for linked authorities can return more that 20 results, I set a max of 10000 (in C4::Heading->_search). + In C4::AuthoritiesMarc->GetAuthorizedHeading() : a 'k' was missing in a to z list.
Created attachment 13488 [details] [review] Proposed patch (follow-up 1) Perltidy formatting
Created attachment 13489 [details] [review] Proposed patch (follow-up 2) Avoid null for string compare in C4::Biblio::_check_valid_auth_link
Created attachment 13490 [details] [review] Proposed patch (follow-up 3) Missing method export in C4::AuthoritiesMarc
Hi, which is the test plan?
(In reply to comment #13) > Hi, which is the test plan? I agree. Needs a test plan.
Is now invalid