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

Controlled-term fields require @value #1107

Closed
marcosmro opened this issue Nov 1, 2020 · 4 comments
Closed

Controlled-term fields require @value #1107

marcosmro opened this issue Nov 1, 2020 · 4 comments

Comments

@marcosmro
Copy link
Member

marcosmro commented Nov 1, 2020

We've observed (see #1106) that some templates require @value for controlled-term fields. This task is about investigating the steps that lead to this inconsistency and fix it.

@graybeal
Copy link
Member

graybeal commented Nov 2, 2020

My common sequence for creating fields in the past is is create the field, ADD the CV before creating the next field. I've never run into this before.

In the first set of cases we had in #1106, we created the fields as text fields first, and saved the template for a few days (because we didn't have the vocabularies available yet to ADD). I don't know whether that happened in the second case seen today, but I'd bet it's possible.

What if the reason we are seeing this is that the act of saving the template while the vocabulary is not yet defined causes the required:" @value to be set, and then when it is changed later, nothing takes the @value back out? Whereas in the normal flow, performing the ADD function prevents the @value from being added in the first place? I really like this idea, but unfortunately I've tested it and can't recreate the problem, in fields, elements, or templates.

@marcosmro
Copy link
Member Author

Another example of template with this issue: Covid project content template backup.json.zip

And here is the diff that shows how we fixed it: https://www.diffchecker.com/9ZJtsLs5

@graybeal
Copy link
Member

graybeal commented Apr 8, 2021

Updating my theory from above: We saw this again as the previous comment indicates. The pattern was the same—the user had created and probably tested the template without vocabularies, then had started adding the vocabularies.

It seems to me that in her case, her fields are all in elements. So the sequence we may need to test is "create the element, save the element, use it in a template; then change the element to add the vocabularies, save the changed element, and copy that into the original template, deleting the previous copy of that element. (Wonder if order could matter there?)

@marcosmro
Copy link
Member Author

Steps to reproduce:

  1. Create new template/element.
  2. Add new field.
  3. Make it multiple. Save.
  4. Add value constraint.

marcosmro added a commit to metadatacenter/cedar-template-editor that referenced this issue Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants