• Resolved Andy Dickinson

    (@theangryduck)


    Hi,

    For all our player lists we are getting the following error:
    Warning: number_format() expects parameter 2 to be long, string given in /home/…./afchornchurch.com/wp-content/plugins/sportspress/includes/class-sp-player-list.php on line 500

    See here: http://www.afchornchurch.com/work-in-progress/

    We did use the Configure option to try and re-order the player performance and player statistics values to try and get the player stats (in this case Appearances) to display to the left of the statistics as it currently shows in the rightmost column.
    This didn’t work though and in putting it back we accidentally deleted the Appearances statistic metric. We added this back in though – we have another site that uses Sportspress so we copied the config exactly.

    It looks like the data may be corrupted but presumably you’ll be able to see which field is causing the error (line 500 in class-sp-player-list.php).

    Line 500: $placeholder = number_format( $placeholder, $stat->precision, ‘.’, ” );

    If it’s corruption and we have to delete all the players and re-input that’s not an issue but if it’s a config issue then I doubt that will work.

    Thanks,
    Andy

Viewing 7 replies - 1 through 7 (of 7 total)
  • Having the same problem here. http://www.panamaflagleague.com/web/list/9ers/

    Warning: number_format() expects parameter 2 to be long, string given in /home/pmaflag/panama/web/wp-content/plugins/sportspress-pro/includes/sportspress/includes/class-sp-player-list.php on line 500

    Hi,

    I am getting the same on player list performance

    http://whitburnpoolleague.co.uk/lammies-player-stats/?preview_id=709&preview_nonce=913870c410&_thumbnail_id=-1&preview=true

    Warning: number_format() expects parameter 2 to be long, string given in /home/content/n3pnexwpnas01_data03/90/3446590/html/wp-content/plugins/sportspress/includes/class-sp-player-list.php on line 500

    I have tried a few different options but get this on every player I had to the list. Found old forum threads from 2012 hinting that issue with the PHP code on the plugin.

    Any help or advise would be great!

    Thanks

    John

    Roch

    (@rochesterj)

    Hi!

    Thanks for reaching out!

    Do you have an empty field for the number of decimal places there? That’s the issue that is getting a warning

    Kind Regards,
    -Roch

    Hi Roch,

    Thanks – I have tried it this morning and seems to be working now. I added a 0 in the decimal place in each item of the player performance on the configuration and now displaying fine.

    Thanks for the help.

    John

    Thread Starter Andy Dickinson

    (@theangryduck)

    Hi Roch,

    Thanks – that seems to have fixed it.

    It is a little confusing because when you edit the player performance values it does show a 0 in the dp field, albeit it’s grey in colour. If you just save the metric at this point the 0 isn’t saved and the error still shows. It’s only when you key a 0 into the field (overwriting the grey 0) that the value is saved on update.

    Perhaps. if there’s no value in the dp field then you should show a blank rather than a greyed out 0.

    Thanks for your help.

    Andy

    Roch

    (@rochesterj)

    Hi Andy!

    Agreed! I’ll send this to our dev team so they can check this for future updates 🙂

    Kind Regards,
    -Roch

    Plugin Author Brian

    (@brianmiyaji)

    Thanks @rochesterj!

    For those seeing this error, the following fix will convert the parameter to prevent this issue:
    https://github.com/ThemeBoy/SportsPress/commit/7bc729dfd17f784ab275eeb31215f690f2f71ca0

    The fix will also be in the next update.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error when displaying player list’ is closed to new replies.