Duplicate file check missing

Created on 24 February 2015, about 10 years ago
Updated 26 November 2024, 4 months ago

If you attempt to add a duplicate url, a sql exception is thrown. See below:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'oembed://...' 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, [error]
:db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7);

The expected behavior would be to check if the file already exists before attempting to add again.

This can be accomplished by sending TRUE to function file_uri_to_object on line 854 of oembed.module as shown below:

$file = file_uri_to_object($uri, TRUE);
πŸ› Bug report
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States uberhacker

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    I'm closing it because the issue was created a long time ago without any further steps.

    if you still need it then raise a new one.
    thanks

Production build 0.71.5 2024