WGBH-MLA / ams

Archival Management System to support the American Archive of Public Broadcasting
GNU General Public License v3.0
5 stars 8 forks source link

BUG: Duplicate, empty instantiation Location (and other properties) getting saved when they should't be #886

Open afred opened 3 months ago

afred commented 3 months ago

To replicate

  1. Go to an "Edit Instantiation" interface where the instantiation has at least one value for Location already.
  2. Without editing anything at all , click the save button.
  3. Navigate back to the parent asset's details page, and view it's PBCore by adding the ".xml" to the URL.

Expected result

The PBCore XML should not have an additional <instantiationLocation> element

Actual result

The PBCore XML has an additional <instantiationLocation> element.

Background

  1. This additional element is invalid PBCore and thus causes a failure when trying to ingest to AAPB (though it does not render any failure notice in the AAPB logs)
  2. The instantiation location should not be multivalued, so it should not even have the option to add multiple locations like this.
  3. But also, the input field used for adding multiple values should not be saving additional empty ones by default when the user doesn't even do anything except hit the save button.

Done when

  1. The form input for multi-valued fields is not saving empty values
  2. Instantiation properties that are not multi-valued are not using the multi-value form input.
afred commented 3 months ago

This the same problem as #882, so before proceeding, check the outcome of that ticket.