• Resolved byzdata

    (@byzdata)


    Hello @savvas
    At the Player List, for the ‘Team’ filer, I would like to select multiple options, instead of All or a single Team.
    Is there a way to have a custom code to patch the current configuration? Of course, later could be implemented as an improvement for future release.
    Thanks

Viewing 15 replies - 1 through 15 (of 15 total)
  • Roch

    (@rochesterj)

    Hey Savvas,

    Just to give a bit of a background about this issue.

    In short, byzdata wants to create a player list to load only players who are currently playing for teams of a specific competition/season.

    For example, if there’s the season A and competition B, any player who has these will be loaded. But they want to load only players who are currently playing for teams that are in this season/competition combination.

    A workaround that I’ve found is to simply create multiple selects for the “team” option. I did it using the browser tools and it worked just fine. So I suggested byzdata to maybe use this approach (but that’s beyond the scope of our Pro support).

    Another option (which would be harder, probably) would be to load this information directly from the player profile, using the selects we have for the current team.

    Thanks!

    Thread Starter byzdata

    (@byzdata)

    Hello @savvas
    Any ideas?
    Thanks

    Plugin Contributor Savvas

    (@savvasha)

    Hi there,

    I am actually @savvasha ??

    Dud tou try to filter only using League and Season and it didnt work? It should actually…

    Thanks,
    Savvas

    Roch

    (@rochesterj)

    Hi Savvas,

    Maybe my previous example wasn’t that good, but let’s try again.

    Imagine this.

    John plays in the MyCup league, 2020, for Bluebirds.

    Next year, John is playing on Newcup, 2021 for Eagles.

    If we create a player list for players who are in the MyCup, 2021 season, John will be loaded.

    That’s correct in the sense that SportsPress loaded what it was asked to, but what byzdata wants is to load only players who are currently in the MyCup 2021.

    A workaround I suggested was to combine the filter with the team filter. So if we load only bluebirds, for example, John won’t be there anymore.

    But in order to make this efficient, we’d need to add multiple teams at once, instead of a single team.

    Another option (which would be much harder) is to load this directly from the player profiles dropdown (which ties together season/league/team).

    Thanks!

    Plugin Contributor Savvas

    (@savvasha)

    If you make the correct assignments in the statistics metabox of each player, then the player list will return all players that participate for League 2021 without any false positives.

    I cannot share a screenshot right now because I am away from a PC…

    Thread Starter byzdata

    (@byzdata)

    Hello Savvas, thanks for your quick reply.

    What are those correct assignments in the statistics metabox of each player?
    Following Roch’s example, I have the following in John’s profile:
    – Current Teams: Eagles
    – Past Teams: Bluebirds
    – Leagues: MyCup, NewCup
    – Seasons: 2020, 2021
    MyCup
    Season: 2021, Team: -None-
    Season: 2020, Team: Bluebirds
    NewCup
    Season: 2021, Team: Eagles
    Season: 2020, Team: -None-

    At the Player List, I have set the following:
    – League: MyCup
    – Season: 2021
    As result, John does appear in that list.
    But he should not appear, since he is not playing that league in that season.

    Plugin Contributor Savvas

    (@savvasha)

    You are right. If you dont select a Team in the Player-List all the player assignments are ignored… Ok I will have to take a closer look to the code and get back…

    Plugin Contributor Savvas

    (@savvasha)

    Can anyone check the following PR:
    https://github.com/ThemeBoy/SportsPress/pull/417

    Thanks,
    Savvas

    Roch

    (@rochesterj)

    Hey Savvas,

    That’s the fastest patch I’ve ever seen. Wow!

    I’ve applied the code change and created the exact example we were discussing.

    It works as it should.

    But there’s another test with some old data that won’t work. I’m guessing that this is just some misconfiguration on my old data though (since it does work with the newly created player).

    Cheers!

    Thread Starter byzdata

    (@byzdata)

    Great! Master Savvas.
    Now, how can I implement it in my site?
    What should I do?
    Thanks for your effort

    Plugin Contributor Savvas

    (@savvasha)

    @rochesterj , did you try with your older data to “update” your players? Each player needs to be updated so as the “correct” assignments meta to be created.

    @byzdata you need to replace your /wp-content/plugins/sportspress/modules/player-assignments.php file with this one https://github.com/ThemeBoy/SportsPress/blob/ac67470b7df50e1a3330c9a2299051f95f7de7b5/modules/sportspress-player-assignments.php

    Thanks,
    Savvas

    Thread Starter byzdata

    (@byzdata)

    Thank you @savvasha
    It worked like a charm.
    Congratulation for your quick support.

    Is this a patch or will be consider in future versions?

    Let me know if I can work with you as a beta tester. I have some other tricky configurations that with a proper fix might improve the experience using the Sportspress.

    Have a good day!

    Plugin Contributor Savvas

    (@savvasha)

    I am glad it worked for you ??
    The patch is already in the state of Pull Request. Hopefully it will be included in the very next update of SportsPress.

    For the beta-testing thing, please come in contact with our developer team at https://support.themeboy.com/ to share your thoughts and ideas. Also https://tboy.co/ideas is a great place to discuss and upvote new ideas about SportsPress ??

    Thanks,
    Savvas

    Thread Starter byzdata

    (@byzdata)

    Hello @savvasha
    Happy New Year 2022.

    I just want to check if the following patch file was already included in the latest version 2.7.13
    https://github.com/ThemeBoy/SportsPress/blob/ac67470b7df50e1a3330c9a2299051f95f7de7b5/modules/sportspress-player-assignments.php

    Thanks

    Plugin Contributor Savvas

    (@savvasha)

    Hu @byzdata ,

    Happy and healthy new year I hope for everyone ??

    I dont think that the patch is included because the last updates were made mainly to fix some escaping and santizing problems with the code. The PR is still open for review.

    Thanks,
    Savvas

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Multi-Selection in Teams filter at Player List’ is closed to new replies.