pkp-lib icon indicating copy to clipboard operation
pkp-lib copied to clipboard

Tools to clean old incomplete submissions

Open ajnyga opened this issue 5 years ago • 39 comments

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?

ajnyga avatar Feb 26 '19 08:02 ajnyga

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?

heike-r avatar Feb 26 '19 08:02 heike-r

@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.

asmecher avatar Feb 26 '19 18:02 asmecher

https://forum.pkp.sfu.ca/t/list-incomplete-submissions-ojs-3/33515/6

ajnyga avatar Feb 26 '19 19:02 ajnyga

also https://forum.pkp.sfu.ca/t/delete-incomplete-submission/51229 (did not test if that is true)

ajnyga avatar Feb 26 '19 19:02 ajnyga

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).

NateWr avatar Feb 27 '19 11:02 NateWr

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.

ajnyga avatar Feb 27 '19 11:02 ajnyga

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.

NateWr avatar Feb 27 '19 11:02 NateWr

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

ajnyga avatar Feb 27 '19 11:02 ajnyga

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());
  }
}

NateWr avatar Feb 27 '19 13:02 NateWr

+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")

librariam avatar Jul 02 '21 19:07 librariam

+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.

librariam avatar Jul 26 '21 14:07 librariam

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.

diegoabadan avatar Sep 20 '21 20:09 diegoabadan

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.

amandastevens avatar Nov 26 '21 20:11 amandastevens

+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.

emmauhl avatar Dec 10 '21 23:12 emmauhl

+1 from PKP|PS client that would like to remove incomplete submissions on multiple journals as well

pmangahis avatar Feb 10 '22 18:02 pmangahis

+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.

zuphilip avatar Apr 07 '22 11:04 zuphilip

Dear community,

What version of OJS that including this release?

Thanks

polkeskdi avatar Jun 20 '22 01:06 polkeskdi

@polkeskdi this issue is not scheduled against any Milestone, which means it is not planned for any future release.

NateWr avatar Jun 20 '22 15:06 NateWr

Thanks @NateWr

Has the community solved the problem about to clean incomplete submissions? I lack the issue from PKP's forum

Thanks again

polkeskdi avatar Jun 21 '22 00:06 polkeskdi

@polkeskdi no, this has not been solved yet.

NateWr avatar Jun 21 '22 08:06 NateWr

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

diegoabadan avatar Aug 17 '22 18:08 diegoabadan

When you solve this problem? When users Journal Manager can delete incomplete submissions or any submissions with simple way!

cordoba3030 avatar Dec 28 '22 17:12 cordoba3030

Any updates on this?

How could such submissions be deleted or archived? They appeared after upgrade. image

01Kuzma avatar Aug 18 '23 13:08 01Kuzma

@01Kuzma, I assume you're asking about OJS; what version did you upgrade from, and what version did you upgrade to?

asmecher avatar Aug 18 '23 19:08 asmecher

@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

01Kuzma avatar Aug 19 '23 07:08 01Kuzma

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.

chunghanlien avatar Aug 21 '23 10:08 chunghanlien

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.

shantanu198713 avatar Sep 01 '23 05:09 shantanu198713

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 avatar Sep 22 '23 10:09 aleskl

@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.

asmecher avatar Sep 22 '23 16:09 asmecher

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.

  1. 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?
  2. 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!

wilsonww avatar Oct 17 '23 17:10 wilsonww