FarCry 7 runs afterSave() when a user clicks Edit

When a user clicks edit on a record in FarCry 7 (latest version), FarCry runs afterSave(). This has been causing all sorts of issues (both performance and duplicate record saving problems) where we use afterSave() in types (since it’s not supposed to run afterSave until actually done saving the record).

This has been a showstopper issue for us. We’ve tried to track down the code in core, but so far have been unsuccessful. Any suggestions?

Might be something to do with the locking code.

Blair

In types.cfc setLock() uses bAfterSave="false" when it calls setData() so that shouldn’t be it…

We might need some more info about your environment / project;

  1. Does this happen on versioned or non-versioned objects, or both?
  2. Does it happen on unmodified core content types or custom content types, or both?
  3. Does it happen for all content types in the system or just some?
  4. How have you confirmed that afterSave is running when “Edit” is clicked? Have you put logging inside afterSave()?
  5. Are you calling setData() from inside afterSave()? If so are you including bAfterSave="false"?

I’ve done the following test on a custom content type that extends types by adding a basic afterSave handler;

<cffunction name="afterSave">
	<cflog file="bug-aftersave" text="inside afterSave">
	<cfreturn super.afterSave(argumentCollection=arguments)>
</cffunction>

With this code, there is no log entry written when clicking “Edit” on the objectadmin grid, and after I click “Complete” to save the object there is a single entry in the log. The same thing happens when I click “Edit” from the object overview dialog.

Do you have any code you can share or a .cfc that can reproduce the issue?

Any further info on this issue?

Yeah, sorry. We’ve been in the middle of a large launch the past couple weeks (getting very little sleep). For the moment, I put a little hack in to prevent the problem I was having. I’ll come back to this shortly.

1 Like