Skip to content

Conversation

@srikanthm79
Copy link
Contributor

@srikanthm79 srikanthm79 commented Apr 26, 2023

Description

Discrete Validations throw error if data element value is not simple value.

Steps to replicate issue :
Discrete validation:

var validationResult = validate(
target = {
// passing userid as an empty array
"userid": []
},
constraints = {
"userid": { "required": true, "type": "integer","discrete": "gte:1" }
}
);

InList validation:

var validationResult = validate(
    target = {
        "userid": []
    },
    constraints = {
        "userid": { "required": true, "type": "integer","inList": "1,2,3,4,5" }
    }
);

Issues

Fixes #73 Discrete and inList validations throw error if data element value is not simple value

Type of change

  • Bug Fix

Checklist

  • My code follows the style guidelines of this project cfformat
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@TheRealAgentK
Copy link

@srikanthm79 srikanthm79 changed the title Issue #73 Discrete Validations throw error if data element value is not simple value Issue #73 Discrete and Inlist Validations throw error if data element value is not simple value Apr 27, 2023
@lmajano lmajano merged commit 78eab3f into coldbox-modules:development May 1, 2023
@lmajano
Copy link
Contributor

lmajano commented May 1, 2023

Can you guys test in be please, and if all Is good, we can release a patch

@TheRealAgentK
Copy link

Thx @lmajano - will do that this morning.

@TheRealAgentK
Copy link

Sorry, got sidetracked.

Tested be against our local tests for the issue and it fixes them all.

Also as a positive side note: Currently we're on cbValidation 3.4.x and with 4.3.x / be all our unit tests and integration still work fine.

@lmajano
Copy link
Contributor

lmajano commented May 5, 2023

https://github.com/coldbox-modules/cbvalidation/releases/tag/v4.3.0

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 this pull request may close these issues.

Discrete and inList validations throw error if data element value is not simple value

3 participants