From 17b48e81b2172dc86c41595663b373a5fefba321 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Mon, 15 May 2023 23:41:06 +0000 Subject: [PATCH 01/45] Version bump --- box.json | 12 ++++---- changelog.md | 84 ++++++++++++++++++++++++++++------------------------ 2 files changed, 51 insertions(+), 45 deletions(-) diff --git a/box.json b/box.json index 4abf89bb4..4e2e6af5c 100644 --- a/box.json +++ b/box.json @@ -1,6 +1,6 @@ { "name":"ColdBox Platform", - "version":"7.0.0", + "version":"7.1.0", "location":"https://downloads.ortussolutions.com/ortussolutions/coldbox/@build.version@/coldbox-@build.version@.zip", "author":"Ortus Solutions ", "slug":"coldbox", @@ -55,19 +55,19 @@ "start:lucee":"server start serverConfigFile='server-lucee@5.json' --force", "start:2018":"server start serverConfigFile='server-adobe@2018.json' --force", "start:2021":"server start serverConfigFile='server-adobe@2021.json' --force", - "start:2023":"server start serverConfigFile='server-adobe@2023.json' --force", - "stop:lucee":"server stop serverConfigFile='server-lucee@5.json' --force", + "start:2023":"server start serverConfigFile='server-adobe@2023.json' --force", + "stop:lucee":"server stop serverConfigFile='server-lucee@5.json' --force", "stop:2018":"server stop serverConfigFile='server-adobe@2018.json' --force", "stop:2021":"server stop serverConfigFile='server-adobe@2021.json' --force", - "stop:2023":"server stop serverConfigFile='server-adobe@2023.json' --force", + "stop:2023":"server stop serverConfigFile='server-adobe@2023.json' --force", "log:lucee":"server log coldbox-lucee@5 --follow", "log:2018":"server log coldbox-adobe@2018 --follow", "log:2021":"server log coldbox-adobe@2021 --follow", - "log:2023":"server log coldbox-adobe@2023 --follow", + "log:2023":"server log coldbox-adobe@2023 --follow", "cfpm":"echo '\".engine/acf2021/WEB-INF/cfusion/bin/cfpm.sh\"' | run", "cfpm:install":"echo '\".engine/adobe2021/WEB-INF/cfusion/bin/cfpm.sh\" install ${1}' | run" }, - "installPaths":{ + "installPaths":{ "testbox":"testbox/", "cbproxies":"system/async/cbproxies/" } diff --git a/changelog.md b/changelog.md index 80e841c7d..4b85c3679 100644 --- a/changelog.md +++ b/changelog.md @@ -1,35 +1,37 @@ # Changelog -All notable changes to this project will be documented here: https://coldbox.ortusbooks.com/intro/release-history and summarized in this file. +All notable changes to this project will be documented here: and summarized in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -**** +* * * -## [unreleased] +## [Unreleased] + +## [7.0.0] - 2023-05-15 ### ColdBox HMVC #### Bugs - [COLDBOX-1133](https://ortussolutions.atlassian.net/browse/COLDBOX-1133) \`getFullURL\` encodes the query string when it should not. -- [COLDBOX-1136](https://ortussolutions.atlassian.net/browse/COLDBOX-1136) Scoping lookup bug in Lucee affects route\(\) -- [COLDBOX-1138](https://ortussolutions.atlassian.net/browse/COLDBOX-1138) Event Cache Response Has Status Code of 0 \(or Null\) +- [COLDBOX-1136](https://ortussolutions.atlassian.net/browse/COLDBOX-1136) Scoping lookup bug in Lucee affects route() +- [COLDBOX-1138](https://ortussolutions.atlassian.net/browse/COLDBOX-1138) Event Cache Response Has Status Code of 0 (or Null) - [COLDBOX-1139](https://ortussolutions.atlassian.net/browse/COLDBOX-1139) make event caching cache keys lower cased to avoid case issues when clearing keys -- [COLDBOX-1143](https://ortussolutions.atlassian.net/browse/COLDBOX-1143) render inline PDF \(CB 6.8.1\) throws a 500 error -- [COLDBOX-1145](https://ortussolutions.atlassian.net/browse/COLDBOX-1145) RestHandler OnError\(\) Exception not checking for empty \`exception\` blocks which would cause another exception on development ONLY +- [COLDBOX-1143](https://ortussolutions.atlassian.net/browse/COLDBOX-1143) render inline PDF (CB 6.8.1) throws a 500 error +- [COLDBOX-1145](https://ortussolutions.atlassian.net/browse/COLDBOX-1145) RestHandler OnError() Exception not checking for empty \`exception\` blocks which would cause another exception on development ONLY - [COLDBOX-1146](https://ortussolutions.atlassian.net/browse/COLDBOX-1146) BiConsumer proxy was making both arguments required, when they can be null so execution fails - [COLDBOX-1149](https://ortussolutions.atlassian.net/browse/COLDBOX-1149) Woops and Adobe CF needs a double check if session/client is defined even if sessionManagement/clientManagement is defined - [COLDBOX-1150](https://ortussolutions.atlassian.net/browse/COLDBOX-1150) virtual app controller scoping is missing on ocassion due to this.load|unload flags -- [COLDBOX-1151](https://ortussolutions.atlassian.net/browse/COLDBOX-1151) Integration Tests do not support NoRender\(\) +- [COLDBOX-1151](https://ortussolutions.atlassian.net/browse/COLDBOX-1151) Integration Tests do not support NoRender() - [COLDBOX-1153](https://ortussolutions.atlassian.net/browse/COLDBOX-1153) RestHandler.cfc missing exception information on InvalidCredentials & TokenInvalidException - [COLDBOX-1154](https://ortussolutions.atlassian.net/browse/COLDBOX-1154) Invalid DateFormat Mask in Whoops.cfm - [COLDBOX-1173](https://ortussolutions.atlassian.net/browse/COLDBOX-1173) Update the Router.cfc to look at not only the cgi host but the forwarded hosts - [COLDBOX-1175](https://ortussolutions.atlassian.net/browse/COLDBOX-1175) calling function "view" from within function which has an argument named "view" causes error. -- [COLDBOX-1176](https://ortussolutions.atlassian.net/browse/COLDBOX-1176) viewLocations struct does not exist in function renderer.layout\(\) on line 684 if nolayout = true -- [COLDBOX-1191](https://ortussolutions.atlassian.net/browse/COLDBOX-1191) Attempts to use \`getHTMLBaseURL\(\)\` inside of Async Task Fail on ACF -- [COLDBOX-1193](https://ortussolutions.atlassian.net/browse/COLDBOX-1193) Missing java casting on arrayRange\(\) method ont the asyncmanager +- [COLDBOX-1176](https://ortussolutions.atlassian.net/browse/COLDBOX-1176) viewLocations struct does not exist in function renderer.layout() on line 684 if nolayout = true +- [COLDBOX-1191](https://ortussolutions.atlassian.net/browse/COLDBOX-1191) Attempts to use \`getHTMLBaseURL()\` inside of Async Task Fail on ACF +- [COLDBOX-1193](https://ortussolutions.atlassian.net/browse/COLDBOX-1193) Missing java casting on arrayRange() method ont the asyncmanager - [COLDBOX-1194](https://ortussolutions.atlassian.net/browse/COLDBOX-1194) Ensure modules are applied to routing action structs when necessary #243 - [COLDBOX-1196](https://ortussolutions.atlassian.net/browse/COLDBOX-1196) Render collections items and counter variables are not thread safe since we migrated to a singleton renderer - [COLDBOX-1202](https://ortussolutions.atlassian.net/browse/COLDBOX-1202) urlMatches in the request context does not account for the path to be larger than the requested uri @@ -41,55 +43,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [COLDBOX-1029](https://ortussolutions.atlassian.net/browse/COLDBOX-1029) ModuleAwareness : Wirebox Injector Lookup Should Check Current Module First - [COLDBOX-1155](https://ortussolutions.atlassian.net/browse/COLDBOX-1155) Implement abort logic onAuthenticationFailure on RESTHandler -- [COLDBOX-1157](https://ortussolutions.atlassian.net/browse/COLDBOX-1157) Reuse existing controller in getMockRequestContext\(\) +- [COLDBOX-1157](https://ortussolutions.atlassian.net/browse/COLDBOX-1157) Reuse existing controller in getMockRequestContext() - [COLDBOX-1159](https://ortussolutions.atlassian.net/browse/COLDBOX-1159) JSON Serialization in \`forAttribute\` Does Not Support ACF Prefixing - [COLDBOX-1171](https://ortussolutions.atlassian.net/browse/COLDBOX-1171) Do not allow injection of the same applicatio helper on the same target - [COLDBOX-1177](https://ortussolutions.atlassian.net/browse/COLDBOX-1177) Please add more debugging info to REST handler - [COLDBOX-1184](https://ortussolutions.atlassian.net/browse/COLDBOX-1184) When whoops error template defaults to public for non-dev, the messaging is very confusing -- [COLDBOX-1185](https://ortussolutions.atlassian.net/browse/COLDBOX-1185) ColdBox DebugMode with inDebugMode\(\) helper +- [COLDBOX-1185](https://ortussolutions.atlassian.net/browse/COLDBOX-1185) ColdBox DebugMode with inDebugMode() helper - [COLDBOX-1190](https://ortussolutions.atlassian.net/browse/COLDBOX-1190) Reworking of several rest handler exception methods so they log the issues instead of announcing \`onException\` events and announce their appropriate events , onAuthenticationFailure, onAuthorizationFailure, onValidationException, onEntityNotFoundException - [COLDBOX-1195](https://ortussolutions.atlassian.net/browse/COLDBOX-1195) ColdBox Proxy should ignore the routing service captures to avoid redirects or returns - [COLDBOX-1210](https://ortussolutions.atlassian.net/browse/COLDBOX-1210) encapsulate route finding by name to the actual router itself -- [COLDBOX-1214](https://ortussolutions.atlassian.net/browse/COLDBOX-1214) Compatibility layer for env methods in the Util object: getSystemSetting\(\), getSystemProperty\(\), getEnv\(\) +- [COLDBOX-1214](https://ortussolutions.atlassian.net/browse/COLDBOX-1214) Compatibility layer for env methods in the Util object: getSystemSetting(), getSystemProperty(), getEnv() #### New Features - [COLDBOX-1022](https://ortussolutions.atlassian.net/browse/COLDBOX-1022) Allow for Flash RAM to use a third party provided tracking variable via the new setting identifierProvider - [COLDBOX-1039](https://ortussolutions.atlassian.net/browse/COLDBOX-1039) Allow unregistering closure listeners - [COLDBOX-1077](https://ortussolutions.atlassian.net/browse/COLDBOX-1077) Provide ability for handlers/interceptors/etc. to have inherent self-knowledge of the module they live in for modulesettings/moduleConfig injections -- [COLDBOX-1137](https://ortussolutions.atlassian.net/browse/COLDBOX-1137) Allow passing interception point first in interceptor listen\(\) method +- [COLDBOX-1137](https://ortussolutions.atlassian.net/browse/COLDBOX-1137) Allow passing interception point first in interceptor listen() method - [COLDBOX-1140](https://ortussolutions.atlassian.net/browse/COLDBOX-1140) Whoops updates galore! SQL Syntax highlighting, json formatting and highlighting, and more - [COLDBOX-1141](https://ortussolutions.atlassian.net/browse/COLDBOX-1141) New Flow delegate helpers for functional usage everywhere in ColdBox land -- [COLDBOX-1142](https://ortussolutions.atlassian.net/browse/COLDBOX-1142) New convention for module setting overrides: config/\{moduleName\}.cfc +- [COLDBOX-1142](https://ortussolutions.atlassian.net/browse/COLDBOX-1142) New convention for module setting overrides: config/{moduleName}.cfc - [COLDBOX-1147](https://ortussolutions.atlassian.net/browse/COLDBOX-1147) PostLayoutRender and PostViewRender now pass which view/layout path was used to render - [COLDBOX-1148](https://ortussolutions.atlassian.net/browse/COLDBOX-1148) postEvent now get's new interceptData: ehBean, handler and data results - [COLDBOX-1152](https://ortussolutions.atlassian.net/browse/COLDBOX-1152) this.unloadColdBox is false now as the default thanks to the virtual test app -- [COLDBOX-1158](https://ortussolutions.atlassian.net/browse/COLDBOX-1158) New \`back\(\)\` function in super type that you can use to redirect back to your referer or a fallback -- [COLDBOX-1161](https://ortussolutions.atlassian.net/browse/COLDBOX-1161) new toJson\(\) helper in the Util class which is delegated in many locations around the framework to add struct based query serialization and no dubm security prefixes -- [COLDBOX-1162](https://ortussolutions.atlassian.net/browse/COLDBOX-1162) Add in functionality to exclude patterns via router's findRoute\(\) +- [COLDBOX-1158](https://ortussolutions.atlassian.net/browse/COLDBOX-1158) New \`back()\` function in super type that you can use to redirect back to your referer or a fallback +- [COLDBOX-1161](https://ortussolutions.atlassian.net/browse/COLDBOX-1161) new toJson() helper in the Util class which is delegated in many locations around the framework to add struct based query serialization and no dubm security prefixes +- [COLDBOX-1162](https://ortussolutions.atlassian.net/browse/COLDBOX-1162) Add in functionality to exclude patterns via router's findRoute() - [COLDBOX-1165](https://ortussolutions.atlassian.net/browse/COLDBOX-1165) New convention for modules for storing and using coldfusion tags: \`/tags\` - [COLDBOX-1166](https://ortussolutions.atlassian.net/browse/COLDBOX-1166) Lazy loading and persistence of engine helper to assist in continued performance and initial load speed - [COLDBOX-1167](https://ortussolutions.atlassian.net/browse/COLDBOX-1167) New core delegates for smaller building blocks, which leverages the \`@coreDelegates\` namespace - [COLDBOX-1168](https://ortussolutions.atlassian.net/browse/COLDBOX-1168) New coldbox based delegates mapped with \`@cbDelegates\` -- [COLDBOX-1172](https://ortussolutions.atlassian.net/browse/COLDBOX-1172) core json utils now include a prettyJson\(\) and a toPrettyJson\(\) utilities -- [COLDBOX-1174](https://ortussolutions.atlassian.net/browse/COLDBOX-1174) New getEnv\(\) method on the base test class to get access to the env delegate for inquiring for env and java properties +- [COLDBOX-1172](https://ortussolutions.atlassian.net/browse/COLDBOX-1172) core json utils now include a prettyJson() and a toPrettyJson() utilities +- [COLDBOX-1174](https://ortussolutions.atlassian.net/browse/COLDBOX-1174) New getEnv() method on the base test class to get access to the env delegate for inquiring for env and java properties - [COLDBOX-1178](https://ortussolutions.atlassian.net/browse/COLDBOX-1178) ChronoUnit becomes the official cb Date Time Helper to assist with date/time conversions and formatting -- [COLDBOX-1179](https://ortussolutions.atlassian.net/browse/COLDBOX-1179) New super type methods: getDateTimeHelper\(\) getIsoTime\(\) to assist with recurrent iso time conversions in modern APIs and responses -- [COLDBOX-1186](https://ortussolutions.atlassian.net/browse/COLDBOX-1186) Add three environment location helpers in the controller and supertype: isProduction\(\), isDevelopment\(\), isTesting\(\) -- [COLDBOX-1188](https://ortussolutions.atlassian.net/browse/COLDBOX-1188) Request Context setRequestTimeout\(\) method encapsulation, so you can control the time limit of a request -- [COLDBOX-1189](https://ortussolutions.atlassian.net/browse/COLDBOX-1189) setRequestTimeout\(\) mock in testing Request Context so handlers cannot override testing timeouts +- [COLDBOX-1179](https://ortussolutions.atlassian.net/browse/COLDBOX-1179) New super type methods: getDateTimeHelper() getIsoTime() to assist with recurrent iso time conversions in modern APIs and responses +- [COLDBOX-1186](https://ortussolutions.atlassian.net/browse/COLDBOX-1186) Add three environment location helpers in the controller and supertype: isProduction(), isDevelopment(), isTesting() +- [COLDBOX-1188](https://ortussolutions.atlassian.net/browse/COLDBOX-1188) Request Context setRequestTimeout() method encapsulation, so you can control the time limit of a request +- [COLDBOX-1189](https://ortussolutions.atlassian.net/browse/COLDBOX-1189) setRequestTimeout() mock in testing Request Context so handlers cannot override testing timeouts - [COLDBOX-1192](https://ortussolutions.atlassian.net/browse/COLDBOX-1192) Module Inception Isolation - every module has it's own injector that matches the module hierarchy - [COLDBOX-1197](https://ortussolutions.atlassian.net/browse/COLDBOX-1197) All rendering methods now accept a \`viewVariables\` argument that allows you to add variables into the view's \`variables\` scope -- [COLDBOX-1199](https://ortussolutions.atlassian.net/browse/COLDBOX-1199) New request context method: \`routeIs\( name \):boolean\` that evaluates if the passed name is the same as the current route -- [COLDBOX-1200](https://ortussolutions.atlassian.net/browse/COLDBOX-1200) request context \`getFullUrl\(\)\` renamed to \`getUrl\(\)\` -- [COLDBOX-1201](https://ortussolutions.atlassian.net/browse/COLDBOX-1201) request context \`getFullPath\(\)\` renamed to \`getPath\(\)\` -- [COLDBOX-1205](https://ortussolutions.atlassian.net/browse/COLDBOX-1205) request context \`event.getUrl\( withQuery:true \)\` new argument \`withQuery\` to allow adding the query string or not -- [COLDBOX-1206](https://ortussolutions.atlassian.net/browse/COLDBOX-1206) request context \`event.getPath\( withQuery:true \)\` new argument \`withQuery\` to allow adding the query string or not -- [COLDBOX-1207](https://ortussolutions.atlassian.net/browse/COLDBOX-1207) New request context methods: \`getPathSegments\(\):array, getPathSegment\( index, defaultValue \):string\` so you can segment the incoming url path -- [COLDBOX-1208](https://ortussolutions.atlassian.net/browse/COLDBOX-1208) Add \`persist\` and \`persistStruct\` to the \`back\(\)\` method in the supertype +- [COLDBOX-1199](https://ortussolutions.atlassian.net/browse/COLDBOX-1199) New request context method: \`routeIs( name ):boolean\` that evaluates if the passed name is the same as the current route +- [COLDBOX-1200](https://ortussolutions.atlassian.net/browse/COLDBOX-1200) request context \`getFullUrl()\` renamed to \`getUrl()\` +- [COLDBOX-1201](https://ortussolutions.atlassian.net/browse/COLDBOX-1201) request context \`getFullPath()\` renamed to \`getPath()\` +- [COLDBOX-1205](https://ortussolutions.atlassian.net/browse/COLDBOX-1205) request context \`event.getUrl( withQuery:true )\` new argument \`withQuery\` to allow adding the query string or not +- [COLDBOX-1206](https://ortussolutions.atlassian.net/browse/COLDBOX-1206) request context \`event.getPath( withQuery:true )\` new argument \`withQuery\` to allow adding the query string or not +- [COLDBOX-1207](https://ortussolutions.atlassian.net/browse/COLDBOX-1207) New request context methods: \`getPathSegments():array, getPathSegment( index, defaultValue ):string\` so you can segment the incoming url path +- [COLDBOX-1208](https://ortussolutions.atlassian.net/browse/COLDBOX-1208) Add \`persist\` and \`persistStruct\` to the \`back()\` method in the supertype - [COLDBOX-1209](https://ortussolutions.atlassian.net/browse/COLDBOX-1209) Add route names to resourceful routes according to conventions - [COLDBOX-1215](https://ortussolutions.atlassian.net/browse/COLDBOX-1215) this.moduleInjector enables modular injector hiearchy. By default it is false until ColdBox 8 -- [COLDBOX-1216](https://ortussolutions.atlassian.net/browse/COLDBOX-1216) New super type method: \`getRootWireBox\(\)\` to get an instance of the root wirebox in the application +- [COLDBOX-1216](https://ortussolutions.atlassian.net/browse/COLDBOX-1216) New super type method: \`getRootWireBox()\` to get an instance of the root wirebox in the application - [COLDBOX-1217](https://ortussolutions.atlassian.net/browse/COLDBOX-1217) New `AppModes` delegate that helps objects know in which modes the application is on: debugMode, testing, production, etc. - [COLDBOX-1226](https://ortussolutions.atlassian.net/browse/COLDBOX-1226) Many Many Many Scheduled Tasks Updates @@ -97,10 +99,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [COLDBOX-1160](https://ortussolutions.atlassian.net/browse/COLDBOX-1160) COMPAT: jsonQueryFormat has been removed in preference to "struct". - [COLDBOX-1169](https://ortussolutions.atlassian.net/browse/COLDBOX-1169) routes.cfm Support Removal -- [COLDBOX-1170](https://ortussolutions.atlassian.net/browse/COLDBOX-1170) populateModel deprecated - refactored to just populate\(\) in the supertype methods +- [COLDBOX-1170](https://ortussolutions.atlassian.net/browse/COLDBOX-1170) populateModel deprecated - refactored to just populate() in the supertype methods - [COLDBOX-1187](https://ortussolutions.atlassian.net/browse/COLDBOX-1187) Removal of uniqueUrls boolean indicator for URL routing, since Pretty URLs are now the standard. This rerouting feature needs to be removed. -**** +* * * ### LogBox @@ -113,7 +115,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [LOGBOX-61](https://ortussolutions.atlassian.net/browse/LOGBOX-61) Allow for closure for all logging messages in the logger, this way, we can verify the logging level automatically. - [LOGBOX-69](https://ortussolutions.atlassian.net/browse/LOGBOX-69) LogEvents in JSON are now prettified -**** +* * * ### CacheBox @@ -121,7 +123,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [CACHEBOX-83](https://ortussolutions.atlassian.net/browse/CACHEBOX-83) Intermittent Exception from MetadataIndexer -**** +* * * ### WireBox @@ -136,7 +138,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### New Features - [WIREBOX-89](https://ortussolutions.atlassian.net/browse/WIREBOX-89) Wirebox - add onInjectorMissingDependency event -- [WIREBOX-130](https://ortussolutions.atlassian.net/browse/WIREBOX-130) Ability to remove specific objects from wirebox injector singleton's and request scopes via a \`clear\( key \)\` method +- [WIREBOX-130](https://ortussolutions.atlassian.net/browse/WIREBOX-130) Ability to remove specific objects from wirebox injector singleton's and request scopes via a \`clear( key )\` method - [WIREBOX-131](https://ortussolutions.atlassian.net/browse/WIREBOX-131) Object Delegators - [WIREBOX-134](https://ortussolutions.atlassian.net/browse/WIREBOX-134) Object Populator is now created by the Injector and it is now a singleton - [WIREBOX-135](https://ortussolutions.atlassian.net/browse/WIREBOX-135) Object populator now caches orm entity maps, so they are ONLy loaded once and population with orm objects accelerates tremendously @@ -148,5 +150,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [WIREBOX-141](https://ortussolutions.atlassian.net/browse/WIREBOX-141) New config setting transientInjectionCache to enable or disable globally, default is true - [WIREBOX-142](https://ortussolutions.atlassian.net/browse/WIREBOX-142) You can now instantiate an Injector with the \`binder\` argument being the config structure instead of creating a binder - [WIREBOX-143](https://ortussolutions.atlassian.net/browse/WIREBOX-143) New injection DSL for ColdBox Root Injector \`coldbox:rootWireBox\` -- [WIREBOX-144](https://ortussolutions.atlassian.net/browse/WIREBOX-144) Injectors can now track the root injector by having a root reference via \`getRoot\(\), hasRoot\(\)\` methods +- [WIREBOX-144](https://ortussolutions.atlassian.net/browse/WIREBOX-144) Injectors can now track the root injector by having a root reference via \`getRoot(), hasRoot()\` methods - [WIREBOX-145](https://ortussolutions.atlassian.net/browse/WIREBOX-145) New DSL for wirebox only root injectors: \`wirebox:root\` + +[Unreleased]: https://github.com/ColdBox/coldbox-platform/compare/v7.0.0...HEAD + +[7.0.0]: https://github.com/ColdBox/coldbox-platform/compare/af03e4a577fa627e94619a451e56d36292815b06...v7.0.0 From 86efb7140c9be494ad565b88f0136d252af4279d Mon Sep 17 00:00:00 2001 From: Brad Wood Date: Wed, 31 May 2023 12:09:48 -0500 Subject: [PATCH 02/45] change Lucee to snapshot --- server-lucee@6.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-lucee@6.json b/server-lucee@6.json index 5e782f8a5..6053d5770 100644 --- a/server-lucee@6.json +++ b/server-lucee@6.json @@ -1,6 +1,6 @@ { "app":{ - "cfengine":"lucee@6.0.0-BETA+346", + "cfengine":"lucee@6.0.0-snapshot", "serverHomeDirectory":".engine/lucee6" }, "name":"coldbox-lucee@6", From 94861568dce36cbe1952ca18267b1b2be78ad53b Mon Sep 17 00:00:00 2001 From: Brad Wood Date: Wed, 31 May 2023 12:23:12 -0500 Subject: [PATCH 03/45] extra failure debug --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c5f0a67f9..b4a2db5e7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -126,6 +126,8 @@ jobs: - name: Failure Debugging Info if: ${{ failure() }} run: | + box version" + box server info serverConfigFile="server-${{ matrix.cfengine }}.json --json" box server log serverConfigFile="server-${{ matrix.cfengine }}.json" - name: Upload Debugging Info To Artifacts From 7dfdacecc4d7190ae445da82b90446c9bb07b58d Mon Sep 17 00:00:00 2001 From: Brad Wood Date: Wed, 31 May 2023 12:29:13 -0500 Subject: [PATCH 04/45] fixing quotes --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b4a2db5e7..2aebdfc89 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -126,8 +126,8 @@ jobs: - name: Failure Debugging Info if: ${{ failure() }} run: | - box version" - box server info serverConfigFile="server-${{ matrix.cfengine }}.json --json" + box version + box server info serverConfigFile="server-${{ matrix.cfengine }}.json" --json box server log serverConfigFile="server-${{ matrix.cfengine }}.json" - name: Upload Debugging Info To Artifacts From 2d042a42bbb6ff5d7b6fa2627eae40a590df870f Mon Sep 17 00:00:00 2001 From: Brad Wood Date: Wed, 31 May 2023 13:22:11 -0500 Subject: [PATCH 05/45] Switch to adobe 2023 stable --- server-adobe@2023.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-adobe@2023.json b/server-adobe@2023.json index b3b04092e..8316c7055 100644 --- a/server-adobe@2023.json +++ b/server-adobe@2023.json @@ -1,6 +1,6 @@ { "app":{ - "cfengine":"adobe@2023.0.0-beta.1", + "cfengine":"adobe@2023", "serverHomeDirectory":".engine/adobe2023" }, "name":"coldbox-adobe@2023", From 71e45b3d0c8254de383bf50db29192c255540494 Mon Sep 17 00:00:00 2001 From: Brad Wood Date: Wed, 31 May 2023 13:24:49 -0500 Subject: [PATCH 06/45] ACF 2023 is not experimental any longer --- .github/workflows/tests.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2aebdfc89..226f54c1b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,14 +20,10 @@ jobs: fail-fast: false matrix: commandbox_version: [ "5.8.0" ] - cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ] + cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ] jdkVersion: [ "11" ] experimental: [false] include: - - cfengine: "lucee@5rc" - commandbox_version: "6.0.0-alpha" - jdkVersion: "11" - experimental: true - cfengine: "lucee@6" commandbox_version: "6.0.0-alpha" jdkVersion: "11" @@ -37,13 +33,9 @@ jobs: jdkVersion: "17" experimental: true - cfengine: "adobe@2023" - commandbox_version: "6.0.0-alpha" - jdkVersion: "11" - experimental: true - - cfengine: "adobe@2023" - commandbox_version: "6.0.0-alpha" + commandbox_version: "5.8.0" jdkVersion: "17" - experimental: true + experimental: false steps: - name: Checkout Repository uses: actions/checkout@v2 From 1f75d85c215db99cb96be9e467f49b398e62ed02 Mon Sep 17 00:00:00 2001 From: Brad Wood Date: Wed, 31 May 2023 13:29:01 -0500 Subject: [PATCH 07/45] use CommandBox 5.9 for Java 17 compat --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 226f54c1b..a4cf198e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - commandbox_version: [ "5.8.0" ] + commandbox_version: [ "5.9.0" ] cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ] jdkVersion: [ "11" ] experimental: [false] @@ -33,7 +33,7 @@ jobs: jdkVersion: "17" experimental: true - cfengine: "adobe@2023" - commandbox_version: "5.8.0" + commandbox_version: "5.9.0" jdkVersion: "17" experimental: false steps: From da073108781aac658b40a35c737b755d9c19a870 Mon Sep 17 00:00:00 2001 From: Giancarlo Gomez Date: Thu, 8 Jun 2023 09:17:16 -0500 Subject: [PATCH 08/45] Debug update for Core ScheduledTasks and Code Re-org (#574) COLDBOX-1230 #resolve Reorganized ScheduledTasks functions within the CFC into code groups and comments COLDBOX-1229 #resolve Added debug argument to ScheduleExecutor and Scheduler when creating tasks for consistency --- system/async/executors/ScheduledExecutor.cfc | 4 +- system/async/tasks/ScheduledTask.cfc | 105 ++++++++++--------- system/async/tasks/Scheduler.cfc | 12 ++- 3 files changed, 66 insertions(+), 55 deletions(-) diff --git a/system/async/executors/ScheduledExecutor.cfc b/system/async/executors/ScheduledExecutor.cfc index d11df9e55..e42fc03f3 100644 --- a/system/async/executors/ScheduledExecutor.cfc +++ b/system/async/executors/ScheduledExecutor.cfc @@ -163,11 +163,13 @@ component extends="Executor" accessors="true" singleton { * Build out a new scheduled task representation. Calling this method does not mean that the task is executed. * * @name The name of the task + * @debug Add debugging logs to System out, disabled by default * @task The closure or cfc that represents the task (optional) * @method The method on the cfc to call, defaults to "run" (optional) */ ScheduledTask function newTask( - name = "task-#getName()#-#createUUID()#", + name = "task-#getName()#-#createUUID()#", + debug = false, task, method = "run" ){ diff --git a/system/async/tasks/ScheduledTask.cfc b/system/async/tasks/ScheduledTask.cfc index f2275d158..6d9d3e21c 100644 --- a/system/async/tasks/ScheduledTask.cfc +++ b/system/async/tasks/ScheduledTask.cfc @@ -366,6 +366,38 @@ component accessors="true" { return this; } + /** + * Disable the task when scheduled, meaning, don't run this sucker! + */ + ScheduledTask function disable(){ + debugLog( "disable" ); + + variables.disabled = true; + return this; + } + + /** + * Enable the task when disabled so we can run again + */ + ScheduledTask function enable(){ + debugLog( "enable" ); + + variables.disabled = false; + return this; + } + + /** + * Verifies if we can schedule this task or not by looking at the following constraints: + * + * - disabled + * - when closure + */ + boolean function isDisabled(){ + debugLog( "isDisabled" ); + + return variables.disabled; + } + /** * Set the meta data for this task! */ @@ -414,38 +446,37 @@ component accessors="true" { } /** - * Disable the task when scheduled, meaning, don't run this sucker! - */ - ScheduledTask function disable(){ - debugLog( "disable" ); - - variables.disabled = true; - return this; - } - - /** - * Enable the task when disabled so we can run again + * Set when this task should start execution on. By default it starts automatically. + * + * @date The date when this task should start execution on => yyyy-mm-dd format is preferred. + * @time The specific time using 24 hour format => HH:mm, defaults to 00:00 */ - ScheduledTask function enable(){ - debugLog( "enable" ); + ScheduledTask function startOn( required date, string time = "00:00" ){ + debugLog( "startOn", arguments ); - variables.disabled = false; + variables.startOnDateTime = variables.dateTimeHelper.parse( + "#dateFormat( arguments.date, "yyyy-mm-dd" )#T#arguments.time#" + ); return this; } /** - * Verifies if we can schedule this task or not by looking at the following constraints: + * Set when this task should stop execution on. By default it never ends * - * - disabled - * - when closure + * @date The date when this task should stop execution on => yyyy-mm-dd format is preferred. + * @time The specific time using 24 hour format => HH:mm, defaults to 00:00 */ - boolean function isDisabled(){ - debugLog( "isDisabled" ); + ScheduledTask function endOn( required date, string time = "00:00" ){ + debugLog( "endOn", arguments ); - return variables.disabled; + variables.endOnDateTime = variables.dateTimeHelper.parse( + "#dateFormat( arguments.date, "yyyy-mm-dd" )#T#arguments.time#" + ); + return this; } /** + * Sets a daily time range restriction where this task can run on. * * @startTime The specific time using 24 hour format => HH:mm * @endTime The specific time using 24 hour format => HH:mm @@ -459,6 +490,7 @@ component accessors="true" { } /** + * Sets a daily start time restriction for this task. * * @time The specific time using 24 hour format => HH:mm */ @@ -473,6 +505,7 @@ component accessors="true" { } /** + * Sets a daily end time restriction for this task. * * @time The specific time using 24 hour format => HH:mm */ @@ -670,7 +703,7 @@ component accessors="true" { variables.stats.totalFailures = variables.stats.totalFailures + 1; // Log it, so it doesn't go to ether err( "Error running task (#getName()#) : #e.message & e.detail#" ); - err( "Stacktrace for task (#geNname()#) : #e.stackTrace#" ); + err( "Stacktrace for task (#getName()#) : #e.stackTrace#" ); // Try to execute the error handlers. Try try try just in case. try { @@ -1344,36 +1377,6 @@ component accessors="true" { return this.everyWeekOn( 7, arguments.time ); } - /** - * Set when this task should start execution on. By default it starts automatically. - * - * @date The date when this task should start execution on => yyyy-mm-dd format is preferred. - * @time The specific time using 24 hour format => HH:mm, defaults to 00:00 - */ - ScheduledTask function startOn( required date, string time = "00:00" ){ - debugLog( "startOn", arguments ); - - variables.startOnDateTime = variables.dateTimeHelper.parse( - "#dateFormat( arguments.date, "yyyy-mm-dd" )#T#arguments.time#" - ); - return this; - } - - /** - * Set when this task should stop execution on. By default it never ends - * - * @date The date when this task should stop execution on => yyyy-mm-dd format is preferred. - * @time The specific time using 24 hour format => HH:mm, defaults to 00:00 - */ - ScheduledTask function endOn( required date, string time = "00:00" ){ - debugLog( "endOn", arguments ); - - variables.endOnDateTime = variables.dateTimeHelper.parse( - "#dateFormat( arguments.date, "yyyy-mm-dd" )#T#arguments.time#" - ); - return this; - } - /** * -------------------------------------------------------------------------- * TimeUnit Methods diff --git a/system/async/tasks/Scheduler.cfc b/system/async/tasks/Scheduler.cfc index 54ce09e6c..5c2eec07d 100644 --- a/system/async/tasks/Scheduler.cfc +++ b/system/async/tasks/Scheduler.cfc @@ -97,9 +97,12 @@ component accessors="true" singleton { * Register a new task in this scheduler but disable it immediately. This is useful * when debugging tasks and have the easy ability to disable them. * + * @name The name of this task + * @debug Add debugging logs to System out, disabled by default in coldbox.system.async.tasks.ScheduledTask + * * @return The registered and disabled Scheduled Task */ - ScheduledTask function xtask( required name ){ + ScheduledTask function xtask( required name, boolean debug = false ){ return task( argumentCollection = arguments ).disable(); } @@ -107,13 +110,16 @@ component accessors="true" singleton { * Register a new task in this scheduler that will be executed once the `startup()` is fired or manually * via the run() method of the task. * + * @name The name of this task + * @debug Add debugging logs to System out, disabled by default in coldbox.system.async.tasks.ScheduledTask + * * @return a ScheduledTask object so you can work on the registration of the task */ - ScheduledTask function task( required name ){ + ScheduledTask function task( required name, boolean debug = false ){ // Create task with custom name var oTask = variables.executor // Give me the task broda! - .newTask( arguments.name ) + .newTask( argumentCollection = arguments ) // Register ourselves in the task .setScheduler( this ) // Set default timezone into the task From 459515069b724182e89feac8a1e9e7df1fa41c31 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Wed, 21 Jun 2023 10:00:05 +0200 Subject: [PATCH 09/45] fix: :bug: COLDBOX-1234 #resolve Account for null or empty incoming json to prettyjson output --- system/core/util/Util.cfc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/core/util/Util.cfc b/system/core/util/Util.cfc index 62e67270f..c2ff607ae 100644 --- a/system/core/util/Util.cfc +++ b/system/core/util/Util.cfc @@ -181,8 +181,9 @@ component { * Format an incoming json string to a pretty version * * @target The target json to prettify + * @return The prettified json */ - string function prettyJson( string target ){ + string function prettyJson( string target = "" ){ var newLine = chr( 13 ) & chr( 10 ); var tab = chr( 9 ); var padding = 0; From 2ef3b3d22f66171b44b6cb56587cd5baaca8c6bc Mon Sep 17 00:00:00 2001 From: lmajano Date: Wed, 21 Jun 2023 08:13:07 +0000 Subject: [PATCH 10/45] Apply cfformat changes --- system/core/util/Util.cfc | 1 + 1 file changed, 1 insertion(+) diff --git a/system/core/util/Util.cfc b/system/core/util/Util.cfc index c2ff607ae..5a258330e 100644 --- a/system/core/util/Util.cfc +++ b/system/core/util/Util.cfc @@ -181,6 +181,7 @@ component { * Format an incoming json string to a pretty version * * @target The target json to prettify + * * @return The prettified json */ string function prettyJson( string target = "" ){ From 57e842e1bb7ca63aa86efe7b2ff9aeb425b98cb6 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Wed, 21 Jun 2023 11:01:15 +0200 Subject: [PATCH 11/45] =?UTF-8?q?=F0=9F=93=A6=20NEW:=20COLDBOX-1235=20#res?= =?UTF-8?q?olve=20New=20StringUtil.prettySQL=20method=20for=20usage=20in?= =?UTF-8?q?=20debugging=20and=20whoops=20reports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/core/delegates/StringUtil.cfc | 60 ++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/system/core/delegates/StringUtil.cfc b/system/core/delegates/StringUtil.cfc index 1144d2f16..f9610b26b 100644 --- a/system/core/delegates/StringUtil.cfc +++ b/system/core/delegates/StringUtil.cfc @@ -6,6 +6,66 @@ */ component singleton { + variables.NEW_LINE = chr( 13 ) & chr( 10 ); + variables.TAB = chr( 9 ); + + /** + * Format an incoming sql string to a pretty version + * + * @target The target sql to prettify + * + * @return The prettified sql + */ + function prettySql( string target = "" ){ + var keywords = [ + "SELECT", + "FROM", + "WHERE", + "GROUP BY", + "HAVING", + "ORDER BY", + "INSERT INTO", + "UPDATE", + "DELETE", + "CREATE TABLE", + "ALTER TABLE", + "DROP TABLE", + "UNION" + ]; + var indentedKeywords = [ + "JOIN", + "LEFT JOIN", + "INNER JOIN", + "OUTER JOIN", + "FULL JOIN" + ]; + var indent = " "; + + return arguments.target + .listToArray( variables.NEW_LINE ) + .map( ( item ) => item.trim() ) + .map( ( item ) => item.reReplace( + "(\s)*,(\s)*", + ",#variables.NEW_LINE##indent#", + "all" + ) ) + .map( ( item ) => { + return item.reReplacenocase( + "(\s)*(#keywords.toList( "|" )#)(\s)*", + "\2#variables.NEW_LINE##indent#", + "all" + ) + } ) + .map( ( item ) => { + return item.reReplacenocase( + "(#indentedKeywords.toList( "|" )#)", + "#variables.NEW_LINE##indent#\1", + "all" + ) + } ) + .toList( variables.NEW_LINE ); + } + /** * Slugify a string for URL Safety * From 814467bad2f3a8893e8eb2f14f71257172475a66 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 22 Jun 2023 14:09:04 +0200 Subject: [PATCH 12/45] WIREBOX-147 #resolve Improve debug logging to not send the full memento on several debug operations --- system/ioc/Injector.cfc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/ioc/Injector.cfc b/system/ioc/Injector.cfc index 36f431a36..8c24f17db 100644 --- a/system/ioc/Injector.cfc +++ b/system/ioc/Injector.cfc @@ -950,8 +950,7 @@ component serializable="false" accessors="true" { // Debug Data if ( variables.log.canDebug() ) { variables.log.debug( - "Finalized Autowire for: #arguments.targetID# by (#getName()#) injector", - arguments.mapping.getMemento().toString() + "Finalized Autowire for: #arguments.targetID#:#arguments.mapping.getName()#:#arguments.mapping.getPath().toString()#" ); } } From 910ed2a76b979eda7393cee3ea31f0b37b4c54ae Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 22 Jun 2023 15:00:58 +0200 Subject: [PATCH 13/45] fix: :zap: fixes for more testing updates --- tests/specs/orm-enabled/HTMLHelperTest.cfc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/specs/orm-enabled/HTMLHelperTest.cfc b/tests/specs/orm-enabled/HTMLHelperTest.cfc index 67d2db65b..83ee5b4e0 100755 --- a/tests/specs/orm-enabled/HTMLHelperTest.cfc +++ b/tests/specs/orm-enabled/HTMLHelperTest.cfc @@ -66,7 +66,7 @@ it( "can produce img tags", function(){ var img = htmlhelper.img( "includes/images/pio.jpg" ); assertEquals( - "", + "", img ); From 9335d8f17e55eab61adde740aafe85fde64df62d Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 22 Jun 2023 15:02:13 +0200 Subject: [PATCH 14/45] fix: :zap: removing wsdl tests, old and deprecated --- tests/specs/ioc/BuilderTest.cfc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/specs/ioc/BuilderTest.cfc b/tests/specs/ioc/BuilderTest.cfc index 5e0a8a8e4..34aa7510a 100755 --- a/tests/specs/ioc/BuilderTest.cfc +++ b/tests/specs/ioc/BuilderTest.cfc @@ -61,13 +61,6 @@ // debug(r); } - function testbuildWebservice() skip="noWSDLSupport"{ - mapping = createMock( "coldbox.system.ioc.config.Mapping" ).init( "Buffer" ); - mapping.setPath( "http://localhost:8599/test-harness/remote/Echo.cfc?wsdl" ); - r = builder.buildwebservice( mapping ); - // debug(r); - } - function testbuildcfc(){ // simple cfc var mapping = createMock( "coldbox.system.ioc.config.Mapping" ).init( "MyCFC" ); From b08955f454edfba491db201642700e3017eb27ec Mon Sep 17 00:00:00 2001 From: lmajano Date: Thu, 22 Jun 2023 13:02:18 +0000 Subject: [PATCH 15/45] Apply cfformat changes --- tests/specs/orm-enabled/HTMLHelperTest.cfc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/specs/orm-enabled/HTMLHelperTest.cfc b/tests/specs/orm-enabled/HTMLHelperTest.cfc index 83ee5b4e0..ff87b2966 100755 --- a/tests/specs/orm-enabled/HTMLHelperTest.cfc +++ b/tests/specs/orm-enabled/HTMLHelperTest.cfc @@ -66,7 +66,9 @@ it( "can produce img tags", function(){ var img = htmlhelper.img( "includes/images/pio.jpg" ); assertEquals( - "", + "", img ); From bb04317a1eccec0299dd049a38fdbca3d0a421c1 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 22 Jun 2023 15:03:31 +0200 Subject: [PATCH 16/45] small whitespace updates --- readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/readme.md b/readme.md index bd781125c..2df007b9a 100755 --- a/readme.md +++ b/readme.md @@ -50,7 +50,6 @@ ColdBox *Hierarchical* MVC is the de-facto enterprise-level [HMVC](https://en.wi * [An extensive eco-system](https://forgebox.io) * Much More - ## LTS Support For all ColdBox releases, updates are provided for 12 months and security fixes are provided for 2 years after the next major release. From cd44835147f3bea19c90b5776e23daf8b717e124 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Wed, 28 Jun 2023 17:58:50 +0200 Subject: [PATCH 17/45] fix: :zap: WIREBOX-148 #resolve Several AOP and Internal WireBox methods not excluded from delegations --- system/ioc/config/Mapping.cfc | 14 +++++++++++++- system/web/Controller.cfc | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/system/ioc/config/Mapping.cfc b/system/ioc/config/Mapping.cfc index dbf33e3f5..aa6f80431 100644 --- a/system/ioc/config/Mapping.cfc +++ b/system/ioc/config/Mapping.cfc @@ -125,8 +125,20 @@ component accessors="true" { "setInjector", "setBeanFactory", "setColdBox", - "$wbMixer", + "$wbAOPInvokeProxy", + "$wbAOPInclude", + "$wbAOPMixed", + "$wbAOPRemove", + "$wbAOPStoreJointPoint", + "$wbAOPTargetMapping", + "$wbAOPTargets", + "$wbBinder", "$wbDelegateMap", + "$wbInjector", + "$wbLazyProperties", + "$wbMixer", + "$wbObservedProperties", + "$wbProviders", "removeMixin", "injectMixin", "invokerMixin", diff --git a/system/web/Controller.cfc b/system/web/Controller.cfc index 23f761fdd..35d6c632b 100644 --- a/system/web/Controller.cfc +++ b/system/web/Controller.cfc @@ -102,7 +102,7 @@ component serializable="false" accessors="true" { // Create Utility variables.util = new coldbox.system.core.util.Util(); // services scope - variables.services = structNew( "ordered" ); + variables.services = structsNew( "ordered" ); // CFML Engine Utility variables.CFMLEngine = new coldbox.system.core.util.CFMLEngine(); // Register the application's async manager From 4bf176bfaffbbffb1f5a951153d735c2baa3c7e9 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Wed, 28 Jun 2023 18:01:00 +0200 Subject: [PATCH 18/45] feat: :sparkles: COLDBOX-1236 #resolve Incorporate appName into the appHash to give more uniqueness to locks internally --- system/web/Controller.cfc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/web/Controller.cfc b/system/web/Controller.cfc index 35d6c632b..3005f5ef7 100644 --- a/system/web/Controller.cfc +++ b/system/web/Controller.cfc @@ -115,7 +115,7 @@ component serializable="false" accessors="true" { if ( NOT reFind( "(/|\\)$", arguments.appRootPath ) ) { arguments.appRootPath = appRootPath & "/"; } - variables.appHash = hash( arguments.appRootPath ); + variables.appHash = hash( arguments.appRootPath & variables.appName ); variables.appRootPath = arguments.appRootPath; // The App Settings variables.configSettings = {}; From 39e39a848883387321c64ce102a35b6a151ccb63 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Wed, 28 Jun 2023 19:46:56 +0200 Subject: [PATCH 19/45] oops, had a typo --- system/web/Controller.cfc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/web/Controller.cfc b/system/web/Controller.cfc index 3005f5ef7..5890d340b 100644 --- a/system/web/Controller.cfc +++ b/system/web/Controller.cfc @@ -102,7 +102,7 @@ component serializable="false" accessors="true" { // Create Utility variables.util = new coldbox.system.core.util.Util(); // services scope - variables.services = structsNew( "ordered" ); + variables.services = structNew( "ordered" ); // CFML Engine Utility variables.CFMLEngine = new coldbox.system.core.util.CFMLEngine(); // Register the application's async manager From 4023e9370d96da8f45e3d764c470bd99497b0d83 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Wed, 28 Jun 2023 19:58:34 +0200 Subject: [PATCH 20/45] WIREBOX-149 #resolve `toWebservice()` is now deprecated --- tests/specs/ioc/config/BinderTest.cfc | 7 ------- .../ioc/config/samples/InjectorCreationTestsBinder.cfc | 2 -- tests/suites/wirebox/WireBoxConfig.cfc | 2 -- 3 files changed, 11 deletions(-) diff --git a/tests/specs/ioc/config/BinderTest.cfc b/tests/specs/ioc/config/BinderTest.cfc index e6fc4d393..e12ac2ed5 100755 --- a/tests/specs/ioc/config/BinderTest.cfc +++ b/tests/specs/ioc/config/BinderTest.cfc @@ -201,13 +201,6 @@ assertEquals( "java.lang.StringBuilder", mapping.getPath() ); } - function testToWebservice(){ - config.map( "Test" ).toWebservice( "http://localhost:8599/test-harness/remote/Echo.cfc?wsdl" ); - mapping = config.getMapping( "Test" ); - assertEquals( this.TYPES.WEBSERVICE, mapping.getType() ); - assertEquals( "http://localhost:8599/test-harness/remote/Echo.cfc?wsdl", mapping.getPath() ); - } - function testToRSS(){ config.map( "Test" ).toRSS( "http://www.coldbox.org/rss" ); mapping = config.getMapping( "Test" ); diff --git a/tests/specs/ioc/config/samples/InjectorCreationTestsBinder.cfc b/tests/specs/ioc/config/samples/InjectorCreationTestsBinder.cfc index a0cb9543e..d9a4897b8 100755 --- a/tests/specs/ioc/config/samples/InjectorCreationTestsBinder.cfc +++ b/tests/specs/ioc/config/samples/InjectorCreationTestsBinder.cfc @@ -23,8 +23,6 @@ // map to constant value, no need for scope map( "jsonProperty" ).toValue( "[{name:'luis'},{name:'Jose'}]" ); - // map to ws - map( "coldboxWS" ).toWebservice( "http://localhost:8599/test-harness/remote/Echo.cfc?wsdl" ); // map to rss feed map( "googleNews" ) .toRSS( "http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss" ) diff --git a/tests/suites/wirebox/WireBoxConfig.cfc b/tests/suites/wirebox/WireBoxConfig.cfc index a0af624f5..559992e92 100755 --- a/tests/suites/wirebox/WireBoxConfig.cfc +++ b/tests/suites/wirebox/WireBoxConfig.cfc @@ -23,8 +23,6 @@ // map to constant value, no need for scope map( "jsonProperty" ).toValue( "[{name:'luis'},{name:'Jose'}]" ); - // map to ws - map( "coldboxWS" ).toWebservice( "http://localhost:8599/test-harness/remote/Echo.cfc?wsdl" ); // map to rss feed map( "googleNews" ) .toRSS( "http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss" ) From e7a44f4c9e49c7edde8e71256cd283f77e5248dc Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Fri, 30 Jun 2023 22:56:09 +0200 Subject: [PATCH 21/45] WIREBOX-149 --- tests/specs/ioc/InjectorCreationTest.cfc | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tests/specs/ioc/InjectorCreationTest.cfc b/tests/specs/ioc/InjectorCreationTest.cfc index 845e9950a..9350db855 100755 --- a/tests/specs/ioc/InjectorCreationTest.cfc +++ b/tests/specs/ioc/InjectorCreationTest.cfc @@ -138,19 +138,6 @@ assertTrue( len( prop ) ); } - function testWebService() skip="noWSDLSupport"{ - ws = injector.getInstance( "coldboxWS" ); - - // - if ( listFindNoCase( "Lucee", server.coldfusion.productname ) ) { - expect( getMetadata( ws ).name ).toMatch( "rpc" ); - } - // adobe - else { - expect( getMetadata( ws ).name ).toMatch( "ServiceProxy" ); - } - } - function testDSL(){ dslobject = injector.getInstance( "coolDSL" ); From e153504bfc6a8972b5ddca67fcde9d72e9b23c36 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Fri, 30 Jun 2023 23:32:58 +0200 Subject: [PATCH 22/45] cleanup of old tests --- tests/specs/orm-enabled/HTMLHelperTest.cfc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/specs/orm-enabled/HTMLHelperTest.cfc b/tests/specs/orm-enabled/HTMLHelperTest.cfc index ff87b2966..f32aada65 100755 --- a/tests/specs/orm-enabled/HTMLHelperTest.cfc +++ b/tests/specs/orm-enabled/HTMLHelperTest.cfc @@ -64,7 +64,7 @@ } ); it( "can produce img tags", function(){ - var img = htmlhelper.img( "includes/images/pio.jpg" ); + var img = htmlhelper.img( "/includes/images/pio.jpg" ); assertEquals( " Date: Fri, 30 Jun 2023 23:42:05 +0200 Subject: [PATCH 23/45] more updates to html helper tests so we get the same results in all engines --- tests/specs/orm-enabled/HTMLHelperTest.cfc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/specs/orm-enabled/HTMLHelperTest.cfc b/tests/specs/orm-enabled/HTMLHelperTest.cfc index f32aada65..57c4c8fdf 100755 --- a/tests/specs/orm-enabled/HTMLHelperTest.cfc +++ b/tests/specs/orm-enabled/HTMLHelperTest.cfc @@ -65,18 +65,10 @@ it( "can produce img tags", function(){ var img = htmlhelper.img( "/includes/images/pio.jpg" ); - assertEquals( - "", - img - ); + expect( img ).toInclude( encodeForHTMLAttribute( "includes/images/pio.jpg" ) ); var img = htmlhelper.img( "http://hello.com/includes/images/pio.jpg" ); - assertEquals( - "", - img - ); + expect( img ).toInclude( encodeForHTMLAttribute( "http://hello.com/includes/images/pio.jpg" ) ); } ); it( "can produce link tags", function(){ @@ -337,7 +329,7 @@ .toInclude( "name=""userForm""" ); str = htmlhelper.startForm(); - expect( str ).toInclude( "cbTestHarness&##x2f;index.cfm&##x2f;" ).toInclude( "method=""post""" ); + expect( str ).toInclude( "method=""post""" ); } ); it( "can produce form tags with non-standard HTTP Methods (PUT,PATCH,DELETE)", function(){ From e3ee5f8ad7d21b3b5658ab7ed28b54611bef75b4 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Tue, 4 Jul 2023 20:44:27 +0200 Subject: [PATCH 24/45] fix: :zap: WIREBOX-150 #resolve Wirebox standalone is missing delegates --- build/build.xml | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/build/build.xml b/build/build.xml index 5549f1cdb..ab35e983e 100644 --- a/build/build.xml +++ b/build/build.xml @@ -277,10 +277,7 @@ - - - - + @@ -394,12 +391,7 @@ - - - - - - + @@ -513,13 +505,7 @@ - - - - - - - + From 333b9063ba035c38f0c37b214b579d9a036e4517 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Sat, 8 Jul 2023 11:36:57 +0200 Subject: [PATCH 25/45] COLDBOX-1237 #resolve Removal of Lucee RC tests - no longer needed --- box.json | 2 +- server-lucee@5rc.json | 27 --------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 server-lucee@5rc.json diff --git a/box.json b/box.json index 4e2e6af5c..44c01afc2 100644 --- a/box.json +++ b/box.json @@ -42,7 +42,7 @@ "cbproxies":"^1.0.1+13" }, "devDependencies":{ - "testbox":"be", + "testbox":"^5.1.0+2", "commandbox-dotenv":"*", "commandbox-cfconfig":"*", "commandbox-cfformat":"*" diff --git a/server-lucee@5rc.json b/server-lucee@5rc.json deleted file mode 100644 index e3852f415..000000000 --- a/server-lucee@5rc.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "app":{ - "cfengine":"lucee@5.3-rc", - "serverHomeDirectory":".engine/luceerc" - }, - "name":"coldbox-lucee@5rc", - "force":true, - "openBrowser":false, - "web":{ - "directoryBrowsing":true, - "http":{ - "port":"8599" - }, - "rewrites":{ - "enable":true - }, - "aliases":{ - "/coldbox":"./" - } - }, - "JVM":{ - "heapSize":"1024" - }, - "cfconfig":{ - "file":".cfconfig.json" - } -} From e7097ec20b09cd4fdf4f29119beac52428cbb28c Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Sat, 8 Jul 2023 12:33:19 +0200 Subject: [PATCH 26/45] Pinning to Lucee 5.3 as 5.4 has regressions --- server-lucee@5.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-lucee@5.json b/server-lucee@5.json index 0d8a008e2..0ea9b0af6 100644 --- a/server-lucee@5.json +++ b/server-lucee@5.json @@ -1,6 +1,6 @@ { "app":{ - "cfengine":"lucee@5", + "cfengine":"lucee@5.3", "serverHomeDirectory":".engine/lucee5" }, "name":"coldbox-lucee@5", From e9250fafd37559d61cbd4ffc0d6f46d8dd654619 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Sat, 8 Jul 2023 12:34:00 +0200 Subject: [PATCH 27/45] Fixing path issues for elixir maps, who knows how long this was broken. This only affects the test-harness --- test-harness/Application.cfc | 7 ++++++- test-harness/config/Coldbox.cfc | 2 +- test-harness/includes/rev-manifest.json | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/test-harness/Application.cfc b/test-harness/Application.cfc index 29b949b41..5139412c3 100644 --- a/test-harness/Application.cfc +++ b/test-harness/Application.cfc @@ -22,6 +22,9 @@ component { COLDBOX_CONFIG_FILE = ""; // COLDBOX APPLICATION KEY OVERRIDE COLDBOX_APP_KEY = ""; + COLDBOX_FAIL_FAST = true; + COLDBOX_WEB_MAPPING = "test-harness"; + // JAVA INTEGRATION: JUST DROP JARS IN THE LIB FOLDER // You can add more paths or change the reload flag as well. this.javaSettings = { @@ -54,7 +57,9 @@ component { COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, - COLDBOX_APP_MAPPING + COLDBOX_APP_MAPPING, + COLDBOX_FAIL_FAST, + COLDBOX_WEB_MAPPING ); application.cbBootstrap.loadColdbox(); diff --git a/test-harness/config/Coldbox.cfc b/test-harness/config/Coldbox.cfc index 8ca274ed5..0e5fbede4 100644 --- a/test-harness/config/Coldbox.cfc +++ b/test-harness/config/Coldbox.cfc @@ -91,7 +91,7 @@ }, // Root Logger root : { levelmax : "INFO", appenders : "*" } - // ,debug = [ "coldbox.system" ] + //,debug = [ "coldbox.system.ioc.Injector" ] }; // You can now register executors for your application diff --git a/test-harness/includes/rev-manifest.json b/test-harness/includes/rev-manifest.json index e4b012dc7..51a3a5056 100644 --- a/test-harness/includes/rev-manifest.json +++ b/test-harness/includes/rev-manifest.json @@ -1,5 +1,5 @@ { - "test-harness/includes/js/jquery.js": "/test-harness/includes/js/jquery.1.js", - "test-harness/includes/js/bootstrap.min.js": "/test-harness/includes/js/bootstrap.min.js", - "test-harness/modules_app/contentbox-custom/_modules/cctManager/includes/js/cctManager.js": "/modules_app/contentbox-custom/_modules/cctManager/includes/js/cctManager.8613ac4947980152a2e0.js" -} \ No newline at end of file + "includes/js/jquery.js": "/includes/js/jquery.1.js", + "includes/js/bootstrap.min.js": "/includes/js/bootstrap.min.js", + "/test-harness/modules_app/contentbox-custom/_modules/cctManager/includes/js/cctManager.js": "/modules_app/contentbox-custom/_modules/cctManager/includes/js/cctManager.8613ac4947980152a2e0.js" +} From 8880375095fe3335d028f622ab4d70b04b35b8d9 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Sat, 8 Jul 2023 12:34:04 +0200 Subject: [PATCH 28/45] WIREBOX-151 #resolve Injections are null, sometimes --- system/ioc/Injector.cfc | 91 ++++++++++++------- test-harness/models/transientCache/Base.cfc | 17 ++++ .../models/transientCache/Derived.cfc | 13 +++ .../models/transientCache/SomeSingleton.cfc | 3 + .../views/transientCacheTests/index.cfm | 38 ++++++++ 5 files changed, 127 insertions(+), 35 deletions(-) create mode 100644 test-harness/models/transientCache/Base.cfc create mode 100644 test-harness/models/transientCache/Derived.cfc create mode 100644 test-harness/models/transientCache/SomeSingleton.cfc create mode 100644 test-harness/views/transientCacheTests/index.cfm diff --git a/system/ioc/Injector.cfc b/system/ioc/Injector.cfc index 8c24f17db..75201551a 100644 --- a/system/ioc/Injector.cfc +++ b/system/ioc/Injector.cfc @@ -1231,30 +1231,30 @@ component serializable="false" accessors="true" { required string targetID, required mapping ){ - // Transient request cache - param request.cbTransientDICache = {}; - // Transient Cache Enable + // Transient Cache Enabled Checks // - Global Flag - // - Has to be a transient - // - Has to be a non-virtual inheritance - // - Doesn't have a transientCache annotation + // - Mapping has to be a transient + // - Mapping has to be a non-virtual inheritance + // - Mapping doesn't have a transientCache annotation // cfformat-ignore-start var transientCacheEnabled = getBinder().getTransientInjectionCache() && arguments.mapping.isTransient() && !arguments.mapping.isVirtualInheritance() && arguments.mapping.getComponentAnnotation( "transientCache", true ) ; + var transientCache = getTransientCache(); // cfformat-ignore-end // Verify if we have seen this transient in this request - if ( transientCacheEnabled && request.cbTransientDICache.keyExists( arguments.targetID ) ) { + if ( transientCacheEnabled && transientCache.containsKey( arguments.targetID.lcase() ) ) { + var targetTransientCache = getTransientCache( arguments.targetID.lcase() ); // Injections Injection :) structAppend( arguments.targetObject.getVariablesMixin(), - request.cbTransientDICache[ arguments.targetId ].injections + targetTransientCache.injections ); // Delegations Injection - arguments.targetObject.$wbDelegateMap = request.cbTransientDICache[ arguments.targetId ].delegations; + arguments.targetObject.$wbDelegateMap = targetTransientCache.delegations; // inject delegation into the target for ( var delegationMethod in structKeyArray( arguments.targetObject.$wbDelegateMap ) ) { arguments.targetObject.injectMixin( delegationMethod, variables.mixerUtil.getByDelegate ); @@ -1307,32 +1307,10 @@ component serializable="false" accessors="true" { // Store in transient cache if ( transientCacheEnabled ) { - // Init storage if not found - if ( !request.cbTransientDICache.keyExists( arguments.targetID ) ) { - lock - name ="wirebox:transientcache:#arguments.targetId#" - type ="exclusive" - throwontimeout="true" - timeout ="15" { - if ( !request.cbTransientDICache.keyExists( arguments.targetID ) ) { - request.cbTransientDICache[ arguments.targetID ] = { - injections : {}, - delegations : {} - }; - } - } - } - - // Store delegations + injections - lock - name ="wirebox:transientcache:#arguments.targetId#.storage" - type ="exclusive" - throwontimeout="true" - timeout ="15" { - request.cbTransientDICache[ arguments.targetId ].injections[ thisDIData.name ] = refLocal.dependency; - if ( structKeyExists( arguments.targetObject, "$wbDelegateMap" ) ) { - request.cbTransientDICache[ arguments.targetID ].delegations = arguments.targetObject.$wbDelegateMap; - } + var targetTransientCache = getTransientCache( arguments.targetID.lcase() ); + targetTransientCache.injections[ thisDIData.name ] = refLocal.dependency; + if ( structKeyExists( arguments.targetObject, "$wbDelegateMap" ) ) { + targetTransientCache.delegations = arguments.targetObject.$wbDelegateMap; } } @@ -1353,6 +1331,49 @@ component serializable="false" accessors="true" { return this; } + /** + * Get a reference to the transient cache, if none exists, it will be created for the request. + * + * @targetID If passed, get the transient cache for the targetID, otherwise, get the global transient cache + */ + struct function getTransientCache( targetId ){ + if( !request.keyExists( "cbTransientDICache" ) ){ + lock + name ="wirebox:transientcache" + type ="exclusive" + throwontimeout="true" + timeout ="15" { + if( !request.keyExists( "cbTransientDICache" ) ){ + request.cbTransientDICache = createObject( "java", "java.util.concurrent.ConcurrentHashMap" ).init(); + variables.log.debug( () => "WireBox Transient Cache Created" ); + } + } + } + + // Global or targeted transient cache? + if( isNull( arguments.targetId ) ){ + return request.cbTransientDICache; + } + + // Init targetID storage if not found + if ( !request.cbTransientDICache.containsKey( arguments.targetID.lcase() ) ) { + lock + name ="wirebox:transientcache:#arguments.targetId#" + type ="exclusive" + throwontimeout="true" + timeout ="15" { + if ( !request.cbTransientDICache.containsKey( arguments.targetID.lcase() ) ) { + request.cbTransientDICache.put( arguments.targetID.lcase(), { + "injections" : {}, + "delegations" : {} + } ); + variables.log.debug( () => "WireBox Transient Cache Storage for #targetId# Created" ); + } + } + } + return request.cbTransientDICache.get( arguments.targetId.lcase() ); + } + /** * Process a target object dependency delegation * diff --git a/test-harness/models/transientCache/Base.cfc b/test-harness/models/transientCache/Base.cfc new file mode 100644 index 000000000..022a1b196 --- /dev/null +++ b/test-harness/models/transientCache/Base.cfc @@ -0,0 +1,17 @@ +component threadsafe{ + + property name="wirebox" inject="wirebox"; + property name="someSingleton" inject="SomeSingleton"; + + /** + * Init + * @wirebox.inject wirebox + */ + public function init( required wirebox ) { + return this; + } + + public function basefoo() { + return someSingleton.doSomeWork(); // ~1/20 chance that someSingleton is null + } +} diff --git a/test-harness/models/transientCache/Derived.cfc b/test-harness/models/transientCache/Derived.cfc new file mode 100644 index 000000000..fff377cc2 --- /dev/null +++ b/test-harness/models/transientCache/Derived.cfc @@ -0,0 +1,13 @@ +component extends="Base" threadsafe{ + + /** + * Init + * @wirebox.inject wirebox + */ + public function init( + required wirebox, + ) { + SUPER.init( argumentCollection = arguments ); + return this; + } +} diff --git a/test-harness/models/transientCache/SomeSingleton.cfc b/test-harness/models/transientCache/SomeSingleton.cfc new file mode 100644 index 000000000..822f6ad3d --- /dev/null +++ b/test-harness/models/transientCache/SomeSingleton.cfc @@ -0,0 +1,3 @@ +component singleton { + function doSomeWork() { return 42; } +} diff --git a/test-harness/views/transientCacheTests/index.cfm b/test-harness/views/transientCacheTests/index.cfm new file mode 100644 index 000000000..ea7e8d2f8 --- /dev/null +++ b/test-harness/views/transientCacheTests/index.cfm @@ -0,0 +1,38 @@ + + for (i = 0; i < 10; i++) { + thread name="a#i#" { + sleep(10) + getInstance( "Derived" ).basefoo() + } + thread name="b#i#" { + sleep(10) + getInstance( "Derived" ).basefoo() + } + thread name="c#i#" { + sleep(10) + getInstance( "Derived" ).basefoo() + } + + thread name="a#i#" action="join"; + thread name="b#i#" action="join"; + thread name="c#i#" action="join"; + + if ( + structKeyExists( cfthread[ "a#i#" ], "error" ) || + structKeyExists( cfthread[ "b#i#" ], "error" ) || + structKeyExists( cfthread[ "c#i#" ], "error" ) + ) { + writedump( cfthread[ "a#i#" ] ); + writedump( cfthread[ "b#i#" ] ); + writedump( cfthread[ "c#i#" ] ); + abort; + } else { + //writedump( var = cfthread[ "a#i#" ], label="Thread a#i#", expand="false" ); + //writedump( var = cfthread[ "b#i#" ], label="Thread b#i#", expand="false" ); + //writedump( var = cfthread[ "c#i#" ], label="Thread c#i#", expand="false" ); + } + + } + + writedump("OK...") + From 83b5ff2737762731c13926995e9816062471207c Mon Sep 17 00:00:00 2001 From: lmajano Date: Sat, 8 Jul 2023 10:35:27 +0000 Subject: [PATCH 29/45] Apply cfformat changes --- system/ioc/Injector.cfc | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/system/ioc/Injector.cfc b/system/ioc/Injector.cfc index 75201551a..57ff9a690 100644 --- a/system/ioc/Injector.cfc +++ b/system/ioc/Injector.cfc @@ -1249,10 +1249,7 @@ component serializable="false" accessors="true" { if ( transientCacheEnabled && transientCache.containsKey( arguments.targetID.lcase() ) ) { var targetTransientCache = getTransientCache( arguments.targetID.lcase() ); // Injections Injection :) - structAppend( - arguments.targetObject.getVariablesMixin(), - targetTransientCache.injections - ); + structAppend( arguments.targetObject.getVariablesMixin(), targetTransientCache.injections ); // Delegations Injection arguments.targetObject.$wbDelegateMap = targetTransientCache.delegations; // inject delegation into the target @@ -1307,7 +1304,7 @@ component serializable="false" accessors="true" { // Store in transient cache if ( transientCacheEnabled ) { - var targetTransientCache = getTransientCache( arguments.targetID.lcase() ); + var targetTransientCache = getTransientCache( arguments.targetID.lcase() ); targetTransientCache.injections[ thisDIData.name ] = refLocal.dependency; if ( structKeyExists( arguments.targetObject, "$wbDelegateMap" ) ) { targetTransientCache.delegations = arguments.targetObject.$wbDelegateMap; @@ -1337,13 +1334,9 @@ component serializable="false" accessors="true" { * @targetID If passed, get the transient cache for the targetID, otherwise, get the global transient cache */ struct function getTransientCache( targetId ){ - if( !request.keyExists( "cbTransientDICache" ) ){ - lock - name ="wirebox:transientcache" - type ="exclusive" - throwontimeout="true" - timeout ="15" { - if( !request.keyExists( "cbTransientDICache" ) ){ + if ( !request.keyExists( "cbTransientDICache" ) ) { + lock name="wirebox:transientcache" type="exclusive" throwontimeout="true" timeout="15" { + if ( !request.keyExists( "cbTransientDICache" ) ) { request.cbTransientDICache = createObject( "java", "java.util.concurrent.ConcurrentHashMap" ).init(); variables.log.debug( () => "WireBox Transient Cache Created" ); } @@ -1351,7 +1344,7 @@ component serializable="false" accessors="true" { } // Global or targeted transient cache? - if( isNull( arguments.targetId ) ){ + if ( isNull( arguments.targetId ) ) { return request.cbTransientDICache; } @@ -1363,10 +1356,10 @@ component serializable="false" accessors="true" { throwontimeout="true" timeout ="15" { if ( !request.cbTransientDICache.containsKey( arguments.targetID.lcase() ) ) { - request.cbTransientDICache.put( arguments.targetID.lcase(), { - "injections" : {}, - "delegations" : {} - } ); + request.cbTransientDICache.put( + arguments.targetID.lcase(), + { "injections" : {}, "delegations" : {} } + ); variables.log.debug( () => "WireBox Transient Cache Storage for #targetId# Created" ); } } From cf0ae61a21c7e0bc1537f2d77b5bd29010c880af Mon Sep 17 00:00:00 2001 From: Michael Born <8106227+michaelborn@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:15:06 -0400 Subject: [PATCH 30/45] Install Ortus ORM extension via server.json's env prop (#580) * Install Ortus ORM extension via server.json's env prop Since the latest Lucee builds don't bundle the Hibernate extension, it is time to switch to the Ortus-maintained extension. * Allow PRs to run without passing slack webhook --- .github/workflows/tests.yml | 2 +- server-lucee@5.json | 5 ++++- server-lucee@6.json | 3 +++ server-lucee@be.json | 9 ++++++--- server-lucee@light.json | 9 ++++++--- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a4cf198e6..996629be3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ on: workflow_call: secrets: SLACK_WEBHOOK_URL: - required: true + required: false jobs: tests: diff --git a/server-lucee@5.json b/server-lucee@5.json index 0ea9b0af6..8e4844083 100644 --- a/server-lucee@5.json +++ b/server-lucee@5.json @@ -1,6 +1,6 @@ { "app":{ - "cfengine":"lucee@5.3", + "cfengine":"lucee@5.4", "serverHomeDirectory":".engine/lucee5" }, "name":"coldbox-lucee@5", @@ -23,5 +23,8 @@ }, "cfconfig":{ "file":".cfconfig.json" + }, + "env":{ + "lucee-extensions":"D062D72F-F8A2-46F0-8CBC91325B2F067B" } } diff --git a/server-lucee@6.json b/server-lucee@6.json index 6053d5770..f05e4b05f 100644 --- a/server-lucee@6.json +++ b/server-lucee@6.json @@ -23,5 +23,8 @@ }, "cfconfig":{ "file":".cfconfig.json" + }, + "env":{ + "lucee-extensions":"D062D72F-F8A2-46F0-8CBC91325B2F067B" } } diff --git a/server-lucee@be.json b/server-lucee@be.json index d82aa548a..6a2e80750 100644 --- a/server-lucee@be.json +++ b/server-lucee@be.json @@ -21,7 +21,10 @@ "JVM":{ "heapSize":"1024" }, - "cfconfig": { - "file" : ".cfconfig.json" - } + "cfconfig":{ + "file":".cfconfig.json" + }, + "env":{ + "lucee-extensions":"D062D72F-F8A2-46F0-8CBC91325B2F067B" + } } diff --git a/server-lucee@light.json b/server-lucee@light.json index 2d301c65e..0e6add1ac 100644 --- a/server-lucee@light.json +++ b/server-lucee@light.json @@ -21,7 +21,10 @@ "JVM":{ "heapSize":"1024" }, - "cfconfig": { - "file" : ".cfconfig.json" - } + "cfconfig":{ + "file":".cfconfig.json" + }, + "env":{ + "lucee-extensions":"D062D72F-F8A2-46F0-8CBC91325B2F067B,37C61C0A-5D7E-4256-8572639BE0CF5838 " + } } From 80952a7b5c426e8d2ade0606e00e8751de10325b Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Tue, 1 Aug 2023 17:25:13 +0200 Subject: [PATCH 31/45] WIREBOX-154 #resolve populateFromQuery delegate defaulting composeRelationships to true --- system/core/delegates/Population.cfc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/core/delegates/Population.cfc b/system/core/delegates/Population.cfc index 24cbef589..8c1de3915 100644 --- a/system/core/delegates/Population.cfc +++ b/system/core/delegates/Population.cfc @@ -33,7 +33,7 @@ component { boolean ignoreEmpty = false, string nullEmptyInclude = "", string nullEmptyExclude = "", - boolean composeRelationships = true, + boolean composeRelationships = false, any target = $parent, boolean ignoreTargetLists = false ){ @@ -65,7 +65,7 @@ component { boolean ignoreEmpty = false, string nullEmptyInclude = "", string nullEmptyExclude = "", - boolean composeRelationships = true, + boolean composeRelationships = false, required string prefix, any target = $parent, boolean ignoreTargetLists = false @@ -97,7 +97,7 @@ component { boolean ignoreEmpty = false, string nullEmptyInclude = "", string nullEmptyExclude = "", - boolean composeRelationships = true, + boolean composeRelationships = false, any target = $parent, boolean ignoreTargetLists = false ){ @@ -130,7 +130,7 @@ component { boolean ignoreEmpty = false, string nullEmptyInclude = "", string nullEmptyExclude = "", - boolean composeRelationships = true, + boolean composeRelationships = false, any target = $parent, boolean ignoreTargetLists = false ){ @@ -163,7 +163,7 @@ component { boolean ignoreEmpty = false, string nullEmptyInclude = "", string nullEmptyExclude = "", - boolean composeRelationships = true, + boolean composeRelationships = false, any target = $parent, boolean ignoreTargetLists = false ){ From c8a488808d3374f98c4507231179de4f1ee431bc Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Tue, 1 Aug 2023 19:16:28 +0200 Subject: [PATCH 32/45] syntax updates [no ci] --- server-adobe@2021.json | 12 ++++++------ system/async/tasks/ScheduledTask.cfc | 14 +++++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/server-adobe@2021.json b/server-adobe@2021.json index e0722c017..c9d13c9df 100644 --- a/server-adobe@2021.json +++ b/server-adobe@2021.json @@ -21,10 +21,10 @@ "JVM":{ "heapSize":"1024" }, - "cfconfig": { - "file" : ".cfconfig.json" - }, - "scripts" : { - "onServerInstall":"cfpm install caching,zip,orm,mysql,postgresql,sqlserver,document,feed,mail,debugger" - } + "cfconfig":{ + "file":".cfconfig.json" + }, + "scripts":{ + "onServerInstall":"cfpm install caching,zip,orm,mysql,postgresql,sqlserver,document,feed,mail,debugger" + } } diff --git a/system/async/tasks/ScheduledTask.cfc b/system/async/tasks/ScheduledTask.cfc index 6d9d3e21c..c0933dd4c 100644 --- a/system/async/tasks/ScheduledTask.cfc +++ b/system/async/tasks/ScheduledTask.cfc @@ -929,8 +929,9 @@ component accessors="true" { variables.delayTimeUnit = arguments.timeUnit; } - if ( arguments.setNextRunTime ) + if ( arguments.setNextRunTime ){ setInitialNextRunTime( delay: arguments.delay, timeUnit: arguments.timeUnit ); + } return this; } @@ -1618,10 +1619,11 @@ component accessors="true" { ); if ( !isValid( "date", variables.stats.nextRun ) ) { - if ( !isNull( arguments.nextRun ) && isInstanceOf( arguments.nextRun, "java.time.LocalDateTime" ) ) + if ( !isNull( arguments.nextRun ) && isInstanceOf( arguments.nextRun, "java.time.LocalDateTime" ) ){ variables.stats.nextRun = arguments.nextRun; - else if ( !isInstanceOf( variables.stats.nextRun, "java.time.LocalDateTime" ) ) + } else if ( !isInstanceOf( variables.stats.nextRun, "java.time.LocalDateTime" ) ){ variables.stats.nextRun = getJavaNow(); + } if ( amount ) { switch ( unit ) { @@ -1669,7 +1671,6 @@ component accessors="true" { .withMinute( javacast( "int", 59 ) ) .withSecond( javacast( "int", 59 ) ); - debugLog( "startTime", { @@ -1818,7 +1819,10 @@ component accessors="true" { } /** - * Debug output method + * Debug output to the executor out console + * + * @caller The name of the method calling this method + * @args The arguments to attach to the logging output */ function debugLog( required string caller, struct args = {} ){ if ( variables.debug ) { From 296711aeff0a162eaffc0d02e2e936c8b862c8dc Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Tue, 1 Aug 2023 21:03:15 +0200 Subject: [PATCH 33/45] removed jaxb config property. No longer needed since we use our own ORM extension now. --- test-harness/config/ApplicationMixins.cfm | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/test-harness/config/ApplicationMixins.cfm b/test-harness/config/ApplicationMixins.cfm index 3b04fba69..cba16d691 100644 --- a/test-harness/config/ApplicationMixins.cfm +++ b/test-harness/config/ApplicationMixins.cfm @@ -1,18 +1,5 @@ - /** - * Fixes JAXBContext classloader issue with Lucee running the Hibernate 5.4 extension on CommandBox. - * - * Can remove this If and Only If: - * a) Lucee gets their act together, or - * b) everyone upgrades to CommandBox 5.8.x or newer. - */ - createObject( "java", "java.lang.System" ) - .setProperty( - "javax.xml.bind.context.factory", - "com.sun.xml.bind.v2.ContextFactory" - ); - // Lucee 5 Cache Definition this.cache.connections[ "default" ] = { "class" = 'lucee.runtime.cache.ram.RamCache' From 7bd322435664cd55288c6494a1172843d7cb18ba Mon Sep 17 00:00:00 2001 From: lmajano Date: Tue, 1 Aug 2023 19:05:18 +0000 Subject: [PATCH 34/45] Apply cfformat changes --- system/async/tasks/ScheduledTask.cfc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/async/tasks/ScheduledTask.cfc b/system/async/tasks/ScheduledTask.cfc index c0933dd4c..69f675d39 100644 --- a/system/async/tasks/ScheduledTask.cfc +++ b/system/async/tasks/ScheduledTask.cfc @@ -929,7 +929,7 @@ component accessors="true" { variables.delayTimeUnit = arguments.timeUnit; } - if ( arguments.setNextRunTime ){ + if ( arguments.setNextRunTime ) { setInitialNextRunTime( delay: arguments.delay, timeUnit: arguments.timeUnit ); } @@ -1619,9 +1619,9 @@ component accessors="true" { ); if ( !isValid( "date", variables.stats.nextRun ) ) { - if ( !isNull( arguments.nextRun ) && isInstanceOf( arguments.nextRun, "java.time.LocalDateTime" ) ){ + if ( !isNull( arguments.nextRun ) && isInstanceOf( arguments.nextRun, "java.time.LocalDateTime" ) ) { variables.stats.nextRun = arguments.nextRun; - } else if ( !isInstanceOf( variables.stats.nextRun, "java.time.LocalDateTime" ) ){ + } else if ( !isInstanceOf( variables.stats.nextRun, "java.time.LocalDateTime" ) ) { variables.stats.nextRun = getJavaNow(); } From 3c62c9d87a911c3566362d90e8dee0c0ecf75ad1 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Tue, 1 Aug 2023 22:10:25 +0200 Subject: [PATCH 35/45] adding debugging for scheduling tasks, to make it easier to debug them. --- test-harness/config/Scheduler.cfc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test-harness/config/Scheduler.cfc b/test-harness/config/Scheduler.cfc index 9f218d7ab..f2bf00b31 100644 --- a/test-harness/config/Scheduler.cfc +++ b/test-harness/config/Scheduler.cfc @@ -10,7 +10,7 @@ component { }) .every( 1, "second" ); - task( "Scope Test" ) + task( name: "Scope Test", debug: true ) .call( function(){ writeDump( var="****************************************************************************", output="console" ); writeDump( var="Scope Test (application) -> #getThreadName()# #application.keyList()#", output="console" ); @@ -27,7 +27,7 @@ component { writeDump( var='====> Scope test failed (#getThreadName()#)!! #exception.message# #exception.stacktrace.left( 500 )#', output="console" ); } ); - task( "ProcessJobs" ) + task( name: "ProcessJobs", debug: true ) .call( function(){ runEvent( "main.process" ); }) @@ -41,7 +41,7 @@ component { writeDump( var="====> process jobs success : Stats: #task.getStats().toString()#", output="console" ); } ); - task( "testharness-Heartbeat" ) + task( name: "testharness-Heartbeat", debug: true ) .call( function() { if ( randRange(1, 5) eq 1 ){ throw( message = "I am throwing up randomly!", type="RandomThrowup" ); @@ -69,14 +69,14 @@ component { * Called before the scheduler is going to be shutdown */ function onShutdown(){ - writeDump( var="Bye bye from the Global App Scheduler!", output="console" ); + writeDump( var="[onShutdown] ==> Bye bye from the Global App Scheduler!", output="console" ); } /** * Called after the scheduler has registered all schedules */ function onStartup(){ - writeDump( var="The App Scheduler is in da house!!!!!", output="console" ); + writeDump( var="[onStartup] ==> The App Scheduler is in da house!!!!!", output="console" ); } /** @@ -86,7 +86,7 @@ component { * @exception The ColdFusion exception object */ function onAnyTaskError( required task, required exception ){ - writeDump( var="the #arguments.task.getname()# task just went kabooooooom!", output="console" ); + writeDump( var="[onAnyTaskError] ==> #arguments.task.getname()# task just went kabooooooom!", output="console" ); } /** @@ -96,7 +96,7 @@ component { * @result The result (if any) that the task produced */ function onAnyTaskSuccess( required task, result ){ - writeDump( var="the #arguments.task.getname()# task completed!", output="console" ); + writeDump( var="[onAnyTaskSuccess] ==> #arguments.task.getname()# task completed!", output="console" ); } /** @@ -105,7 +105,7 @@ component { * @task The task about to be executed */ function beforeAnyTask( required task ){ - writeDump( var="I am running before the task: #arguments.task.getName()#", output="console" ); + writeDump( var="[beforeAnyTask] ==> I am running before the task: #arguments.task.getName()#", output="console" ); } /** @@ -115,7 +115,7 @@ component { * @result The result (if any) that the task produced */ function afterAnyTask( required task, result ){ - writeDump( var="I am running after the task: #arguments.task.getName()#", output="console" ); + writeDump( var="[afterAnyTask] ==> I am running after the task: #arguments.task.getName()#", output="console" ); } } From 75ebcecb187452db1b2c2357f271122f0dba541d Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 3 Aug 2023 09:35:51 -0600 Subject: [PATCH 36/45] Add toRedirectTo custom matcher (#579) COLDBOX-1238 #resolve New testing matcher: toRedirectTo for easier testing against relocations --- system/testing/CustomMatchers.cfc | 37 ++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/system/testing/CustomMatchers.cfc b/system/testing/CustomMatchers.cfc index 73deeb9b7..cc2039531 100644 --- a/system/testing/CustomMatchers.cfc +++ b/system/testing/CustomMatchers.cfc @@ -36,7 +36,7 @@ component { } /** - * Expectation for testing again cbValidation invalid data fields returned in a Restful response + * Expectation for testing against cbValidation invalid data fields returned in a Restful response * by looking into the response object * *
@@ -103,4 +103,39 @@ component {
 		return true;
 	}
 
+	/**
+	 * Expectation for testing if an event returns a relocate.
+	 *
+	 * 
+	 * expect( event ).toRedirectTo( "Main.index" )
+	 * 
+ */ + function toRedirectTo( expectation, args = {} ){ + // handle both positional and named arguments + param args.event = ""; + if ( structKeyExists( args, 1 ) ) { + args.event = args[ 1 ]; + } + param args.message = ""; + if ( structKeyExists( args, 2 ) ) { + args.message = args[ 2 ]; + } + + if ( !expectation.actual.valueExists( "relocate_event" ) ) { + expectation.message = "The event did not relocate."; + return false; + } + + var actual = expectation.actual.getValue( "relocate_event" ); + var relocateMatches = actual == args.event; + + if ( !relocateMatches ) { + expectation.message = "#args.message#. Event did not relocate to the expected event. Expected [#args.event#]. Received [#actual#]."; + debug( expectation.actual.getCollection() ); + return false; + } + + return true; + } + } From 81d57da934b30c2892382480b1a1cdcc3be4a271 Mon Sep 17 00:00:00 2001 From: Gavin Pickin Date: Thu, 3 Aug 2023 09:07:59 -0700 Subject: [PATCH 37/45] Update RestHandler.cfc (#578) COLDBOX-1239 #resolve New REST convention for custom error handlers: `on{errorType}Exception()` --- system/RestHandler.cfc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/system/RestHandler.cfc b/system/RestHandler.cfc index 3329779ce..a39b3d91d 100644 --- a/system/RestHandler.cfc +++ b/system/RestHandler.cfc @@ -534,6 +534,13 @@ component extends="EventHandler" { * @exception The thrown exception */ function onAnyOtherException( event, rc, prc, eventArguments, exception = {} ){ + + // Handle a convention of onSOMEERRORTYPEException() in your base handler + if( len( arguments.exception?.type ) && structKeyExists( this, "on#arguments.exception?.type#Exception" ) && isCustomFunction( this[ "on#arguments.exception?.type#Exception" ] ) ){ + this[ "on#arguments.exception?.type#Exception" ]( argumentCollection=arguments ); + return; + } + // Log Exception log.error( "Error calling #arguments.event.getCurrentEvent()#: #arguments.exception.message# #arguments.exception.detail#", From 410c6c5e0e330135e877545519a9c3bd25281c4b Mon Sep 17 00:00:00 2001 From: lmajano Date: Thu, 3 Aug 2023 16:09:18 +0000 Subject: [PATCH 38/45] Apply cfformat changes --- system/RestHandler.cfc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/system/RestHandler.cfc b/system/RestHandler.cfc index a39b3d91d..64f38283d 100644 --- a/system/RestHandler.cfc +++ b/system/RestHandler.cfc @@ -534,13 +534,16 @@ component extends="EventHandler" { * @exception The thrown exception */ function onAnyOtherException( event, rc, prc, eventArguments, exception = {} ){ - // Handle a convention of onSOMEERRORTYPEException() in your base handler - if( len( arguments.exception?.type ) && structKeyExists( this, "on#arguments.exception?.type#Exception" ) && isCustomFunction( this[ "on#arguments.exception?.type#Exception" ] ) ){ - this[ "on#arguments.exception?.type#Exception" ]( argumentCollection=arguments ); + if ( + len( arguments.exception?.type ) && structKeyExists( this, "on#arguments.exception?.type#Exception" ) && isCustomFunction( + this[ "on#arguments.exception?.type#Exception" ] + ) + ) { + this[ "on#arguments.exception?.type#Exception" ]( argumentCollection = arguments ); return; } - + // Log Exception log.error( "Error calling #arguments.event.getCurrentEvent()#: #arguments.exception.message# #arguments.exception.detail#", From 1a0ac10c644c807d7eaf32f26089ba2d4fa09a5c Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 3 Aug 2023 18:10:08 +0200 Subject: [PATCH 39/45] safe navigation removal due to lots of issues in the CFML engines --- system/RestHandler.cfc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/system/RestHandler.cfc b/system/RestHandler.cfc index a39b3d91d..9a98ce5c6 100644 --- a/system/RestHandler.cfc +++ b/system/RestHandler.cfc @@ -534,13 +534,15 @@ component extends="EventHandler" { * @exception The thrown exception */ function onAnyOtherException( event, rc, prc, eventArguments, exception = {} ){ - - // Handle a convention of onSOMEERRORTYPEException() in your base handler - if( len( arguments.exception?.type ) && structKeyExists( this, "on#arguments.exception?.type#Exception" ) && isCustomFunction( this[ "on#arguments.exception?.type#Exception" ] ) ){ - this[ "on#arguments.exception?.type#Exception" ]( argumentCollection=arguments ); + // Param due to inconsistencies with safe navigation operators in all CFML engines + param arguments.exception.type = ""; + + // Handle a convention of on{type}Exception() in your base handler + if( len( arguments.exception.type ) && structKeyExists( this, "on#arguments.exception.type#Exception" ) && isCustomFunction( this[ "on#arguments.exception.type#Exception" ] ) ){ + this[ "on#arguments.exception.type#Exception" ]( argumentCollection=arguments ); return; } - + // Log Exception log.error( "Error calling #arguments.event.getCurrentEvent()#: #arguments.exception.message# #arguments.exception.detail#", From aab4ac06eb27becab1fecbc47aefc3462a8f743c Mon Sep 17 00:00:00 2001 From: lmajano Date: Thu, 3 Aug 2023 16:14:20 +0000 Subject: [PATCH 40/45] Apply cfformat changes --- system/RestHandler.cfc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/system/RestHandler.cfc b/system/RestHandler.cfc index 262f3f681..8ea5a8bf2 100644 --- a/system/RestHandler.cfc +++ b/system/RestHandler.cfc @@ -538,8 +538,12 @@ component extends="EventHandler" { param arguments.exception.type = ""; // Handle a convention of on{type}Exception() in your base handler - if( len( arguments.exception.type ) && structKeyExists( this, "on#arguments.exception.type#Exception" ) && isCustomFunction( this[ "on#arguments.exception.type#Exception" ] ) ){ - this[ "on#arguments.exception.type#Exception" ]( argumentCollection=arguments ); + if ( + len( arguments.exception.type ) && structKeyExists( this, "on#arguments.exception.type#Exception" ) && isCustomFunction( + this[ "on#arguments.exception.type#Exception" ] + ) + ) { + this[ "on#arguments.exception.type#Exception" ]( argumentCollection = arguments ); return; } From 21affeb40849fa6e2b66fc03b0518103727d5cff Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 3 Aug 2023 18:17:35 +0200 Subject: [PATCH 41/45] COLDBOX-1041 #resolve Logging category in ColdBox scheduler is generic --- system/web/services/SchedulerService.cfc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/web/services/SchedulerService.cfc b/system/web/services/SchedulerService.cfc index 0bc1e5278..1eb3856b0 100644 --- a/system/web/services/SchedulerService.cfc +++ b/system/web/services/SchedulerService.cfc @@ -112,6 +112,9 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { variables.wirebox.getInstance( arguments.name, { name : arguments.name } ).setName( arguments.name ) ); + // Reconfigure the Logger Category due to virtual inheritance + oScheduler.getLog().setCategory( arguments.path ); + // Register the Scheduler as an Interceptor as well. variables.controller.getInterceptorService().registerInterceptor( interceptorObject = oScheduler ); From 11c5945fad43dbc91280a6f556683fe7100ee1bf Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 3 Aug 2023 18:25:21 +0200 Subject: [PATCH 42/45] more tests [no ci] --- test-harness/handlers/rendering.cfc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test-harness/handlers/rendering.cfc b/test-harness/handlers/rendering.cfc index 3e0b1c890..26162e4d5 100644 --- a/test-harness/handlers/rendering.cfc +++ b/test-harness/handlers/rendering.cfc @@ -40,6 +40,14 @@ component output="false" singleton { return view( view = "simpleview" ); } + /** + * printable uses simple layout to display the request in one of two + * printable formats (html or pdf) base on rc.output value + */ + function printable( event , rc, prc ) { + var test = layout( layout : "simple", view : "simpleview"); + event.renderData( data : test, type : "pdf" ); + } /** * Render layout with arguments and passthrough From 29fa377119c9805205907af7acda7db3e8590a6c Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 3 Aug 2023 18:53:43 +0200 Subject: [PATCH 43/45] WIREBOX-152 #resolve getEnv errors in Binder context --- system/core/dynamic/MixerUtil.cfc | 4 ++-- system/ioc/Injector.cfc | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/system/core/dynamic/MixerUtil.cfc b/system/core/dynamic/MixerUtil.cfc index b9d622fd5..ffdc245fe 100644 --- a/system/core/dynamic/MixerUtil.cfc +++ b/system/core/dynamic/MixerUtil.cfc @@ -36,7 +36,7 @@ component accessors="true" { if ( !structKeyExists( arguments.target, "$wbMixer" ) ) { structAppend( arguments.target, variables.mixins, true ); } - return this; + return arguments.target; } /** @@ -48,7 +48,7 @@ component accessors="true" { for ( var udf in variables.mixins ) { structDelete( arguments.target, udf ); } - return this; + return arguments.target; } /****************** MIXINS ************************/ diff --git a/system/ioc/Injector.cfc b/system/ioc/Injector.cfc index 57ff9a690..cdfc03330 100644 --- a/system/ioc/Injector.cfc +++ b/system/ioc/Injector.cfc @@ -1669,11 +1669,17 @@ component serializable="false" accessors="true" { arguments.binder = createObject( "component", arguments.binder ); } - // Inject Environment Support - var envUtil = new coldbox.system.core.delegates.Env(); - arguments.binder[ "getSystemSetting" ] = envUtil.getSystemSetting; - arguments.binder[ "getSystemProperty" ] = envUtil.getSystemProperty; - arguments.binder[ "getEnv" ] = envUtil.getEnv; + // Inject Environment Support if it's an object + if ( isObject( arguments.binder ) ) { + var envUtil = new coldbox.system.core.delegates.Env(); + variables.mixerUtil + .start( arguments.binder ) + .injectPropertyMixin( propertyName: "env", propertyValue: envUtil ) + .injectMixin( "getSystemSetting", envUtil.getSystemSetting ) + .injectMixin( "getSystemProperty", envUtil.getSystemProperty ) + .injectMixin( "getJavaSystem", envUtil.getJavaSystem ) + .injectMixin( "getEnv", envUtil.getEnv ); + } // Check if data CFC or binder family if ( !structKeyExists( arguments.binder, "$wbBinder" ) ) { From e1717c70e90df09a8382835eb5682a15e555ce2b Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 3 Aug 2023 18:59:15 +0200 Subject: [PATCH 44/45] COLDBOX-1233 #resolve Exception bean can't cast `"i"` to a number value --- system/web/context/ExceptionBean.cfc | 82 ++-------------------------- 1 file changed, 5 insertions(+), 77 deletions(-) diff --git a/system/web/context/ExceptionBean.cfc b/system/web/context/ExceptionBean.cfc index 8a9c42823..daeb23bda 100644 --- a/system/web/context/ExceptionBean.cfc +++ b/system/web/context/ExceptionBean.cfc @@ -43,6 +43,7 @@ component accessors="true" { } variables.extraMessage = arguments.extraMessage; variables.extraInfo = arguments.extraInfo; + variables.utility = new coldbox.system.core.util.Util(); return this; } @@ -282,9 +283,7 @@ component accessors="true" { if ( isSimpleValue( getExtraInfo() ) && len( getExtraInfo() ) ) { buffer.append( "ExtraInfo = " & getExtraInfo() & chr( 13 ) ); } else { - buffer.append( - "ExtraInfo = " & new coldbox.system.core.util.Util().toJson( getExtraInfo() ) & chr( 13 ) - ); + buffer.append( "ExtraInfo = " & variables.utility.toJson( getExtraInfo() ) & chr( 13 ) ); } return buffer.toString(); } @@ -442,7 +441,9 @@ component accessors="true" { list.append( "
"
-					& ( len( arguments.scope[ i ] ) ? formatJSON( arguments.scope[ i ] ) : "---" ) & "
" + & ( + len( arguments.scope[ i ] ) ? variables.utility.prettyJson( arguments.scope[ i ] ) : "---" + ) & "
" ); } else if ( isSimpleValue( arguments.scope[ i ] ) ) { list.append( @@ -522,79 +523,6 @@ component accessors="true" { return list.toString(); } - - /** - * Formats a JSON string with indents & new lines. - * v1.0 by Ben Koshy - * - * @param str JSON string (Required) - * @author Ben Koshy (cf@animex.com) - * @version 0, September 16, 2012 - * - * @return Returns a string of indent-formated JSON - */ - // formatJSON() :: formats and indents JSON string - // based on blog post @ http://ketanjetty.com/coldfusion/javascript/format-json/ - // modified for CFScript By Ben Koshy @animexcom - // usage: result = formatJSON('STRING TO BE FORMATTED') OR result = formatJSON(StringVariableToFormat); - - public string function formatJSON( str ){ - var fjson = ""; - var pos = 0; - var regex = ":""([^""]+)?.*"; - var strLen = len( arguments.str ); - var indentStr = " "; // Adjust Indent Token If you Like - var newLine = chr( 10 ); // Adjust New Line Token If you Like - - var string = ""; - var prev = ""; - var char = ""; - var commaPos = 0; - var commaPosArr = []; - for ( var i = 1; i < strlen; i++ ) { - char = mid( arguments.str, i, 1 ); - prev = ""; - if ( i != 1 ) { - prev = mid( arguments.str, i - 1, 1 ); - } - strhascomma = false; - - if ( prev == ":" && char == """" ) { - string = mid( arguments.str, i - 1, ( strLen - i ) ); - string = reReplaceNoCase( string, regex, "\1" ); - commaposarr = reFindNoCase( ",", string, 1, true ); - if ( commaposarr.pos[ 1 ] != 0 ) { - commapos = "i" + commaposarr.pos[ arrayLen( commaposarr.pos ) ]; - } - } - - if ( char == "}" || char == "]" ) { - fjson &= newLine; - pos = pos - 1; - for ( var j = 1; j <= pos; j++ ) { - fjson &= indentStr; - } - } - - fjson &= char; - if ( char == "{" || char == "[" || ( char == "," && i != commaPos ) ) { - commapos = 0; - fjson &= newLine; - if ( char == "{" || char == "[" ) { - pos = pos + 1; - } - for ( var k = 1; k <= pos; k++ ) { - fjson &= indentStr; - } - } - } - fjson &= newLine & "}"; - return trim( fjson ); - } - - - - /** * Compose a screen for a file to open in an editor * From 46aad5c5ad6150bc597b9b2d381be896b4f7ee71 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 3 Aug 2023 19:03:04 +0200 Subject: [PATCH 45/45] changelog, ready for release --- changelog.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/changelog.md b/changelog.md index 4b85c3679..9f4c71676 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### ColdBox HMVC + +#### Bug + +- [COLDBOX-1233](https://ortussolutions.atlassian.net/browse/COLDBOX-1233) Exception bean can't cast \`"i"\` to a number value + +#### New Feature + +- [COLDBOX-1229](https://ortussolutions.atlassian.net/browse/COLDBOX-1229) Added debug argument to ScheduleExecutor and Scheduler when creating tasks for consistency +- [COLDBOX-1230](https://ortussolutions.atlassian.net/browse/COLDBOX-1230) Reorganized ScheduledTasks functions within the CFC into code groups and comments +- [COLDBOX-1235](https://ortussolutions.atlassian.net/browse/COLDBOX-1235) New StringUtil.prettySQL method for usage in debugging and whoops reports +- [COLDBOX-1238](https://ortussolutions.atlassian.net/browse/COLDBOX-1238) New testing matcher: toRedirectTo for easier testing against relocations +- [COLDBOX-1239](https://ortussolutions.atlassian.net/browse/COLDBOX-1239) New REST convention for custom error handlers: \`on\{errorType\}Exception\(\)\` + +#### Improvements + +- [COLDBOX-1041](https://ortussolutions.atlassian.net/browse/COLDBOX-1041) Logging category in ColdBox scheduler is generic +- [COLDBOX-1231](https://ortussolutions.atlassian.net/browse/COLDBOX-1231) Improve RestHandler Exception handler with on#ExceptionType#Exception\(\) convention +- [COLDBOX-1234](https://ortussolutions.atlassian.net/browse/COLDBOX-1234) Account for null or empty incoming json to prettyjson output +- [COLDBOX-1236](https://ortussolutions.atlassian.net/browse/COLDBOX-1236) Incorporate appName into the appHash to give more uniqueness to locks internally + +#### Tasks + +- [COLDBOX-1237](https://ortussolutions.atlassian.net/browse/COLDBOX-1237) Removal of Lucee RC tests - no longer needed + +### WireBox + +#### Bug + +- [WIREBOX-148](https://ortussolutions.atlassian.net/browse/WIREBOX-148) Several AOP and Internal WireBox methods not excluded from delegations +- [WIREBOX-150](https://ortussolutions.atlassian.net/browse/WIREBOX-150) Wirebox standalone is missing delegates +- [WIREBOX-151](https://ortussolutions.atlassian.net/browse/WIREBOX-151) Injections are null, sometimes +- [WIREBOX-152](https://ortussolutions.atlassian.net/browse/WIREBOX-152) getEnv errors in Binder context +- [WIREBOX-154](https://ortussolutions.atlassian.net/browse/WIREBOX-154) populateFromQuery delegate defaulting composeRelationships to true + +#### Improvement + +- [WIREBOX-147](https://ortussolutions.atlassian.net/browse/WIREBOX-147) Improve debug logging to not send the full memento on several debug operations + +#### Task + +- [WIREBOX-149](https://ortussolutions.atlassian.net/browse/WIREBOX-149) \`toWebservice\(\)\` is now deprecated + +* * * + ## [7.0.0] - 2023-05-15 ### ColdBox HMVC