SportsPress
SportsPress copied to clipboard
Fix player league stats when not using "combined"
When using Offense → Defense
or Defense → Offense
in Settings > Players > Statistics > Categories
, all stats are zeroed out. This chunk of code seems to be the cause. See the private ticket number 25434.
Hi @brianmiyaji
I wanted to point out that this was causing trouble to many people, especially with baseball sites where they couldn't use Pitching -> Batting
and were forced to use Combined
.
Cheers, Nabil
Removing that line of code actually breaks the entire "Section" function of this plugin (offense/Defense). The issue isn't this code, it's how player lists fetches the statistics. It doesn't respect the "IF" code to separate offensive from defensive stats - at all. I have 2 performance stat for Games Played. One is purely "Offense" while the 2nd is purely "Defense". When viewing an actual players profile page, the statistics are separated correctly. Shows 3 games played as defensive (goalie) and 1 gp as offense (forward/player). However, when viewing stats for this same person using a Player List, It doesn't matter which option I choose (GP1 or GP2). Both will show Games played as being 4 REGARDLESS. Please do not remove this code. The Player list module is what actually needs to be fixed. It needs to separate DEFENSE from OFFENSE just like individual Player profiles do. Note: Part of this issue MAY be attributed partly to Configuring Player Performance (used for events). Using option of "All" does not work. It should put the performance under both offensive and defensive players but it only shows up under the Offensive players. It's a snowball effect.