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

Fix files not uploading when there is a required selectone component #10401

Merged

Conversation

scolapasta
Copy link
Contributor

@scolapasta scolapasta commented Mar 20, 2024

What this PR does / why we need it:
Fixes an issue with dataset field types that use controlled vocab, are only single select, and are required

Which issue(s) this PR closes:

Closes #10385

Special notes for your reviewer:
So it investigating this, I found that the selectOne simple fields had a required attribute, whereas no other fields did. Removing it fixed the issue AND validation still works correctly.

Looked in history, found it was added 5 years ago, but not to other fields - not sure why. Likely it was not actually needed (as validation is handled differently).

Here is what the attribute looked like before removing:
required="#{dsf.required and datasetPage}"

Suggestions on how to test this:
Use the CAFE metadatablock that has dataset field types that use controlled vocab, are only single select, and are required (or create a new one for testing). Add a new dataset and try to upload a file before filling out the metadata. Make sure it gets added to the list, and then also fill out metadata, and make sure everything gets saved correctly.

Also confirm that the field still acts as required (won't save without value, gets validation message)

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No

Is there a release notes update needed for this change?:
No, simple bug fix

Additional documentation:

@scolapasta scolapasta added the Size: 3 A percentage of a sprint. 2.1 hours. label Mar 20, 2024
@scolapasta scolapasta added this to the 6.2 milestone Mar 20, 2024
@scolapasta scolapasta changed the title removed required attr from selectone component Fix files not uploading when there is a required selectone component Mar 20, 2024
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable fix. I haven't tested it.

@sekmiller sekmiller self-assigned this Mar 21, 2024
@sekmiller sekmiller merged commit fb76116 into develop Mar 21, 2024
2 checks passed
@sekmiller sekmiller deleted the 10385-fix-validation-blocking-for-selectone-required branch March 21, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File Upload: file upload for collection with metadblocks that have required, single, controlled vocab fails
3 participants