Skip to main content
Participant
April 15, 2010
Question

Is this magic ??

  • April 15, 2010
  • 4 replies
  • 579 views

Hi,

I've had an issue with a cfswitch on assigning charges. It looks at the first 2 characters of a field customer_id and set rates accordingly. They have been charged incorrectly and it's all down to a this cfswitch. I have stripped it down to basics:

<cfswitch expression="F3">

     <cfcase value="DS">

            prices for DS customers

     </cfcase>

     <cfcase value="SC">

            prices for SC customers

     </cfcase>

     <cfcase value="ER">

            prices for ER customers

     </cfcase>

     <cfdefaultcase>

          prices for all other customers

     </cfdefaultcase>

</cfswitch>

so running this code you would expect it to be prices for all other customers. NO!, it uses prices for ER customers??. We are using Coldfusion 9 so I would be intrested if any other CF9 developers are getting the same result?

Thanks

Stuart

    This topic has been closed for replies.

    4 replies

    BKBK
    Community Expert
    Community Expert
    April 15, 2010

    I, too, can confirm the bug; I am on CF9. It don't look good at all, Adobe.

    Inspiring
    April 15, 2010

    I can confirm the bug you're seeing.  It works as one would expect on CF8, but is bung on CF9.

    It looks similar to this issue - http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=81658 - which is marked as closed.  Possibly it's been fixed in an upcoming patch for CF9?  The bug tracker is a bit impenetrable when it comes to finding out that sort of info...

    --

    Adam

    TheLinoAuthor
    Participant
    April 15, 2010

    Thank you A. Cameron. that is exactly right. It looks like they have released a hotfix to fix the problem.

    Many Thanks Again

    Stuart

    Inspiring
    April 15, 2010

    I troubleshoot stuff like this by looking at the data.

    In this case, right before the cfswitch tag I would output the variable.  I might even output it with some text immediately before and after to check for leading or trailing spaces.  Then, inside each cfcase block, I would output some more text to tell me which block got executed.

    When I look at these results, I am almost always able to determine the problem, and it's absolutely always something I did as opposed to the software not working properly.

    TheLinoAuthor
    Participant
    April 15, 2010

    Hi,

    Yes, I did all that. The main value of the customer_id was a session variable, so this was my first thought of action.

    Known Participant
    April 15, 2010

    No.  I just quickly run your code and it comes out with result from "Default".

    TheLinoAuthor
    Participant
    April 15, 2010

    Thanks. What version CF are you using?