[coldbox-3.6.0] runEvent() performs differently between Standard and Lite

104 views
Skip to first unread message

Adrian Moreno

unread,
Jun 19, 2013, 11:29:01 AM6/19/13
to col...@googlegroups.com
I was testing out ColdBox Lite with my art gallery application and quickly hit an error .

I have a handler (Main.cfc) with two functions:

public function index(event,rc,prc) void {
    rc.welcomeMessage = "Welcome to the Kung Foo Gallery!";
    event.setView("gallery/index");
}

public function carousel(event,rc,prc) string {
    prc.artwork = getModel("gallery").carousel(3);
    return renderView("gallery/homepage_carousel");
}

views/gallery/index.cfm

<h2>#rc.welcomeMessage#</h2>

#runEvent(event:'main.carousel')#

causes this error:

An unhandled exception has occurred. Please look at the diagnostic information below:
Type     Renderer.ViewNotSetException
Message     The "currentview" variable has not been set, therefore there is no view to render.
Detail     Please remember to use the 'event.setView()' method in your handler or pass in a view to render.

The URL was switched to index.cfm?event=main.carousel, but I requested the default event of main.index. This acts like I had called setNextEvent() instead of runEvent(). I hadn't, but ColdBox Lite had:

ColdBox Lite: \system\mvc\FrameworkSupertype.cfc

function runEvent(event, {etc}){
    controller.setNextEvent(argumentCollection=arguments);
}

ColdBox Standard: \system\FrameworkSupertype.cfc

<cffunction name="runEvent" {etc}>
    <cfargument name="event" type="any" required="false" default="">
    <!--- other args --->
    <cfset var refLocal = structnew()>
    <cfset reflocal.results = controller.runEvent(argumentCollection=arguments)>
    <cfif structKeyExists(refLocal,"results")>
        <cfreturn refLocal.results>
    </cfif>
</cffunction>

I can't change the Lite version to return controller.runEvent() without putting it into an infinite loop.

The documentation indicates there shouldn't be a difference.

http://wiki.coldbox.org/wiki/cbl.cfm#Executing_Events

I've checked the development and master branches in Github and this code still exists. Bug?

Luis Majano

unread,
Jun 19, 2013, 11:31:21 AM6/19/13
to col...@googlegroups.com
I submitted a patch for this. It was in the super type for lite. 

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
Twitter: @lmajano, @ortussolutions
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages