After a derivate is created the maindoc is not the lexicographically first (by filename) file

Description

After a derivate is created the maindoc is not the lexicographically (by filename) first file as it used to be. E.g. if one uploads 11 files the 5th is set as maindoc.

Environment

None

Activity

Show:
Thomas Scheffler
June 10, 2020, 3:37 PM

Must be a bug in org.mycore.frontend.fileupload.MCRUploadHandlerIFS.MainFileFinder#visitFile. Can you give a list of file names that cause this issue?

Silvio Hermann
June 11, 2020, 7:02 AM

2013-05-22-_DSC591722.jpg
2011-08-09-_DSC3710.jpg
2011-10-15-_DSC5114.jpg
2011-10-16-_DSC5164.jpg
2011-10-19-_DSC5650.jpg
2011-10-20-_DSC5775.jpg
2011-10-20-_DSC5812.jpg
2011-10-21-_DSC5818.jpg
2012-02-12-_DSC7973.jpg
2012-03-03-_DSC8095.jpg
2012-05-25-_DSC9377.jpg
2012-08-16-_DSC0427.jpg
2013-05-20-_DSC529720.jpg
2013-05-20-_DSC530120.jpg
2013-05-21-_DSC551321.jpg
2013-05-22-_DSC591222.jpg
2013-05-22-_DSC591322.jpg

2011-10-21-_DSC5818.jpg gets marked as maindoc

Thomas Scheffler
September 9, 2020, 7:20 AM

MCRUploadHandlerIFS is not the source of this problem. This seems to be related to org.mycore.webtools.upload.MCRUploadResource#setDefaultMainFile, as no sorting is done before returning the “first” name.

Assignee

Sebastian Hofmann

Reporter

Silvio Hermann

Labels

None

URL

None

External issue ID

None

Components

Fix versions

Affects versions

Priority

Medium
Configure