Removing a galley does not delete associated submission_files

Describe the issue or problem
When removing a galley, should the submission_files associated with the galley be deleted? Not deleting the files is a problem, especially in terms of available server space, for installations that contract with an external web service provider.

What application are you using?
OJS 3.4.0-8

Additional information
Files remain on the server without being deleted.


The log file has not reported any errors

Hi @sbir,

I think it might depend on how you went about deleting the files?
There is a way to delete them all documented here: https://docs.pkp.sfu.ca/dev/documentation/en/submission-files#submission-file-repository

-Roger
PKP Team

Good afternoon Roger,
I am testing a clean version of OJS 3408, and I have found that the files associated with a galley are not deleted, when I think they should be. I wonder if the function Repo::galley()->delete($galley) in /lib/pkp/classes/Repository.php lines: 190-207 is OK.
This is as written:
// Delete related submission files
$submissionFiles = Repo::submissionFile()
->getCollector()
->filterByAssoc(Application::ASSOC_TYPE_GALLEY)
->filterByFileIds([$galley->getId()])
->getMany();
And, what I’m wondering is if it shouldn’t be this other:
// Delete related submission files
$submissionFiles = Repo::submissionFile()
->getCollector()
->filterByAssoc(Application::ASSOC_TYPE_GALLEY,[$galley->getId()])
->getMany();

I’ve tested it with that change and now it has indeed deleted the files from the server, including all dependencies and revisions if any

Carlos

1 Like

Hi @sbir,

Thanks for reporting back. @asmecher - might this be something you and/or the dev team want to have a look at?

-Roger
PKP Team

Hi @sbir,

Thanks for the details, and for the proposed fix! I can confirm that it’s correct. I’ve filed and fixed this at the following github issue:

https://github.com/pkp/pkp-lib/issues/10758

The fix will be included in the next release of 3.4.0-x.

Regards,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 10 days. New replies are no longer allowed.