TexasDigitalLibrary / Vireo

Vireo is a turnkey Electronic Thesis and Dissertation (ETD) Management System.
https://texasdigitallibrary.atlassian.net/wiki/spaces/VUG/pages/87490642/About
GNU General Public License v2.0
46 stars 35 forks source link

Present uploader name rather than submission owner name under ALL FILES Name field #1960

Closed smutniak closed 1 month ago

smutniak commented 1 month ago

Vireo3 shows the name of the uploader for a submission's documents. Vireo4 lists under ADD FILES Name field (in view page) the name of the submitter rather than the file uploader. This is hardcoded in line 77 of src/main/webapp/app/views/admin/view.html

This is a request of an admin from one of the TDL hosted sites.

smutniak commented 1 month ago

If i, as admin@tdl.org, upload a file on an existing submission i am properly credited with the upload. This information seems to be coming from service/AssetService.java and ActionLogRepo.java as the user name is taken from an action_log query. Even though the migration properly populates the user_id in action_log this does not get picked up for prior files. I notice the message ' // current best hack to identify the user whom originally uploaded the file' which leads me to believe this feature is not complete.

smutniak commented 1 month ago

Upon further investigation there are 2 causes of this problem which result in the uploader name coming from the the default in view.html. The problem is in the AssetService.java file

  1. the 'fileIdentifier 'current best hack' line - this is not needed and the findBySubmissionIdAndEntryLikeAndBeforeActionDate method should just used 'name'
  2. the creationDate.setTimeInMillis(attr.creationTime().toMillis()) line which comes from the actual unix file datestamp and sets the time to filter by - in cases where data has been migrated from V3 the file date will be later than the date expressed in action_log

The solution is to, in all cases, remove the fileIdentifier hack. The second thing to fix this is either to change the creationDate.setTimeInMillis to zero (creationDate.setTimeInMillis(0);) OR, create a ruby script to go through each action log representing a file upload and set the unix timestamp accordingly.