Ever wonder how great it would be if you can edit the content of an object that you have selected in the library? Well now you can! By adding a form tool attribute ‘ftAllowLibraryEdit’ into your CF property such as below, it allows you to individually edit each object.

<cfproperty ftSeq="15" ftwizardStep="Body" ftFieldset="Relationships" name="aRelatedIDs" type="array" required="no" default="" ftJoin="dmNavigation,dmHTML,dmNews,dmEvent,dmFacts,dmLink" ftLabel="Associated Content" ftAllowLibraryEdit="true" />

Once you have included the new attribute, update the application. You should see a new button named ‘Edit Item’ appearing next to the ‘Remove Item’ button.

Regular Expressions are your friend. Once you’ve learn the dark art, you’ll wonder how you ever got by without. It does take a little time and some mastering however. Here are a few links to get you started on your way.

Annoyingly, depending on the setup of the MYSQL server at your host (and more specifically if they host their MYSQL server on a Windows box) the case sensitivity setting of the database may be set to be ‘case insensitive’… which is a pain if you are moving from a Linux MYSQL server to Windows and back etc because Farcry will not think that any of the object tables have been deployed along with all sorts of other issues. So to get around this issue I wrote a script that produces a nice bunch of sql statements to plant into your MYSQL GUI (eg. sqlYog) and it will rename all the tables back ito the case expected by farcry. This beats the heck out of doing it manually…. zippedy doo!


<cfset lcoretables = "container_aRules,dmExternalGroupToPolicyGroup,dmGroup,dmPermission,dmPermissionBarnacle,dmPolicyGroup,dmUser,dmUserToGroup,fqAudit,refCategories,refContainers,refDSAS,reffriendlyURL,refObjects,statsCountries,statsDays,statsHours,statsSearch" />

<cfloop index="i" list="#lcoretables#">
	<cfoutput>ALTER table #lcase(i)# RENAME _#i#;</cfoutput>
</cfloop>

<cfloop index="i" list="#lcoretables#">
	<cfoutput>ALTER table _#i# RENAME #i#;</cfoutput>
</cfloop>

<cfset lTypes = "#structKeyList(application.types)#">

<cfloop list="#lTypes#" index="st">
	<cfoutput>ALTER table #lcase(st)# RENAME _#st#;</cfoutput>
</cfloop>

<cfloop list="#lTypes#" index="st">
	<cfoutput>ALTER table _#st# RENAME #st#;</cfoutput>
</cfloop>

</cfset><cfset lRules = "#structKeyList(application.rules)#">

<cfloop list="#lRules#" index="st">
	<cfoutput>ALTER table #lcase(st)# RENAME _#st#;</cfoutput>
</cfloop>

<cfloop list="#lRules#" index="st">
	<cfoutput>ALTER table _#st# RENAME #st#;</cfoutput>
</cfloop>

<cfloop index="i" list="#lTypes#"></cfloop><cfloop collection="#application.types[i].stProps#" item="st"><cfif application.types[i].stProps[st].metadata.type is 'array'>
	<cfoutput>ALTER table #lcase(i&"_"&st)# RENAME _#i&"_"&st#;</cfoutput>
</cfif></cfloop>

<cfloop index="i" list="#lTypes#"></cfloop><cfloop collection="#application.types[i].stProps#" item="st"><cfif application.types[i].stProps[st].metadata.type is 'array'>
	<cfoutput>ALTER table _#i&"_"&st# RENAME #i&"_"&st#;</cfoutput>
</cfif></cfloop>

<cfloop index="i" list="#lRules#"></cfloop><cfloop collection="#application.rules[i].stProps#" item="st"><cfif application.rules[i].stProps[st].metadata.type is 'array'>
	<cfoutput>ALTER table #lcase(i&"_"&st)# RENAME #i&"_"&st#;</cfoutput>
</cfif></cfloop>

<cfloop index="i" list="#lRules#"></cfloop><cfloop collection="#application.rules[i].stProps#" item="st"><cfif application.rules[i].stProps[st].metadata.type is 'array'>
	<cfoutput>ALTER table _#i&"_"&st# RENAME #i&"_"&st#;</cfoutput>
</cfif></cfloop>

Good news for children everywhere… Tree Inspector now alerts you when you are with the wrong parent!

Ever thought your navigation node was appearing under the wrong parent node?

Well the updated Tree Inspector helps ease your anxiety, take a look at the image below.

In the case above you will see that the footer nodes parentid does not match the utility nodes objectid. There are two possible causes for this and I will explain them and the fixes below.

  1. The footer node is underneath the wrong parent; in this case you would simply update the nLeft and nRight (as normal) so that the node jumps underneath the correct parent node.
  2. The footer node is underneath the correct parent, but for some reason the parentid in the database in wrong; you would need to manually update the nested_tree_objects table so that the footer nodes parentid is the same as the utily nodes objectid.

Have a shot at using this release and if you have any thoughts / improvements please post them here.

Now and then when building a custom farcry object you might get the error ‘Element [insert object name] is undefined in a CFML structure referenced as part of an expression.’ upon accessing one of its methods by using the application scoped path eg:


createObject("component",application.types['insert type name here'].typepath)

Basically, this means that during the initialisation of the farcry application there was some sort of syntax error in the farcry object and was not able to be referenced in the application scope.

The simplest way to debug this is to make a small test file, put it into the webroot and call the object directly eg:


<cfset o = createObject("component","farcry.projects.projectname.packages.types.objectname") />
<cfdump var="#o#" />

Run the test file and it will try and create the farcry object and crash letting you know where the problem lies. All you have to do is fix the problem until you are able to run your test file without it crashing, then update the farcry application and boomshanka, all will return to a perfect state of harmony.

At the moment jQuery is our javascript framework of choice – it is straight forward to use and you can create complex effects/functions with only the basic of knowledge. Although like many coding languages your source can quickly become bloated and start affecting the performance of your application. Luckily while reading my daily new feeds I found a great post written by Samer Kamel Draidi (originally by Jon Hobbs-Smith) which details 25 excellent tips to improve the use of jQuery.

The article ‘Improve your jQuery – 25 excellent tips‘ has many great tips to increase speed and generally improve how you code using jQuery and I feel it is a must read… so check it out.

Recently, I’ve discovered that some of the Firefox version 2 (in particular 2.0.0.20 on Window Vista) has an error in the mime type settings. Reasons for this is because when I uploaded a PDF document (using cffile tag) via the Firefox browser the mime type returns from the browser was ‘text/html’ instead of ‘application/pdf’. Patrick van Bergen wrote a detailed article about this issue and has concluded that this occurs due to the incorrectly configured mimetype.rdf file located in the Firefox profile folder. There’s no common solution for this issue so far and the best we can do is to perform checks for both the mime type and the file extension to determine the content of the file.

The filter form on the top of the object admin page inherits the default properties, this can be problematic especially when you only want something to be display only.

When a property is set to display only, you are unable to filter by it.

To fix this modify the custom admin file as below.


<cfset stFilterMetaData = structNew() />
<cfset stFilterMetaData.thehiddenproperty.ftDisplayOnly= "false" />

<!--- set up page header --->
<admin :header title="News" />

<ft :o bjectadmin  typename="dmNews"
permissionset="news"
title="#application.adminBundle[session.dmProfile.locale].newsAdministration#"
columnList="title,catnews,publishdate,datetimelastUpdated"
sortableColumns="title,publishdate,datetimelastUpdated"
lFilterFields="title,source"
stFilterMetaData="#stFilterMetaData#"
sqlorderby="publishdate desc"
plugin="farcrycms"
module="/dmNews.cfm" />

read more at http://docs.farcrycms.org/display/FCDEV40/Formtools+Object+Admin

The other day i was having an issue with a button which had a movie clip layered on top of it. I assumed that the movieclip on top of the button would disable the button mouse events but after running my application, the button was still firing an onRelease event (even though you could not see it on stage). After a bit of research, i discovered that setting the ‘visible’ property to false on a button/movieclip completely disables the mouse events for the button/movieclip, as well as hiding it from the stage. I’m finding this very useful for situations where i would like to dynamically enable or disable the mouse events of a button/movieclip.

No… not global warming.

Developing on your local environment is quite often very different to what is actually running at your hosts end. I am not going to tell you how to get around the issues with different combinations of CF, database server and web server but instead, here is a little script that you can upload to your host and see what they are running compared to yourself if you run into any ‘environment’ issues. Hopefully armed with this info and google you can find someone who has the same issue, goodluck:


<cfquery name="q" datasource="#application.dsn#">
	SELECT version() AS MYSQLversionNo
</cfquery>
<cfoutput>
	<html>
		<style type="text/css">
			body{
				font-family: verdana;
			}
		</style>
		<body>
			<h2>CF - #server.coldfusion.PRODUCTVERSION#</h2>
			<h2>MYSQL - #q.MYSQLversionNo#</h2>
			<h2>WEBSERVER - #CGI.SERVER_SOFTWARE#</h2>
		</body>
	</html>
</cfoutput>