ho-dev / HattrickOrganizer

Assistant for Hattrick online football manager
https://ho-dev.github.io/HattrickOrganizer/
GNU Lesser General Public License v3.0
195 stars 79 forks source link

[BUG] Country ID selected as League ID, causing incorrect league details (incl. currency) #1233

Closed tychobrailleur closed 2 years ago

tychobrailleur commented 3 years ago

Describe the bug HO uses the Country ID (here 16) as the League ID (Ireland is 21, https://www85.hattrick.org/World/Leagues/League.aspx?LeagueID=21), see extract from HRF:

[basics]
. . .
owner=tychobrailleur
ownerHomepage=
countryID=16
leagueID=21

It saves it in XTRADATA, causing for example the wrong currency to be picked:

            case 16 -> leagueLocale = Locale.forLanguageTag("pt-BR");
. . .
            case 21 -> leagueLocale = Locale.forLanguageTag("en-IE");
Screen Shot 2021-10-13 at 13 01 17

To Reproduce Steps to reproduce the behavior:

  1. Download latest HRF
  2. Check Country ID vs. League ID in the HRF file that was downloaded
  3. Observe that currency is selected based on country ID rather than League ID

Screenshots

Screen Shot 2021-10-13 at 12 57 09

(Currency in Ireland should be €)

Platform information:

Additional context N/A

wsbrenk commented 3 years ago

this was introduced by #1103

it is hard for me to test this because for me both values are identical:

ownerHomepage= countryID=3 leagueID=3

if country id is not correct, we should reset the change of that row:

public static NumberFormat CURRENCYFORMAT = CurrencyUtils.getLeagueCurrencyFormater(HOVerwaltung.instance().getModel().getCountryId());

wsbrenk commented 3 years ago

as i read this https://www83.hattrick.org/Community/CHPP/NewDocs/File.aspx?name=worlddetails i thought currency would be selected by country id.