From: Cameron Ball Date: Wed, 1 Jul 2015 05:07:07 +0000 (+0800) Subject: Fix a bug where contributors array was being encoded as an object. X-Git-Url: http://git.cameron1729.xyz/?p=rock.divinelegy.git;a=commitdiff_plain Fix a bug where contributors array was being encoded as an object. --- diff --git a/Domain/Entities/StepMania/Pack.php b/Domain/Entities/StepMania/Pack.php index 241b1f2..57d4b2c 100644 --- a/Domain/Entities/StepMania/Pack.php +++ b/Domain/Entities/StepMania/Pack.php @@ -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()