Support

Account

Home Forums ACF PRO Saving/updating metabox forms fail throughout WP

Solved

Saving/updating metabox forms fail throughout WP

  • When ACF Pro 5.0.8 is active (in some cases at the while memcached object caching is on), many admin metabox forms fail to save. Not always ACF fields, either. In some circumstances, this results in an infinite loop. I’ve seen this happen to various post types: Pages, Woocommerce Orders, and Woocommerce Coupons, even when the post types have no ACF fields.

    Here are some bugs that I have now traced back to ACF Pro being active at the same time as object caching:

    In all these issue, update and save actions don’t appear to fire at the right time. The Woocommerce issues pop up only when object caching is active.

    I encountered this issue because I didn’t realize that 5.0.8 was still in Beta, and I pushed this to our production webserver. (I wish the version number etc had made this more clear!) Anyway, since we updated the database I don’t think it’s easy to roll back, and would love to solve this issue.

  • The first Woocommerce issue was likely unrelated to ACF Pro.

    The latter two popped up because acf_form_post::save_post() hooks onto ‘save_post’. This hook only fires if something changs on the post’s <i>main</i> fields. What this means, for example, if you change a field within an ACF metabox without changing anything else, this hook doesn’t fire. Instead, hook into ‘pre_update_post’. See this diff to solve this problem:
    http://pastie.org/9617141
    Here is a reference to this same problem in another plugin.

  • This is NOT solved. Just updated to the 5.1.7.1 three months later to this one-word patch has not been applied to the live code…after a customer received 150 duplicate emails from our site. So though the problem is “solved” the code is not fixed.

    Why don’t you incorporate this one-word fix (posted above) into the code? If you would share the githib repo with @haroldkyle I would be happy to submit a pull request.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Saving/updating metabox forms fail throughout WP’ is closed to new replies.