Skip to content

Commit 1768039

Browse files
committed
Merge branch 'hotfix-1.2.5' into stable
2 parents 88c3f77 + 5c440b7 commit 1768039

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Generate release version number
3535
if: "env.PUBLISH == 'true'"
3636
id: versiongen
37-
uses: pixl8/github-action-twgit-release-version-generator@v2
37+
uses: pixl8/github-action-twgit-release-version-generator@v3
3838

3939
- name: Inject version into box json
4040
if: "env.PUBLISH == 'true'"
@@ -95,7 +95,7 @@ jobs:
9595

9696
- name: Publish to forgebox
9797
if: "env.PUBLISH == 'true'"
98-
uses: pixl8/github-action-box-publish@v3
98+
uses: pixl8/github-action-box-publish@v5
9999
with:
100100
forgebox_user: ${{ secrets.FORGEBOX_USER }}
101101
forgebox_pass: ${{ secrets.FORGEBOX_PASS }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.2.5
4+
5+
* JS validators fail if value is null
6+
37
## v1.2.4
48

59
* Apply translation manager CI action

services/validation/ValidationExtrasValidators.cfc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ component {
2121
return arguments.data.keyExists( fieldName ) && !IsEmpty( value );
2222
}
2323
public string function requiredIfOtherFieldChecked_js() validatorMessage="cms:validation.conditional.required.default" {
24-
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']:checked' ); if ( !$otherField.length || !$otherField.is( ':checked' ) || ( params[1] != null && $otherField.val() != params[1] ) ) { return true; } return ( value.length > 0 ); }";
24+
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']:checked' ); if ( !$otherField.length || !$otherField.is( ':checked' ) || ( params[1] != null && $otherField.val() != params[1] ) ) { return true; } return ( value && value.length > 0 ); }";
2525
}
2626

2727

@@ -32,7 +32,7 @@ component {
3232
return arguments.data.keyExists( fieldName ) && !IsEmpty( value );
3333
}
3434
public string function requiredIfOtherFieldNotChecked_js() validatorMessage="cms:validation.conditional.required.default" {
35-
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length || $otherField.is( ':checked' ) ) { return true; } return ( value.length > 0 ); }";
35+
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length || $otherField.is( ':checked' ) ) { return true; } return ( value && value.length > 0 ); }";
3636
}
3737

3838

@@ -43,7 +43,7 @@ component {
4343
return arguments.data.keyExists( fieldName ) && !IsEmpty( value );
4444
}
4545
public string function requiredIfOtherFieldEmpty_js() validatorMessage="cms:validation.conditional.required.default" {
46-
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length || $otherField.val().length ) { return true; } return ( value.length > 0 ); }";
46+
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length || $otherField.val().length ) { return true; } return ( value && value.length > 0 ); }";
4747
}
4848

4949

@@ -54,7 +54,7 @@ component {
5454
return arguments.data.keyExists( fieldName ) && !IsEmpty( value );
5555
}
5656
public string function requiredIfOtherFieldNotEmpty_js() validatorMessage="cms:validation.conditional.required.default" {
57-
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length || !$otherField.val().length ) { return true; } return ( value.length > 0 ); }";
57+
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length || !$otherField.val().length ) { return true; } return ( value && value.length > 0 ); }";
5858
}
5959

6060

@@ -65,7 +65,7 @@ component {
6565
return arguments.data.keyExists( fieldName ) && !IsEmpty( value );
6666
}
6767
public string function requiredIfOtherFieldValue_js() validatorMessage="cms:validation.required.default" {
68-
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length ) { return true}; var otherValue = $otherField.prop('type')=='radio'?$( '[name=' + params[0] + ']:checked').val() : $otherField.val(); if ( otherValue != params[1] ) { return true; } return ( value.length > 0 ); }";
68+
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length ) { return true}; var otherValue = $otherField.prop('type')=='radio'?$( '[name=' + params[0] + ']:checked').val() : $otherField.val(); if ( otherValue != params[1] ) { return true; } return ( value && value.length > 0 ); }";
6969
}
7070

7171
public boolean function requiredIfOtherFieldMatchSystemLookup( required string fieldName, any value="", struct data={}, required string otherField, required string category, required setting ) validatorMessage="cms:validation.conditional.required.default" {
@@ -75,7 +75,7 @@ component {
7575
if ( !len( trim ( lookupValue ) ) || !len( trim( otherFieldValue ) ) ) {
7676
return true;
7777
}
78-
78+
7979
return !( listFindNoCase( lookupValue, otherFieldValue ) && !len( trim( value ) ) );
8080
}
8181
public string function requiredIfOtherFieldMatchSystemLookup_js() {
@@ -92,7 +92,7 @@ component {
9292
}
9393

9494
public string function requiredIfOtherFieldInValues_js() validatorMessage="cms:validation.required.default" {
95-
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length ) { return true}; var otherValue = $otherField.prop('type')=='radio'?$( '[name=' + params[0] + ']:checked').val() : $otherField.val(); var otherValues = params[1].split(',');if ( !otherValues.includes( otherValue ) ) { return true; } return ( value.length > 0 ); }";
95+
return "function( value, el, params ){ $otherField = $( '[name=' + params[0] + ']' ); if ( !$otherField.length ) { return true}; var otherValue = $otherField.prop('type')=='radio'?$( '[name=' + params[0] + ']:checked').val() : $otherField.val(); var otherValues = params[1].split(',');if ( !otherValues.includes( otherValue ) ) { return true; } return ( value && value.length > 0 ); }";
9696
}
9797

9898
public boolean function simpleUrl( required string fieldName, any value="" ) validatorMessage="validationExtras:validation.simpleUrl.default" {

0 commit comments

Comments
 (0)