• Resolved marzoolio

    (@marzoolio)


    Hi,

    I have problem with calculation and I get error message every time. I enabled debug and it’s giving me this error code:

    PHP Fatal error:  Football Pool => default ranking with ID 1 is missing in the pool_wp_rankings table in /share/CACHEDEV1_DATA/Web/MyBet/wp-content/plugins/football-pool/admin/class-football-pool-admin-score-calculation.php on line 1089

    …so it’s pointing on this function

    private static function get_rankings(): ?array
    {
        $cache_key = 'fp_calc_rankings';
        if ( ! self::cache_key_exists( $cache_key ) ) {
            global $wpdb;
            $prefix = FOOTBALLPOOL_DB_PREFIX;
    
            $sql = "SELECT id FROM {$prefix}rankings ORDER BY id ASC";
            $rankings = $wpdb->get_col( $sql );
    
            // throw error if the default ranking is missing from the database
            if ( count( $rankings ) === 0 || ! in_array( FOOTBALLPOOL_RANKING_DEFAULT, $rankings ) ) {
                trigger_error( 'Football Pool => default ranking with ID ' . FOOTBALLPOOL_RANKING_DEFAULT .
                    ' is missing in the ' . FOOTBALLPOOL_DB_PREFIX . 'rankings table', E_USER_ERROR );
            }
    
            $rankings = array_map( 'intval', $rankings );
    
            self::set_value_in_cache(
                $cache_key,
                apply_filters( 'footballpool_score_calc_rankings', $rankings )
            );
        }
    
        return self::get_value_from_cache( $cache_key );
    }

    Can you point me the way where to find what is wrong, please ? ??

    Great job with the plugin, I’m just messing my site, thanks! ??

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