• We are aware that a no permission error was shown when you tried to purchase in the last 2 days, this is now fixed.

Bug Fixed Submit scores in first round @ Single Elimination = Wrong/invalid opponents

Cyberkef

New Member
Joined
Jun 21, 2021
Messages
7
While playing a test tournament before putting everything online, we discovered a rather peculiar bug when users try to submit scores via the "Submit Scores" button.

For some reason, in XFA/Tournament/Entity/Bracket.php line 178 (v3.2.1) you do the $teamInfo['match_idx'] x 2? (if you remove the "* 2" it should be fixed).

We set up a Single Elimination tournament with 8 players, so the first rounds go like:

Code:
(group 0)
- Player A
- Player B

(group 1)
- Player C
- Player D

(group 2)
- Player E
- Player F

(group 3)
- Player G
- Player H
A (Group 0 x 2 => opponent in Group 0 = sees B as a correct opponent for scoring)
C (Group 1 x 2 => opponent in Group 2 -> sees F in form as a wrong opponent for scoring)
E (Group 2 x 2 => opponent in Group 4 -> invalid group/opponent id -> empty nickname in form + a nullpointer exception on submitting @ /XFA/Tournament/Service/Participant/Notify.php at line 88 because unexisting opponent)
 
Last edited:

MtoR

Freaky Coder
Staff member
Joined
Nov 14, 2015
Messages
5,753
Do you have that bug every time ?
 

Cyberkef

New Member
Joined
Jun 21, 2021
Messages
7
Only in the first rounds/level and via the "Submit scores" button.

Everything works fine filling in the scores in the second/third/... level, also works every time when a moderator fills in the scores directly in the tree.
 

MtoR

Freaky Coder
Staff member
Joined
Nov 14, 2015
Messages
5,753
Ok so just the first rounds in a single elimination one ?
 

Cyberkef

New Member
Joined
Jun 21, 2021
Messages
7
Not really?

Line 176 checks if we are on round_idx 0 (so when first "column") => Line 178 checks participant from match_idx * 2

1625402724427.png


The ...[$teamInfo['match_idx'] * 2]... in that index calculation breaks the logic.
 

MtoR

Freaky Coder
Staff member
Joined
Nov 14, 2015
Messages
5,753
I'll have to check, thanks for the detailed analysis.
I'll try to fix that during my holidays in August.
 

MtoR

Freaky Coder
Staff member
Joined
Nov 14, 2015
Messages
5,753
Indeed, I didn't catch it though as it was only visible when at least 1 score had been set.