Bug 28844 - Suggestion from existing title can alert patron in error
Summary: Suggestion from existing title can alert patron in error
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 14963
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-11 12:58 UTC by Andrew Fuerste-Henry
Modified: 2021-08-20 10:40 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2021-08-11 12:58:40 UTC
To recreate:
- in acquisitions, create an order
- on the OPAC, find the bib relating to your order and put in a purchase suggestion tied to that bib
- back in acquisitions, receive your order without interacting with the purchase suggestion at all
- the patron tied to the suggestion has received a notice that their suggestion is available

While the suggestion and the order tie to the same bib, we cannot assume the suggestion and the order are linked directly. Especially in a multi-library system, there's no guarantee that the received copy of this title will go to the patron that requested it. 

We should only send suggestion notices to the patron for receipt of orders created from a purchase suggestion directly.
Comment 1 Jonathan Druart 2021-08-19 11:27:41 UTC
Looks like we need an additional link between the 2 tables aqorders and suggestions to achieve that.

That would make sense, especially when looking at such code:

         SELECT suggestions.*,
            U1.surname          AS surnamesuggestedby,
            U1.firstname        AS firstnamesuggestedby,
            U1.borrowernumber   AS borrnumsuggestedby
        FROM suggestions
            LEFT JOIN borrowers AS U1 ON suggestedby=U1.borrowernumber
        WHERE biblionumber=?
        LIMIT 1

in GetSuggestionInfoFromBiblionumber. It is wrong if there are several suggestions on the same bib.

Hard to know it won't break existing workflows however.
Comment 2 Katrin Fischer 2021-08-20 10:40:39 UTC
(In reply to Jonathan Druart from comment #1)
> Looks like we need an additional link between the 2 tables aqorders and
> suggestions to achieve that.
> 
> That would make sense, especially when looking at such code:
> 
>          SELECT suggestions.*,
>             U1.surname          AS surnamesuggestedby,
>             U1.firstname        AS firstnamesuggestedby,
>             U1.borrowernumber   AS borrnumsuggestedby
>         FROM suggestions
>             LEFT JOIN borrowers AS U1 ON suggestedby=U1.borrowernumber
>         WHERE biblionumber=?
>         LIMIT 1
> 
> in GetSuggestionInfoFromBiblionumber. It is wrong if there are several
> suggestions on the same bib.
> 
> Hard to know it won't break existing workflows however.

I agree - we should have a real link and not be guessing.