Skip to content

Commit de908e9

Browse files
committed
Removing Evaluates
Removed the usage of the evaluate function and replaced it with the scope mapping to get the scope from the provided value and then used the dynamic allocation operator to get the value from the appropriate scope. Also used the throw function to throw and error if the value is not found from the request, arguments, application, session and variables scope.
1 parent 827efb3 commit de908e9

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

vendor/wheels/controller/processing.cfc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,22 @@ component {
6363
if (Len(local.appendToKey)) {
6464
for (local.item in local.appendToKey) {
6565
if (IsDefined(local.item)) {
66-
local.key &= Evaluate(local.item);
66+
scopeMap = {
67+
"request": request,
68+
"arguments": arguments,
69+
"application": application,
70+
"session": session,
71+
"variables": variables
72+
};
73+
74+
// Extract scope name and variable name from local.item
75+
local.scopeName = listFirst(local.item, ".");
76+
local.varName = listLast(local.item, ".");
77+
if (structKeyExists(scopeMap, local.scopeName) && structKeyExists(scopeMap[local.scopeName], local.varName)) {
78+
local.key &= scopeMap[local.scopeName][local.varName];
79+
} else {
80+
throw(type = "Wheels.KeyNotFound", message = "The `#local.item#` argument was not found.");
81+
}
6782
}
6883
}
6984
}

0 commit comments

Comments
 (0)