Handle new flattened custom field return format
authorColeman Watts <coleman@civicrm.org>
Sat, 14 Sep 2019 22:45:22 +0000 (18:45 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 14 Sep 2019 22:45:22 +0000 (18:45 -0400)
Civi/Test/Api3TestTrait.php

index 1c99c0490b42d3e61f84014020a4704a7d43216e..d844012e0dcc21dce4b6c6fb2169502981a65a2f 100644 (file)
@@ -572,13 +572,11 @@ trait Api3TestTrait {
       }
       // Resolve custom field names
       foreach ($custom as $group => $fields) {
-        if (isset($row[$group])) {
-          foreach ($fields as $field => $v3FieldName) {
-            if (isset($row[$group][$field])) {
-              $result[$index][$v3FieldName] = $row[$group][$field];
-            }
+        foreach ($fields as $field => $v3FieldName) {
+          if (isset($row["$group.$field"])) {
+            $result[$index][$v3FieldName] = $row["$group.$field"];
+            unset($result[$index]["$group.$field"]);
           }
-          unset($result[$index][$group]);
         }
       }
     }