• Tilman

    (@archeryimagesnet)


    Hi there,

    I am using leaguemanager to display results of the German Archery Bundesliga. As the points are the same as in volleyball, I am just using volleyball as the sport template.

    My problem is, that leaguemanager will only import 4 out of 5 sets. Here is the csv I am importing:
    csv screenshot

    This will be imported:
    leaguemanager screenshot

    Tried with a newly installed, latest version of leaguemanager on a fresh wordpress install with no other plugins active. Could reproduce the error on other systems, too.

    Any advice? Is this a bug?

Viewing 1 replies (of 1 total)
  • Thread Starter Tilman

    (@archeryimagesnet)

    Okay, found the bug and found the solution.

    In wp-content/plugins/leaguemanager/sports/volleyball.php in line 399 there is the function

    
    	function importMatches( $custom, $line, $match_id )
    	{
    		$match_id = intval($match_id);
    		for( $x = 9; $x <= 14; $x++ ) {
    			$set = isset($line[$x]) ? explode(":",$line[$x]) : array('','');
    			$custom[$match_id]['sets'][] = array( 'home' => $set[0], 'away' => $set[1] );
    		}
    
    		return $custom;
    	}
    
    

    It starts going through line[] from position 9 to 14. This misses the first set and comes up with an empty last set, eventually. To solve, change this line

    
    		for( $x = 9; $x <= 14; $x++ ) {
    

    into to this:

    
    		for( $x = 8; $x <= 13; $x++ ) {
    
Viewing 1 replies (of 1 total)
  • The topic ‘Leaguemanager only imports 4 of 5 sets’ is closed to new replies.