Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: seadhna on May 15, 2020, 17:14:21

Title: Issue with Embedding Tweet if contains icons
Post by: seadhna on May 15, 2020, 17:14:21
Hi, there is an issue with the content editor in Elxis 5.1 whereby if embedding a tweet that contains icons, upon clicking APPLY or SAVE, all content AFTER the icon is lost.
e.g. example tweet featuring an icon: https://twitter.com/peta/status/1261069871531655170
If we click the dropdown to "Embed Tweet" we get this page:
https://publish.twitter.com/?query=https%3A%2F%2Ftwitter.com%2Fpeta%2Fstatus%2F1261069871531655170&widget=Tweet

If we copy the code provided:
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Pacing endlessly behind bars, staring outside their tanks, rocking back and forth, screaming out in distress, starving for affection: a life in captivity is no life at all 💔 <a href="https://t.co/6h2sPyVGRJ">pic.twitter.com/6h2sPyVGRJ</a></p>&mdash; PETA (@peta) <a href="https://twitter.com/peta/status/1261069871531655170?ref_src=twsrc%5Etfw">May 14, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

we can see that it features a broken heart icon.
If we now copy that code into the content editor and click SAVE or APPLY, this code itself is partially lost and all content after were we placed this code is lost.
If we delete the broken heart icon before clicking SAVE or APPLY, the tweet is embedded successfully.
This happens with any icons.
Title: Re: Issue with Embedding Tweet if contains icons
Post by: datahell on May 18, 2020, 22:12:41
It seems a database/PDO issue. The editor has nothing to do with this problem. Maybe the encoding needs to be changed to utf8mb4. Needs debug inorder to tell more.
Title: Re: Issue with Embedding Tweet if contains icons
Post by: seadhna on May 21, 2020, 13:48:59
Hi datahell,
can you advise how to switch to a UTF8mb4 character set?

If it's helpful, this is how the issue was tackled on Drupal and Wordpress:

Drupal: https://www.drupal.org/forum/support/post-installation/2013-07-16/removing-emoji-code
Title: Re: Issue with Embedding Tweet if contains icons
Post by: seadhna on May 21, 2020, 14:22:17
This online tool removes all emojis (they still appear in the tweet on the frontend, it just removes them from the embed code).
http://cloudandfree.com/en/remove_non_ascii.php
(best to remove the asterisk from the field titled: Change characters without an equivalent to:)