Custom stPropMetadata to ft:serverSideValidation?

How do you send custom stPropMetadata to ft:serverSideValidation?
I’m trying to override the content type in a rule in execute. Specifically the ftAllowedFileExtensions on the original content type. It works on the front end OK but I can’t get it to get past ft:serverSideValidation. Always checks for the original ftAllowedFileExtensions in the content type.

ft:serverSideValidation passes the form to ft:validateFormObjects which does have a stPropMetadata attribute. Could I get away with just using ft:validateFormObjects instead? (That does seem to work in principle) by just adding this to the execute;

<cfif structKeyExists(form, "FARCRYFORMPREFIXES")>
	<cfset lValidatedForms = "">
	<cfloop list="#form.FARCRYFORMPREFIXES#" index="prefix">

		<cfif structKeyExists(form, "#prefix#objectid") AND NOT listFindNoCase(lValidatedForms, prefix)>
			<ft:validateFormObjects typename="#ListGetAt(form['#prefix#typename'],1)#" objectid="#ListGetAt(form['#prefix#objectid'],1)#" stPropMetadata="#stPropMetadata#" />
			<cfset lValidatedForms = listAppend(lValidatedForms, prefix)>

Perhaps ft:serverSideValidation should have the attribute of stPropMetadata and then pass that to ft:validateFormObjects.

1 Like

I think you’ve nailed it. Adding stPropMetadata to <ft:serverSideValidation> makes sense, so if you’d like to do a PR for your change I’ll merge it. Otherwise you can definitely use <ft:validateFormObjects> directly as you’ve found.

It still appears that it fails to actually save the file unless you change the real content type property. So the takeaway would probably make the content type generous on what it accepts and filter it with the stPropMetadata. It’s probably failing in the application.fc.lib.cdn.ioValidateFile() process as that looks at the content type for it’s behaviour.