Skip to content

Cannot delete last Bitstream using new "Edit" menu #5381

@tdonohue

Description

@tdonohue

Describe the bug

This issue was found during testing of #5145, the PR which adds this new "Edit" menu (via submission form).

If you use the new Edit (via form) menu to modify an existing Item, and then attempt to delete all the Item's bitstreams, you will find that you cannot delete the final Bitstream (i.e. the Item cannot be left with no bitstreams). While the reason for this behavior is that every Item requires a Bitstream (in the default form), the Edit Form will not display any useful information or errors. This makes the behavior confusing to users.

Workaround: To work around this problem, just add another Bitstream to the Item before deleting the final Bitstream. Bitstream deletions work fine as long as there are multiple Bitstreams.

To Reproduce

Steps to reproduce the behavior:

  1. Modify any archived Item or Entity using the new "Edit" menu. Find an Item that has multiple Bitstreams if possible.
  2. On the Edit Form, delete all Bitstreams from the Item/Entity except the final Bitstream. These deletions will all be successful.
  3. Now, attempt to delete the final Bitstream. This deletion request will never complete (the delete button will show an in-progress icon) because it fails silently behind the scenes because of validation errors (as the Item requires at least on Bitstream exist).

Expected behavior

Any one of these behaviors would be acceptable:

  1. Either display a useful error to the user that says: "All Items require at least one File. To delete this File, please first add another File to the Item."
  2. Or, disable the Bitstream "Delete" button if there is only one Bitstream. Provide a hover-over which says the same as 1.
  3. Or, allow the Bitstream deletion to succeed, but disable the "Save" buttons until the form is valid again (i.e. another Bitstream has been added)

Related work

This "Edit" menu (via submission form) was introduced in #5145.

Metadata

Metadata

Labels

DSpace-CRIS mergerThis ticket/PR relates to the merger of DSpace-CRIS into DSpace.affects: mainIssue impacts "main" (latest release).bugclaimed: eScireeScire team is working on this issue & will contribute back

Type

Projects

Status

🏗 In Progress

Status

🏗 In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions