northernfrontier
Forum Replies Created
-
I have already confirmed to @savvasha that the issue is not completely fixed (please see my previous responses for more details). The commit that he ask me to verify was made more than a week after the 2.7.8 release.
Can you confirm when this patch will be available in a release?
Hi @savvasha ,
I can confirm that the commit fixes the issue. Do you know when the next release will be available with this patch in it?
Thanks
Yes they’re included when creating the event as well,
The workaround from @chriskchris I previously mentioned fixed this issue. From his description of the issue in his post, the format is not being correctly set on the events when they are created.
Sorry for the late reply. After running a test it looks as though version 2.7.8 only partially resolves the issue. Event results can be updated via the REST API now but league tables are still not updated correctly as per the second point in the workarounds I previously posted.
Hi @dhorava,
I’m using 5.7 as well. There are a few things I can think of the might be causing you to still see the problem. I’m not sure if these are a problem for you, but I’ll list them for your to check.
1- Performing PATCH or POST calls requires authentication. I used the Application Passwords plugin for this but there are a few different ways this can be accomplished.
2- Make sure that the Content-Type header is added with a value of application/json when using Postman
3- Your JSON payload needs to identify that it contains results since there are a number of different fields that can be updated. In your case, the payload should look like this
{"results: {"5049":{"one":"7","two":"10","three":"17","four":"0","ot":"","td":"","points":"34","outcome":["win"]},"5055":{"one":"7","two":"10","three":"3","four":"0","ot":"","td":"","points":"20","outcome":["loss"]},"0":{"one":"1","two":"2","three":"3","four":"4","ot":"OT", "td":"TD","points":"T","outcome":"Vysledek"}} }
For anyone else that is unable to add/update event results via the Rest API, the problem is due to two different issues that were previously reported in the forums and don’t appear to have been fixed yet.
I’ve provided links to the forum posts below with details on the temporary workarounds I used to get the results to update correctly.
1- REST API ‘results’ bug due WP update 5.5
In wp-includes/rest-api.php, each occurrence of the following line needs to be commented out to allow the event results to be updated
$value = rest_sanitize_array( $value );
2- REST API new events not updated in league table
Follow the instructions provided by @chriskchris in this post to ensure that league tables include the submitted event results
@rochesterj and @savvasha , I wasn’t able to find any issues in the Github repo related to the above posts. Do you know when they might be fixed?
Thanks
- This reply was modified 3 years, 8 months ago by northernfrontier.
@rochesterj and @savvasha,
While trying to figure out what might have been incorrect with the results data syntax I was using to update the event I performed the following test:
1- Import the demo events from the Configuration view
2- Create new new event using the same 2 teams as one of the demo events
3- Performed a GET on the demo event and copied the “results” portion of the json result:{"results":{ "2293":{ "one":1, "two":2, "three":3, "four":4, "five":5, "six":6, "seven":7, "eight":8, "nine":9, "ten":10, "r":11, "h":12, "e":13, "outcome":[ "win" ] }, "2294":{ "one":"0", "two":"0", "three":"0", "four":"0", "five":"0", "six":"0", "seven":"0", "eight":"0", "nine":"0", "ten":"0", "r":"0", "h":"0", "e":"0", "outcome":[ "loss" ] }, "0":{ "one":"1", "two":"2", "three":"3", "four":"4", "five":"5", "six":"6", "seven":"7", "eight":"8", "nine":"9", "ten":"10", "r":"R", "h":"H", "e":"E", "outcome":"Outcome" } }}
4 – Attempted a PATCH on the new event from step 2 using Postman. I am getting the same 200 status response and empty results as before. Removing the “0” entry and sending only the results data for the teams themselves gave the same results.
"results": { "2293": [], "2294": [], "0": { "outcome": "Outcome" } }
I would assume that posting the data from a GET should result in the event being updated correctly.
Thanks @rochesterj
The results syntax for baseball should be enough for me to be able to get this working.
Also, can the results be included when creating an event or does this have to be done in a separate update call?
Thanks
Hi @savvasha,
The patch seems to fix the issue. I can continue my migration testing with 2.7.5 for now but is there an ETA for the next release yet and will this patch be included?
Thanks
The issue seems to have been introduced in version 2.7.6 of Sportspress. After downgrading to version 2.7.5 I’m able to see the fields on the Event Edit page. Upgrading back to 2.7.6 caused the fields to disappear again.
Hi,
Nothing’s installed other than Sportspress, Sportspress for Baseball and the Rookie Theme. There isn’t any custom code in there either.
I’ve also tried reinstalling WordPress, the plugins and theme and I’m still seeing the same behaviour with the demo content
Hi,
Below are the screen shots you requestedThanks
- This reply was modified 3 years, 9 months ago by northernfrontier.
Hi,
I’m seeing this issue with the demo content which contains statistic since I can see them on the site.
With baseball selected as the sport, the “Box Score” section is shown when editing a Game (event). I can see the players listed in both the batting and pitching sections of the “Box Score” but only their number and status fields are available. Shouldn’t the fields for entering batting and pitching statics be listed in these section for each player as well?
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Match StatsI’m seeing the same behaviour when testing with the demo content for both baseball and football(soccer).
The stats are auto-populated and listed on the SportsPress->Configure page but are not available when editing an event.
Each sport was tested on a fresh install with the Rookie theme
Are there additional steps required to have the fields appear when editing an event?