Emojis submitted to CiviCRM API cause issues
Problem/Motivation
Emojis that are submitted to custom fields cause an issue upon webform submission.
Detailed steps to reproduce
- Set up a simple webform event registration form, e.g. first name, last name, and a custom attendee-specific custom field (multi-line text box / textarea).
- Put
👍🏻 into the custom field - Error message: The website encountered an unexpected error. Please try again later.
Alongside every form submission with emojis, the log contains two related entries:
webform_submission
CRM_Core_Exception: DB Error: unknown error in civicrm_api3() (line 135 of /var/www/[SITE]/vendor/civicrm/civicrm-core/api/api.php).
php
Drupal\Core\Entity\EntityStorageException: DB Error: unknown error in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of /var/www/[SITE]/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Proposed resolution
Successful submission of text that contains emojis.
Further context
Moved from webform_civicrm
issue 3331605.