History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: FC-914
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Blocker Blocker
Assignee: Jeff Coughlin
Reporter: Doug Hughes
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
FarCry Core Framework

dmInclude type doesn't work on window (and probably other oses too)

Created: 17/Aug/07 02:08 AM   Updated: 17/Aug/07 07:55 AM
Component/s: Core Types
Affects Version/s: 4.0.6
Fix Version/s: 4.0.6

Time Tracking:
Not Specified

Environment: Windows and CF 8


 Description  « Hide
If you create a new include item in your navigation the resulting include does not work and you see CF errors.

To reproduce:

1) Create a new Include "page", Any template and any include will reproduce this problem (at least on windows)

2) Preview it. You get an error:

Sorry, but I've fixed the issue and don't remember the exact text of the error. I think it's that "include can not be found in stObj".

Anyhow, first off, the include.cfm custom tag in /farcry/core/tags/webskin makes direct reference to stObj on line 33 (or so). This variable doesn't exist to the tag. This needs to be request.stObj. So, that line should be changed from:

<cfset templatePath = "/farcry/projects/#application.applicationname#/includedObj/#stObj.include#" />

to:

<cfset templatePath = "/farcry/projects/#application.applicationname#/includedObj/#request.stObj.include#" />

Once you're past that error you get a different one that shows itself in a couple ways. If you go back to the include form and look at the Included CF Template drop down HTML you'll see that every object has the same value. On my machine this was "C" on another it was "D". Because this value is the same across the board the selection in this drop down is not persisted in a meaningful manner. Also, the include tag tries to include a file named "C" from the includedObj folder. That's not what I expected.

The problem stems from the dmInclude.cfc file. There is a method here named getIncludeList. In the svn version it looks like this:

<cffunction access="public" name="getIncludeList" returntype="string" hint="returns a list (column name 'include') of available includes.">

<cfset var returnList = "" />
<cfset var includePath = application.path.project & "/includedObj">
<cfset var qDir = queryNew("blah") />
<cfset var includeAlias = "" />


<cfset var qIncludes = application.coapi.coapiadmin.getIncludes() />

<cfloop query="qIncludes">
<cfset includeAlias = left(qIncludes.name, len(qIncludes.name)-4)>
<cfset returnList = listAppend(returnList, "#qIncludes.PATH#:#qIncludes.displayName#") />
</cfloop>

<cfreturn returnList>
</cffunction>

The problem is that the resulting list has the full path to the include, a colon and then the name of the included file. Because a colon is the delimiter here the system thinks that "C" in "C:\path to include" is the file. So in the list in the form the value is "C" or "D" or whatever drive you have your source on.

It needs to be updated to this:


<cffunction access="public" name="getIncludeList" returntype="string" hint="returns a list (column name 'include') of available includes.">

<cfset var returnList = "" />
<cfset var qDir = queryNew("blah") />
<cfset var includeAlias = "" />


<cfset var qIncludes = application.coapi.coapiadmin.getIncludes() />


<cfloop query="qIncludes">
<cfset includeAlias = left(qIncludes.name, len(qIncludes.name)-4)>
<cfset returnList = listAppend(returnList, "#ListLast(qIncludes.PATH, "\/")#:#qIncludes.displayName#") />
</cfloop>

<cfreturn returnList>
</cffunction>

Note that this removes the unused line:

<cfset var includePath = application.path.project & "/includedObj">

And changes the return list like this:

<cfset returnList = listAppend(returnList, "#ListLast(qIncludes.PATH, "\/")#:#qIncludes.displayName#") />

There's a new listLast function in that line that gets just the file. (I guess I could have used getFileFromPath)

So now the form will use the include file name a the value in the drop down.

Applying the tag and type fix together allow the include to work.




 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Coughlin - 17/Aug/07 07:38 AM
The fix for the function "getIncludeList" exists in p400. See FC-901 and SVN revision 1949.

Jeff Coughlin - 17/Aug/07 07:53 AM
The other fix for the tag include.cfm also exists in p400. See FC-760 and SVN revision 1606.

Jeff Coughlin - 17/Aug/07 07:55 AM
Both of these issues have already been addressed.