Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when switching the separator for Mass Import #6009

Open
BartChris opened this issue Mar 21, 2024 · 0 comments · May be fixed by #6012
Open

Bug when switching the separator for Mass Import #6009

BartChris opened this issue Mar 21, 2024 · 0 comments · May be fixed by #6012
Labels
bug import Import mappings and configurations

Comments

@BartChris
Copy link
Collaborator

BartChris commented Mar 21, 2024

Describe the bug
There is a feature of switching the CSV seperator in the mass import page to match the column seperator of the imported csv file.
image
When using this feature the list with the metadata keys (representing the current column headings) is recreated using List.of

metadataKeys = List.of(String.join(previousCsvSeparator, metadataKeys).split(csvSeparator));

Using List.of here creates a problem because the new list is immutable so no new items can be added to the list. When using the "Add Metadata" feature
image

afterwards an exception is thrown because Kitodo tries to add items to an now immutable list.

https://github.com/kitodo/kitodo-production/blob/83b1b9fcbb586add543a55c8d7844d0d82077e36/Kitodo/src/main/java/org/kitodo/production/forms/massimport/AddMetadataDialog.java#L116-117

image

To Reproduce
Steps to reproduce the behavior:

  1. Upload a csv file seperated by comma (",")
  2. Switch the seperator to from semicolon to comma (";")
  3. Try to add metadata

Expected behavior
The list with the metadata keys probably has to stay mutable after changing the csv separator.

Release
Kitodo Production 3.6.2, Master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug import Import mappings and configurations
Projects
None yet
2 participants