Inconsistent behavior of repeatable subfields in compound metadata
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 564
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 29
Description
What is going on?
I am having some trouble with (nested) compound metadata in a custom metadata block. In particular, fields that allow multiple entries behave inconsistently when nested under a compound metadata field. In the zulip chat where I first mentioned this, I thought this problem was purely a visualization problem, however, field that use controlled vocabularies behave different than fields that do not.
Values do not display as expected
In the first metadata block (compound_error.csv, sorry, had to change the suffix to csv for GitHub to accept this upload) I tried, a have a datasetField called "Parent" with type none and two related fields "Child A", "Child B" that both allow multiple entries from controlled vocabularies and are nested under "Parent" (i.e. have "Parent" in the parent column).
I can enter multiple values for the "Child A" and "Child B" fields but only the first entry is shown in the UI. E.g. if I enter Child A: "C1 Value A", "C1 Value B" and Child B: "C2 Value E", "C2 Value D" the metadata panel of the dataset will only show "C1 Value A" "C2 Value E", i.e. the first two entries.
So this entry
renders as
Nested repeatable fields behave inconsistently
Until here I thought this was just a visibility bug, but today I tested a version that also used an additional field that does not use a controlled vocabulary: In my second metadata block (compound_error_v2.csv) I have a datasetField called "Parent" with type none and three related fields "Child A", "Child B", and "Child C" that all allow multiple entries. Child A and Child B allow multiple entries from controlled vocabularies and are nested under "Parent" (i.e. have "Parent" in the parent column). Child C allows multiple text entries and is also nested under "Parent".
Here, for the field Child 3, I do not get the option to create multiple entries, even though this is specified in the metadata block.
In the following screenshot I do not have the option to create more than one entry.
And in the UI the problem described above persists, just with one additional entry:
Affected systems
In all cases above, all values are stored and can be searched for via the advanced search.
When reproducing this issue, (cf. chat) @jggautier experienced problems saving such a dataset. For me everything saved fine (in draft state).
Wild guessing
Since I can only add one entry for Child C (the field without controlled vocabulary), it seems to me that all fields inside a compound metadata chunk are treated as single fields. This could explain why only the first entries show up. The fields that use a controlled vocab somehow seem to weasel around this check.
Steps to reproduce
- Add the metadata block compound_error_v2.csv to a dataverse instance
- Create a new dataset using this metadata schema
- Add at least two entries for Child A and Child B
- Confirm that there is not option to add more than one entry for Child C
- Save the dataset
- Go to the metadata page of the dataset where only the first two entries for Child A and Child B can be seen.
To whom does it occur (all users, curators, superusers)?
Tested with a superuser account, however this should affect all users.
What did you expect to happen?
- A list of all entries for the repeatable fields Child A, Child B and Child C can be seen.
- It is possible to add more than one entry for Child C
Which version of Dataverse are you using?
5.13
I will, hopefully, be able to test this on 5.14 and 6.0 in the next two weeks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Load the attached compound_error_v2.csv metadata block and follow the listed reproduction steps, checking the dataset entry form and metadata page. Compare repeatable Child A, Child B, and Child C behavior; done means all values display, Child C accepts multiple entries, and the dataset saves successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100