Loris: [Raisinbread] Duplicate filenames inserted into the document repository

Created on 25 Jun 2020  路  3Comments  路  Source: aces/Loris

One of the raisinbread files is inserting files with identical names into the document repository. This goes against point 13 of the test plan and is creating issues when trying to access one of those files via Database->pSelectOne because the results return more than one row which throws an exception.

To Reproduce
Steps to reproduce the behavior (attach screenshots if applicable):

  1. For a raisinbread install, go to tools > document repository
  2. Observe different files with identical names:
    test.txt , bread-fod-healthy-breakfast.jpg are duplicated twice, test.pdf and test_test.txt 3 times each.

Changing the names of the files in the SQL file here should resolve this issue.

What did you expect to happen?
Only files with uniquer file names to be permitted.

Server Environment (if known):
_Note: We only support the most recent release of LORIS._

  • LORIS Version: 23.0 and master branch
  • Linux distribution and Version: Ubuntu 16.04
  • MySQL/MariaDB Version: MySQL 5.7
Bug RaisinBread

All 3 comments

@maltheism Were you working on this? I remember we had an extended conversation about handling duplicate filenames and I think it was for this module but I can't remember how it resolved

@johnsaigle I worked on preventing duplicate files with the issue_tracker attachment feature. The solution was to use the hash from the file content for preventing duplicate files being stored on the backend but also to allow multiple same files as attachments on the frontend. It also allowed files with different content but the same file names to exist without issues.

@johnsaigle I don't think the problem is in the module (document repository). The module handles duplicate file names well (according to its test plan, duplicate file names are not allowed) when I tried to manually upload several documents with the same name. The problem here is, if you check the SQL file linked in the description, it momentarily disables foreign key constraints, adds the data (which contains) duplicate names then sets it back on.

Was this page helpful?
0 / 5 - 0 ratings