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!

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

Cyberkef

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:

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:
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.
 
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.
 
I'll have to check, thanks for the detailed analysis.
I'll try to fix that during my holidays in August.
 
Indeed, I didn't catch it though as it was only visible when at least 1 score had been set.
 

From bespoke add-on development to complex integrations and specialized enhancements, we offer a range of XenForo development services designed to help your community thrive.

Start discussing your needs
Back
Top
Cart