Revision > 467 -> Local variable fields on line 295 must be grouped at the top of the function body. The error occurred on line 166.

98 views
Skip to first unread message

ol...@ansit.no

unread,
Dec 3, 2009, 5:12:28 PM12/3/09
to Reactor
All revisions > 467 generates the following error:

Local variable fields on line 295 must be grouped at the top of the
function body. <br>The error occurred on line 166.

I have traced the error back to the following function that was
introduced in revision 468 in abstractMetadata.cfc:

<cffunction name="getDisplayField" access="public" output="false"
returntype="any" hint="I return the first most obvious field to use as
a display">
<cfif hasField("name")> <!--- Quick way to do this, so that we can
always get the name field, which generally covers all bases --->
<cfreturn "name">
</cfif>


<!--- If we didnt find a name field, lets get the first string field
--->
****** > <cfset var fields = getFields()>
******> <cfset var f = "">


<cfloop array="#fields#" index="f">
<cfif f.cfDataType EQ "string">
<cfreturn f.alias>
</cfif>
</cfloop>
<cfreturn "">
</cffunction>









ERROR - array
1 ERROR - struct
COLUMN 0
ID CF_CFPAGE
LINE 166
RAW_TRACE at cfobjectFactory2ecfc1045319167$funcCREATE.runFunction(C:
\ColdFusion8\wwwroot\reactor\core\objectFactory.cfc:166)
TEMPLATE C:\ColdFusion8\wwwroot\reactor\core\objectFactory.cfc
TYPE CFML

2 ERROR - struct
COLUMN 0
ID CF_UDFMETHOD
LINE 175
RAW_TRACE at cfobjectFactory2ecfc1045319167$funcCREATE.runFunction(C:
\ColdFusion8\wwwroot\reactor\core\objectFactory.cfc:175)
TEMPLATE C:\ColdFusion8\wwwroot\reactor\core\objectFactory.cfc
TYPE CFML

3 ERROR - struct
COLUMN 0
ID CF_TEMPLATEPROXY
LINE 26
RAW_TRACE at
cfreactorFactory2ecfc1656745913$funcCREATERECORD.runFunction(C:
\ColdFusion8\wwwroot\reactor\reactorFactory.cfc:26)
TEMPLATE C:\ColdFusion8\wwwroot\reactor\reactorFactory.cfc
TYPE CFML

4 ERROR - struct
COLUMN 0
ID CF_TEMPLATEPROXY
LINE 31
RAW_TRACE at
cfDatabaseAuthenticator2ecfc85346263$funcAUTHENTICATE.runFunction(C:
\ColdFusion8\wwwroot\RshFB\controller\utils\login
\DatabaseAuthenticator.cfc:31)
TEMPLATE C:\ColdFusion8\wwwroot\RshFB\controller\utils\login
\DatabaseAuthenticator.cfc
TYPE CFML

DatabaseAuthenticator.cfc:31 => <cfset BrukerRecord =
Application.Reactor.createRecord("BRUKER").load(Ident="#lcase(username)
#") />

Chuck Savage

unread,
Dec 4, 2009, 3:57:32 PM12/4/09
to Reactor
Olav, I just debugged this.

Here's the fix: Edit reactor.base.abstractMetadata.cfc, replace
method getDisplayField at line 289 with this one:

<cffunction name="getDisplayField" access="public" output="false"
returntype="any" hint="I return the first most obvious field to use as
a display">
<cfset var fields = 0>
<cfset var f = "">

<cfif hasField("name")> <!--- Quick way to do this, so that we can
always get the name field, which generally covers all bases --->
<cfreturn "name">
</cfif>

<!--- If we didnt find a name field, lets get the first string field
--->
<cfset fields = getFields()>
Reply all
Reply to author
Forward
0 new messages