December 1st, 2003, 01:56 PM
Unable to find Custom Tags
I have an CF application that has just been upgraded to CF MX. My custom tags are located in the same directory but now CF is failing to locate them.
I create the custom tag path dynamically by reading in a file and parsing the key value pairs into a struct array. In addition their is a carriage return placed at the end of each key value pair to indicate end of line. The parsing program looks for the ascii value chr(10) of the carriage return to know when to complete reading. For some reason since I have upgraded to C Fusion MX it is appending a space to the end of my value (where carriage return in located). Therefore causing my custom tag paths to contain the space.
PArt of file that is parsed
tagDir=myDevTags(carriage return here)
Custom Tag call
<CFMODULE NAME="#application.tagDir#.Status" path="#Application.path#">
Error message in log:
Cannot find CFML template for custom tag myDevTags .Status
Notice the space between tagDir and .Status. This problem never occurred in previous versions of CF.
I guess I should parse by something other than a carriage return.
Anyone aware of CFMX behaving strangely with carriage returns?
December 1st, 2003, 02:37 PM
Not that I have experienced. If you have a special directory for your custom tags, can you confirm that the directory where you have your custom tags is defined as a custom tag path in the CF Administrator? Also, does it work if you manually specify the name of the tag instead of trying to do it dynamically?
December 1st, 2003, 02:38 PM
You could also try using trim() and see if that gets rid of the extra space, if that extra space is indeed the problem.
December 2nd, 2003, 10:50 AM
Yes, my directory is defined in the custom tag path. If I manually specify the tag name it works as well. I am currently experimenting with the trim function.
What I find disturbing is that this is currently working under previous versions, and I cannot find anything in the CFMX documentation to indicate that this would cause problems. I suppose that is nothing new always fun with upgrades.
Thanks for your assistance, you had some good ideas. Let me experiment further with the trim function and I will update the thread when I get some results.
December 2nd, 2003, 11:13 AM
After experimenting a bit with the trim function I have a clearer picture of what is happening. I store the tagDir variable as an application variable. The first time in the tagDir variable is defined correctly without a space. However than the value changes *(even though the app name has not changed nor has CF been recycled). My app var settings in CF Admin are set to 2 days. So why is the application variable value changing? My code indicates to check for existence before setting that value, and it is not going into that portion of code when the value is changing. Any thoughts on adding additional spaces to application variables? I can verify that it is not accessing the code to set the variables because I included outputs and an abort statement to test. This is seems very strange to me. Anyone else have problems with CFMX application variables?
December 3rd, 2003, 10:10 AM
I haven't seen this, but I can say with certainty that the application scope in CFMX does indeed work correctly. Witness the Mach-II framework (www.mach-ii.com) which caches vast numbers of CFC instances in the application scope to drive the framework. If there were problems with the application scope this large and complex system would blow up all over the place. So I'm still thinking it must be something specific to the application, but I'm not sure what.
Could there be someplace else that is modifying the vars? Can you verify that the vars have no spaces upon initial creation? Perphaps try dumping the application scope at various points in the processing of a request to see if you can narrow down where it seems to change?
December 3rd, 2003, 12:57 PM
You are correct, it is not a problem with the application variables. Indeed, I found a portion of code which is resetting all of the application variables without using a proper trim. Thanks for your assistance.