Upgrading from 2.2 to 4.1

70 views
Skip to first unread message

Phil Kemp

unread,
Feb 1, 2018, 4:13:49 AM2/1/18
to framework-one
Hello all,

We currently have a FW/1 website running with v2.2, and have been requested to upgrade to the latest version (currently v4.1).

Looking through the documentation site, I can't seem to find any materials that detail the update steps that are needed for such a migration.

Can anyone point me in the right direction, or suggest the best approach to handling this kind of update?

Thanks,
Phil.

Sean Corfield

unread,
Feb 1, 2018, 12:15:50 PM2/1/18
to framew...@googlegroups.com

I would recommend upgrading in stages – because functionality has changed over time in a way that is mitigated by doing specific upgrades.

 

In particular, upgrade to each of these versions in order, run full tests at each step, and make the necessary adjustments:

  • 2.5
  • 3.0
  • 3.5
  • 4.1

 

When crossing major version lines, there are usually deprecations and/or removals of features (as other features have replaced them). In each case, the N.5 release introduces a migration path that will log warnings to the console about changes coming in the N+1.0 release and you’ll need to address those warnings before moving on (because they will indicate a feature change/removal in the N+1.0 version that will otherwise break your code!).

 

You’ll want to read through several of the release-related articles here http://framework-one.github.io/blog/archives/

 

Pay particularly close attention to these:

 

And, yes, that’s a lot of work (four upgrade cycles with full testing and code changes) and half a dozen important blog posts to read in detail, along with associated change logs. That’s what happens when you don’t upgrade as each release becomes available – sorry!

 

Also check the system requirements for 4.0 / 4.1 – the supported releases of CF and Railo / Lucee have changed quite a bit: Supported Platforms

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 


From: framew...@googlegroups.com <framew...@googlegroups.com> on behalf of Phil Kemp <boondoc...@gmail.com>
Sent: Thursday, February 1, 2018 1:13:49 AM
To: framework-one
Subject: [framework-one] Upgrading from 2.2 to 4.1
 
--
FW/1 documentation: http://framework-one.github.io
FW/1 source code: http://github.com/framework-one/fw1
FW/1 chat / support: https://gitter.im/framework-one/fw1
FW/1 mailing list: http://groups.google.com/group/framework-one
---
You received this message because you are subscribed to the Google Groups "framework-one" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
Visit this group at https://groups.google.com/group/framework-one.
For more options, visit https://groups.google.com/d/optout.

Phil Kemp

unread,
Feb 20, 2018, 11:27:57 AM2/20/18
to framework-one
I'm starting the update to v2.5 after yet more updates to the actual application (they have always taken priority over updating the underlying framework).

Already I seem to be hitting a stumbling block:
"Deprecated: service() call requires suppressServiceQueue = false"

Okay, so I either fix the code to not call the service() function, or set that suppression option.

Please note that Release 3.0 will completely remove these backward compatibility options

That message would suggest that the suppression setting won't be allowed in v3.0 - so that leaves me with having to replace all service() function calls.

Fair enough, but... howI've read through the release notes linked in your message about v2.5 and v3.0, but I can't find anything about what the new code should look like, just that the suppression option exists while I update everything. Update everything to what?

If you need an example, here's what I have from v2.5 to call a the function "getItemDetails" in the /services/content.cfc file and store it as the variable "thisItem":

<cfset variables.fw.service("content.getItemDetails","thisItem",{itemtype="page", uuid=rc.uuid})/> 

Sean Corfield

unread,
Feb 20, 2018, 10:09:08 PM2/20/18
to framew...@googlegroups.com

The recommended approach is to switch to using DI/1 for service injection (the default in 3.0) and then changing the fw.service() call to an explicit call to the injected service.

 

So you’ll add accessors=true to the component tag in your controller CFC and add a property declaration for each service you expect to be injected:

 

component accessors=true {

          property contentService;

          … rest of your controller as-is …

}

 

And then that fw.service() call becomes:

 

          rc.thisItem = variables.contentService.getItemDetails( “page”, rc.uuid );

 

That’s assuming that the arguments to that service are itemtype and uuid in that order, otherwise you can use:

 

          rc.thisItem = variables.contentService.getItemDetails( argumentCollection = {itemtype = “page”, uuid = rc.uuid} );

 

(that’s from memory – it’s been years since I’ve looked at 2.x code)

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 

Sent: Tuesday, February 20, 2018 8:27:57 AM
To: framework-one
Subject: Re: [framework-one] Upgrading from 2.2 to 4.1
 
--

Phil Kemp

unread,
Feb 28, 2018, 3:24:01 AM2/28/18
to framework-one
Updating to v2.5 was completed, but using a different method to access the service CFC files.

Now that I've put v3.0.2 in place, I'm told:
Could not find the ColdFusion component or interface framework.ioc.

So, it would appear that using DI/1 isn't a "recommendation" as suggested in your comment and the documentation, but instead enforced?

Julian Halliwell

unread,
Feb 28, 2018, 4:40:19 AM2/28/18
to framew...@googlegroups.com
You don't have to use DI/1. Just add this to your config:

variables.framework.diEngine: "none"

Phil Kemp

unread,
Feb 28, 2018, 4:52:45 AM2/28/18
to framework-one
Thanks, I see now that is mentioned in the Alpha 1 release notes. I had originally looked here only to find how to change the location FW/1 looks in, I didn't realise I could turn it off.
Reply all
Reply to author
Forward
0 new messages