Bug 30195: Search by ISBN if it is provided in suggestion
authorThomas Klausner <domm@plix.at>
Tue, 15 Mar 2022 15:00:48 +0000 (16:00 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Sat, 25 Jun 2022 14:20:37 +0000 (11:20 -0300)
commitf1e29b18ea308574e619e7c2b5ae324a93a25d01
tree13a4285130cc7890343a73c6ff6787f2ba04cf9a
parentb6dcd3cbd395b0df439d846f58772808a5696da5
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Suggestions.pm
suggestion/suggestion.pl
t/db_dependent/Suggestions.t