Answers.Body: <p>My guess is the problem is in Event/BAO/Event.php where it's not getting assigned. A quicky fix might be to add the following at line 1189: <a href="https://github.com/civicrm/civicrm-core/blob/9bb515bc272bf1d04360b6d243c988a86cbf4e58/CRM/Event/BAO/Event.php#L1189" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/9bb515bc272bf1d04360b6d243c988a86cbf4e58/CRM/Event/BAO/Event.php#L1189</a></p>
  <pre><code>// make sure the array key exists
  $tplParams['participant_status'] ??= NULL;
  </code></pre>
  <p>Does that fix it?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-07T08:16:58.063Z
Answers.Text: Yes that fixed it! Thanks for the tip, much appreciated
Answers.UserDisplayName: Rose Lanigan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-05T16:18:17.690Z
Answers.LastActivityDate: 2024-08-05T16:18:17.690Z
Answers.UserDisplayName: Demerit
Body: <p>Drupal 10.3.1
  CiviCRM 5.75.1
  PHP 8.2
  Smarty 4</p>
  <p>When someone registers for the waitlist, the email contains the following two warnings:</p>
  <pre><code>Warning: Undefined array key &quot;participant_status&quot; in /home/mysite/www/www/vendor/civicrm/civicrm-packages/smarty4/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php(52) : eval()'d code on line 95
  
  Warning: Attempt to read property &quot;value&quot; on null in /home/mysite/www/www/vendor/civicrm/civicrm-packages/smarty4/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php(52) : eval()'d code on line 95
  </code></pre>
  <p>I've tried commenting out the <em>define('CIVICRM_SMARTY_AUTOLOAD_PATH'....)</em> but it doesn't make a difference. I get the same results on PHP 8.1 and 8.2.</p>
  <p>The only non-standard extension that affects events is CiviDiscount.</p>
  <p>Not sure what else to try?</p>
  
Tags: <civievent><smarty><participants>
Title: Smarty warning for participant_status when someone is registering for the waitlist
ThreadText: # Smarty warning for participant_status when someone is registering for the waitlist
  
  (Asked by: username_0 on 2024-08-05)
  
  Drupal 10.3.1
  CiviCRM 5.75.1
  PHP 8.2
  Smarty 4
  
  When someone registers for the waitlist, the email contains the following two warnings:
  
  ```
  Warning: Undefined array key "participant_status" in /home/mysite/www/www/vendor/civicrm/civicrm-packages/smarty4/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php(52) : eval()'d code on line 95
  
  Warning: Attempt to read property "value" on null in /home/mysite/www/www/vendor/civicrm/civicrm-packages/smarty4/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php(52) : eval()'d code on line 95
  
  ```
  
  I've tried commenting out the *define('CIVICRM\_SMARTY\_AUTOLOAD\_PATH'....)* but it doesn't make a difference. I get the same results on PHP 8.1 and 8.2.
  
  The only non-standard extension that affects events is CiviDiscount.
  
  Not sure what else to try?
  
  **Tags:** civievent, smarty, participants
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-08-05. Score: 1
  
  My guess is the problem is in Event/BAO/Event.php where it's not getting assigned. A quicky fix might be to add the following at line 1189: <https://github.com/civicrm/civicrm-core/blob/9bb515bc272bf1d04360b6d243c988a86cbf4e58/CRM/Event/BAO/Event.php#L1189>
  
  ```
  // make sure the array key exists
  $tplParams['participant_status'] ??= NULL;
  
  ```
  
  Does that fix it?
  
  > **Comments:**
  > **username_0**: Yes that fixed it! Thanks for the tip, much appreciated  
  
  ---
  
  