Issue #2713761 by ckng: File deduplication broken + PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry