Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding emojis to Annotations breaks annotations #14516

Closed
CodeAndWeb opened this issue Jun 7, 2019 · 3 comments
Closed

Adding emojis to Annotations breaks annotations #14516

CodeAndWeb opened this issue Jun 7, 2019 · 3 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@CodeAndWeb
Copy link

Adding an emoji to the annotation text breaks the annotations view and does not show any annotations.

Reproduce: Create an annotation with an emoji. E.g. "This kills your annotations 馃挘馃挘馃挘"

What happens?

The annotations are serialized and inserted in to the matomo_option table. But the serialized string is truncated at the first emoji. This is because utf8_general_ci is limited in the character range. The values can't be retrieved from the database.

Manual fix for users:

Find the entry < site id>_annotations in the matomo_option and fix the serialized php data set. Replace < site id> with the id of your site.

Fix:

My preferred solution would be to use utf8mb4_general_ci instead - this should support all characters.

@Findus23
Copy link
Member

Findus23 commented Jun 7, 2019

My preferred solution would be to use utf8mb4_general_ci instead - this should support all characters.

That's the plan (#9785), but as it is a breaking change and may take a while to upgrade this can only be done in Matomo 4

@tsteur
Copy link
Member

tsteur commented Jun 7, 2019

Was just going to mention the same. Will mark it as a duplicate.

@tsteur tsteur closed this as completed Jun 7, 2019
@tsteur tsteur added the duplicate For issues that already existed in our issue tracker and were reported previously. label Jun 7, 2019
@CodeAndWeb
Copy link
Author

CodeAndWeb commented Jun 7, 2019

A non breaking change would be to check the strings for invalid characters and report an error instead of corrupting the database with an invalid entry and trashing all existing annotations.

Not everybody is able to change the database content and fix the broken php data.

This is not just a small inconvenience that the entries are not displayed - they are simply lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

3 participants