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

Field Validation Rule is between always fails #12656

Closed
ctholho opened this issue Apr 9, 2022 · 0 comments · Fixed by #12666
Closed

Field Validation Rule is between always fails #12656

ctholho opened this issue Apr 9, 2022 · 0 comments · Fixed by #12666
Labels

Comments

@ctholho
Copy link

ctholho commented Apr 9, 2022

Describe the Bug

I was trying to use the "is between" Field validation Rule for a number column. I set the values to be between -20 and 20.
Next, it was impossible to edit the value.

I could circumvent the error by changing the "is between" validation to an "and" group and checking for greater and less than.

To Reproduce

screenshot

Using this field validation will always fail.

Errors Shown

My directus logs showed this

2022-04-09T10:29:08.502674382Z 10:29:08 🚨 limit must be a number or reference
2022-04-09T10:29:08.502712799Z Error: limit must be a number or reference
2022-04-09T10:29:08.502716424Z     at new module.exports (/directus/node_modules/@hapi/hoek/lib/error.js:23:19)
2022-04-09T10:29:08.502722924Z     at module.exports (/directus/node_modules/@hapi/hoek/lib/assert.js:20:11)
2022-04-09T10:29:08.503327757Z     at internals.Base.$_addRule (/directus/node_modules/joi/lib/base.js:613:29)
2022-04-09T10:29:08.503352966Z     at internals.Base.method [as greater] (/directus/node_modules/joi/lib/types/number.js:125:29)
2022-04-09T10:29:08.503355924Z     at generateJoi (/directus/node_modules/@directus/shared/dist/cjs/utils/generate-joi.js:193:49)
2022-04-09T10:29:08.503399674Z     at validatePayload (/directus/node_modules/@directus/shared/dist/cjs/utils/validate-payload.js:37:55)
2022-04-09T10:29:08.503404091Z     at /directus/node_modules/@directus/shared/dist/cjs/utils/validate-payload.js:23:20
2022-04-09T10:29:08.503408549Z     at Array.map (<anonymous>)
2022-04-09T10:29:08.503411091Z     at validatePayload (/directus/node_modules/@directus/shared/dist/cjs/utils/validate-payload.js:22:66)
2022-04-09T10:29:08.503413424Z     at AuthorizationService.validatePayload (/directus/node_modules/directus/dist/services/authorization.js:353:84)

What version of Directus are you using?

9.8.0

What version of Node.js are you using?

16.14

What database are you using?

Postgres 14

What browser are you using?

n.a.

How are you deploying Directus?

Kubernetes

@ctholho ctholho changed the title Field Validation Rule is between doe Field Validation Rule is between always fails Apr 9, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants