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

  1. Enable the cloudinary_storage_db module
  2. Upload a to Cloudinary using non-ASCII characters (e.g. é) in the filename
  3. Select the file in a cloudinary media entity

Proposed resolution

Change the column type of cloudinary_storage.public_id to varchar.

CommentFileSizeAuthor
#3 cloudinary-3479908-2.patch1.49 KBklaasvw

Issue fork cloudinary-3479908

Command icon 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

klaasvw created an issue. See original summary.

klaasvw’s picture

Status: Active » Needs review
StatusFileSize
new1.49 KB

The attached patch changes the column type to varchar.

  • lquessenberry committed a957eb0a on 3.0.x
    Merge !32 — thanks @instromaniac (#3479908).
    
    Change cloudinary_storage....

  • lquessenberry committed a957eb0a on 3428387-d11-maintenance
    Merge !32 — thanks @instromaniac (#3479908).
    
    Change cloudinary_storage....