Skip to main content
WolfShade
Legend
December 27, 2018
Answered

CFSCRIPT and savecontent (or is it cfsavecontent?)

  • December 27, 2018
  • 1 reply
  • 3998 views

Hello, all,

I'm a bit confused about something, and I hope someone can set me straight.

According to a blog entry (from four years ago) by Adam Cameron, Adobe initially created a CFSCRIPT version of CFSAVECONTENT, and it was called "savecontent", which falls into step with the typical CFSCRIPT implementation of CF tags (ie, remove "CF" from the tag for the CFSCRIPT version.)

But according to Adam's blog entry, CF11 changed it to "cfsavecontent".

Now, we develop in CF10, but our production servers run CF11.  So, am I to understand that "savecontent" does not work in CF11???  Do I have to write conditionals and double my code in order to get it to work in both development (CF10) and production (CF11)?  Or is it backwards compatible, and "savecontent" will work in both versions?

V/r,

^ _ ^

    This topic has been closed for replies.
    Correct answer Dave Watts

    This is probably going to be an unsatisfying answer. I tested this out on CF 2016, which is what I have locally installed on this particular machine. I did get an error using savecontent in CFSCRIPT, but when I changed it to cfsavecontent the error went away. That said, I couldn't get the contents of cfsavecontent to work the way I expected, reading Adam's blog post. I will confess that I really don't use CFSCRIPT for any heavy lifting in CFML, especially anything relating to the output of variables, so ...

    Anyway, my guess is you'll probably have to rewrite your CFSCRIPT code accordingly.

    Dave Watts, Fig Leaf Software

    1 reply

    Dave WattsCommunity ExpertCorrect answer
    Community Expert
    December 27, 2018

    This is probably going to be an unsatisfying answer. I tested this out on CF 2016, which is what I have locally installed on this particular machine. I did get an error using savecontent in CFSCRIPT, but when I changed it to cfsavecontent the error went away. That said, I couldn't get the contents of cfsavecontent to work the way I expected, reading Adam's blog post. I will confess that I really don't use CFSCRIPT for any heavy lifting in CFML, especially anything relating to the output of variables, so ...

    Anyway, my guess is you'll probably have to rewrite your CFSCRIPT code accordingly.

    Dave Watts, Fig Leaf Software

    Dave Watts, Eidolon LLC
    WolfShade
    WolfShadeAuthor
    Legend
    December 27, 2018

    I tested it, too.  Within a try/catch.  And the scary thing is that the catch didn't trigger.  It just sent full-blown details of what failed.  NOT GOOD!    Something about "function keyword missing in FUNCTION declaration."  There is no function.

    So.. more hackish things to do to get this working in both environments.  Thanks, Adobe.

    V/r,

    ^ _ ^