From d5252e1cbb236c80f907a9021a9752f99b446577 Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Wed, 1 Jul 2015 13:07:07 +0800 Subject: [PATCH] Fix a bug where contributors array was being encoded as an object. --- Domain/Entities/StepMania/Pack.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() -- 2.11.0