Skip to content

Conversation

@ElectricalBoy
Copy link
Collaborator

Summary

⚠️ WIP

Resolves #6496

How did you test this change?

untested

substitutions = manualPlayersInput.substitutions
-- Change compared to commons MatchGroupInputUtil.readOpponent
local template = mw.ext.TeamTemplate.raw(opponent.template or '') or {}
local template = TeamTemplate.getRawOrNil(opponent.template or '') or {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the or '' needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamTemplate.getRawOrNil expects a non-nil string argument
we could add nil handling there instead though

function CustomPlayer:adjustLPDB(lpdbData, args)
if String.isNotEmpty(args.team2) then
lpdbData.extradata.team2 = mw.ext.TeamTemplate.raw(args.team2).page
lpdbData.extradata.team2 = TeamTemplate.getRaw(args.team2).page
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use TeamTemplate.getPageName?
(same in several of the other cases too)

Copy link
Collaborator Author

@ElectricalBoy ElectricalBoy Oct 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getPageName has resolve_redirect slapped onto the return value, so not using it is to avoid breaking historic stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup: Remove direct calls to mw.ext.teamtemplate

3 participants