Steps to reproduce:

I added a image to my site (/admin/content/media, then clicked the Add link).

Tried to use it in a node with CKEditor - that didn't work too well coz I didn't want to use an absolute path and the image wouldn't show using a relative path (e.g. ./sites/.../image.jpeg and various variations of this). I then tried to remove it from the list of media. Drupal wouldn't let me delete it "because the image is in use".

It was not in use - I did not save the node.

I then wen't to the backend and removed the image file from the file system after which the following exception occured:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'public://snowman.jpg' 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] => 5 [:db_insert_placeholder_1] => snowman.jpg [:db_insert_placeholder_2] => public://snowman.jpg [:db_insert_placeholder_3] => image/jpeg [:db_insert_placeholder_4] => 18376 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1355591603 [:db_insert_placeholder_7] => image ) in drupal_write_record() (line 7036 of includes/common.inc).

Comments

ench0’s picture

Correction: the exception occured when I tried to upload the same image again.

adamdicarlo’s picture

Is this issue still relevant? This is not Drupal core's issue queue.

davidwbarratt’s picture

Project: » D7 Media
Version: » 7.x-2.x-dev
Chris Matthews’s picture

Status: Active » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team