dev/core#4200 use org ID rather than assume it
authorHerb <herb@3speedhub.com>
Thu, 23 Mar 2023 19:41:59 +0000 (15:41 -0400)
committerHerb v/d Dool <herb@3speedhub.com>
Thu, 23 Mar 2023 19:48:02 +0000 (15:48 -0400)
CRM/Core/BAO/UFGroup.php

index f41e9bfeb0238e4abb243f7deff338920fbecdfb..0d121267dc666fa14e290d9450f6ba2ed59167ae 100644 (file)
@@ -1932,8 +1932,9 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
         // we only have one org - so we should default to it. Not sure about defaulting to first type
         // as it could be missed - so adding a select
         // however, possibly that is more similar to the membership form
-        if (count($types[1]) > 1) {
-          $types[1] = $select + $types[1];
+        $orgId = array_key_first($orgInfo);
+        if (!empty($types[$orgId])) {
+          $types[$orgId] = $select + $types[$orgId];
         }
       }
       else {