Description
Benjamin Rokseth
2014-06-02 11:30:44 UTC
Created attachment 28605 [details] [review] This small patch corrects the order of generating notices for issues and returns (checkout/checkin) so that borrower's notices are rendered correctly (for sms,email,etc.) Test plan: 1) Edit SMSSendDriver syspref to use driver 'Test' 2) Edit CHECKOUT template for sms to 'SMS test' 3) select SMS for test patron's messaging prefs for item checkout 4) checkout an item 5) check the table message_queue, verify that template sms is not used (message content is not 'SMS test') 6) apply patch, make new checkout 7) check that message_queue table now has a correctly generated notice with 'SMS test' For a real world test use a real SMS::Send driver and run the cronjob process-message-queue.pl to send messages immediately. Created attachment 28606 [details] [review] Bug 12344 - Multi transport types for issues and checkins This small patch corrects the order of generating notices for issues and returns (checkout/checkin) so that borrower's notices are rendered correctly (for sms,email,etc.) Test plan: 1) Edit SMSSendDriver syspref to use driver 'Test' 2) Edit CHECKOUT template for sms to 'SMS test' 3) select SMS for test patron's messaging prefs for item checkout 4) checkout an item 5) check the table message_queue, verify that template sms is not used (message content is not 'SMS test') 6) apply patch, make new checkout 7) check that message_queue table now has a correctly generated notice with 'SMS test' For a real world test use a real SMS::Send driver and run the cronjob process-message-queue.pl to send messages immediately. Created attachment 36406 [details] [review] Bug 12344 - Multi transport types for issues and checkins This small patch corrects the order of generating notices for issues and returns (checkout/checkin) so that borrower's notices are rendered correctly (for sms,email,etc.) Test plan: 1) Edit SMSSendDriver syspref to use driver 'Test' 2) Edit CHECKOUT template for sms to 'SMS test' 3) select SMS for test patron's messaging prefs for item checkout 4) checkout an item 5) check the table message_queue, verify that template sms is not used (message content is not 'SMS test') 6) apply patch, make new checkout 7) check that message_queue table now has a correctly generated notice with 'SMS test' For a real world test use a real SMS::Send driver and run the cronjob process-message-queue.pl to send messages immediately. http://bugs.koha-community.org/show_bug.cgi?id=12344 Signed-off-by: Sophie Meynieux <sophie.meynieux@biblibre.com> Works as described : - without patch, letter model used is the one for email - with patch, letter model used is the one for sms I think I found an issue, to reproduce: Enable sms + email for checkout, check an item out => no letter is generated. Ok it's a configuration problem, but I think it could easily be fixed if you next instead of return if the template does not exist. good catch, Jonathan! If a patron enables multiple message types, and a message type is missing a template, it would return before processing the remaining types. A simple fix, as suggested, is to use next instead of return Created attachment 36568 [details] [review] Bug 12344 - Multi transport types for issues and checkins This small patch corrects the order of generating notices for issues and returns (checkout/checkin) so that borrower's notices are rendered correctly (for sms,email,etc.) Test plan: 1) Edit SMSSendDriver syspref to use driver 'Test' 2) Edit CHECKOUT template for sms to 'SMS test' 3) select SMS for test patron's messaging prefs for item checkout 4) checkout an item 5) check the table message_queue, verify that template sms is not used (message content is not 'SMS test') 6) apply patch, make new checkout 7) check that message_queue table now has a correctly generated notice with 'SMS test' For a real world test use a real SMS::Send driver and run the cronjob process-message-queue.pl to send messages immediately. http://bugs.koha-community.org/show_bug.cgi?id=12344 Signed-off-by: Sophie Meynieux <sophie.meynieux@biblibre.com> Created attachment 36570 [details] [review] QA followup: skip message type if template is missing Use next instead of return when generating templates. In case patron has enabled a message type that misses a template, next message type will be attempted instead of returning at once. Created attachment 36576 [details] [review] Bug 12344 - Multi transport types for issues and checkins This small patch corrects the order of generating notices for issues and returns (checkout/checkin) so that borrower's notices are rendered correctly (for sms,email,etc.) Test plan: 1) Edit SMSSendDriver syspref to use driver 'Test' 2) Edit CHECKOUT template for sms to 'SMS test' 3) select SMS for test patron's messaging prefs for item checkout 4) checkout an item 5) check the table message_queue, verify that template sms is not used (message content is not 'SMS test') 6) apply patch, make new checkout 7) check that message_queue table now has a correctly generated notice with 'SMS test' For a real world test use a real SMS::Send driver and run the cronjob process-message-queue.pl to send messages immediately. Signed-off-by: Sophie Meynieux <sophie.meynieux@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Created attachment 36577 [details] [review] Bug 12344: QA followup: use next instead of return Use next instead of return when generating templates. In case patron has enabled a message type that misses a template, next message type will be attempted instead of returning at once. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Patches pushed to master. Thanks Benjamin! Pushed to 3.18.x will be in 3.18.6 Just a note Benjamin, you might want to fix your git.author and git.email settings in your vagrant instance. Ive fixed the author in the 3.18.x branch, but its still wrong in master. Ah, I see. It was an old vagrant instance used on the first patch. How do you suggest I change? New patch and obsolete? |