beyond-all-reason / teiserver

Middleware server for online gaming
https://www.beyondallreason.info/
MIT License
46 stars 46 forks source link

Fix data export #344

Open jauggy opened 1 week ago

jauggy commented 1 week ago

Work Done

Fixes https://github.com/beyond-all-reason/teiserver/issues/334 Also allows filtering by Small Team and Large Team when exporting data

Test Steps

  1. Login website as root@localhost (or whatever is the admin)
  2. Go to Reports > Data Exports > Match Ratings
  3. Press Generate Export. There should be a download with no errors
  4. Change Game type to "Small Team" and generate export. There should be a download with no errors
  5. Change Game type to "Large Team" and generate export. There should be a download with no errors
  6. Repeat with Player Ratings, Ratings Logs, Match Datatable tabs
geekingfrog commented 1 week ago

Looks alright to me. I couldn't test that locally (yet) because there's another error if there is no match at all in the DB.

jauggy commented 1 week ago

So before this line:

AND rating_type_id = $3

would fetch zero rows when the $3 is nil. And we would get the error as shown in #334

Now, it should not error if you actually have matches. If you don't have any matches at all it would error but that would only occur if you didn't run the mix teiserver.fakedata locally.