php8.x fatal fix
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 18 Aug 2023 00:44:40 +0000 (12:44 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 18 Aug 2023 00:46:15 +0000 (12:46 +1200)
CRM/Event/BAO/Event.php

index 4ba2795c044dfbc156ee853b6d3332ddad8b0d73..8c7fea3c880c4ccdf85bd30bc6ae961719f9298d 100644 (file)
@@ -1271,7 +1271,7 @@ WHERE civicrm_event.is_active = 1
    * Add the custom fields OR array of participant's profile info.
    *
    * @param int $id
-   * @param string $name
+   * @param string $name eg. customPre or additionalCustomPost to denote the profile location.
    * @param int $cid
    * @param \CRM_Core_Smarty $template
    * @param int $participantId
@@ -1443,22 +1443,15 @@ WHERE civicrm_event.is_active = 1
       }
     }
 
-    if (count($val)) {
-      $template->assign($name, $val);
-    }
-
-    if (count($groupTitles)) {
-      $template->assign($name . '_grouptitle', $groupTitles);
-    }
+    $template->assign($name, $val);
+    $template->assign($name . '_grouptitle', $groupTitles);
 
     //return if we only require array of participant's info.
     if ($returnResults) {
-      if (count($val)) {
+      if ($val) {
         return [$val, $groupTitles];
       }
-      else {
-        return NULL;
-      }
+      return NULL;
     }
   }