Bug 22778: Suggestions with no "suggester" can cause errors
commit3c419c007c538cff8a233e6b5777fc57ae022f1f
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 25 Apr 2019 19:50:35 +0000 (25 15:50 -0400)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 13 May 2020 21:05:57 +0000 (13 21:05 +0000)
tree89caaf328a3e7249b05537ddcf1127b6f49ec34a
parent0bbaf0d1e67d343beba5b043408c488db30db8bd
Bug 22778: Suggestions with no "suggester" can cause errors

If one tries to modify a suggestion that has no suggester you will get the following error:

Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506

Koha assumes that every suggestion has a borrowernumber in suggestedby

Test Plan:
1) Create a suggestion with an unpopulated suggestedby
2) Attempt to modify that suggestion
3) Note the error
4) Apply this patch
5) Restart all teh things
6) Attempt to modify that suggestion
7) No error!

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cac73b47ef221b32a6254fd25f22c86bcdd20c20)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Suggestions.pm