Fix a bug where contributors array was being encoded as an object. master
authorCameron Ball <c.ball1729@gmail.com>
Wed, 1 Jul 2015 05:07:07 +0000 (13:07 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Wed, 1 Jul 2015 05:07:07 +0000 (13:07 +0800)
Domain/Entities/StepMania/Pack.php

index 241b1f2..57d4b2c 100644 (file)
@@ -48,7 +48,12 @@ class Pack extends AbstractEntity implements IPack
             );
         }
         
-        return $contributors;
+        //XXX: If there are duplicate contributors, say, index 5 and 6 are the same
+        //then we loose index 5 and have an array like 1,2,3,4,6
+        //
+        //This makes json_encode use the indicies as object keys, so we need to
+        //reshuffle the array into a continuous list
+        return array_values($contributors);
     }
     
     public function getFile()