Skip to content
Browse files

Fix for scaffolding bug preventing lazy loading of scaffolded events …

…when not in development mode

git-svn-id: http://svn.model-glue.com/branch/newScaffolding@443 e037dfa2-038c-9047-8ad2-eadf13718248
  • Loading branch information...
1 parent 25e83d7 commit aa0c1e6298bdaa4e1e674305078d700d4e514ec0 cfgrok committed Nov 1, 2011
View
6 ModelGlue/gesture/module/XMLModuleLoader.cfc
@@ -819,7 +819,7 @@ Lastly, we need to rip out the configuration for this ModuleLoader and just have
<cfreturn allScaffolds />
</cffunction>
-<cffunction name="loadScaffolds" output="false" hint="I load the scaffold tags">
+<cffunction name="generateScaffolds" output="false" hint="I generate the scaffold config XML">
<cfargument name="modelglue" />
<cfset var scaffoldsXML = getScaffoldBlocks() />
@@ -861,6 +861,10 @@ Lastly, we need to rip out the configuration for this ModuleLoader and just have
</cfloop>
<cfset arguments.modelglue.getScaffoldManager().generate( scaffoldsArray ) />
+</cffunction>
+
+<cffunction name="loadScaffolds" output="false" hint="I load the scaffold tags">
+ <cfargument name="modelglue" />
<cfif fileExists( expandPath( arguments.modelglue.getConfigSetting('scaffoldPath') ) ) IS true>
<cfset load( arguments.modelglue, expandPath( arguments.modelglue.getConfigSetting('scaffoldPath') ) ) />
View
1 ModelGlue/gesture/modules/scaffold/config/scaffolding.xml
@@ -4,6 +4,7 @@
<controller id="modelglue.scaffoldController" type="ModelGlue.gesture.modules.scaffold.controller.ScaffoldController">
<message-listener message="modelglue.modulesLoaded" function="appendGeneratedViewMapping" />
<message-listener message="modelglue.readyForModuleLoading" function="generateScaffolds" />
+ <message-listener message="modelglue.readyForModuleLoading" function="loadScaffolds" />
<message-listener message="modelglue.needCFUniformConfig" function="loadCFUniformConfig" />
</controller>
</controllers>
View
17 ModelGlue/gesture/modules/scaffold/controller/ScaffoldController.cfc
@@ -60,15 +60,28 @@ then this file is a working copy and not part of a release build.
<cfset var moduleLoaderArray = getModelGlue().getModuleLoaderArray() />
<cfset var moduleIndex = 0 />
<cfset var moduleLoader = "" />
- <cfset var scaffolds = arrayNew(1) />
<cfif getModelGlue().getConfigSetting("reload") is true and getModelGlue().getConfigSetting("rescaffold") is true>
<cfloop from="1" to="#arrayLen(moduleLoaderArray)#" index="moduleIndex">
<cfset moduleLoader = moduleLoaderArray[moduleIndex] />
- <cfset moduleLoader.loadScaffolds(getModelGlue()) />
+ <cfset moduleLoader.generateScaffolds(getModelGlue()) />
</cfloop>
</cfif>
</cffunction>
+<cffunction name="loadScaffolds" output="false" access="public" returntype="void" hint="">
+ <cfargument name="event">
+
+ <cfset var moduleLoaderArray = getModelGlue().getModuleLoaderArray() />
+ <cfset var moduleIndex = 0 />
+ <cfset var moduleLoader = "" />
+
+ <cfloop from="1" to="#arrayLen(moduleLoaderArray)#" index="moduleIndex">
+ <cfset moduleLoader = moduleLoaderArray[moduleIndex] />
+
+ <cfset moduleLoader.loadScaffolds(getModelGlue()) />
+ </cfloop>
+</cffunction>
+
</cfcomponent>

0 comments on commit aa0c1e6

Please sign in to comment.
Something went wrong with that request. Please try again.