Skip to content

Commit 1e71745

Browse files
author
Blair McKenzie
committed
fixes to handle screwy event properties
1 parent 41e3dcf commit 1e71745

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/events/cloudsearch.cfc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929

3030
<!--- update index --->
3131
<cfif not structIsEmpty(st)>
32-
<cfset application.fapi.getContentType("csContentType").importIntoCloudSearch(stObject=arguments.stProperties, operation="updated") />
32+
<cfset structappend(stProps, application.fapi.getContentType(typename=stProps.typename, objectid=stProps.objectid)) />
33+
<cfset application.fapi.getContentType("csContentType").importIntoCloudSearch(stObject=stProps, operation="updated") />
3334
</cfif>
3435
</cffunction>
3536

packages/types/csContentType.cfc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,11 @@
619619
</cfswitch>
620620

621621
<cfcatch>
622-
<cfset exception = createObject("java", "java.lang.Exception").init("error setting #stFields[field].type# #field# to value #serializeJSON(arguments.stObject[property])# from #arguments.stObject.typename#:#arguments.stObject.objectid# - #cfcatch.message#") />
622+
<cfset item = "" />
623+
<cfif structKeyExists(arguments.stObject, property)>
624+
<cfset item = arguments.stObject[property] />
625+
</cfif>
626+
<cfset exception = createObject("java", "java.lang.Exception").init("error setting #stFields[field].type# #field# to value #serializeJSON(item)# from #arguments.stObject.typename#:#arguments.stObject.objectid# - #cfcatch.message#") />
623627
<cfset exception.initCause(cfcatch.getCause()) />
624628
<cfset exception.setStackTrace(cfcatch.getStackTrace()) />
625629
<cfthrow object="#exception#" />

0 commit comments

Comments
 (0)