After the refactoring in bug 22343 some emails sent from Koha are double encoded, meaning they show us garbled for the email recipient.
Created attachment 113242 [details] [review] Bug 22343: (QA follow-up) Remove double encoding from sent emails The sent emails from Koha were garbled / double encoded because Koha::Email now after the refactoring and moving to use Email::Stuffer handles the encoding itself. Previously the Koha::Email callee had to handle the encoding. This patch removes the double encoding in the email subject and content. To test: 1) Put some UTF-8 characters like ä in the HOLD template subject and body 2) Create hold and check-in an item to make it Waiting and cause the email to be send 3) Notice the email comes garbled / double encoded 4) Apply patch 5) Repeat step 2) and notice the email comes without any issues in encoding and look OK. 6) Make sure "prove t/Koha/Email.t" and "prove t/db_dependent/Letters.t" and passes Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 113243 [details] [review] Bug 22343: Remove double encoding from sent emails The sent emails from Koha were garbled / double encoded because Koha::Email now after the refactoring and moving to use Email::Stuffer handles the encoding itself. Previously the Koha::Email callee had to handle the encoding. This patch removes the double encoding in the email subject and content. To test: 1) Put some UTF-8 characters like ä in the HOLD template subject and body 2) Create hold and check-in an item to make it Waiting and cause the email to be send 3) Notice the email comes garbled / double encoded 4) Apply patch 5) Repeat step 2) and notice the email comes without any issues in encoding and look OK. 6) Make sure "prove t/Koha/Email.t" and "prove t/db_dependent/Letters.t" and passes
Created attachment 113244 [details] [review] Bug 26948: Remove double encoding from sent emails The sent emails from Koha were garbled / double encoded because Koha::Email now after the refactoring and moving to use Email::Stuffer handles the encoding itself. Previously the Koha::Email callee had to handle the encoding. This patch removes the double encoding in the email subject and content. To test: 1) Put some UTF-8 characters like ä in the HOLD template subject and body 2) Create hold and check-in an item to make it Waiting and cause the email to be send 3) Notice the email comes garbled / double encoded 4) Apply patch 5) Repeat step 2) and notice the email comes without any issues in encoding and look OK. 6) Make sure "prove t/Koha/Email.t" and "prove t/db_dependent/Letters.t" and passes
Created attachment 113245 [details] [review] Bug 26948: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(In reply to Tomás Cohen Arazi from comment #4) > Created attachment 113245 [details] [review] [review] > Bug 26948: Regression tests > > Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> As discussed on #koha@freenode IRC channel, the test didn't test this particular issue. This still would benefit from a regression test.
Upping severity here.
Created attachment 113545 [details] [review] Bug 26948: Remove double encoding from sent emails The sent emails from Koha were garbled / double encoded because Koha::Email now after the refactoring and moving to use Email::Stuffer handles the encoding itself. Previously the Koha::Email callee had to handle the encoding. This patch removes the double encoding in the email subject and content. To test: 1) Put some UTF-8 characters like ä in the HOLD template subject and body 2) Create hold and check-in an item to make it Waiting and cause the email to be send 3) Notice the email comes garbled / double encoded 4) Apply patch 5) Repeat step 2) and notice the email comes without any issues in encoding and look OK. 6) Make sure "prove t/Koha/Email.t" and "prove t/db_dependent/Letters.t" and passes Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 113553 [details] [review] Bug 26948: Remove double encoding from sent emails The sent emails from Koha were garbled / double encoded because Koha::Email now after the refactoring and moving to use Email::Stuffer handles the encoding itself. Previously the Koha::Email callee had to handle the encoding. This patch removes the double encoding in the email subject and content. To test: 1) Put some UTF-8 characters like ä in the HOLD template subject and body 2) Create hold and check-in an item to make it Waiting and cause the email to be send 3) Notice the email comes garbled / double encoded 4) Apply patch 5) Repeat step 2) and notice the email comes without any issues in encoding and look OK. 6) Make sure "prove t/Koha/Email.t" and "prove t/db_dependent/Letters.t" and passes Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 113555 [details] [review] Bug 26948: Unit tests
Created attachment 113558 [details] [review] Bug 26948: Remove double encoding from sent emails The sent emails from Koha were garbled / double encoded because Koha::Email now after the refactoring and moving to use Email::Stuffer handles the encoding itself. Previously the Koha::Email callee had to handle the encoding. This patch removes the double encoding in the email subject and content. To test: 1) Put some UTF-8 characters like ä in the HOLD template subject and body 2) Create hold and check-in an item to make it Waiting and cause the email to be send 3) Notice the email comes garbled / double encoded 4) Apply patch 5) Repeat step 2) and notice the email comes without any issues in encoding and look OK. 6) Make sure "prove t/Koha/Email.t" and "prove t/db_dependent/Letters.t" and passes Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 113559 [details] [review] Bug 26948: Regression tests We already mock the send_or_die method from Email::Stuffer; This patch updates that mock to extract the internal representation of the email encoded message and looks for a known double encoded representation of a character in the sample body. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 113560 [details] [review] Bug 26948: Remove double encoding from sent emails The sent emails from Koha were garbled / double encoded because Koha::Email now after the refactoring and moving to use Email::Stuffer handles the encoding itself. Previously the Koha::Email callee had to handle the encoding. This patch removes the double encoding in the email subject and content. To test: 1) Put some UTF-8 characters like ä in the HOLD template subject and body 2) Create hold and check-in an item to make it Waiting and cause the email to be send 3) Notice the email comes garbled / double encoded 4) Apply patch 5) Repeat step 2) and notice the email comes without any issues in encoding and look OK. 6) Make sure "prove t/Koha/Email.t" and "prove t/db_dependent/Letters.t" and passes Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 113561 [details] [review] Bug 26948: Regression tests We already mock the send_or_die method from Email::Stuffer; This patch updates that mock to extract the internal representation of the email encoded message and looks for a known double encoded representation of a character in the sample body. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Ooops, collision.. I've restored your second SO/QA Kyle. So, this isn't my neatest work, but it does at least add a regression test for the content double encoding.. the subject could likely be covered in a similar way but my brain was failing me to see how to check that. Unit tests++
Pushed to master for 20.11, thanks to everybody involved!
missing dependencies for 20.05.x, no backport