Skip to content

Commit 14db919

Browse files
authored
Merge pull request #89 from coldbox-modules/development
v4.8.0
2 parents 734f0a7 + 26d2c69 commit 14db919

File tree

6 files changed

+83
-27
lines changed

6 files changed

+83
-27
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,27 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
cfengine: [ "boxlang-cfml@1", "lucee@5", "lucee@6", "adobe@2023", "adobe@2025" ]
22-
coldboxVersion: [ "^7.0.0" ]
21+
cfengine: [ "boxlang-cfml@1", "lucee@5", "lucee@6", "adobe@2023", "adobe@2025" ]
22+
coldboxVersion: [ "^7.0.0", "^8.0.0" ]
2323
experimental: [ false ]
2424
# Experimental: ColdBox BE vs All Engines
2525
include:
26-
- coldboxVersion: "be"
27-
cfengine: "lucee@5"
28-
experimental: true
2926
- coldboxVersion: "be"
3027
cfengine: "lucee@6"
3128
experimental: true
3229
- coldboxVersion: "be"
33-
cfengine: "adobe@2025"
30+
cfengine: "adobe@2023"
3431
experimental: true
3532
- coldboxVersion: "be"
3633
cfengine: "boxlang-cfml@1"
3734
experimental: true
38-
- coldboxVersion: "be"
39-
cfengine: "boxlang@1"
35+
# BoxLang PRIME with ColdBox 8
36+
- coldboxVersion: "8"
37+
cfengine: "boxlang-cfml@1"
38+
experimental: true
39+
# BoxLang CFML BE with ColdBox 8
40+
- coldboxVersion: "8"
41+
cfengine: "boxlang-cfml@be"
4042
experimental: true
4143
steps:
4244
- name: Checkout Repository
@@ -88,16 +90,12 @@ jobs:
8890
mkdir -p test-harness/tests/results
8991
box testbox run --verbose outputFile=test-harness/tests/results/test-results outputFormats=json,antjunit
9092
91-
- name: Publish Test Reports
92-
uses: mikepenz/[email protected]
93+
- name: Publish Test Results
94+
uses: EnricoMi/publish-unit-test-result-action@v2
9395
if: always()
9496
with:
95-
report_paths: |
96-
test-harness/tests/results/**/*.xml
97-
check_name: "TestBox Report ${{ matrix.cfengine }}-${{ matrix.coldboxVersion }}"
98-
include_passed: false
99-
fail_on_failure: true
100-
detailed_summary: true
97+
junit_files: test-harness/tests/results/**/*.xml
98+
check_name: "${{ matrix.cfengine }} ColdBox ${{ matrix.coldboxVersion }} Test Results"
10199

102100
- name: Upload Test Results to Artifacts
103101
if: always()

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"ColdBox Validation",
33
"author":"Ortus Solutions <[email protected]>",
4-
"version":"4.7.0",
4+
"version":"4.8.0",
55
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbvalidation/@build.version@/[email protected]@.zip",
66
"slug":"cbvalidation",
77
"type":"modules",

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
### Fixed
13+
14+
- Copilot instructions added.
15+
- Null values are now properly filtered out when `validateOrFail` returns validated struct/array results
16+
- Handle null values correctly when filtering constraints in nested structures and arrays
17+
- GitHub Actions workflow fixes
18+
1219
## [4.7.0] - 2025-10-13
1320

1421
### Changed

models/ValidationManager.cfc

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,16 @@ component accessors="true" serialize="false" singleton {
327327
}
328328

329329
var constraint = arguments.constraints[ key ];
330-
if ( constraint.keyExists( "items" ) || constraint.keyExists( "arrayItem" ) ) {
330+
if (
331+
( constraint.keyExists( "items" ) || constraint.keyExists( "arrayItem" ) ) && !isNull(
332+
arguments.target[ key ]
333+
) && isArray( arguments.target[ key ] )
334+
) {
335+
var items = arguments.target[ key ];
331336
var filteredArray = [];
332337
var arrayConstraints = ( constraint.keyExists( "items" ) ? constraint.items : constraint.arrayItem );
333338
if ( arrayConstraints.keyExists( "constraints" ) || arrayConstraints.keyExists( "nestedConstraints" ) ) {
334-
for ( var item in arguments.target[ key ] ) {
339+
for ( var item in items ) {
335340
if ( isStruct( item ) ) {
336341
arrayAppend(
337342
filteredArray,
@@ -345,18 +350,28 @@ component accessors="true" serialize="false" singleton {
345350
}
346351
}
347352
} else {
348-
filteredArray = arguments.target[ key ];
353+
filteredArray = isNull( arguments.target[ key ] ) ? javacast( "null", "" ) : arguments.target[
354+
key
355+
];
349356
}
350-
filteredTarget[ key ] = filteredArray;
351-
} else if ( constraint.keyExists( "constraints" ) || constraint.keyExists( "nestedConstraints" ) ) {
357+
if ( !isNull( filteredArray ) ) {
358+
filteredTarget[ key ] = filteredArray;
359+
}
360+
} else if (
361+
( constraint.keyExists( "constraints" ) || constraint.keyExists( "nestedConstraints" ) ) && !isNull(
362+
arguments.target[ key ]
363+
) && isStruct( arguments.target[ key ] )
364+
) {
352365
filteredTarget[ key ] = filterTargetForConstraints(
353366
target = arguments.target[ key ],
354367
constraints = (
355368
constraint.keyExists( "constraints" ) ? constraint.constraints : constraint.nestedConstraints
356369
)
357370
);
358371
} else {
359-
filteredTarget[ key ] = arguments.target[ key ];
372+
if ( !isNull( arguments.target[ key ] ) ) {
373+
filteredTarget[ key ] = arguments.target[ key ];
374+
}
360375
}
361376
}
362377
return filteredTarget;

readme.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Apache License, Version 2.0.
3333

3434
- **BoxLang** 1.0+ (Preferred)
3535
- **Lucee** 5.x+
36-
- **Adobe ColdFusion** 2021+
36+
- **Adobe ColdFusion** 2023+
3737
- **Dependencies**: ColdBox 7+, cbi18n 3.0+
3838

3939
## Installation
@@ -46,7 +46,11 @@ box install cbvalidation
4646

4747
The module will register several objects into WireBox using the `@cbvalidation` namespace. The validation manager is registered as `ValidationManager@cbvalidation`. It will also register several helper methods that can be used throughout the ColdBox application: `validate(), validateOrFail(), getValidationManager()`
4848

49-
### WireBox Registrations
49+
## Documentation
50+
51+
This module is fully documented at: https://coldbox-validation.ortusbooks.com/. It also has an MCP server with live docs and examples.
52+
53+
## WireBox Registrations
5054

5155
- `ValidationManager@cbvalidation` - The core validation engine
5256
- `validationManager@cbvalidation` - Alias for convenience
@@ -348,7 +352,7 @@ www.coldbox.org | www.luismajano.com | www.ortussolutions.com
348352
********************************************************************************
349353
```
350354

351-
### HONOR GOES TO GOD ABOVE ALL
355+
## HONOR GOES TO GOD ABOVE ALL
352356

353357
Because of His grace, this project exists. If you don't like this, then don't read it, its not for you.
354358

@@ -358,6 +362,6 @@ And not only so, but we glory in tribulations also: knowing that tribulation wor
358362
And patience, experience; and experience, hope:
359363
And hope maketh not ashamed; because the love of God is shed abroad in our hearts by the Holy Ghost which is given unto us. ." Romans 5:5
360364

361-
### THE DAILY BREAD
365+
## THE DAILY BREAD
362366

363367
> "I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12

[email protected]

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name":"cbvalidation-boxlang-cfml@be",
3+
"app":{
4+
"serverHomeDirectory":".engine/boxlang-cfml-be",
5+
"cfengine":"boxlang@be"
6+
},
7+
"web":{
8+
"http":{
9+
"port":"60299"
10+
},
11+
"rewrites":{
12+
"enable":true
13+
},
14+
"webroot":"test-harness",
15+
"aliases":{
16+
"/moduleroot/cbvalidation":"../"
17+
}
18+
},
19+
"JVM":{
20+
"heapSize":"1024",
21+
"javaVersion":"openjdk21_jre",
22+
"args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888"
23+
},
24+
"openBrowser": false,
25+
"cfconfig":{
26+
"file":".cfconfig.json"
27+
},
28+
"env":{},
29+
"scripts":{
30+
"onServerInitialInstall":"install bx-compat-cfml,bx-esapi,bx-mysql --noSave"
31+
}
32+
}

0 commit comments

Comments
 (0)