CFML Engine: Adobe ColdFusion2016,0,16,320445
CFWheels Version: 2.2.0
I have tried different arguments, and each time, I get the same ERROR:
// ERROR: Element PARAMS.CONTROLLER is undefined in VARIABLES.
// in ./controllers/Users.cfc
component extends="app.controllers.Controller" {
// ...
function update() {
user=model("user").findByKey(params.key);
if(user.update(params.user)) {
// ALL of the following functions FAIL with ERROR:
redirectTo(route="users");
// GIVES: ERROR: Element PARAMS.CONTROLLER is undefined in VARIABLES.
//redirectTo(route="Users");
// GIVES: ERROR: Element PARAMS.CONTROLLER is undefined in VARIABLES.
//redirectTo(controller="users", action="show", method="get", key=params.key);
// GIVES: ERROR: Element PARAMS.CONTROLLER is undefined in VARIABLES.
//redirectTo(controller="users", action="show", key=params.key);
// GIVES: ERROR: Element PARAMS.CONTROLLER is undefined in VARIABLES.
//redirectTo(route="users", key=params.key, success="user successfully updated");
// GIVES: ERROR: Element PARAMS.CONTROLLER is undefined in VARIABLES.
//redirectTo(action="show", key=params.key);
// GIVES: ERROR: Element PARAMS.CONTROLLER is undefined in VARIABLES.
//redirectTo(route="users", key=params.key, success="user successfully updated");
// GIVES: ERROR: Element PARAMS.CONTROLLER is undefined in VARIABLES.
//redirectTo(route="user"); // As expected Gives ERROR: Wheels.IncorrectRoutingArguments
// HOWEVER the following does NOT give an error:
renderView(controller="users", action="show", method="get", key=params.key); // NO ERROR
} else {
flashInsert(error="ERROR: User #params.key# was NOT updated !!");
renderView(action="edit");
}
}
// All other functions in controller are ok.
// my ./config/routes.cfm is as follows;
mapper()
.get(name="processendofyear", to="home##processendofyear")
.get(name = "scanupc", to="upcs##scanupc")
.resources("posts")
.resources("comments")
.resources("users")
.resources("profiles")
.resources("employees")
.resources("authors")
.resources("bios")
.resources("customers")
.resources("subscriptions")
.resources("publications")
.resources(name="upcs")
.resources(name="inventoryitems")
.resources(name="inventoryevents")
.resources("receipts")
.resources("pfstmts")
.resources("zselectaptabbrs")
.resources("zselectwarehouselocations")
.resources("zselectpaymentmethods")
.resources("zselectstorenames")
.resources("zselecttaxcats")
.resources("zselectinveventtypes")
.resources("zselectinveventstates")
.resources("zselectdhgpfsnames")
.resources("zselectdhgpfstypeofvalues")
.get(name="sayHello", to="ttt_say##hello")
// CLI-Appends-Here
.wildcard()
.root(to="home##index", method="get")
.end();