[Koha-bugs] [Bug 28844] Suggestion from existing title can alert patron in error

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jul 7 16:37:41 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28844

--- Comment #25 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
I'd really love to see this long standing issue fixed :)


1) Migration of data

At the moment this change would break processing the existing suggestions. As
the suggestion_id for the existing orders is empty, the information would not
show up on the orders in acq, and I am also not sure that the patrons would be
informed by email.

My suggestion: 

We only compare entries with the same biblionumber:

1 suggestion with status in (ORDERED, AVAILABLE) and 1 order => link them
1 suggestion with status (ORDERED) and 1 order with orderstatus in (ordered,
partial) => link them
1 suggestion with status (AVAILABLE) and 1 order with orderstatus (complete) =>
link them

For the rest:
Mimick what we have done until now, use the first match (LIMIT 1, ->single):

For every order line that has no suggestion_id yet
that has a matching biblionumber in suggestions
link to the suggestion_id with the lowest/smallest suggestion_id where status
in (ORDERED, AVAILABLE)

So it might not be correct, but I think it's what would be displayed on the
order line now and where the email would be sent to, so that might be the best
we can do?

2) ModSuggestion 

ModSuggestion is called to update the status of the suggestion and to send the
email, but the calls haven't always been adjusted to look up the correct
suggestion.

Orders.pm cancel()
my $suggestion = Koha::Suggestions->find({ biblionumber => $self->biblionumber,
status => "ORDERED" });
if ( $suggestion and $suggestion->id ) {

Wouldn't this fail if there is more than one suggestion for biblionumber with
status ORDERED?

addorder.pl = seems OK, because using the suggestion_id passed, but double
checking would be good

EDI.pm
                    my $s = $schema->resultset('Suggestion')->search(
                        {
                            biblionumber => $order->biblionumber->biblionumber,
                        }
                    )->single;
                    if ($s) {
                        ModSuggestion(
                            {
                                suggestionid => $s->suggestionid,
                                STATUS       => 'AVAILABLE',
                            }
                        );
                    }

And there are more calls I haven't checked that need to be verified.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list