Loading ...
Sorry, an error occurred while loading the content.

Model CFC and cfreturn

Expand Messages
  • houston_blue_texas
    FB5.5, MVC, no XML, non-OO. I ve been using this methodology to get queries out of my models: model m_MyModel qry_GetStuff.cfm: [snip]
    Message 1 of 33 , Jan 2, 2009
    • 0 Attachment
      FB5.5, MVC, no XML, non-OO.

      I've been using this methodology to get queries out of my models:

      model\m_MyModel\qry_GetStuff.cfm:

      [snip]
      <cfset event.setValue("Stuff", Q_GetStuff)>


      I was doing some research and it appears that I should be able to do this instead (more graceful):

      model\m_MyModel.cfc:

      <cffunction name="qry_GetStuff" returntype="query">
      [snip]
      <cfreturn Q_GetStuff>
      </cffunction>

      ...and then in my controller have:

      <cfset event.setValue("Stuff", myFusebox.do( action="m_MyModel.qry_GetStuff", returnOutput="true" ))>

      ...but when I cfdump Stuff, I get, "[empty string]"

      What am I missing? Is there a way to do what I'm trying to do here? Thanks!
    • Adam Haskell
      I got some idea s but not been able to track it down. Could you send me the parsed file that is running so I can view it. Remember that is a Bleeding Edge
      Message 33 of 33 , Jan 26, 2009
      • 0 Attachment
        I got some idea's but not been able to track it down. Could you send me the parsed file that is running so I can view it. Remember that is a Bleeding Edge release I would advise against using it in production till I push it to beta.

        Adam


        On Mon, Jan 26, 2009 at 7:25 AM, John M Bliss <bliss.john@...> wrote:

        Adam (or anyone else), any more ideas on this?  If no, I'll have to revert to 5.5.1 and remove all passThroughReturn="true" from my app.  Let me know...

        Thanks!



        On Fri, Jan 23, 2009 at 4:04 PM, John M Bliss <bliss.john@...> wrote:
        Yes: FUSEBOX_PARAMETERS.mode = "production";


        On Fri, Jan 23, 2009 at 4:01 PM, Seth Johnson <sjohnson@...> wrote:

        Are you in Production mode?  I see weird things like this when in development mode sometimes . . .

         

        From: fusebox5@yahoogroups.com [mailto:fusebox5@yahoogroups.com] On Behalf Of John M Bliss
        Sent: Friday, January 23, 2009 4:52 PM


        To: fusebox5@yahoogroups.com
        Subject: Re: [fusebox5] Model CFC and cfreturn

         

        Nothing is changing in circuit cfc between when it works and when it throws that error.  That particular error happens during login: so I can login, logout, login, logout, etc...until one login when that error will be thrown.  Then I can loadclean/parseall/execute and the error will go away...for a while...



        Just spitballing: could it be some kind of scope conflict issue (where one user's login request is screwing up another user's login request)?

        On Fri, Jan 23, 2009 at 3:29 PM, Adam Haskell <a.haskell@...> wrote:

        That might be some of the other things I've added that allow for No XML circuits but I've never seen this happen personally. I'd be curious to know more about what else is happening before the error occurs notably what is being changed (if anything) in the circuit cfc.


        Adam

         

        On Fri, Jan 23, 2009 at 4:09 PM, John M Bliss <bliss.john@...> wrote:

        Adam, I'm seeing some strange behavior with this.  If I call fusebox.loadclean=true&fusebox.parseall=true&fusebox.execute=true&fusebox.password=[password] everything runs fine for a while and then, all of a sudden, this:

        <cfset event.setValue("Q_AuthenticateUser", myFusebox.do( action="m_User.qry_AuthenticateUser", passThroughReturn="true" ))>

        ...will stop working and return the below error.  If I then reload the framework, error will go away for a while and then come back again.  Can you help?

        Element m_User is undefined in a CFML structure referenced as part of an expression.
         
        The error occurred in C:\inetpub\wwwroot\fusebox5\myFusebox.cfc: line 234
        Called from C:\inetpub\wwwroot\fusebox5\fuseboxExecutionContext.cfc: line 49
        Called from C:\inetpub\wwwroot\fusebox5\fuseboxApplication.cfc: line 627
        Called from C:\inetpub\wwwroot\fusebox5\myFusebox.cfc: line 324
        Called from C:\inetpub\wwwroot\[snip]\trunk\website\controller\User.cfc: line 63
        Called from C:\inetpub\wwwroot\[snip]\trunk\website\parsed\user.validateuser.cfm: line 14
        Called from C:\inetpub\wwwroot\fusebox5\Application.cfc: line 232
        Called from C:\inetpub\wwwroot\fusebox5\Application.cfc: line 222

        232 :                 hint="I am a convenience method to return the current Fusebox circuit object.">
        233 :    
        234 :         <cfreturn getApplication().circuits[this.thisCircuit] />
        235 :    
        236 :     </cffunction>

         

        On Sun, Jan 4, 2009 at 1:46 AM, Adam Haskell <a.haskell@...> wrote:

        In the future feel free to add these straight to the ticket system and link to it for discussion here.

        http://trac.fuseboxframework.org/fusebox/ticket/350

        As I noted in the ticket it seemed like a quick win so I added it. Completely untested, try it out and let me know if it works the way you want.
         
        http://dl-client.getdropbox.com/u/64114/fusebox552BER.corefiles.zip


        Adam

        On Fri, Jan 2, 2009 at 2:13 PM, John M Bliss <bliss.john@...> wrote:

        I see.  Would the following make sense as an upcoming-version feature-request (so that you can do what I'm describing without going "outside" FB)...?

        One of these:

        1. make it so that if you have myFusebox.do( action="CircuitCFC.FuseactionFunction", returnOutput="true" ) where CircuitCFC.FuseactionFunction has cffunction returntype="[returntype]" and a cfreturn, the do actually returns the value
        2. make it so that if you have myFusebox.do( action="CircuitCFC.FuseactionFunction", returnValue="true" ), the do actually returns the value (or something like that)

         

        On Fri, Jan 2, 2009 at 12:24 PM, Adam Haskell <a.haskell@...> wrote:

        Note that your are setting the return of myFusebox.do() into 'stuff' at this point. myFusebox.do() returns strings only. Specifically do() returns the output of the do action, not the return of the one fuseaction. Make sense? The first way, how you were doing it, looks ok (pretty coupled to fusebox but ok) to me. If you want a cleaner way like the second way just create a CFC yourself in the controller and call the methods (instead of using fusebox). If you are not comfortable with OO I am not sure how good of an idea this might be but that would be my advice here heh.
         

        Adam Haskell




        On Fri, Jan 2, 2009 at 1:00 PM, houston_blue_texas <bliss.john@...> wrote:

        FB5.5, MVC, no XML, non-OO.

        I've been using this methodology to get queries out of my models:

        model\m_MyModel\qry_GetStuff.cfm:

        [snip]
        <cfset event.setValue("Stuff", Q_GetStuff)>


        I was doing some research and it appears that I should be able to do this instead (more graceful):

        model\m_MyModel.cfc:

        <cffunction name="qry_GetStuff" returntype="query">

        [snip]
        <cfreturn Q_GetStuff>

        </cffunction>

        ...and then in my controller have:

        <cfset event.setValue("Stuff", myFusebox.do( action="m_MyModel.qry_GetStuff", returnOutput="true" ))>

        ...but when I cfdump Stuff, I get, "[empty string]"

        What am I missing? Is there a way to do what I'm trying to do here? Thanks!

         



        --
        John Bliss
        IT Professional
        LinkedIn: http://www.linkedin.com/in/jbliss

         




        --
        John Bliss
        IT Professional
        LinkedIn: http://www.linkedin.com/in/jbliss

         




        --
        John Bliss
        IT Professional
        LinkedIn: http://www.linkedin.com/in/jbliss




        --
        John Bliss
        IT Professional
        LinkedIn: http://www.linkedin.com/in/jbliss



        --
        John Bliss
        IT Professional
        LinkedIn: http://www.linkedin.com/in/jbliss

      Your message has been successfully submitted and would be delivered to recipients shortly.