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

ui: publishing an unmodified draft skips validations #2895

Open
miguelgrc opened this issue Jul 18, 2024 · 1 comment · May be fixed by #2896
Open

ui: publishing an unmodified draft skips validations #2895

miguelgrc opened this issue Jul 18, 2024 · 1 comment · May be fixed by #2896
Assignees

Comments

@miguelgrc
Copy link
Contributor

It is possible to, for example, publish draft with an unfilled required field if it has not been modified. This should not be allowed.

To replicate:

  • Create a cms_analysis draft > publish it > it should publish without issues [WRONG BEHAVIOR]
  • Edit any field in the draft (other than the required cadi_id) > save the draft > publish it > it should throw an error [DESIRED BEHAVIOR]
@miguelgrc
Copy link
Contributor Author

Suspicion: Before the save/publish action, the object is cleaned up in the backend (after this call), which removes the basic_info object which inside has the required: ["cadi_id"]. This essentially removes the required from the object before running the validation, causing the above issue.

This can be solved for that schema by marking basic_info as required, but I would consider reviewing how we clean up objects in the backend.

Note that if we try with a new schema created in the admin the issue is not there, even if we use object nesting (obj > obj > req test field).

Needs a bit more investigation and discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants