From 75c61b94f34d406aaa8ac862024ccfd3d9030cc8 Mon Sep 17 00:00:00 2001 From: Sophie Meynieux Date: Wed, 24 Aug 2016 14:56:54 +0200 Subject: [PATCH] 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 Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- C4/Members/Messaging.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Members/Messaging.pm b/C4/Members/Messaging.pm index 51bcdd885b..2270c3742e 100644 --- a/C4/Members/Messaging.pm +++ b/C4/Members/Messaging.pm @@ -72,6 +72,7 @@ ON message_attributes.message_attribute_id = borrower_message_preferences.me LEFT JOIN message_transports ON message_transports.message_attribute_id = message_attributes.message_attribute_id AND message_transports.message_transport_type = borrower_message_transport_preferences.message_transport_type +AND message_transports.is_digest = borrower_message_preferences.wants_digest WHERE message_attributes.message_name = ? END_SQL -- 2.39.5