What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

  • 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


New Member
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:

(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:


New Member
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.


New Member
Not really?

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


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


Freaky Coder
Staff member
I'll have to check, thanks for the detailed analysis.
I'll try to fix that during my holidays in August.


Freaky Coder
Staff member
Indeed, I didn't catch it though as it was only visible when at least 1 score had been set.