MarcRecordFromNewSuggestion (in C4::::Suggestions, used eg in koha/opac-suggestions.pl) only converts title, author and itemtype from the $suggestion input into the marc record that is passed on to FindDuplicate. So if a patron enters an ISBN, this is not used for the duplicate search. We will provide a patch implementing this feature in the next few days.
Created attachment 131731 [details] [review] Patch adding ISBN-search to purchase suggestions When a patron enters an ISBN/ISSN when suggesting a new purchase, the ISBN is used to find duplicates. Title/Author are ignored (as patrons might misspell them, and the ISBN provides a better way to find duplicates) Test Plan: * in the OPAC, go to /cgi-bin/koha/opac-suggestions.pl * Click "new purchase suggestion" * Enter any title * Enter an ISBN that exists in your library * Click "Submit your suggestion" -> A new purchase suggestion has been submitted * Apply the patch! * Again start a new purchase suggestion, enter any title and the duplicate ISBN, and Submit * You should see the note "A similar document already exists: ..." Please note that the title should not be required when entering an ISBN, but as the list of required fields is managed via OPACSuggestionMandatoryFields I fear that it's rather complicated to make title an optional required field if isbn is provided. I also added a simple non-DB test case to t/db_dependent/Suggestions.t (in a subtest at the end), but could not actually run it as I haven't gotten around to set up / try a testing Koha dev env... Sponsored-by: Steiermärkische Landesbibliothek
Created attachment 134923 [details] [review] Bug 30195: Search by ISBN if it is provided in suggestion When a patron enters an ISBN/ISSN when suggesting a new purchase, the ISBN is used to find duplicates. Title/Author are ignored (as patrons might misspell them, and the ISBN provides a better way to find duplicates) Test Plan: * in the OPAC, go to /cgi-bin/koha/opac-suggestions.pl * Click "new purchase suggestion" * Enter any title * Enter an ISBN that exists in your library * Click "Submit your suggestion" -> A new purchase suggestion has been submitted * Apply the patch! * Again start a new purchase suggestion, enter any title and the duplicate ISBN, and Submit * You should see the note "A similar document already exists: ..." Please note that the title should not be required when entering an ISBN, but as the list of required fields is managed via OPACSuggestionMandatoryFields I fear that it's rather complicated to make title an optional required field if isbn is provided. I also added a simple non-DB test case to t/db_dependent/Suggestions.t (in a subtest at the end), but could not actually run it as I haven't gotten around to set up / try a testing Koha dev env... Sponsored-by: Steiermärkische Landesbibliothek
Created attachment 134924 [details] [review] Added a missing semicolon to the added subtest and increased test count to 107
Created attachment 134925 [details] [review] The patch passes the provided test cases under t/db_dependent/Suggestions.t as well as several manual tests using different existing ISBNs inside opac-suggestions.pl https://bugs.koha-community.org/show_bug.cgi?id=30195 Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Current status: Signed Off
There are some issues with the signoff. - Each commit must be signed off. I don't know the simplest way, I used to do an interactive rebase with git but now I just signoff when applying the patches: `git git bz apply 30195 --signoff` - It's clearer if comments are written in separate messages than the patches. - The 2nd and 3rd attachment are actually a duplicate of the 2nd patch.
Created attachment 135264 [details] [review] Bug 30195: Search by ISBN if it is provided in suggestion When a patron enters an ISBN/ISSN when suggesting a new purchase, the ISBN is used to find duplicates. Title/Author are ignored (as patrons might misspell them, and the ISBN provides a better way to find duplicates) Test Plan: * in the OPAC, go to /cgi-bin/koha/opac-suggestions.pl * Click "new purchase suggestion" * Enter any title * Enter an ISBN that exists in your library * Click "Submit your suggestion" -> A new purchase suggestion has been submitted * Apply the patch! * Again start a new purchase suggestion, enter any title and the duplicate ISBN, and Submit * You should see the note "A similar document already exists: ..." Please note that the title should not be required when entering an ISBN, but as the list of required fields is managed via OPACSuggestionMandatoryFields I fear that it's rather complicated to make title an optional required field if isbn is provided. I also added a simple non-DB test case to t/db_dependent/Suggestions.t (in a subtest at the end), but could not actually run it as I haven't gotten around to set up / try a testing Koha dev env... Sponsored-by: Steiermärkische Landesbibliothek Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> xbsoletes: 131731 - Patch adding ISBN-search to purchase suggestions Current status: Signed Off
Created attachment 135265 [details] [review] Bug 30195: Added a missing semicolon to the added subtest and increased test count to 107 https://bugs.koha-community.org/show_bug.cgi?id=30195 Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Created attachment 135474 [details] [review] Bug 30195: Search by ISBN if it is provided in suggestion When a patron enters an ISBN/ISSN when suggesting a new purchase, the ISBN is used to find duplicates. Title/Author are ignored (as patrons might misspell them, and the ISBN provides a better way to find duplicates) Test Plan: * in the OPAC, go to /cgi-bin/koha/opac-suggestions.pl * Click "new purchase suggestion" * Enter any title * Enter an ISBN that exists in your library * Click "Submit your suggestion" -> A new purchase suggestion has been submitted * Apply the patch! * Again start a new purchase suggestion, enter any title and the duplicate ISBN, and Submit * You should see the note "A similar document already exists: ..." Please note that the title should not be required when entering an ISBN, but as the list of required fields is managed via OPACSuggestionMandatoryFields I fear that it's rather complicated to make title an optional required field if isbn is provided. I also added a simple non-DB test case to t/db_dependent/Suggestions.t (in a subtest at the end), but could not actually run it as I haven't gotten around to set up / try a testing Koha dev env... Sponsored-by: Steiermärkische Landesbibliothek Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 135475 [details] [review] Bug 30195: Added a missing semicolon to the added subtest and increased test count to 107 https://bugs.koha-community.org/show_bug.cgi?id=30195 Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 135476 [details] [review] Bug 30195: Remove second parameter for GetMarcFromKohaField It does not longer exist. Also fix a spelling (emtpy ==> empty) Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 22.11. Nice work everyone, thanks!
Enhancement will not be backported to the 22.05.x series unless requested.