• Resolved berndelpan

    (@berndelpan)


    Hi,

    first of all thanks for the great plugin!

    I’ve the following problem:
    – I’ve several users which already predicted games.
    – I’ve a multisite-installation and long time ago I tested it and everything was fine
    – After the first game of EM2016 I can see the points won by each user per game, but it doesn’t create a score entry (even in the database)

    Is there any workaround that the calculation of the ranking will work? Why does the user prediction works fine with multisite, but scores (ranking) not? What do I need to change?

    https://www.ads-software.com/plugins/football-pool/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author AntoineH

    (@antoineh)

    To be honest, I wouldn’t know what to change. I am not familiar with the working of multi-site installs and possible side-effects.

    Big difference in the calculation is that I use a lightbox with ajax calls to do the different calculation steps. You can try to use the calculation without ajax calls. For this add the following to your wp-config and do a calculation:

    define( 'FOOTBALLPOOL_RANKING_CALCULATION_NOAJAX', true );

    Also, enable debugging in WP to see if anything is logged that might help in solving the problem.

    But multi-site support is not a feature of the plugin. So no guarantee that it will work.

    Thread Starter berndelpan

    (@berndelpan)

    Hi again,

    thanks for the quick response. I did a test with the “NoAjax”-Calculation and turned on the debugging. I got 3 times the same error:
    Undefined offset: 0 in admin/class-football-pool-admin-score-calculation.php –> Lines 64, several times line 342 and 400 –> the code always indicates to the ranking_id variable:

    if ( ! in_array( $calculation_step, array( ‘cancel_calculation’, ‘finalize’, ‘stop_message’ ) ) ) {
    $ranking_ids = self::get_rankings();
    $ranking_id = $ranking_ids[$ranking];

    I’m not sure if this has to do with the multisite, as everything else like predictions groups update etc. works fine… so the prefix works. Any further ideas regarding the undefined offset: 0 – ranking_ID?

    Plugin Author AntoineH

    (@antoineh)

    Seems like the get_rankings() function is not returning any rankings. If the ranking table contains the default ranking (that one should always be there), then it’s not a database problem and then I think it is related to the fact that I use sessions to store the rankings and other intermediate values.

    Thread Starter berndelpan

    (@berndelpan)

    I’ve checked the ranking table and it didn’t contain any data sets. So I guess the default ranking didn’t work… I now added an user specified ranking and then it worked!

    Anyway thanks a lot for your help and it seems, that the plugin already works even with multisites… at least in my environment ??

    Plugin Author AntoineH

    (@antoineh)

    OK, good to hear it is working now, although it is strange that the default ranking was gone. Not sure if this is related to the MU install or if something else went wrong.

    Hi,

    I got the same problem but i’m not using mulitsites and i tried:
    define( 'FOOTBALLPOOL_RANKING_CALCULATION_NOAJAX', true );

    The ranking table in the database is empty and I get the same error at:
    $ranking_id = $ranking_ids[$ranking];

    What do you guys mean with: I now added an user specified ranking and then it worked!
    Did you use something like this:
    [fp-user-ranking user=1 text="not ranked"]

    That’s not working for me, how can I add an user specified ranking?

    Plugin Author AntoineH

    (@antoineh)

    If the ranking table is empty, please run the following query on the database to fix it:

    TRUNCATE TABLE pool_wp_rankings;
    
    INSERT INTO pool_wp_rankings ( id, name, user_defined, calculate )
    VALUES ( 1, 'default ranking', 0, 1 );

    p.s. if you don’t use the default prefixes, you’ll have to change the table names accordingly

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Ranking and Statistics empty, but predictions working’ is closed to new replies.