• Hello,
    We have a recurring issue with Pods, when calling $pod->field() the output is empty, if we clear Pods cache from the admin screen data is returned again.

    This happens mostly when content is added / updated and, it seems, mostly on pods configured with storage type as table.

    We currently are on the latest version of the plugin (3.2.1.1) and running PHP 8.1.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    This one is a stumper. I don���t think I’ve seen that issue before. Pods::field() doesn’t normally have this kind of issue because it doesn’t have a caching layer of its own.

    When it comes up empty, do you see the same issue in get_post_meta?

    Thread Starter edshare

    (@edshare)

    Hi Scott

    Calls to get_post_meta do work and return data.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    If you want to fill out this form for priority support, I think this one qualifies. I’m eager to figure out what exactly is causing this and it’s the best way to get certain site info privately.

    https://docs.pods.io/pods-upgrade-troubleshooting-and-priority-support/

    Plugin Support Paul Clark

    (@pdclark)

    While you may have been able to resolve this by providing more details through the form above, one thing to consider in this situation where $pod->field() is at times storing an empty value to cache is the priority of hooks or filters in which $pod->field() or the field is being accessed.

    For example, Pods initializes some functionality on plugins_loaded at priority 10, and some functionality on after_setup_theme at priority 10. (I am not seeing it in the code at the moment, but I recall there may be some functionality registered as late as init at priority 10.)

    If code has been added which accesses some data before the data structures have been initialized, but still caches the result, this might cause the type of behavior described.

    One way to test this possibility would be to run the additional code at a later priority after clearing caches one last time — for example add_action( 'template_redirect', 'function_name', 100 ); or add_action( 'admin_init', 'function_name', 100 );

    Thread Starter edshare

    (@edshare)

    Hi Paul,

    Thank you for your input. The issue we have here is that even with caching disabled (from W3TC) the issue seems to persist for some reason.

    I have already sent a support request, was unable to add WP Health info, an error was returned when submitting the form, but haven’t heard anything back yet.

    Plugin Support Paul Clark

    (@pdclark)

    The error message might provide more information. Scott will provide feedback as soon as able if there is enough information to do so.

    In addition to plugins like W3TC, WordPress has its own caches for requests to the database.

    If queries are run before init at priority 20 or better template_redirect, it may cause that query and later queries to think the content does not exist. This is the case even if no caching plugins are running.

    Thread Starter edshare

    (@edshare)

    Hello Paul,

    Did a few tests, the calls to $pod->field() are always after the init hook has finished, but sometimes return empty values.

    if ( !did_action('init') ) {
    die('init not finished');
    }

    We never enter the die condition.

    • This reply was modified 1 month, 2 weeks ago by edshare.
    • This reply was modified 1 month, 2 weeks ago by edshare.
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.