PauloV Posted February 18, 2014 Report Posted February 18, 2014 (edited) Hello, Problem: Describe the issue you're experiencing: Reciving/Importing emails to Tickets, removes special characters like Latin Characters (á|ã|â|à|é|è|ê|í|ì|î|ó|ò|ô|õ|ú|ù|û|) Provide detailed steps necessary to reproduce the issue: Send an email to Blesta import with characters like por exemple á|ã|â|à|é|è|ê|í|ì|î|ó|ò|ô|õ|ú|ù|û| Solution: After days testing, tracing and debuging, we finally detect the issues: 1º First problem detected: On file plugins/support_manager/vendors/html2text/html2text.class.php we have fount that characters encoded as html are being removed by the line 187: '/&[^&;]+;/i', // Unknown/unhandled entities and on line 239: '', // Unknown/unhandled entities We have coment this two lines to not remove the encoded characters like so: change to, on line 187: //'/&[^&;]+;/i', // Unknown/unhandled entities change to, on line 239: '', // Unknown/unhandled entities ///////////////////////////////////////////////////////////////////////////// Small extra note and fix: If you whant to see break lines on Tickets (I sure you do ), just do this also on this file: find on the same file on line 147: "/[\n\t]+/", // Newlines and tabs change to: "/[\t]+/", // Tabs ///////////////////////////////////////////////////////////////////////////// 2º Second problem detected: We have detected that html_entity_decode was not being used on body and subject of the email to translate special characters, so to fix it do: Open file: plugins\support_manager\components\email_parser\email_parser.php find on line 174: // Prefer conversion using iconv, but if the character set is not change to: // Decode encoded characters $text = html_entity_decode($text); // Prefer conversion using iconv, but if the character set is not 3º The final problem detected, is that the class html2text was being called one second time from "vendors\html2text\" directory, and its not nedded, causing more problems than fixing them Open file: plugins\support_manager\views\default\admin_tickets_reply.pdt find on line 186: <?php echo $this->TextParser->encode("markdown", $this->Html->_($reply->details, true));?> change to (this fix also fixes the breaklines issue): <?php echo nl2br($this->Html->_($reply->details, true));?> Open file: plugins\support_manager\views\default\client_tickets_reply.pdt find on line 137: <?php echo $this->TextParser->encode("markdown", $this->Html->_($reply->details, true));?> change to (this fix also fixes the breaklines issue): <?php echo nl2br($this->Html->_($reply->details, true));?> And thats it I hope this will help outhers. Blesta can close this issue Regards, PV Edited February 25, 2014 by Paulo V PauloV 1
PauloV Posted February 18, 2014 Author Report Posted February 18, 2014 (edited) Hello again Found a solution Solution: open plugins/support_manager/vendors/html2text.class.php Update with a fix, on the first post. Edited February 25, 2014 by Paulo V
PauloV Posted February 18, 2014 Author Report Posted February 18, 2014 (edited) there is some more bugs that we detected. will investigate more than post here. the latest bug is on pipe retuning: Object of class MimeMailParser could not be converted to string on line 124 /home/username/public_html/blesta/lib/model.php Update with a fix, on the first post. Edited February 25, 2014 by Paulo V
Tyson Posted February 18, 2014 Report Posted February 18, 2014 Please limit 1 bug report per thread following the criteria on How to Report a Bug.
PauloV Posted February 18, 2014 Author Report Posted February 18, 2014 Please limit 1 bug report per thread following the criteria on How to Report a Bug. Sorry I will edit the content above. Regards, Paulo V
PauloV Posted February 25, 2014 Author Report Posted February 25, 2014 Hello, Issue fixed See first post for the detail solution. Regards, PV
Tyson Posted February 25, 2014 Report Posted February 25, 2014 Your solution makes several changes that I'm not sure are necessary, particularly removing support for Markdown from ticket replies. I've added CORE-1074 to investigate the issue.
PauloV Posted February 25, 2014 Author Report Posted February 25, 2014 Your solution makes several changes that I'm not sure are necessary, particularly removing support for Markdown from ticket replies. I've added CORE-1074 to investigate the issue. Hello, Thanks We wil check also the "Markdown" to see any outher solution Regards, PV
Cody Posted February 26, 2014 Report Posted February 26, 2014 If you can provide a demonstration of the issue by pasting the email with all Headers, we can investigate and come up with a workable solution. As it is, I don't think we can use any of your proposed solutions.
PauloV Posted February 26, 2014 Author Report Posted February 26, 2014 Hello, I have send you a PM Thanks again for all your help. regards, PV
Recommended Posts