Submission track names of files

It isn’t solved, video above shows different cases and in only one case renaming works.
Where are settings in database for Review or for workflow that I could check?

Oh, I see – I could reproduce it – I’ll take a look, why is that happening… :open_mouth:

I am fairly sure that the problem you have is not related to the issue I mentioned. That is solved simply by going to the Workflow => Review settings page and pressing save. Your issue is definitely something different.

Hi @knjigor

You can follow the issue in GitHub: File revision names · Issue #2235 · pkp/pkp-lib · GitHub. – I made a fix, but I am not sure if it will be merged like that – I asked other team members to take a look. However, if you need it immediately, you could either change it like that, or just for your case remove this:

&& $submissionFile->getName($submissionLocale) == $submissionFile->_generateName()

from this code line: https://github.com/pkp/pkp-lib/blob/master/classes/submission/SubmissionFileDAODelegate.inc.php#L104.

Thanks a lot!
Bozana

Hi @bozana
Thank You for help,

I have tried patch from pkp/pkp-lib#2235 fix file revision names by bozana · Pull Request #2455 · pkp/pkp-lib · GitHub and naming of files is now correct but there is problem with uploading form. We get HTTP error without possibility of continuing submission (file upload), only thing possible is to close uploading form, but after refreshing page it seems that files are deployed to server and registered in database, so it is generally working, but I think that it would be confusing to authors.

and after refresh

@knjigor
Hmmm… strange… this shouldn’t happen because of that chnge… maybe something else… Could it be that permissions on the files folder are not correct?
:-\

No, all permissions are ok, without that change every thing is fine, second patch didn’t work either, same error.

If I apply second fix system doesn’t load files and form at all:

@knjigor, what do you mean with second patch?

I meant this part here

Hmmm…
So, originally you had these code lines in the lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php, function insertObject:

if (!$submissionFile->getName(AppLocale::getPrimaryLocale())) {
if ($reviewStage) {
$submissionFile->setName($submissionFile->_generateName(true), AppLocale::getPrimaryLocale());
} else {
$submissionFile->setName($submissionFile->_generateName(), AppLocale::getPrimaryLocale());
}
} else {
if ($reviewStage && $submissionFile->getName(AppLocale::getPrimaryLocale()) == $submissionFile->_generateName()) {
$submissionFile->setName($submissionFile->_generateName(true), AppLocale::getPrimaryLocale());
}
}

Correct?
If you change them to be like this:

if (!$submissionFile->getName(AppLocale::getPrimaryLocale())) {
if ($reviewStage) {
$submissionFile->setName($submissionFile->_generateName(true), AppLocale::getPrimaryLocale());
} else {
$submissionFile->setName($submissionFile->_generateName(), AppLocale::getPrimaryLocale());
}
} else {
if ($reviewStage) {
$submissionFile->setName($submissionFile->_generateName(true), AppLocale::getPrimaryLocale());
}
}

Does the file upload works correctly?

If I change it like that then it works, if I change it like in this patch pkp/pkp-lib#2235 fix file revision names by bozana · Pull Request #2455 · pkp/pkp-lib · GitHub it doesn’t work.
With this change

files does have authors usernames in names but on uploading second revision filename is changed to uploader role name and it is changed when submission is sent to review. It is same if SecEd is sending file to review without uploading new file.

I think that this is solved

The patch contains $submissionLocale, which is slightly different from what you have – the original 3.0.2 release. So if you change it to be like this:

if ($reviewStage) {
$submissionFile->setName($submissionFile->_generateName(true), AppLocale::getPrimaryLocale());
} else {
$submissionFile->setName($submissionFile->_generateName(), AppLocale::getPrimaryLocale());
}
Does it work?

Yes that way it works correctly.

OK, glad to hear… :slight_smile:

@bozana
…And I have just founded another bug related to this, If user selects another language for submission form he cannot pass file uploading process if he doesn’t enter (copy paste) name to primary locale (OJS3: uploading submission files in multilingual installations: does the file name have to be localized?)
Our primary locale is Serbian Cyrillic

Hi @knjigor,

I believe that’s this issue: OJS3: uploading submission files in multilingual installations: does the file name have to be localized?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, that is solved, s. the GitHub Issue for the patch: [OJS] Localised filenames complicate uploading submission files in multilingual journals · Issue #2114 · pkp/pkp-lib · GitHub

@bozana @asmecher
Hi, I have tried to apply this patch Merge pull request #2333 from bozana/2114-stable · pkp/pkp-lib@745fe00 · GitHub (I guess that this is the one, or am I wrong) but when I go to Submit an Article page as author form for uploading files doesn’t load, it stay on page with loading sign.

Using this commit Comparing b9a95026f5514fbdd08ac684bda2382e27f6d65c...9d3f6a8aad89a45085092e9334294e4b03bd6132 · pkp/pkp-lib · GitHub every thing works