Frank, looking back at CF9, you had to set your variable to the
listappend(). Perhaps in CF10 they changed the functionality or was an
unintentional "feature"? Here's a link to the CF9 doc

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-6d71.html

Slightly unrelated, is anyone running CF 2016 / version 12? I'm hoping to
upgrade our site from CF 8 in Q4. Just curious if anyone has run into any
quirks?

Glad to see the list is still alive and kicking!

Kevin

On Wed, Aug 31, 2016 at 8:45 PM, Frank Moorman <stretch...@franksdomain.net>
wrote:

> Charlie,
>
> Here is the actual code (though the SQL is a little slimmed down for
> clarity.)
>
> <!--- Update Draw Items --->
> <cfset UpdateString = '0'>
> <cfloop index="loopix" from="1" to="#ArrayLen(arguments.DrawIds)#">
>     <cfquery name="UpdateDraw" datasource="#session.DBsource#">
>         UPDATE tbl_inspection_form_draws
>            SET last_user            = <cfqueryparam
> cfsqltype="CF_SQL_SMALLINT" value="#session.UserID#">,
>                draw_note            = <cfqueryparam
> cfsqltype="CF_SQL_VARCHAR" value="#arguments.DrawNotes[loopix]#"
> maxlength="200">,
>                completion_percent   = <cfqueryparam
> cfsqltype="CF_SQL_TINYINT" value="#Val(arguments.CompPercent[loopix])#">,
>                prior_completion_percent = <cfqueryparam
> cfsqltype="CF_SQL_TINYINT" value="#Val(arguments.
> OrigCompPercent[loopix])#">,
>                last_inspection_date = <cfqueryparam
> cfsqltype="CF_SQL_TIMESTAMP" value="#InspectionDateTime#">,
>                last_update          = <cfqueryparam
> cfsqltype="CF_SQL_TIMESTAMP" value="#CurrentDateTime#">
>          WHERE draw_id = <cfqueryparam cfsqltype="CF_SQL_INTEGER"
> value="#arguments.DrawIds[loopix]#">;
>     </cfquery>
>     <cfset devnull = ListAppend(UpdateString,arguments.DrawIds[loopix])>
> </cfloop>
> <cfquery name="PriorPercentUpdate" datasource="#session.DBsource#">
>     UPDATE tbl_inspection_form_draws
>        SET prior_completion_percent = <cfqueryparam
> cfsqltype="CF_SQL_TINYINT"   value="100">,
>            status                   = <cfqueryparam
> cfsqltype="CF_SQL_CHAR"      value="C" maxlength="1">,
>            last_update              = <cfqueryparam
> cfsqltype="CF_SQL_TIMESTAMP" value="#CurrentDateTime#">
>      WHERE inspection_form_id       = <cfqueryparam
> cfsqltype="CF_SQL_INTEGER" value="#arguments.FormID#">
>        AND draw_id                  NOT IN (#UpdateString#)
>
> </cfquery>
>
> As you can tell The ListAppend is right in the middle. Essentially I am
> updating an inspection form. Arrays with the values of every line item
> changed are passed into this function. The list is used to create a comma
> separated value of every line item id that was updated. The value is then
> used in the second query to make changes to every line item not updated
> within the specified inspection form.
>
> After the code was moved to the new CF11 server (from a CF10 server) We
> noticed that the prior completion percent was set to 100 in every case (and
> tracked it down to the 2nd query here.) According to the svn log, the
> component containing this code has not changed since 6/27/2014. (and I know
> this particular section was not changed in a longer period of time.)
>
> In tracking down the error and determining exactly what happened I
> basically added a result attribute to the queries and dumped them to verify
> that the proper values where being initially set and added a bunch of dumps
> for the other variables.. I also added a SELECT statement to verify that
> there was not some weird database connector problem on the new server.
>
>     <cfquery name="UpdateDraw" datasource="#session.DBsource#"
> result="xxxx">
>     </cfquery>
>     <cfdump var="#xxxx#">
>
>     <cfdump var="#UpdateString#">
>     <cfdump var="#devnull#">
>     <cfquery name="UpdateDraw2"  datasource="#session.DBsource#">
>         SELECT * from tbl_inspection_form_draws
>         WHERE draw_id = <cfqueryparam cfsqltype="CF_SQL_INTEGER"
> value="#arguments.DrawIds[loopix]#">;
>      </cfquery>
>     <cfdump var="#UpdateDraw2#">
>
>
> The dumps came back and pointed the finger at the ListAppend statement.
> UpdateString was not changing and staying with the initial value of 0. The
> devnull variable was being changed constantly to 0 & the value of the
> current draw. (It was changing to 0 and the current draw id with each
> iteration, it was not expanding draws due to the way it was written.
>
> In addition I had added a result attribute to the second query as well as
> another SELECT * and DUMP. It also confirmed that the #UpdateString# was
> only passing a single value of 0 to the SQL. Which essentially caused all
> rows to update instead of just the rows that were not changed by the first
> SQL.
>
> I left the cfdumps in the code and changed the line to:
>
>     <cfset UpdateString = ListAppend(UpdateString,
> arguments.DrawIds[loopix])>
>
> At this point UpdateString was expanding with each iteration of the loop
> appending the new draw id. The way it was functioning on the old server
> with CF10.
>
>
>
> On 08/31/2016 06:16 PM, Charlie Arehart wrote:
>
> Dude, they’re getting the band back together! :-)
>
> So Frank, on your observation, can you offer a simple 2-3 line proofcase?
> I realize you gave us code, but not with the values you’re really using for
> the vars.
>
> Sometimes, when you create such an example, you find out that it’s not
> what you thought. But if it is, then others could at least readily try it
> on their own systems, and if there’s no solution found, you could then
> include it in a bug report to Adobe.
>
> I’ve not heard of this problem you report, so I’m inclined to think there
> may be another explanation. But let’s see. Hope that’s helpful.
>
> /charlie
>
>
>
> *From:* ad...@acfug.org [mailto:ad...@acfug.org <ad...@acfug.org>] *On
> Behalf Of *Cameron Childress
> *Sent:* Wednesday, August 31, 2016 05:03 PM
> *To:* discussion@acfug.org
> *Subject:* Re: [ACFUG Discuss] Hopefully this list still exists
>
>
>
> Folks are still on the list, though I am not sure the list management tool
> are visible anymore.
>
>
>
> The acfug.org domain actually just auto-renewed - so I think we are still
> good as long as the list software is actually running....
>
>
>
> -Cameron
>
>
>
> On Wed, Aug 31, 2016 at 5:23 PM, Ajas Mohammed <ajash...@gmail.com> wrote:
>
> Thanks for the email. I for one used to enjoy the challenges in this group
> with people sending their issues.
>
>
>
> I hope we can bring it back through this group emails or any other means
> as long as we are actively getting requests.
>
>
>
> Thanks,
>
>
>
> On Wednesday, August 31, 2016, Frank Moorman <stretch...@franksdomain.net>
> wrote:
>
> As the subject line states... hopefully this mail list still exists...
>
> I came across something interesting today... (and very stressful before I
> figured it out...)
>
> I migrated code from a CF10 server to a CF11 server. And I had a major bug
> because of it. It seems like the function of ListAppend changed.
>
> The Migration docs mentioned how there were changes to the CFScript way of
> using list functions... but I did not see any mention of changes to the
> CFML tag functionality.
>
> I had this code inside a loop:
>
>         <cfset devnull = ListAppend(UpdateString,
> arguments.DrawIds[loopix])>
>
> But it turns out that where CF10 and before would append UpdateString with
> the additional value and store nonsense in devnull, CF11 changes the way it
> works. In the above function in now stores the combination in the devnull
> variable.
>
>         <cfset UpdateString = ListAppend(UpdateString,
> arguments.DrawIds[loopix])>
>
> The above does work in CF11 also which seems to be how to change it to
> work on a minimal level.
>
> Hope everyone is well if this maillist still gets out,
> Enjoy all,
>
> Frank Moorman
>
>
>
> --
> <Ajas Mohammed />
>
> iUseDropbox(http://db.tt/63Lvone9)
> http://ajashadi.blogspot.com
> We cannot become what we need to be, remaining what we are.
> No matter what, find a way. Because thats what winners do.
> You can't improve what you don't measure.
> Quality is never an accident; it is always the result of high intention,
> sincere effort, intelligent direction and skillful execution; it represents
> the wise choice of many alternatives.
>
>
>
>
>
>
>
> --
>
> Cameron Childress
> --
> p:   678.637.5072
>
> im: cameroncf
>
> facebook <http://www.facebook.com/cameroncf> | twitter
> <http://twitter.com/cameronc> | google+
> <https://profiles.google.com/u/0/117829379451708140985>
>
>
>
>
>

Reply via email to