Support

Account

Forum Replies Created

  • Update: the current ACF version failed, so I had to apply the patch again.

  • It worked John! Thanks a lot for all the help, I’ve been troubleshooting this for over a month already.

    BTW, can you add the function tag to that function, just in case someone wants to copy and paste the solution?

    Looking past what the cache is returning, I would look at what could be causing the get_posts() query to return an empty array, because this is where the empty array in the cache is being set. This has to happen at some point before you see the fields disappear.

    Regarding your previous comment, I’m not sure to what line or file are you referring, but the line that’s returning an empty array is not get_posts(), it’s this one:

    $post_ids = wp_cache_get( $cache_key, 'acf' );

  • Great news, I did some findings. At least just spotted where the problem is coming from and how to patch it.

    I did check acf-field-group-functions.php as you suggested, and after tracing the errors through the code I found out that when the fields are not showing up, $post_ids in acf_get_raw_field_groups() is returning an empty array, then the if statement at line 360 fails (see below).

    So changing the if statement like this did the trick
    if( $post_ids === false || empty($post_ids) ) {

    I’m not sure how wp_cache works, but I’ve read that “All cache-related work is made using instance of the WP_Object_Cache class. The cache data is saved to the memory (server RAM) during the page generation. But if you’re using a persistent cache plugin, the cache can be stored among page visits for a longer amount of time.”

    The cache plugin (FlyingPress) is currently deactivated when testing this, but it seems that the hosting (it’s WordPress.com hosting, from automattic) has memcache activated by default. This is what they told me regarding memcache:

    “Memcache cannot be disabled, it’s part of site infrastructure here and there’s no way to turn it off. It’s not possible to turn off memcache in our hosting environment (and honestly, I’m not sure why you would since it’s common on websites of all sorts, and I’ve never personally seen an issue with that)”

    TBH I’m not sure about these comments as I’m no cache expert by any means. But having this issue in mind and that this may be the case for other hosting platforms, is my solution feasible for future plugin updates?

    If not, how would you suggest fixing this permanently on my end? As future plugin updates will overwrite this line of code.

  • I like that approach. Just tried cleaning the functions.php completely and that didn’t change things either.

    Do you know which line should I look at in acf.php?

    Is there a price if I find a bug? 🙂

  • Hi John. I’ve disabled all caching and left only ACF activated, and the issue persists. Also tested with other themes, and same thing happens.

    Besides, this is backend related and not frontend, so I’m not sure how the theme would affect here?

    What seems to “fix” it almost everytime, is adding a new field group. But then again, after what seems to be a random number of hours/days, it stops working again.

    Having in mind what I’m doing to temporarily fix it, can you determine where the issue might be coming from? Or what else could I check?

  • Thanks John, this explanation makes more sense. However, this still happens randomly when ACF is the only plugin active.

    How would you go to debug/solve this? Is there a way to do this via the init hook?

  • I’m using ACF Pro. I’ve not installed any extra addons, however I see that the repeater field is supposed to be an addon?

    One of the field groups has a repeater field. However when the fields are displaying, the repeater field is still enabled.

  • Thanks for getting back.

    There are no javascript errors.

    Regarding memcache, I’ve all the plugins disabled, even cache ones. Where can I check this?

    We are on wordpress.com hosting

  • I’m having the same problem. They randomly show up for a few hours, then disappear for hours or days.

    I’ve tried disabling all the plugins and they aren’t showing up either.

    Thing is, they are not even showing up in the screen options at the top, where you choose what to display in the current post backend.

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