pkp-lib
pkp-lib copied to clipboard
Tools to clean old incomplete submissions
Since a couple of releases ago OJS started to show the incomplete submissions for editors. Some editors have asked whether they can remove these and if there is some automatic way of doing it.
Of course there could be legit incomplete submissions included, but maybe we could have at least a command line tool for removing older incomplete submissions from the database?
A command line tool might not be convenient for editors / journal managers. Maybe add an option where the journal manager can enter a time span (in days), after which incomplete submissions are deleted and include the option to never delete them. In my experience, authors sometimes take several days to complete a submission. We usually contact authors of incomplete submissions (not possible via the incomplete submission but via their OJS user profile) after two weeks, just in case they forgot to press the final button. A few days after this, we delete it by hand from the submission list. Maybe an automated reminder two or three days before deletion would also be possible?
@NateWr, do you recall this change? I don't think showing incomplete submissions was an intentional change. Most likely this came with the move to the API/vue.js toolset for submission lists.
https://forum.pkp.sfu.ca/t/list-incomplete-submissions-ojs-3/33515/6
also https://forum.pkp.sfu.ca/t/delete-incomplete-submission/51229 (did not test if that is true)
To clarify, your own incomplete submissions show up in My Queue. Journal Managers and admins see others incomplete submissions in All Active.
This was intentional. If I recall, it was done to help cases where authors get stuck during submission and email the editors for help. Editors wanted to be able to "hop into it" to see for themselves how far the author had gotten.
The All Active list has always been intended as a master list to be used infrequently. However, in conversations at sprints, it seems that many senior editors use it more like a My Queue without requiring them to be assigned.
How and where they should be presented is an open question. I suspect that small journals eager for submissions may want to follow up and encourage the author to complete their submission, but large journals overwhelmed with submissions would probably prefer they are automatically cleaned up and kept out of sight. A separate "incomplete" list might be worth considering down the road.
Anyone who would like to change the default behaviour can do so easily by modifying the parameters passed to the active list. Here's a quick sample plugin to do that (not tested).
I think it is a good feature to have those visible in the listing, but like one of our editors said, it would be nice to be able to easily remove the older ones easily. As I mentioned above, I would be happy with a simple command line tool for the site admins to manage. This is not something journals ask for all the time. Basically a tool with two parameters: context_path and timelimit.
It will probably be a while before we get to submission deletion in our CLI tool, but definitely good to have if you're willing to write the DELETE /submissions/{id}
endpoint.
Not probably something I will have time right now, but can you link an example here of a similar endpoint. Are you simply thinking of extending this https://github.com/pkp/ojs/blob/master/api/v1/submissions/SubmissionHandler.inc.php
Oh, looks like we've already got this in https://github.com/pkp/pkp-lib/blob/master/api/v1/_submissions/PKPBackendSubmissionsHandler.inc.php#L43-L52!
Deleting from a CLI tool would just involve getting the submissions you want then passing each one to the delete method in the service class:
$submissionService = Services::get('submission');
$submissions = $submissionService->getMany(['contextId' => X, 'isIncomplete' => true]);
foreach ($submissions as $submission) {
if (/* submission last modified date or original submission date or something is too old */) {
$submissionService->delete($submission->getId());
}
}
+1 from PKP|PS where we sometimes need to create test/incomplete submissions in client journals and usually delete them right away. In 3.3 it's not possible if created from a JM role (I guess we'll have to be mindful to create them as "author")
+1 from PKP|PS. A journal on 3.3 is looking to clear a significant (25+) number of incomplete submissions done by authors. Logging in as an author for each is rather time-consuming.
We have cases of journals coming from OJS 2 with hundreds of incomplete submissions.
OJS 2 hid these submissions from the editor so they ended up piling up.
I had a request from a hosted client for both a tool to clear multiple incomplete submissions at once and a separate list of incomplete submissions, separate from the archive.
+1 from PKP|PS - had a client with multiple completely blank submissions with no record of who initiated them in the log (is this what happens when the Journal Manager creates them?), making them arduous to clean up.
+1 from PKP|PS client that would like to remove incomplete submissions on multiple journals as well
+1 Also the authors themselves should be have the possibility to delete a submission they started. Currently they can only abort it, which will only save it and return.
Dear community,
What version of OJS that including this release?
Thanks
@polkeskdi this issue is not scheduled against any Milestone, which means it is not planned for any future release.
Thanks @NateWr
Has the community solved the problem about to clean incomplete submissions? I lack the issue from PKP's forum
Thanks again
@polkeskdi no, this has not been solved yet.
To make it easier for people to find, I'm noting references to this issue.
It was covered at the Helsinki 2022 Sprint and the summary can be read at: https://pkp.sfu.ca/2022/08/05/helsinki-2022-sprint-notes-released-cleaning-incomplete-submissions/
There is a PR at https://github.com/pkp/ojs/pull/3431
Also, we have this comment related to the issue of incomplete submissions no longer showing to editors by default: https://github.com/pkp/pkp-lib/issues/7495#issuecomment-1205451057
When you solve this problem? When users Journal Manager can delete incomplete submissions or any submissions with simple way!
Any updates on this?
How could such submissions be deleted or archived? They appeared after upgrade.
@01Kuzma, I assume you're asking about OJS; what version did you upgrade from, and what version did you upgrade to?
@asmecher , sorry, I supposed this issue is about OJS. Current version is 3.3.0.8 There were multiple upgrades, but another person was executing them, so I've now observed such issues. The latest upgrades were done in a following order: 2.4.6.0 -> 2.4.8.3 -> 3.2.1.3 -> 3.3.0.8
I would really like to have this feature too!!! After a period of journal operation, too many incomplete submissions in queue, we cannot confirm this state all the time. Moreover, the author may have uploaded junk files taking up our storage space. It is recommended to add a function to automatically delete these useless submissions while a period of time.
Hi @asmecher @NateWr
We are using OJS-3.3.0-14
and we have successfully upgraded to OJS-3.4.0-3
. Please suggest how to use this Delete Incomplete Submission code, if we can use this code in any of the above-mentioned versions. The All active
tab is very heavy due to incomplete submission.
The Delete Incomplete Submission tool is not working for our 3.3.0-15 version, the error thrown is Class 'APP\core\Application' not found. If I compare deleteSubmissions.php
code in the Git repository with what I have installed in 3.3.0-15, I can see use APP\facades\Repo;
and \APP\core\Application
calls that are probably new in OJS 3.4?
@aleskl, that code is written to be used with 3.4.0, not 3.3.0; we've added namespaces and made numerous other changes to our conventions to make them more modern since 3.3.0 was released.
Hello team, @asmecher we are running 3.4.0.3. I downloaded deleteIncompleteSubmissions.php and tried running php tools/deleteIncompleteSubmissions.php 600 --dryrun and ran into two issues.
- PHP Warning: require(ojs/tools/bootstrap.inc.php): Failed to open stream: No such file or directory in ojs/tools/deleteIncompleteSubmissions.php on line 18 which I mitigated by changing Line 18 to "bootstrap.php" instead of "bootstrap.inc.php" -- this looks like a future or pending change to rename to bootstrap.inc.php?
- PHP Fatal error: Uncaught Error: Call to undefined method APP\submission\Repository::getMany() in ojs/tools/deleteIncompleteSubmissions.php:86 which I am unsure on how to debug. Is something else out of sync on my instance? Any intuitions? Thank you!