CFWheels 2.2.0 + Lucee 5.3.x

98 views
Skip to first unread message

Hugo Habicht

unread,
Oct 20, 2021, 7:34:55 AM10/20/21
to CFWheels
Hello,

trying to move an old Wheels 1.x App from ACF to Lucee. After some steps I got stuck with the error seen in the attachment. Any ideas? Thank you in advance!

Regards, Hugo

Screenshot 2021-10-20 at 13-20-31 Screenshot.png

Tom King

unread,
Oct 20, 2021, 7:37:35 AM10/20/21
to CFWheels
Exactly which wheels version? - Lucee was only supported from 1.4 (IIRC) so if you've got a 1.1 or 1.3 release you'll need to get it to at least 1.4 first. (Ideally 1.4.6)
T

David Belanger

unread,
Oct 20, 2021, 7:41:18 AM10/20/21
to CFWheels
Hello Hugo,

In order to help, we're going to need a little more information.
  1. which version of CFWheels are you upgrading from?
  2. which version of CFWheels are you trying to upgrade to?
  3. did you follow the upgrade guide found at https://guides.cfwheels.org/docs/upgrading
Jumping to 2.0 is usally a big leap because of some breaking changes.  It's recommend that you follow the guide and go to the closest 1.x version to what you have.  Upgrade, test and the go the next level.

For the 1.x series, 1.4.6 would be the last version in that series and it was very stable.

Cheers,
David

Adam Cameron

unread,
Oct 20, 2021, 10:08:20 AM10/20/21
to CFWheels
Whichever version of CFWheels their site originated from doesn't seem to be relevant here. It's an implementation bug in CFWheels as far as I can tell.

The code that's erroring is this:

public any function $createObjectFromRoot(required string path, required string fileName, required string method) {
local.returnVariable = "local.rv";
local.method = arguments.method;
local.component = ListChangeDelims(arguments.path, ".", "/") & "." & ListChangeDelims(arguments.fileName, ".", "/");
local.argumentCollection = arguments;
include "../../root.cfm";
return local.rv; // <------------------- THIS LINE HERE
}

There is no guarantee in this function that local.rv will exist. It's sloppy coding to ass-u-me that a variable in a function will be magicked into existence by some external resource (root.cfm in this case).

local.rv should be initialised to some safe value in this function.


Now if we look at root.cfm we have this:


<cfinvoke
component="#local.component#"
method="#local.method#"
returnVariable="#local.returnVariable#" <!--- no guarantee this will end up being defined --->
argumentCollection="#local.argumentCollection#"
>

If the method being invoked is void, then you won't get a value back, and local.rv will be undefined.

Which is what the error is saying.

Given root.cfm can quite legitimately leave local.rv undefined, then $createObjectFromRoot *can't* assume it will be defined. That's a bug.

-- 
Adam

David Belanger

unread,
Oct 20, 2021, 10:31:19 AM10/20/21
to CFWheels
Hey Adam,

The reason for requesting the exact version numbers is due to the fact that the upgrade path for Wheels isn't quite like it is for ColdBox (where you simply delete the wheels directory and drop in the new one).  Sometimes there are files outside the wheels directory that were changed to accommodate program changes at the time.  In the upgrade notes to 1.3 you'll see that root.cfm was indeed changed.

Tom's note that we didn't support Lucee (well Railo at the time) until 1.1 is also a valid possibility which is why we requested the exact version numbers.

We'll take all the info we can get when troubleshooting :)

Regards,
David
Reply all
Reply to author
Forward
Message has been deleted
0 new messages