-
Notifications
You must be signed in to change notification settings - Fork 529
Cannot delete last Bitstream using new "Edit" menu #5381
Description
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:
- Modify any archived Item or Entity using the new "Edit" menu. Find an Item that has multiple Bitstreams if possible.
- On the Edit Form, delete all Bitstreams from the Item/Entity except the final Bitstream. These deletions will all be successful.
- 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:
- 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."
- Or, disable the Bitstream "Delete" button if there is only one Bitstream. Provide a hover-over which says the same as 1.
- 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
Assignees
Labels
Type
Projects
Status
Status