The routine orders by score/biblionumber desc - it limits to the first match when 'best only' is passed. With bug 22785 we introduced a 'chosen' field to allow the best, or no match, be chosen We need to honor this when getting the matches This causes order imports to choose the wrong match
Created attachment 142838 [details] [review] Bug 32054: Add get_import_record_matches object method and use it Thispatch adds the new method and alters addorderiso2907.pl to use this rather than GetRecordImportMatches To test: 1 - Import the attached record several times 2 - Set up a matching rule: TitleAuthor threshold: 100 Matchpoint: search index: title, score: 100, tag: 245$a search index: author, score: 100, tag:100$a 3 - Edit one of the imported records to have a different author 4 - Stage the file again. and match using the matchpoint above 5 - Note that matches are found and listed on batch management, with the lowest scored match last 6 - Choose that match 7 - In acquisitions, add to a basket from the staged file 8 - Check the box for the record 9 - Note the match lists the biblionumber for the highest scoring match, not the chosen one 10 - Add an order and note it is for the wrong biblio 11 - Appy patch 12 - Restart_all 13 - Stage the file again and choose a lower scoring match 14 - Confirm when adding to basket this match is preserved 15 - Complete order and verify correct biblio ordered 16 - Stage again, select no match 17 - Confirm no match listed when adding to basket, and choose 'Do not look for matching records' while adding 18 - Confirm order is created on a new biblio
I'm happy to try and test, however there is no attached record (step 1 of the test plan).
Created attachment 142896 [details] Sample biblio from sample database
Created attachment 143293 [details] [review] Bug 32054: Add get_import_record_matches object method and use it Thispatch adds the new method and alters addorderiso2907.pl to use this rather than GetRecordImportMatches To test: 1 - Import the attached record several times 2 - Set up a matching rule: TitleAuthor threshold: 100 Matchpoint: search index: title, score: 100, tag: 245$a search index: author, score: 100, tag:100$a 3 - Edit one of the imported records to have a different author 4 - Stage the file again. and match using the matchpoint above 5 - Note that matches are found and listed on batch management, with the lowest scored match last 6 - Choose that match 7 - In acquisitions, add to a basket from the staged file 8 - Check the box for the record 9 - Note the match lists the biblionumber for the highest scoring match, not the chosen one 10 - Add an order and note it is for the wrong biblio 11 - Appy patch 12 - Restart_all 13 - Stage the file again and choose a lower scoring match 14 - Confirm when adding to basket this match is preserved 15 - Complete order and verify correct biblio ordered 16 - Stage again, select no match 17 - Confirm no match listed when adding to basket, and choose 'Do not look for matching records' while adding 18 - Confirm order is created on a new biblio Signed-off-by: David Nind <david@davidnind.com>
I think I tested this correctly - this is the first time I've used matching rules and adding to an order from a staged record. Mainly found the options for steps 14-15, and the duplicate record message and choices, a bit confusing.
This patch leaves us with one actual remaining call of GetImportRecordMatches: C4/ImportBatch.pm: GetImportRecordMatches C4/ImportBatch.pm:=head2 GetImportRecordMatches C4/ImportBatch.pm: my $results = GetImportRecordMatches($import_record_id, $best_only); C4/ImportBatch.pm:sub GetImportRecordMatches { tools/batch_records_ajax.pl:use C4::ImportBatch qw( GetImportBatch GetImportRecordsRange GetImportRecordMatches ); tools/batch_records_ajax.pl: my $matches = GetImportRecordMatches( $record->{'import_record_id'} ); The last one is the only real one. koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt: "sAjaxSource": 'batch_records_ajax.pl',
Having issues with the background jobs here. The staged file job is stuck on New status. Restarted stuff etc. No change at all. Logs dont make me wiser. Please confirm if it still works..
(In reply to Marcel de Rooy from comment #7) > Having issues with the background jobs here. The staged file job is stuck on > New status. Restarted stuff etc. No change at all. Logs dont make me wiser. > Please confirm if it still works.. I am able to stage and import without issue
(In reply to Nick Clemens from comment #8) > (In reply to Marcel de Rooy from comment #7) > > Having issues with the background jobs here. The staged file job is stuck on > > New status. Restarted stuff etc. No change at all. Logs dont make me wiser. > > Please confirm if it still works.. > > I am able to stage and import without issue Resolved that now ;) background_jobs..
We could go ahead but we could also try here to remove the last occurrence. What do you think? See comment6.
(In reply to Marcel de Rooy from comment #10) > We could go ahead but we could also try here to remove the last occurrence. > What do you think? See comment6. The real fix there is to remove that script and use API to build the datatables - we could update it to remove the use, but it feels like it would be double work. Either way, I think that should be on its own report
Created attachment 145360 [details] [review] Bug 32054: Add get_import_record_matches object method and use it Thispatch adds the new method and alters addorderiso2907.pl to use this rather than GetRecordImportMatches To test: 1 - Import the attached record several times 2 - Set up a matching rule: TitleAuthor threshold: 100 Matchpoint: search index: title, score: 100, tag: 245$a search index: author, score: 100, tag:100$a 3 - Edit one of the imported records to have a different author 4 - Stage the file again. and match using the matchpoint above 5 - Note that matches are found and listed on batch management, with the lowest scored match last 6 - Choose that match 7 - In acquisitions, add to a basket from the staged file 8 - Check the box for the record 9 - Note the match lists the biblionumber for the highest scoring match, not the chosen one 10 - Add an order and note it is for the wrong biblio 11 - Appy patch 12 - Restart_all 13 - Stage the file again and choose a lower scoring match 14 - Confirm when adding to basket this match is preserved 15 - Complete order and verify correct biblio ordered 16 - Stage again, select no match 17 - Confirm no match listed when adding to basket, and choose 'Do not look for matching records' while adding 18 - Confirm order is created on a new biblio Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Nice work everyone! Pushed to 23.05.x for the next release
Nice work, thanks everyone! Pushed to 22.11.x for the next release.
Created attachment 147184 [details] [review] Bug 30254: [22.05.x] Don't charge overdue fines unless some fine exists We need to determine if a book was lost by a patron, the clues we have are previous charges. If we don't find any, we shouldn't charge a new fine To test: 1 - set Lost item fee refund on return policy to "Refund lost item charge and charge new overdue fine", turn on FinesMode, make sure your circ rules charge fines 2 - have an itemtype / patron combo that charges an overdue fine 3 - check item out (with a due date in the future) and then right back in again 4 - confirm patron doesn't have a fine because the item was not late 5 - set the item to Lost 6 - in the database, edit the date_due of your checkout to a date in the past 7 - check the item in, it is marked found 8 - confirm your patron now has a fine 9 - Apply patch 10 - Repeat with a new item and patron 11 - Confirm no charges Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Bug 30254: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Bug 30254: (QA follow-up) Remove warn from tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>