Summary: | AutoCreateAuthorities can repeatedly generate authority records when using Default linker and heading is cached | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Cataloging | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Joonas Kylmälä <joonas.kylmala> |
Severity: | major | ||
Priority: | P5 - low | CC: | dcook, fridolin.somers, joonas.kylmala, kyle, m.de.rooy, phil, victor, wainuiwitikapark |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
21.11.00,21.05.05,20.11.11,20.05.17,19.11.23
|
Circulation function: | |
Bug Depends on: | 25189 | ||
Bug Blocks: | |||
Attachments: |
Bug 28676: Unit test
Bug 28676: Cache and retrieve match_count when searching a cached heading Bug 28676: Unit test Bug 28676: Cache and retrieve match_count when searching a cached heading Bug 28676: Cache and retrieve match_count when searching a cached heading Bug 28676: Unit test Bug 28676: Cache and retrieve match_count when searching a cached heading |
Description
Nick Clemens (kidclamp)
2021-07-07 14:44:21 UTC
Created attachment 122653 [details] [review] Bug 28676: Unit test Created attachment 122654 [details] [review] Bug 28676: Cache and retrieve match_count when searching a cached heading We use match_count to determine if a new authority record should be created, however, we were not adding this count to the cache, so if a record returned too many matches on first lookup, we would create a new record on the second lookup To test: 1 - Set Linker Module to 'Default' 2 - Enable AutoCreateAuthorities and BiblioAddsAuthorities and CatalogModuleRelink and LinkerRelink 3 - Add two copies of a single authority via Z39 4 - Add two headings for that authority to a bib record (e.g. a 610 and 710) 5 - Save the record and note a new authority is generated 6 - Repeat and see another is generated 7 - Apply patch 8 - Restart all the things 9 - Save the record again, no new authority created Created attachment 124430 [details] [review] Bug 28676: Unit test Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Created attachment 124431 [details] [review] Bug 28676: Cache and retrieve match_count when searching a cached heading We use match_count to determine if a new authority record should be created, however, we were not adding this count to the cache, so if a record returned too many matches on first lookup, we would create a new record on the second lookup To test: 1 - Set Linker Module to 'Default' 2 - Enable AutoCreateAuthorities and BiblioAddsAuthorities and CatalogModuleRelink and LinkerRelink 3 - Add two copies of a single authority via Z39 4 - Add two headings for that authority to a bib record (e.g. a 610 and 710) 5 - Save the record and note a new authority is generated 6 - Repeat and see another is generated 7 - Apply patch 8 - Restart all the things 9 - Save the record again, no new authority created Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Created attachment 125026 [details] [review] Bug 28676: Cache and retrieve match_count when searching a cached heading We use match_count to determine if a new authority record should be created, however, we were not adding this count to the cache, so if a record returned too many matches on first lookup, we would create a new record on the second lookup To test: 1 - Set Linker Module to 'Default' 2 - Enable AutoCreateAuthorities and BiblioAddsAuthorities and CatalogModuleRelink and LinkerRelink 3 - Add two copies of a single authority via Z39 4 - Add two headings for that authority to a bib record (e.g. a 610 and 710) 5 - Save the record and note a new authority is generated 6 - Repeat and see another is generated 7 - Apply patch 8 - Restart all the things 9 - Save the record again, no new authority created Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Fixes the problem, also as well for link_bibs_to_authorities.pl where the same issue occurred. This patch doesn't update the match_count value to cache in the update_cache() function even though it should, but the function was already buggy before this (it didn't update correctly the fuzzy value), and I think what we should do there is call the get_link() with a parameter to tell ignore cache so it will correctly then populate the cache values – but it's out of scope for this bug. Passing QA. Created attachment 125027 [details] [review] Bug 28676: Unit test Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Created attachment 125028 [details] [review] Bug 28676: Cache and retrieve match_count when searching a cached heading We use match_count to determine if a new authority record should be created, however, we were not adding this count to the cache, so if a record returned too many matches on first lookup, we would create a new record on the second lookup To test: 1 - Set Linker Module to 'Default' 2 - Enable AutoCreateAuthorities and BiblioAddsAuthorities and CatalogModuleRelink and LinkerRelink 3 - Add two copies of a single authority via Z39 4 - Add two headings for that authority to a bib record (e.g. a 610 and 710) 5 - Save the record and note a new authority is generated 6 - Repeat and see another is generated 7 - Apply patch 8 - Restart all the things 9 - Save the record again, no new authority created Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> (In reply to Joonas Kylmälä from comment #6) > Fixes the problem, also as well for link_bibs_to_authorities.pl where the > same issue occurred. This patch doesn't update the match_count value to > cache in the update_cache() function even though it should, but the function > was already buggy before this (it didn't update correctly the fuzzy value), > and I think what we should do there is call the get_link() with a parameter > to tell ignore cache so it will correctly then populate the cache values – > but it's out of scope for this bug. > > Passing QA. Forgot to attach the other patch, re-attached now with my sign-off again. Pushed to master for 21.11, thanks to everybody involved! Pushed to 21.05.x for 21.05.05 Pushed to 20.11.x for 20.11.11 Backported: Pushed to 20.05.x branch for 20.05.17 Backported to 19.11.x for 19.11.23 |