Skip to main content
Participating Frequently
March 25, 2021
Answered

Coldfusion 2018 update 11 error

  • March 25, 2021
  • 5 replies
  • 3070 views

After installing the update, form variables being sent as a list, cannot be read as a simple values, they are now being sent as arrays.

error message is 

 Complex object types cannot be converted to simple values
    This topic has been closed for replies.
    Correct answer Charlie Arehart

    This is a known issue. The recent March cf updates changed this. And whether it is right or wrong (that they did that), there is at least a work-around. And no, you do NOT need to hunt down every program, just every CF application (at least until perhaps Adobe may offer a JVM arg to revert things instance-wide): 

    • if using application.cfc put in this.sameformfieldsasarray="false"
    • if using application.cfm put the same attribute (as sameformfieldsasarray="false") into your cfapplication tag

     

    (Update: Note in both cases, there's an "s" after "form field" there. When I first wrote this, I mistakenly left it off, though I had it right in the other thread I refer to in a moment, as did some other folks writing here. Apologies for the finger fumble. ) 

     

    As for where to raise a stink about this, you have choices:

    • you can certainly comment right here, or in another similar thread here that had much more discussion (and in which some others here participated before sgean01's comment today and the previous ones about 10 days ago)
    • you can add a vote to either of these CF bug reports about this: mine, or this one that mine was marked to be a dupe of, or this earliest one on a related aspect to this (from BEFORE the March updates)
    • It's not clear where is the most likely place that Adobe will see your comments. They tend not to participate here, but it's not clear which of those 3 bug reports they will pay attention to

     

    Let us know if this helps. 

    5 replies

    Charlie Arehart
    Community Expert
    Community Expert
    November 4, 2021

    As an update on all this, and an FYI to those who maybe didn't notice: update 12 (of CF2018) and update 2 (of cf2021) did revert the behavior back to defaulting sameformfieldsasarray to false.

    /Charlie (troubleshooter, carehart. org)
    Participating Frequently
    April 8, 2021

    I tried this in my application.cfm

    <cfset sameformfieldasarray=false>

    no joy, same error.

    my work around is this, but it requires mitigating all my codebase.

    <cfif isarray(form.WK)>
    <cfset wklist = arraytolist(form.WK)>
    <cfelse>
    <cfset wklist = form.WK>
    </cfif>
    <cfloop list="#wklist#" index="w">

    George____
    Inspiring
    April 8, 2021

    You're creating a variable with <cfset sameformfieldasarray....

    You need to put it in the cfapplication tag.

    <cfapplication sameformfieldasarray=false .....

    Participating Frequently
    April 8, 2021

    Thanks, that works.

    Charlie Arehart
    Community Expert
    Charlie ArehartCommunity ExpertCorrect answer
    Community Expert
    April 7, 2021

    This is a known issue. The recent March cf updates changed this. And whether it is right or wrong (that they did that), there is at least a work-around. And no, you do NOT need to hunt down every program, just every CF application (at least until perhaps Adobe may offer a JVM arg to revert things instance-wide): 

    • if using application.cfc put in this.sameformfieldsasarray="false"
    • if using application.cfm put the same attribute (as sameformfieldsasarray="false") into your cfapplication tag

     

    (Update: Note in both cases, there's an "s" after "form field" there. When I first wrote this, I mistakenly left it off, though I had it right in the other thread I refer to in a moment, as did some other folks writing here. Apologies for the finger fumble. ) 

     

    As for where to raise a stink about this, you have choices:

    • you can certainly comment right here, or in another similar thread here that had much more discussion (and in which some others here participated before sgean01's comment today and the previous ones about 10 days ago)
    • you can add a vote to either of these CF bug reports about this: mine, or this one that mine was marked to be a dupe of, or this earliest one on a related aspect to this (from BEFORE the March updates)
    • It's not clear where is the most likely place that Adobe will see your comments. They tend not to participate here, but it's not clear which of those 3 bug reports they will pay attention to

     

    Let us know if this helps. 

    /Charlie (troubleshooter, carehart. org)
    James Moberg
    Inspiring
    April 8, 2021

    This is strange. I have CF2016,0,17,325979 & CF2021,0,01,325996 (both Developer Edition) updated to the most recent version and they both return a string instead of an array.  I verified that neither sameFormFieldsAsArray or sameURLFieldsAsArray are configured in the application.cfc.

    QUESTION: Are duplicated URL parameters being treated like this too or only FORM parameters?

     

    For the sake of comparison as a result of migration testing, I reviewed our tests using Lucee (server.coldfusion.productversion 2016,0,03,300357) and it didn't return an array for duplicated form or URL parameters.

    Charlie Arehart
    Community Expert
    Community Expert
    April 8, 2021

    James, I experienced that same vagary, when I first tried to help folks in that other thread that l listed above, and mentioned it in the bug report I filed (also listed above). It seems to vary at least based on OS, in an odd way.  See those other two and comment there or here as you may see fit. Again, this is an odd one. 

    /Charlie (troubleshooter, carehart. org)
    Participating Frequently
    March 25, 2021
    <!doctype html>
    <cfparam name="form.testtext" default="">
    <cfdump var="#form.testtext#" expand="yes">
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    </head>
    
    <body>
    <form action="test.cfm" method="post">
    
    
    <input type="text" value="1" name="testtext">
    <input type="text" value="2" name="testtext">
    <input type="text" value="3" name="testtext">
    <input type="text" value="4" name="testtext">
    <input
    type="submit">
    </form>
    </body>
    </html>

    executing that prior to updating returns

    1,2,3,4

     

    after updating, it returns

    array11223344

    George____
    Inspiring
    March 26, 2021

    I wasn't able to duplicate the issue you're seeing.   I still get 1,2,3,4 as the result with CF2018 Update 11.

     

    My test page had no application.cfm or application.cfc, so you might want to try that if you haven't already.  The test was done on a Windows 10 system using the built in CF web server.

    Participating Frequently
    March 25, 2021

    test