IQSS/11990 Controlled Vocabulary Field editing error#11991
Merged
sekmiller merged 3 commits intoIQSS:developfrom Dec 1, 2025
Merged
Conversation
stevenwinship
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it: This PR fixes the issue - where editing a single-value CVV field starting from a published version would also update the field in the published version (causing the version difference view to not show the change).
Which issue(s) this PR closes:
Special notes for your reviewer: Took a while to find, but relatively straight forward. When an edit is made from a published version, we make a copy of the version and all fields. For DatasetFields using ControlledVocabularyValues, the code just set the new field in the new version to share the array of values from the original version. When an edit was made, the change was to the shared array and thus got saved for both versions. A fix is to copy the values in the array rather than sharing the array.
I confirmed the issue on demo, and confirmed the fix on a test machine.
I would have expected the error to occur with fields like language, but it appears that when multiple values are used, the JSF is sending a new array rather than editing the existing one, so the fact that the original copy was shared doesn't matter.
I did not test the API, but I would guess the problem could occur there as well since it was related to the DatasetField.copy method.
W.r.t. release notes - the copy code is 11+ years old, so I'm assuming the bug is that old and affects basically all versions of Dataverse currently in use.
Not sure if this has been seen in any of the version differencing related issues.
Suggestions on how to test this: Per the issue, create and publish a dataset. Change the value in a CVV single value field (publication relationType or contributor type) and save. Check the version difference details or look at the published version and, before the PR, you'll see the new value in the published version.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: included
Additional documentation: