Bug 10227 : Fix GetMessagingPreferences when digest is possible
authorSophie Meynieux <sophie.meynieux@biblibre.com>
Wed, 24 Aug 2016 12:56:54 +0000 (14:56 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 13 Sep 2016 17:14:28 +0000 (17:14 +0000)
commit75c61b94f34d406aaa8ac862024ccfd3d9030cc8
tree567850aff9597f36b6239e8f1bfddbd082d15bf3
parentaf2918045f3323f9a558eb463165bb4ef331e477
Bug 10227 : Fix GetMessagingPreferences when digest is possible

This bug is a bit tricky to test, as the result is somehow  random, depending on the order of rows returned by sql request. You've got to change the preferences several times to see bad results.

Enable EnhancedMessaging preferences
Set preferences for a borrower or a category.
run misc/cronjobs/advance_notices.pl and look in message_queue table the letter_code of the generated messages.
Change digest selection and do the test again several times

Without patch, for message where digest is allowed (Advance_Notice, Item_Due), for a borrower or a category with 'wants_digest' selected, GetBorrowerMessagingPreferences returns sometimes letter_code with DGST and sometimes not.

With the patch, letter_code returned is always correct depending on digest selected or not

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Members/Messaging.pm