-
Notifications
You must be signed in to change notification settings - Fork 480
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foorm: allow emojis in submissions #34868
Conversation
By changing the Foorm::Submission backing table to use utf8mb4 instead of utf8 encoding, we now support emojis in Foorm submissions.
before_validation :strip_emoji_from_answers | ||
|
||
# Drops unicode characters not supported by utf8mb3 strings (most commonly emoji) | ||
# from the submission answers | ||
# We can remove this once our database has utf8mb4 support everywhere. | ||
def strip_emoji_from_answers | ||
# Drop emoji and other unsupported characters | ||
self.answers = answers&.strip_utf8mb4&.strip | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can move this change to a followup PR before merging.
Continue filtering emojis until our change to the table encoding is live.
It's interesting that when building this PR on my local machine, the character-encoding migration generated a text limit of 4294967295 (4 GB), but when we ran the same migration on staging, it generated a At any rate, that staging change was scooped here. |
Followup to the migration in #34868. Now that the migration is live, we can discontinue filtering emojis out of Foorm submissions. Also updates an annotation.
Followup to #34868 which modified DB connection settings causing databases to be created with utf8mb4 by default. This migration should bring settings in existing databases back in sync with the new default.
By changing the
Foorm::Submission
backing table to useutf8mb4
instead ofutf8
encoding, we now support emojis in Foorm submissions.Successful submission as seen in
dashboard-console
:Successful submission seen in facilitator results: