I’ve searched etc to try and resolve this but couldn’t so am asking the question here…
We’ve built a fairly complex data manager for a couple of our clients using the marvellous ACF (one of the best maintained, professional developer-savvy plugins I’ve used).
However! One thing which keeps biting us currently is that our clients keep losing data due to re-saving a post before ACF has finished loading all of it’s data. We have quite a few relationship fields and even though we’ve done a data schema overhaul to simplify the ACF relationships, there are still times when loading the full ACF data for a post can take 5-10 seconds. If the Admin is just tweaking something near the top of the post, they can easily try to ‘Update’ the post before all the data is loaded, and then the incomplete data is lost.
Is there a way to disable the Update button until ACF has fully completed loading?
Or alternatively, if we need to do this bespoke, which action/hook would be best to use to develop such a solution.
(I have considered the potential problem of disabling the Update button and relying on events to ‘re-enable’ it but that’s a much smaller issue than losing data!).
Does no-one else have this issue when there are a lot of ACF fields on a page? I assumed this was a helpful topic to raise and hoped for a solution but perhaps no-one else has the issue.
Or am I doing something wrong or approaching the solution the wrong way? I’d be more than happy to have that pointed out to me if it fixes the issue for me as currently we’re having to consider moving away from ACF which is a shame for such a feature-rich commercial plugin we’ve invested a lot of time in.
I also have this problem when updating a large content set before it has loaded in, my problem is that the client isn’t too tech savvy and are un-aware they need to wait.
This results in a corrupted output or loss of information in the database – is there any updates on this issue?
Is there likely to be a hotfix for this? I agree with the solution above to disable the update button until ACF has finished loading its content.
Before I begin, I have never had this issue.
The following is just an idea of a way to work around this that may work but is untested.
First step, add custom CSS to the admin that hides the update button. “display:none”.
Add custom JS to the page that set the display back to inline “display:inline” on $(document).ready
The topic ‘Disable Update button until all fields have loaded’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!