Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@im-shivamb
Copy link

References

Description

Remove workflow groups associated with a collection when the collection is deleted.

Instructions for Reviewers

• Delete a collection that has one or more workflow groups assigned.
• Verify that the associated workflow groups are also removed from the database.
• Confirm that no other collections or unrelated workflow groups are affected.
• Check for proper handling in both UI and backend.

List of changes in this PR:

• Updated CollectionServiceImpl.java to remove workflow groups linked to a collection when the collection is deleted.

How to Test

  1. Log in as a site admin.
  2. Create a new collection and assign roles (reviewer/editor/final-editor) to users.
  3. Deposit items, ensuring some enter the workflow.
  4. Open the Edit Collection panel and delete the collection.
  5. Verify that the workflow groups associated with the deleted collection are removed.
  6. Confirm that other collections and their workflow groups remain unaffected.

@tdonohue tdonohue added bug high priority component: workflow Related to approval workflow or configurable workflow 1 APPROVAL pull request only requires a single approval to merge. labels Oct 9, 2025
@tdonohue tdonohue added port to main This PR needs to be ported to `main` branch for the next major release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release labels Oct 9, 2025
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release Oct 9, 2025
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@im-shivamb : Thanks for the PR. Unfortunately, though, I'm not able to reproduce the bug that this is supposed to fix. On a DSpace 7.6.x site, I've tried the following:

  1. Create a new Collection
  2. Add two Role groups to that Collection (I used ADMIN and SUBMIT). Add a few EPersons to each group.
  3. Note down the names of both groups. Verify they can be found through the "Access Control" -> "Groups" admin menu
  4. Now, Delete the Collection.
  5. Go back to "Access Control" -> "Groups" and search for the two groups. They are both gone.

Basically, I'm not sure this bug exists anymore. Or maybe I don't understand how to test it. If you can provide more details on how to reproduce this bug, I can try again.

Finally, assuming this bug is reproducible, I think your PR needs to have automated tests added that will prove that the groups are cleaned up after deletion. These might be added to the existing CollectionTest class. I have another minor comment inline below.

String roleId = collectionRole.getRoleId();
int stepId = -1;
switch (roleId) {
case "reviewer":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't hardcode the values here. Instead, you should be using CollectionRoleService.LEGACY_WORKFLOW_STEP1_NAME.

Same with the other hardcoded values below, there's variables that can replace each if you use CollectionRoleService directly

@github-project-automation github-project-automation bot moved this from 🙋 Needs Reviewers Assigned to 👀 Under Review in DSpace 10.0 Release Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge. bug component: workflow Related to approval workflow or configurable workflow port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release port to main This PR needs to be ported to `main` branch for the next major release

Projects

Status: 👀 Under Review

Development

Successfully merging this pull request may close these issues.

2 participants