minj / foxtrick

FoxTrick is a browser extension for the Hattrick online football manager game, currently available for Firefox, Google Chrome, as well as for Opera.
https://www.foxtrick.org
GNU General Public License v3.0
69 stars 48 forks source link

redir_to_coach is broken after coach reform #1706

Closed dominiquelee closed 1 year ago

dominiquelee commented 1 year ago

Short description of the problem

redir_to_coach now redirects to /Club/Players/Player.aspx?playerId=null

What steps will reproduce the problem?

From a club page, follow the Foxtrick's Coach link in the menu.

What is the expected behaviour? What is the actual behaviour? Please provide any relevant screenshots.

This line is no longer correct: https://github.com/minj/foxtrick/blob/29bf94f4267d9f149b638008df5800ff8cf46b0e/content/redirections.js#L136 The link in the Players' sidebar box is now looking like /Club/Specialists/Trainer.aspx?teamId=1757850&trainerId=370835131 and can be directly extracted from the sidebar box.

Any other relevant information. Is it a regression, when it worked/broke etc.

Broken since last coach reform.

Unrelated but since code is close: line 141+ code for NT coach redirection should be deleted.

minj commented 1 year ago

Hi, thanks for the report.

As you can evidently read the code, how about submitting a PR? :smile:

dominiquelee commented 1 year ago

Hi, thanks for the report.

As you can evidently read the code, how about submitting a PR? 😄

I didn't want to have to check for all the bizarre cases that must happen when it's a regular coach, or a player-coach, or a coach turned player turned coach again (🤪), or for bots (the PR actually opens a page, though, eh, it's interesting at best 😁), but here we go.