The exception that you posted seems to be coming from your SecurityFilter.cfc rather then from the Mach II framework. Thank you for attaching SecurityFilter.cfc but I think to really understand what is happening we will also need to see it's super class BaseApplicationFilter.
I run several Mach II sites on a SAN that is accessed via UNC paths on the server so I am pretty certain Mach II works with UNC paths. For us UNC paths doesn't even come up because we path everything relative to the root or use mappings which seems like generally a best practice. Are you using that practice? --Kurt On Fri, Jun 1, 2012 at 12:09 AM, Shaun <[email protected]> wrote: > The app that is receiving the environment error is using no modules at all. > > I tried upgrading to MachII 1.8.1 but unfortunately it breaks the generation > of the .htaccess file for URL rewriting that works on my version 1.8.0 and > as right now I am simply trying to migrate the sites was hoping to avoid > getting back into the code on them and editing it from what was previously > working (See attached file of working url code). > > The UNC paths seem to work fine on CF10 in all other non MachII sites - the > immediate code that breaks the UNC paths in MachII is the expandRelativePath > function which I was able to edit to ensure that the absolute path that is > generated works fine: > > <cffunction name="expandRelativePath" access="public" returntype="string" > output="false" > hint="Expands a relative path to an absolute path relative from a base > (starting) directory."> > <cfargument name="baseDirectory" type="string" required="true" > hint="The starting directory from which relative path is relative." /> > <cfargument name="relativePath" type="string" required="true" > hint="The relative path to use." /> > <cfset var combinedWorkingPath = arguments.baseDirectory & > arguments.relativePath /> > <cfset var pathCollection = 0 /> > <cfset var resolvedPath = "" /> > <cfset var hits = ArrayNew(1) /> > <cfset var offset = 0 /> > <cfset var i = 0 /> > <!--- Unified slashes due to operating system differences and convert ./ to > / ---> > <cfset combinedWorkingPath = Replace(combinedWorkingPath, "\", "/", "all") > /> > <cfset combinedWorkingPath = Replace(combinedWorkingPath, "/./", "/", "all") > /> > <cfset pathCollection = ListToArray(combinedWorkingPath, "/") /> > <!--- Check how many directories we need to move up using the ../ syntax > ---> > <cfloop from="1" to="#ArrayLen(pathCollection)#" index="i"> > <cfif pathCollection[i] IS ".."> > <cfset ArrayAppend(hits, i) /> > </cfif> > </cfloop> > <cfloop from="1" to="#ArrayLen(hits)#" index="i"> > <cfset ArrayDeleteAt(pathCollection, hits[i] - offset) /> > <cfset ArrayDeleteAt(pathCollection, hits[i] - (offset + 1)) /> > <cfset offset = offset + 2 /> > </cfloop> > <!--- Rebuild the path from the collection ---> > <cfset resolvedPath = ArrayToList(pathCollection, "/") /> > <!--- Reinsert the leading slash if *nix system ---> > <cfif Left(arguments.baseDirectory, 1) IS "/"> > <cfset resolvedPath = "/" & resolvedPath /> > </cfif> > <!--- Reinsert the trailing slash if the relativePath was just a directory > ---> > <cfif Right(arguments.relativePath, 1) IS "/"> > <cfset resolvedPath = resolvedPath & "/" /> > </cfif> > <!--- If the base directory is a UNC network path add the removed slashes > back to it so CF can find it ---> > <cfif Left(arguments.baseDirectory, 2) is "\\"> > <cfset resolvedPath = "\\" & resolvedPath /> > </cfif> > > <cfreturn resolvedPath /> > </cffunction> > > The code works fine without network paths - I make the change to use network > paths and all of a sudden I get the following error: > > Type: Expression || Message: Element EVENT is undefined in ARGUMENTS. || > Detail: || Base Template: \\vmware-host\Shared > Folders\tim\Sites\srconstruction\filters\SecurityFilter.cfc at line 43 || > Original Template: \\vmware-host\Shared > Folders\tim\Sites\srconstruction\filters\SecurityFilter.cfc at line 43 > > Filter attached. > > You mentioned earlier to use drive mappings in CF for network paths. How is > this possible? > > Best, > > Shaun > > On Friday, June 1, 2012 1:57:17 PM UTC+10, Shaun wrote: >> >> Hi, >> >> I have used MachII on numerous projects, but recently was tasked with >> relocating some websites using the Framework to a new server. >> >> The location of the Framework and all websites is on a network drive >> and as such the root path looks something like: >> >> //vmware-host/Shared Folders/sites/MachII >> //vmware-host/Shared Folders/sites/website >> >> Instead of previously being something like: >> >> C:\inetpub\wwwroot\MachII >> C:\inetpub\wwwroot\website >> >> This seems to have caused a whole range of issues with the Framework >> and there are many things that are not working. Firstly relative paths >> in the config would not even load. This was fixed by adding the >> following code at the end of the expandRelativePath() function in >> MachII/util/Utils.cfc >> >> <cfif Left(arguments.baseDirectory, 2) is "\\"> >> <cfset resolvedPath = "\\" & resolvedPath /> >> </cfif> >> >> However then other things seem to be unworking - depending on the site >> - one was using the MachII environments and refused to load past that >> point. Another older site before MachII environments existed (had its >> own environment system) was reporting errors with "event" being >> undefined in arguments while using a filter. On that one I was able to >> remove some filter code and get a page to load, but as soon as an >> event was triggered I would get the same event undefined error. >> >> My feeling on this is that events are not being passed through, likely >> because of something like a hash id for memory storage being different >> in several places (possible due to me changing that util code) and >> thus it cant be looked up and found on subsequent execution flow. This >> is simply a guess but one way or another MachII does not seem to play >> nice with it being on a network drive. >> >> Additionally other sites I have migrated that do not use MachII are >> fine. >> >> Help on this would be appreciated as all MachII sites wont' work with >> a network drive setup :( >> >> Best Regards, >> >> Shaun Byrnes > > -- > To post to this group, send email to [email protected] > For more options and to unsubscribe, visit this group at > http://groups.google.com/group/mach-ii-for-coldfusion?hl=en > > SVN: http://svn.mach-ii.com/machii/ > Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/ -- To post to this group, send email to [email protected] For more options and to unsubscribe, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en SVN: http://svn.mach-ii.com/machii/ Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/
