Bug 22785 - Manage matches when importing through stage MARC record import
Summary: Manage matches when importing through stage MARC record import
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Nick Clemens (kidclamp)
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on: 26326
Blocks: 30652 30854 32685
  Show dependency treegraph
 
Reported: 2019-04-26 15:31 UTC by Joy Nelson
Modified: 2023-12-28 20:42 UTC (History)
14 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/595
Text to go in the release notes:
Version(s) released in:
22.05.00
Circulation function:


Attachments
Bug 26326: Add Koha Objects for Import Records and Import Record Matches (14.62 KB, patch)
2021-01-04 16:52 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (37.68 KB, patch)
2021-01-04 16:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema updates (1.61 KB, patch)
2021-01-04 16:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (857 bytes, patch)
2021-01-04 16:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (37.53 KB, patch)
2021-05-14 17:52 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema updates (1.66 KB, patch)
2021-05-14 17:52 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (859 bytes, patch)
2021-05-14 17:52 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.68 KB, patch)
2021-05-19 10:56 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (37.53 KB, patch)
2021-05-19 12:59 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema updates (1.44 KB, patch)
2021-05-19 12:59 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (859 bytes, patch)
2021-05-19 12:59 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.68 KB, patch)
2021-05-19 12:59 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (39.64 KB, patch)
2021-05-19 13:01 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema updates (1.44 KB, patch)
2021-05-19 13:01 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (859 bytes, patch)
2021-05-19 13:01 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.68 KB, patch)
2021-05-19 13:01 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (39.70 KB, patch)
2021-05-19 22:16 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema updates (1.50 KB, patch)
2021-05-19 22:16 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (925 bytes, patch)
2021-05-19 22:16 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.75 KB, patch)
2021-05-19 22:16 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (23.63 KB, patch)
2021-10-15 17:12 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema updates (1.50 KB, patch)
2021-10-15 17:12 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (925 bytes, patch)
2021-10-15 17:12 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.74 KB, patch)
2021-10-15 17:12 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (24.50 KB, patch)
2021-10-19 15:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema updates (1.50 KB, patch)
2021-10-19 15:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (925 bytes, patch)
2021-10-19 15:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.74 KB, patch)
2021-10-19 15:33 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: API files (15.28 KB, patch)
2021-10-19 19:35 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: API files (15.35 KB, patch)
2021-10-19 20:10 UTC, Benjamin Daeuber
Details | Diff | Splinter Review
Bug 26326: DO NOT PUSH Schema changes (1.41 KB, patch)
2021-10-19 20:21 UTC, Benjamin Daeuber
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (24.50 KB, patch)
2021-10-19 20:23 UTC, Benjamin Daeuber
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema updates (1.50 KB, patch)
2021-10-19 20:23 UTC, Benjamin Daeuber
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (925 bytes, patch)
2021-10-19 20:23 UTC, Benjamin Daeuber
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.74 KB, patch)
2021-10-19 20:23 UTC, Benjamin Daeuber
Details | Diff | Splinter Review
Bug 22785: API files (15.33 KB, patch)
2021-10-19 20:23 UTC, Benjamin Daeuber
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (44.09 KB, patch)
2021-12-21 11:36 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema Updates (1.44 KB, patch)
2021-12-21 11:37 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (979 bytes, patch)
2021-12-21 11:37 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.79 KB, patch)
2021-12-21 11:37 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Fix translatability (2.08 KB, patch)
2021-12-21 11:37 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (44.22 KB, patch)
2022-02-17 13:04 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema Updates (1.44 KB, patch)
2022-02-17 13:05 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (979 bytes, patch)
2022-02-17 13:05 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.79 KB, patch)
2022-02-17 13:05 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Fix translatability (2.08 KB, patch)
2022-02-17 13:05 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (44.27 KB, patch)
2022-02-26 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema Updates (1.49 KB, patch)
2022-02-26 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (1.01 KB, patch)
2022-02-26 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.85 KB, patch)
2022-02-26 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22785: (follow-up) Fix translatability (2.14 KB, patch)
2022-02-26 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (43.39 KB, patch)
2022-04-26 15:35 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema Updates (1.49 KB, patch)
2022-04-26 15:36 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (1.01 KB, patch)
2022-04-26 15:36 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.85 KB, patch)
2022-04-26 15:36 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Fix translatability (2.14 KB, patch)
2022-04-26 15:36 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (43.45 KB, patch)
2022-04-27 16:32 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema Updates (1.55 KB, patch)
2022-04-27 16:32 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (1.08 KB, patch)
2022-04-27 16:32 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.91 KB, patch)
2022-04-27 16:32 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Fix translatability (2.20 KB, patch)
2022-04-27 16:32 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (QA follow-up) Remove superflous spec files (7.08 KB, patch)
2022-04-27 16:32 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Update contentType in request (1.13 KB, patch)
2022-04-28 10:29 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: Allow option to choose which record match is applied during import (43.45 KB, patch)
2022-04-29 11:37 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: DO NOT PUSH Schema Updates (1.55 KB, patch)
2022-04-29 11:37 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: Update Schema for boolean (1.08 KB, patch)
2022-04-29 11:37 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches (2.91 KB, patch)
2022-04-29 11:37 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Fix translatability (2.20 KB, patch)
2022-04-29 11:37 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (QA follow-up) Remove superflous spec files (7.14 KB, patch)
2022-04-29 11:37 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (follow-up) Update contentType in request (1.19 KB, patch)
2022-04-29 11:37 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 22785: (follow-up) no additionalProperties (806 bytes, patch)
2022-05-04 11:17 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22785: (follow-up) no additionalProperties (871 bytes, patch)
2022-05-04 12:19 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joy Nelson 2019-04-26 15:31:03 UTC Comment hidden (obsolete)
Comment 1 Nick Clemens (kidclamp) 2021-01-04 16:52:27 UTC Comment hidden (obsolete)
Comment 2 Nick Clemens (kidclamp) 2021-01-04 16:53:00 UTC
Created attachment 114814 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled
Comment 3 Nick Clemens (kidclamp) 2021-01-04 16:53:02 UTC
Created attachment 114815 [details] [review]
Bug 22785: DO NOT PUSH Schema updates
Comment 4 Nick Clemens (kidclamp) 2021-01-04 16:53:05 UTC
Created attachment 114816 [details] [review]
Bug 22785: Update Schema for boolean
Comment 5 Pascale Nalon 2021-04-01 13:57:33 UTC
In the test plan,is it necessary to set matching rules in administration page ?
Without one, the only choice in "Record matching rule" line is "Don't look for matching records"
Comment 6 Pascale Nalon 2021-04-02 09:18:28 UTC
I've set concordance rule in my sandbox and play 2nd step of the test plan : it's OK.
At the step 3, I don't understand where radio buttons should to be ? I can't see no radio buttons, before or after importing the new file.

Is the patch really applied on this sandbox  http://sandboxes.ptfs-europe.co.uk/provision_log/bz22785 ?
Comment 7 Nick Clemens (kidclamp) 2021-04-02 10:52:28 UTC
(In reply to Pascale Nalon from comment #6)
> I've set concordance rule in my sandbox and play 2nd step of the test plan :
> it's OK.
> At the step 3, I don't understand where radio buttons should to be ? I can't
> see no radio buttons, before or after importing the new file.
> 
> Is the patch really applied on this sandbox 
> http://sandboxes.ptfs-europe.co.uk/provision_log/bz22785 ?

Checking the git log it only appears the dependency was applied - you can click 'Apply patches' under 'Actions' to apply the patches from this bug
Comment 8 Nick Clemens (kidclamp) 2021-05-14 17:52:07 UTC
Created attachment 120995 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled
Comment 9 Nick Clemens (kidclamp) 2021-05-14 17:52:14 UTC
Created attachment 120996 [details] [review]
Bug 22785: DO NOT PUSH Schema updates
Comment 10 Nick Clemens (kidclamp) 2021-05-14 17:52:20 UTC
Created attachment 120997 [details] [review]
Bug 22785: Update Schema for boolean
Comment 11 Andrew Fuerste-Henry 2021-05-14 20:37:25 UTC
I took bib#1, and reimported it without editing, creating bib#439. I then edited ONLY the 245a in my downloaded copy of the bib and reimported it again, matching on ISBN. The incoming record shows matches with #1 and #439, as expected.

The smaller issue is that the list of potential matches isn't consistently in the same order. Sometimes 1 was above 439 and sometimes it was the other way around. This is really confusing, as it changed on the page load at import - I picked the bottom match, selected import, and when it finished the two matches had reversed their order.

Much more importantly, though, it consistently overlaid on bib#1, even when I told it I wanted to match to bib#439 instead. To recreate:
- have two identical bibs in your system
- import a third bib that you know will match the identical bibs but has a different title
- stage and match, telling Koha to overlay on a match
- select the higher bib number from your two potential matches
- import
- see the title changed on the lower bib number
Comment 12 Nick Clemens (kidclamp) 2021-05-19 10:56:53 UTC
Created attachment 121149 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen
Comment 13 Nick Clemens (kidclamp) 2021-05-19 12:59:15 UTC
Created attachment 121167 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled
Comment 14 Nick Clemens (kidclamp) 2021-05-19 12:59:19 UTC
Created attachment 121168 [details] [review]
Bug 22785: DO NOT PUSH Schema updates
Comment 15 Nick Clemens (kidclamp) 2021-05-19 12:59:22 UTC
Created attachment 121169 [details] [review]
Bug 22785: Update Schema for boolean
Comment 16 Nick Clemens (kidclamp) 2021-05-19 12:59:26 UTC
Created attachment 121170 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen
Comment 17 Nick Clemens (kidclamp) 2021-05-19 13:01:26 UTC
Created attachment 121171 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled
Comment 18 Nick Clemens (kidclamp) 2021-05-19 13:01:30 UTC
Created attachment 121172 [details] [review]
Bug 22785: DO NOT PUSH Schema updates
Comment 19 Nick Clemens (kidclamp) 2021-05-19 13:01:34 UTC
Created attachment 121173 [details] [review]
Bug 22785: Update Schema for boolean
Comment 20 Nick Clemens (kidclamp) 2021-05-19 13:01:37 UTC
Created attachment 121174 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen
Comment 21 Andrew Fuerste-Henry 2021-05-19 22:16:08 UTC
Created attachment 121204 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 22 Andrew Fuerste-Henry 2021-05-19 22:16:12 UTC
Created attachment 121205 [details] [review]
Bug 22785: DO NOT PUSH Schema updates

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 23 Andrew Fuerste-Henry 2021-05-19 22:16:16 UTC
Created attachment 121206 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 24 Andrew Fuerste-Henry 2021-05-19 22:16:20 UTC
Created attachment 121207 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 25 Marcel de Rooy 2021-08-27 09:18:11 UTC
Base does not apply
Comment 26 Nick Clemens (kidclamp) 2021-10-15 17:12:36 UTC
Created attachment 126369 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 27 Nick Clemens (kidclamp) 2021-10-15 17:12:40 UTC
Created attachment 126370 [details] [review]
Bug 22785: DO NOT PUSH Schema updates

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 28 Nick Clemens (kidclamp) 2021-10-15 17:12:43 UTC
Created attachment 126371 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 29 Nick Clemens (kidclamp) 2021-10-15 17:12:47 UTC
Created attachment 126372 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 30 Nick Clemens (kidclamp) 2021-10-19 15:32:47 UTC
Created attachment 126522 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 31 Nick Clemens (kidclamp) 2021-10-19 15:32:53 UTC
Created attachment 126523 [details] [review]
Bug 22785: DO NOT PUSH Schema updates

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 32 Nick Clemens (kidclamp) 2021-10-19 15:32:57 UTC
Created attachment 126524 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 33 Nick Clemens (kidclamp) 2021-10-19 15:33:01 UTC
Created attachment 126525 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 34 Benjamin Daeuber 2021-10-19 18:45:02 UTC
When I attempt to change my choice by selecting "Ignore Match", for example, Koha produces the popup error message "Unable to update match choices".
Comment 35 Nick Clemens (kidclamp) 2021-10-19 19:11:51 UTC
(In reply to Benjamin Daeuber from comment #34)
> When I attempt to change my choice by selecting "Ignore Match", for example,
> Koha produces the popup error message "Unable to update match choices".

Hi Ben,

Did you restart memcached/plack after applying the patches? The selection worked for me.
You should see PUT/DELETE routes for:
/api/v1/import/{import_batch_id}/records/{import_record_id}/matches/chosen
if you check 
http://localhost:8080/api/v1/.hmtl
adjusting the URL for your test environment


-Nick
Comment 36 Benjamin Daeuber 2021-10-19 19:31:22 UTC
(In reply to Nick Clemens from comment #35)
> Did you restart memcached/plack after applying the patches? The selection
> worked for me.
> You should see PUT/DELETE routes for:
> /api/v1/import/{import_batch_id}/records/{import_record_id}/matches/chosen
> if you check 
> http://localhost:8080/api/v1/.hmtl
> adjusting the URL for your test environment

I've tried that and I do not see a PUT route. This is on both my docker test environment and I spun up a sandbox just to ensure it wasn't only me. I restart plack on both. I will try taking down my container and rebuilding.
Comment 37 Nick Clemens (kidclamp) 2021-10-19 19:35:05 UTC
Created attachment 126531 [details] [review]
Bug 22785: API files
Comment 38 Nick Clemens (kidclamp) 2021-10-19 19:35:52 UTC
/me sheepishly reattaches API files

Looks like I didn't commit then when I rebased, apologies
Comment 39 Benjamin Daeuber 2021-10-19 20:10:48 UTC
Created attachment 126532 [details] [review]
Bug 22785: API files

That did it, thanks.

Signed-off-by: Benjamin Daeuber <benjamin@valla>
Comment 40 Benjamin Daeuber 2021-10-19 20:17:08 UTC
(In reply to Benjamin Daeuber from comment #39)
> Created attachment 126532 [details] [review] [review]
> Bug 22785: API files
> 
> That did it, thanks.
> 
> Signed-off-by: Benjamin Daeuber <benjamin@valla>

Ugg, sorry about that signoff, I forgot to update my local config. Anyway, thank you, it looks good now.
Comment 41 Benjamin Daeuber 2021-10-19 20:21:32 UTC
Created attachment 126533 [details] [review]
Bug 26326: DO NOT PUSH Schema changes

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 42 Benjamin Daeuber 2021-10-19 20:23:16 UTC
Created attachment 126534 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 43 Benjamin Daeuber 2021-10-19 20:23:20 UTC
Created attachment 126535 [details] [review]
Bug 22785: DO NOT PUSH Schema updates

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 44 Benjamin Daeuber 2021-10-19 20:23:24 UTC
Created attachment 126536 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 45 Benjamin Daeuber 2021-10-19 20:23:28 UTC
Created attachment 126537 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 46 Benjamin Daeuber 2021-10-19 20:23:32 UTC
Created attachment 126538 [details] [review]
Bug 22785: API files

Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 47 Katrin Fischer 2021-11-01 13:44:19 UTC
I've PQA on the base patch for adding the new classes, but I'll probably need some help here especially for the API parts of the patch.

1) Translatability

You did great with View a few lines above, but here "Ignore matches" is not translatable:

+                            $('td:eq(4) ul', nRow).prepend('<li><label><input type="radio" data-import_record_id="'+aData['import_record_id']+'" class="chosen" name="import_record_id_'+aData['import_record_id']+'_match" value="none" ' + checked + disabled + ' > Ignore matches</label></li>');

Also here:

+                }).fail(function(){ alert("Unable to update match choices"); return false; });


2) Unrelated file change

reports/acquisitions_stats.pl
+    warn $strcalc;


I am marking this as a candidate for early inclusion in 22.05 as this enh is a bit bigger and we have already reached soft feature freeze.

I am a little worried about side effects, like with the CLI tools for staged MARC import, so would like to see those tested as well.
Comment 48 Nick Clemens (kidclamp) 2021-12-21 11:36:58 UTC
Created attachment 128820 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Bug 22785: API files

Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 49 Nick Clemens (kidclamp) 2021-12-21 11:37:02 UTC
Created attachment 128821 [details] [review]
Bug 22785: DO NOT PUSH Schema Updates
Comment 50 Nick Clemens (kidclamp) 2021-12-21 11:37:06 UTC
Created attachment 128822 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 51 Nick Clemens (kidclamp) 2021-12-21 11:37:10 UTC
Created attachment 128823 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 52 Nick Clemens (kidclamp) 2021-12-21 11:37:14 UTC
Created attachment 128824 [details] [review]
Bug 22785: (follow-up) Fix translatability
Comment 53 Nick Clemens (kidclamp) 2021-12-21 11:39:36 UTC
(In reply to Katrin Fischer from comment #47)

> 1) Translatability

    Updated 
>
> 2) Unrelated file change

    Removed

> I am a little worried about side effects, like with the CLI tools for staged
> MARC import, so would like to see those tested as well.

    There should be no change - previously we just picked the first mathc, now we explicitly mark it as chosen during staging and will then select it during import.
Comment 54 Nick Clemens (kidclamp) 2022-02-17 13:04:56 UTC
Created attachment 130726 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Bug 22785: API files

Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 55 Nick Clemens (kidclamp) 2022-02-17 13:05:01 UTC
Created attachment 130727 [details] [review]
Bug 22785: DO NOT PUSH Schema Updates
Comment 56 Nick Clemens (kidclamp) 2022-02-17 13:05:07 UTC
Created attachment 130728 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 57 Nick Clemens (kidclamp) 2022-02-17 13:05:12 UTC
Created attachment 130729 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Comment 58 Nick Clemens (kidclamp) 2022-02-17 13:05:17 UTC
Created attachment 130730 [details] [review]
Bug 22785: (follow-up) Fix translatability
Comment 59 Katrin Fischer 2022-02-26 20:23:21 UTC
OK	C4/ImportBatch.pm
 FAIL	installer/data/mysql/atomicupdate/bug_22785.pl
   FAIL	  file permissions
		File must have the exec flag

 FAIL	t/db_dependent/api/v1/import_record_matches.t
   FAIL	  file permissions
		File must have the exec flag
Comment 60 Katrin Fischer 2022-02-26 20:36:40 UTC
Besides the QA test failures which might be false positives (files don't appear to exist?) what is really blocking me here is:

I see no checkboxes!

I have staged the same file of records twice.
Imported one file into catalog.
Matched the other on ISBN.

-> No checkboxed in result list, although there are several Match found in the list.

Am I looking in the wrong spot?

http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=5 and have several
Comment 61 Katrin Fischer 2022-02-26 20:39:44 UTC
Did the database update get lost somehow? We have a Schema change noting a new column, kohastructure.sql, but no atomic update file.
Comment 62 Katrin Fischer 2022-02-26 20:43:41 UTC
(In reply to Katrin Fischer from comment #61)
> Did the database update get lost somehow? We have a Schema change noting a
> new column, kohastructure.sql, but no atomic update file.

Did a git reset --hard origin/master and reapplied the patches. The missing files have reappeared.

I have no clue how they got deleted the first time. ls installer/data/mysql/atomicupdate/ didn't list the file, now it does... maybe hallucinating.
Comment 63 Katrin Fischer 2022-02-26 20:56:24 UTC
I am adding a second sign-off, but as I had a bit of a rough start with this one, I'd like someone else to have a final look.

It turns out, I was not hallucinating, but there is something odd happening here with the QA test tools on ktd in that it deleted and modified files:

reset --hard origin/master
git bz apply 22785
git status - clean

kshell
qa -v 2

testing 5 commit(s) (applied to 4cc3c0a '60 Bug 30133: (follow-up) Update obje')

Processing files before patches
|========================>| 17 / 17 (100.00%)
Processing files after patches
|========================>| 17 / 17 (100.00%)

 OK	C4/ImportBatch.pm
 OK	Koha/REST/V1/ImportRecordMatches.pm
 OK	Koha/Schema/Result/ImportRecordMatch.pm
 OK	api/v1/swagger/definitions.yaml
 OK	api/v1/swagger/definitions/import_record_match.yaml
 OK	api/v1/swagger/parameters.yaml
 OK	api/v1/swagger/parameters/import_record_match.yaml
 OK	api/v1/swagger/paths.yaml
 OK	api/v1/swagger/paths/import_record_matches.yaml
 OK	api/v1/swagger/x-primitives.yaml
 FAIL	installer/data/mysql/atomicupdate/bug_22785.pl
   FAIL	  file permissions
		File must have the exec flag

 OK	installer/data/mysql/kohastructure.sql
 OK	koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
 OK	t/db_dependent/ImportBatch.t
 OK	t/db_dependent/Koha/Import/Record/Matches.t
 FAIL	t/db_dependent/api/v1/import_record_matches.t
   FAIL	  file permissions
		File must have the exec flag

 OK	tools/batch_records_ajax.pl

git status

On branch 59-22785-manage-staged
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   C4/ImportBatch.pm
	deleted:    Koha/REST/V1/ImportRecordMatches.pm
	modified:   Koha/Schema/Result/ImportRecordMatch.pm
	modified:   api/v1/swagger/definitions.yaml
	deleted:    api/v1/swagger/definitions/import_record_match.json
	deleted:    api/v1/swagger/definitions/import_record_match.yaml
	modified:   api/v1/swagger/parameters.yaml
	deleted:    api/v1/swagger/parameters/import_record_match.json
	deleted:    api/v1/swagger/parameters/import_record_match.yaml
	modified:   api/v1/swagger/paths.yaml
	deleted:    api/v1/swagger/paths/import_record_matches.json
	deleted:    api/v1/swagger/paths/import_record_matches.yaml
	modified:   api/v1/swagger/x-primitives.yaml
	deleted:    installer/data/mysql/atomicupdate/bug_22785.pl
	modified:   installer/data/mysql/kohastructure.sql
	modified:   koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
	modified:   t/db_dependent/ImportBatch.t
	modified:   t/db_dependent/Koha/Import/Record/Matches.t
	deleted:    t/db_dependent/api/v1/import_record_matches.t
	modified:   tools/batch_records_ajax.pl
Comment 64 Katrin Fischer 2022-02-26 21:02:12 UTC
Created attachment 131143 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Bug 22785: API files

Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 65 Katrin Fischer 2022-02-26 21:02:18 UTC
Created attachment 131144 [details] [review]
Bug 22785: DO NOT PUSH Schema Updates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 66 Katrin Fischer 2022-02-26 21:02:23 UTC
Created attachment 131145 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 67 Katrin Fischer 2022-02-26 21:02:28 UTC
Created attachment 131146 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 68 Katrin Fischer 2022-02-26 21:02:33 UTC
Created attachment 131147 [details] [review]
Bug 22785: (follow-up) Fix translatability

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 69 Katrin Fischer 2022-04-24 09:14:40 UTC
I am sorry, but it looks like this will need a bigger rebase:

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 22785: Allow option to choose which record match is applied during import
Using index info to reconstruct a base tree...
M	C4/ImportBatch.pm
A	api/v1/swagger/definitions.yaml
A	api/v1/swagger/parameters.yaml
A	api/v1/swagger/paths.yaml
A	api/v1/swagger/x-primitives.yaml
M	installer/data/mysql/kohastructure.sql
M	koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
Auto-merging installer/data/mysql/kohastructure.sql
CONFLICT (modify/delete): api/v1/swagger/x-primitives.yaml deleted in HEAD and modified in Bug 22785: Allow option to choose which record match is applied during import. Version Bug 22785: Allow option to choose which record match is applied during import of api/v1/swagger/x-primitives.yaml left in tree.
CONFLICT (modify/delete): api/v1/swagger/paths.yaml deleted in HEAD and modified in Bug 22785: Allow option to choose which record match is applied during import. Version Bug 22785: Allow option to choose which record match is applied during import of api/v1/swagger/paths.yaml left in tree.
CONFLICT (modify/delete): api/v1/swagger/parameters.yaml deleted in HEAD and modified in Bug 22785: Allow option to choose which record match is applied during import. Version Bug 22785: Allow option to choose which record match is applied during import of api/v1/swagger/parameters.yaml left in tree.
CONFLICT (modify/delete): api/v1/swagger/definitions.yaml deleted in HEAD and modified in Bug 22785: Allow option to choose which record match is applied during import. Version Bug 22785: Allow option to choose which record match is applied during import of api/v1/swagger/definitions.yaml left in tree.
Auto-merging C4/ImportBatch.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 22785: Allow option to choose which record match is applied during import
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-22785-Allow-option-to-choose-which-record-matc-Drlq9o.patch
Comment 70 Nick Clemens (kidclamp) 2022-04-26 15:35:57 UTC
Created attachment 133947 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Bug 22785: API files

Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 71 Nick Clemens (kidclamp) 2022-04-26 15:36:03 UTC
Created attachment 133948 [details] [review]
Bug 22785: DO NOT PUSH Schema Updates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 72 Nick Clemens (kidclamp) 2022-04-26 15:36:08 UTC
Created attachment 133949 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 73 Nick Clemens (kidclamp) 2022-04-26 15:36:14 UTC
Created attachment 133950 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 74 Nick Clemens (kidclamp) 2022-04-26 15:36:20 UTC
Created attachment 133951 [details] [review]
Bug 22785: (follow-up) Fix translatability

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 75 Katrin Fischer 2022-04-27 15:12:42 UTC
I still have some strange issues here running the QA script. (see comment #63)

Could someone else please take over from here?
Comment 76 Martin Renvoize (ashimema) 2022-04-27 16:32:19 UTC
Created attachment 134127 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Bug 22785: API files

Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 77 Martin Renvoize (ashimema) 2022-04-27 16:32:26 UTC
Created attachment 134128 [details] [review]
Bug 22785: DO NOT PUSH Schema Updates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 78 Martin Renvoize (ashimema) 2022-04-27 16:32:33 UTC
Created attachment 134129 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 79 Martin Renvoize (ashimema) 2022-04-27 16:32:39 UTC
Created attachment 134130 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 80 Martin Renvoize (ashimema) 2022-04-27 16:32:45 UTC
Created attachment 134131 [details] [review]
Bug 22785: (follow-up) Fix translatability

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 81 Martin Renvoize (ashimema) 2022-04-27 16:32:51 UTC
Created attachment 134132 [details] [review]
Bug 22785: (QA follow-up) Remove superflous spec files

We don't need these any more.. I think they crept back in during
rebases
Comment 82 Martin Renvoize (ashimema) 2022-04-27 17:27:10 UTC
All appears to be working well, QA scripts are happy too.
Comment 83 Martin Renvoize (ashimema) 2022-04-27 17:31:15 UTC
Scratch that.. I forgot to test an action and now found a bug.

If you select to 'Ignore' then change your mind and select a match again.. the API request fails with: 

[
  {
    "message": "Expected application/json - got application/x-www-form-urlencoded; charset=UTF-8.",
    "path": "/body"
  }
]
Comment 84 Nick Clemens (kidclamp) 2022-04-28 10:29:50 UTC
Created attachment 134219 [details] [review]
Bug 22785: (follow-up) Update contentType in request
Comment 85 Martin Renvoize (ashimema) 2022-04-29 11:37:10 UTC
Created attachment 134368 [details] [review]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Bug 22785: API files

Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 86 Martin Renvoize (ashimema) 2022-04-29 11:37:16 UTC
Created attachment 134369 [details] [review]
Bug 22785: DO NOT PUSH Schema Updates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 87 Martin Renvoize (ashimema) 2022-04-29 11:37:22 UTC
Created attachment 134370 [details] [review]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 88 Martin Renvoize (ashimema) 2022-04-29 11:37:28 UTC
Created attachment 134371 [details] [review]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 89 Martin Renvoize (ashimema) 2022-04-29 11:37:33 UTC
Created attachment 134372 [details] [review]
Bug 22785: (follow-up) Fix translatability

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 90 Martin Renvoize (ashimema) 2022-04-29 11:37:39 UTC
Created attachment 134373 [details] [review]
Bug 22785: (QA follow-up) Remove superflous spec files

We don't need these any more.. I think they crept back in during
rebases

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 91 Martin Renvoize (ashimema) 2022-04-29 11:37:45 UTC
Created attachment 134374 [details] [review]
Bug 22785: (follow-up) Update contentType in request

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 92 Martin Renvoize (ashimema) 2022-04-29 11:52:57 UTC
All working now :)  PQA
Comment 93 Fridolin Somers 2022-05-03 21:27:22 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 95 Nick Clemens (kidclamp) 2022-05-04 11:17:45 UTC
Created attachment 134575 [details] [review]
Bug 22785: (follow-up) no additionalProperties
Comment 96 Martin Renvoize (ashimema) 2022-05-04 12:19:49 UTC
Created attachment 134608 [details] [review]
Bug 22785: (follow-up) no additionalProperties

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 97 Martin Renvoize (ashimema) 2022-05-04 12:20:53 UTC
Follow-up tested, passed and pushed as RM Assistant. 

Thanks for the quick action Nick :)