From a0b1095d596f743bbfed45028096213d754e9eb1 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:23:47 +0200 Subject: [PATCH] fix(match2): display on bracket templates broken (#4907) --- components/match2/commons/bracket_template.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/match2/commons/bracket_template.lua b/components/match2/commons/bracket_template.lua index aae137f134d..2217d6cf76f 100644 --- a/components/match2/commons/bracket_template.lua +++ b/components/match2/commons/bracket_template.lua @@ -16,6 +16,7 @@ local BracketDisplay = Lua.import('Module:MatchGroup/Display/Bracket') local Match = Lua.import('Module:Match') local MatchGroupCoordinates = Lua.import('Module:MatchGroup/Coordinates') local MatchGroupUtil = Lua.import('Module:MatchGroup/Util') +local Opponent = Lua.import('Module:Opponent') ---@class BracketTemplateBracket ---@field bracketDatasById table @@ -54,8 +55,12 @@ end ---@param props {bracketId: string, config: table?} ---@return Html function BracketTemplate.BracketContainer(props) + local bracket = MatchGroupUtil.fetchMatchGroup(props.bracketId) --[[@as MatchGroupUtilBracket]] + Array.forEach(bracket.matches or {}, function(match) + match.opponents = {Opponent.blank()} + end) return BracketDisplay.Bracket({ - bracket = MatchGroupUtil.fetchMatchGroup(props.bracketId) --[[@as MatchGroupUtilBracket]], + bracket = bracket, config = Table.merge(props.config, { OpponentEntry = function() return mw.html.create('div'):addClass('brkts-opponent-entry') end, matchHasDetails = function() return false end,