Problem/Motivation
When uploading files that have non-ASCII characters in their filename the cloudinary database storage module cannot save them. The public_id column of the cloudinary_storage table is defined as a varchar_ascii type, which results in the following error when using non-ASCII characters:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '=': SELECT "cs".* FROM "cloudinary_storage" "cs" WHERE "public_id" = :db_condition_placeholder_0 LIMIT 1 OFFSET 0; Array ( [:db_condition_placeholder_0] => ) in Drupal\cloudinary_storage_db\CloudinaryStorageDb->load() (regel 69 van /code/web/modules/contrib/cloudinary/modules/cloudinary_storage/modules/cloudinary_storage_db/src/CloudinaryStorageDb.php).
Steps to reproduce
- Enable the cloudinary_storage_db module
- Upload a to Cloudinary using non-ASCII characters (e.g. é) in the filename
- Select the file in a cloudinary media entity
Proposed resolution
Change the column type of cloudinary_storage.public_id to varchar.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | cloudinary-3479908-2.patch | 1.49 KB | klaasvw |
Issue fork cloudinary-3479908
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
klaasvw commentedThe attached patch changes the column type to varchar.