Description
Stéphane Delaune
2013-01-09 11:31:25 UTC
Created attachment 14487 [details] [review] proposed patch Created attachment 14488 [details] [review] proposed patch for 3.8 This patch appears to be stripping all whitespace from messages: Example before patch: Dear Henry Acevedo, <a href="#">test</a> You have a hold available for pickup as of 2013-01-11. This hold will expire if it is not picked up before 01/18/2013. If you no longer need this item or have any questions please contact us : Title: Learning Perl Author: Schwartz, Randal L 005.13/3 Location: Centerville Example after patch: DearHenryAcevedo,<ahref="#">test</a>Youhaveaholdavailableforpickupasof2013-01-11.Thisholdwillexpireifitisnotpickedupbefore01/18/2013.Ifyounolongerneedthisitemorhaveanyquestionspleasecontactus:Title:LearningPerlAuthor:Schwartz,RandalL005.13/3Location:Centerville Created attachment 14546 [details] [review] Bug 9372 - Automatic carriage return in message_queue where content_type is html - Followup The patch for bug 9372 causes all whitespace to be stripped from a message. This is because the $content variable was previously loaded with the content and then stripped of whitespace to determine if the message had any text. The previous patch for 9372 then used the $content variable as if it were the original unmodified content of the message. Created attachment 14547 [details] [review] [SIGNED-OFF] Bug 9372 : replace \n with <br /> for html messages in message_queue Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 14548 [details] [review] Bug 9372 - Automatic carriage return in message_queue where content_type is html - Followup The patch for bug 9372 causes all whitespace to be stripped from a message. This is because the $content variable was previously loaded with the content and then stripped of whitespace to determine if the message had any text. The previous patch for 9372 then used the $content variable as if it were the original unmodified content of the message. Created attachment 14549 [details] [review] [SIGNED-OFF] Bug 9372 : replace \n with <br /> for html messages in message_queue [3.8.x] Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> This patch will need a sign off before it can be QAed. Looks like the follow-up still needs to be signed off? But it doesn't have a test plan, so please add one. I was wondering about this patch. If we automatically change evey line break to be a <br/> tag, wouldn't that be confusing when creating html messages? Normally when you make a line break in HTML code this has no effect on the layout later? Created attachment 20062 [details] [review] Bug 9372 : Replaces carriage return with <br /> in printed html files for overdues. For pdf generation, html files need explicit <br /> html tags. With this patch, carriage return are replaced by <br /> when letters are written into html files. Test plan : - Ensure you've got at least one reader with overdue triggering notice - Ensure that your notice template got html checked - Run misc/cronjobs/overdue_notices.pl -v -n -html <dirname> and misc/cronjobs/printoverdues.sh <dirname> Without patch, the content of the letter is all on one line in pdf file With the patch, pdf file is correctly formated - remove your reader email - Run misc/cronjobs/overdue_notices.pl -v -html <dirname> and misc/cronjobs/printoverdues.sh <dirname> Without patch, the content of pdf file is all on one line with the patch, pdf file is correctly formated. - restore reader email - run misc/cronjobs/overdue_notice.pl -v -html <dirname> Verify that the a message has been generated in message_queue table With or without patch, the message is the same To take Kratin's comment into account, I propose this new patch that changes carriage returns with <br /> only in printed files if paramter file format is html. Created attachment 20071 [details] [review] Bug 9372 : Replaces carriage return with <br /> in printed html files for overdues. For pdf generation, html files need explicit <br /> html tags. With this patch, carriage return are replaced by <br /> when letters are written into html files. Test plan : - Ensure you've got at least one reader with overdue triggering notice - Ensure that your notice template got html checked - Run misc/cronjobs/overdue_notices.pl -v -n -html <dirname> and misc/cronjobs/printoverdues.sh <dirname> Without patch, the content of the letter is all on one line in pdf file With the patch, pdf file is correctly formated - remove your reader email - Run misc/cronjobs/overdue_notices.pl -v -html <dirname> and misc/cronjobs/printoverdues.sh <dirname> Without patch, the content of pdf file is all on one line with the patch, pdf file is correctly formated. - restore reader email - run misc/cronjobs/overdue_notice.pl -v -html <dirname> Verify that the a message has been generated in message_queue table With or without patch, the message is the same Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 21003 [details] [review] Bug 9372 : Replaces carriage return with <br /> in printed html files for overdues. For pdf generation, html files need explicit <br /> html tags. With this patch, carriage return are replaced by <br /> when letters are written into html files. Test plan : - Ensure you've got at least one reader with overdue triggering notice - Ensure that your notice template got html checked - Run misc/cronjobs/overdue_notices.pl -v -n -html <dirname> and misc/cronjobs/printoverdues.sh <dirname> Without patch, the content of the letter is all on one line in pdf file With the patch, pdf file is correctly formated - remove your reader email - Run misc/cronjobs/overdue_notices.pl -v -html <dirname> and misc/cronjobs/printoverdues.sh <dirname> Without patch, the content of pdf file is all on one line with the patch, pdf file is correctly formated. - restore reader email - run misc/cronjobs/overdue_notice.pl -v -html <dirname> Verify that the a message has been generated in message_queue table With or without patch, the message is the same Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Pushed to master. Thanks, Sophie! This patch has been pushed to 3.12.x, will be in 3.12.7. Thanks Sophie! As in Bug 11173 it was decided to write full html in letter models, this patch should be reverted, because models in html already contains <br /> tags Forget my last comment, it is done by Bug 12294 |