GF_Cache seems to not work

In the following code, the GFCache::get doesn’t seem to hold its value for longer than a second:

public static function get_entry_count_per_form() {

    if ( version_compare( self::get_database_version(), '2.3-dev-1', '<' ) ) {
        return GF_Forms_Model_Legacy::get_entry_count_per_form();
    }

    global $wpdb;
    $entry_table_name = self::get_entry_table_name();

    $entry_count = GFCache::get( 'get_entry_count_per_form' );
    if ( empty( $entry_count ) ) {
        //Getting entry count per form
        $sql         = "SELECT form_id, count(id) as entry_count FROM $entry_table_name l WHERE status='active' GROUP BY form_id";
        $entry_count = $wpdb->get_results( $sql );

        GFCache::set( 'get_entry_count_per_form', $entry_count, true, 30 );
    }

    return $entry_count;
}

On the

$entry_count = GFCache::get( 'get_entry_count_per_form' );

Line.

I also found there’s an error in common.php

public function flush( $flush_persistent = false ) {
	return GFCache::flush( $flus_persistent );
}

I’m wondering if that has something to do with it?

Hi Paul. I recommend opening a support ticket for this issue:

https://www.gravityforms.com/open-support-ticket/technical/

Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.