Can't upload file with name including characters like ü,ä,ö

Created on 5 December 2024, 5 months ago

Problem/Motivation

Our customer tries to upload a file and it has the word 'für' in it. This needs to be checked and replaced instead if throwing an "General error: 1267 Illegal mix of collations" error.

Steps to reproduce

  • Activate the 2.0.2 version of the module
  • upload a file with the name "für.zip"

Proposed resolution

Add the check into the uploadIdFromFileId function in the FileFormAlterBase.php line 131

$resup_file_id = iconv('UTF-8', 'ASCII//TRANSLIT', $resup_file_id);

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇦🇹Austria eameyers

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @eameyers
  • Merge request !16add replace for special characters → (Open) created by Unnamed author
  • Status changed to RTBC about 1 month ago
  • 🇨🇿Czech Republic parisek

    I have same issue within Media upload (using also entity_usage) and this patch helped, thank you, making RTBC

    Drupal\Core\Entity\EntityStorageException: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '=': DELETE FROM "entity_usage" WHERE ("source_id_string" = :db_condition_placeholder_0) AND ("source_type" = :db_condition_placeholder_1); Array ( [:db_condition_placeholder_0] => 1-1154103-1742542846810-Obrázek_test.png [:db_condition_placeholder_1] => file_resup )

  • 🇳🇱Netherlands ricovandevin

    We also ran into this issue. The patch in #2 properly applies and resolves the issue!

Production build 0.71.5 2024