diff --git a/app/src/Lib/Match/AttributeManager.php b/app/src/Lib/Match/AttributeManager.php index 49c8f699e..ed13c5bcc 100644 --- a/app/src/Lib/Match/AttributeManager.php +++ b/app/src/Lib/Match/AttributeManager.php @@ -203,7 +203,16 @@ public function parseFromJSON(\stdClass $json) { // We have a set of objects of type $k. We group on type. foreach($v as $vobject) { // Group is default unless type is set - $g = !empty($vobject['type']) ? $vobject['type'] : '_default'; + $g = "_default"; + + // For some reason, $vobject is an array if it comes over the API, + // or an object if we get here via /matchgrids/reconcile. So for now + // at least we check both. + if(is_array($vobject) && !empty($vobject['type'])) { + $g = $vobject['type']; + } elseif(!empty($vobject->type)) { + $g = !empty($vobject->type); + } foreach($vobject as $vk => $vv) { if($vk == 'type') {