• Resolved NickJP

    (@nickjp)


    After upgrading Sportspress on our site to version 2.7.16, I see the following warning appearing on one of the pages on the site: “Warning: A non-numeric value encountered in /home/customer/www/bsaact.org.au/public_html/wp-content/plugins/sportspress/includes/class-sp-league-table.php on line 395”. The page it appears on is https://bsaact.org.au/snooker/. This warning did not appear prior to the update.

    When I look at line 395 of the php file, it contains:

    $totals[?$team_id?][‘eventminutes’]?+=?$minutes;

    The values appearing in the league table are still correct. Any ideas on this problem?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Savvas

    (@savvasha)

    Hi @nickjp ,

    It seems like you added as minutes somewhere a non numeric value. For example, instead of adding 45, you added 45′.

    You can draft your events and published one by one until.yoi identify in which event that happened.

    Thanks, Savvas

    Thread Starter NickJP

    (@nickjp)

    I’ve checked, and I cannot find such a non-numeric time value anywhere. The only times in the database are those that were imported when I created all the season’s events a couple of months ago via import of CSV files. I’ve checked the CSV files, there are no non-numeric values in the time fields, and when I check all the season’s events in Sportspress, they all have a valid time field with no non-numeric values shown. It seems to me very coincidental that the events were all created a couple of months ago, with no warnings seen, and this warning has suddenly appeared immediately after a version upgrade of Sportspress.

    Plugin Contributor Savvas

    (@savvasha)

    Hi @nickjp ,

    Since I cannot reproduce this issue, there must be something different with your setup/data.

    Please draft your events and published one by one until you which event “produce” this error.

    Thanks,
    Savvas

    Thread Starter NickJP

    (@nickjp)

    Well, this is interesting. We have events in the current season for two separate competitions, billiards and snooker. I was previously seeing the error only on the page containing the league table for the snooker competition, and only that competition had events where I had entered results since the upgrade to Sportspress 2.7.16.

    However, I just entered results for two billiards events by editing the existing events (just entering points scored, no times entered at all), and after updating those events, I am now seeing the identical error on the page containing the billiards league table (https://bsaact.org.au/billiards-2/).

    So something with the new version is causing the problem to appear when an event is edited to enter the points scored.

    Thread Starter NickJP

    (@nickjp)

    OK, I have found the cause of the problem. When I view an event, there is a field under Details named Full Time, given in minutes. In the five or so years that I have been using Sportspress, I’ve never bothered to populate this field when importing events, as it’s irrelevant to our competitions, which are played to a target and not a time, and this has not caused a problem until the latest version of Sportspress. Now, as soon as I enter the results for an event that has been completed, I have to put a value in this field, which shows as blank (I just put 0) or I get the non-numeric value warning.

    When I view older events for which results were entered using an older version of Sportspress, this Full Time field has been automatically populated with a value of zero, whereas the new version leaves it blank and generates the warning. Why the change in behaviour?

    Thread Starter NickJP

    (@nickjp)

    Same error has just appeared again. I updated more events with their results, and I get the same non-numeric value warning unless I enter a value of zero in the Full Time field. This problem did not happen when entering event results with the previous version of Sportspress.

    Plugin Contributor Savvas

    (@savvasha)

    Hi there @nickjp ,

    Sorry for the delayed reply on this. Did you manage to resolve it? One more thing you can try is to add a default value of minutes at SportsPress->Settings->Matches->Full time

    Thanks,
    Savvas

    Thread Starter NickJP

    (@nickjp)

    Yes, that was the Sportspress setting I changed to get rid of the error. I have the value set to 0 minutes.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Non-numeric value warning’ is closed to new replies.