One of my clients has found that if the same image is uploaded twice, the error below occurs. Seems to be based on having duplicated file name.

Not sure if this error is specific to Media Gallery as this issue seems to discuss something similar

Any suggestions?

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uri': INSERT INTO {file_managed} (uid, filename, uri, filemime, filesize, status, timestamp, type) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => 86 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => application/octet-stream [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1363030206 [:db_insert_placeholder_7] => default ) indrupal_write_record() (line 7106 of/var/sites/r/xxx/public_html/includes/com


Moloc’s picture

That is usually not a media_gallery issue. All files, which are uploaded, are stored through drupal. If a file already exists, drupal core will rename it to a unique file. So i mark this a a dupplicate of your mentioned issue #1163740.