Answers.Body: <p>It was a regression issue caused by a recent change.</p>
  <p>I have submitted a <a href="https://github.com/civicrm/civicrm-core/pull/30389/commits" rel="nofollow noreferrer">PR</a> for the fix and should be available in the next release. Alternatively, you can apply the <a href="https://github.com/civicrm/civicrm-core/pull/30389.patch" rel="nofollow noreferrer">patch</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-10T20:23:41.420Z
Answers.Text: @ Pradeep - can you please provide more information on how I apply this patch. Do I copy this code into the file. thx
Answers.UserDisplayName: markd
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-10T21:09:06.357Z
Answers.Text: yes that's correct
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-11T11:29:56.553Z
Answers.Text: I removed line 361 and  added the new line as per your line in the file PayPalImpl.php
  
   $args['cancelURL'] = $this->getCancelUrl($params['qfKey'], ($params['participantID'] ?? NULL)); 
  
  however I still got the same error.
Answers.UserDisplayName: markd
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-11T12:55:15.993Z
Answers.Text: Did you the same line?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-11T12:57:20.750Z
Answers.Text: Apply this patch https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/30392.patch
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-11T20:38:55.180Z
Answers.Text: @Pradeep...yes  I did the same line.
  
  I have reverted the first patch.
  Question - Do I need both patches?
Answers.UserDisplayName: markd
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-12T08:35:43.837Z
Answers.Text: Nope, the latest one only.
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-12T12:23:00.893Z
Answers.Text: it looks like the latest patch worked on my production server....hence I am very appreciative of your assistance.
Answers.UserDisplayName: markd
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-13T15:18:36.137Z
Answers.Text: The latest release contains the fix now
Answers.UserDisplayName: eileen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-13T22:11:20.563Z
Answers.Text: @Pradeep - as mentioned above we are not getting the error and PayPal payment goes thru and we do receive the funds. However we have noticed that the new registered participant is not being added to the event. When we look at the new participant record -in the Event tab -it shows that the participant has the status as "Pending (incomplete transaction)".  Could you pls suggest what we do here.
Answers.UserDisplayName: markd
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-19T15:10:26.253Z
Answers.Text: @PradeepNayak is this patch supposed to work for stripe checkout as well?
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-19T15:13:49.900Z
Answers.Text: yes or you can upgrade to latest civi
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-10T19:57:02.983Z
Answers.LastActivityDate: 2024-06-10T19:57:02.983Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I performed a Civi upgrade from v5.65.1 to 5.74.0 on Wordpress 6.5.4.
  I am running Php 8.2.19.</p>
  <p>I have also added.... define('CIVICRM_SMARTY_AUTOLOAD_PATH',
  '/var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/smarty4/vendor/autoload.php');
  into civicrm.settings.php</p>
  <p>The upgrade was successful, however we are getting this error when registering for an event &quot;Expected to find one Participant record, but there were zero.&quot;</p>
  <p>Error log is as follows:-</p>
  <p>[error]
  $Fatal Error Details = array:3 [
  &quot;message&quot; =&gt; &quot;Expected to find one Participant record, but there were zero.&quot;
  &quot;code&quot; =&gt; null
  &quot;exception&quot; =&gt; CRM_Core_Exception {#13091
  #message: &quot;Expected to find one Participant record, but there were zero.&quot;
  #code: 0
  #file: &quot;/var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/Array.php&quot;
  #line: 1245
  #cause: null
  -_trace: null
  -errorData: array:1 [
  &quot;error_code&quot; =&gt; 0
  ]
  trace: {
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/Array.php:1245 {
  CRM_Utils_Array::single(iterable $items, string $recordTypeLabel = 'record')
  › if ($result === NULL) {
  ›   throw new \CRM_Core_Exception(&quot;Expected to find one {$recordTypeLabel}, but there were zero.&quot;);
  › }
  }
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Result.php:90 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment.php:1245 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalImpl.php:258 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalImpl.php:897 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:1168 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Event/Form/Registration/Register.php:899 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:646 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php:153 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php:120 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:355 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:333 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm.php:1231 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/includes/civicrm.basepage.php:425 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/class-wp-hook.php:324 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/class-wp-hook.php:348 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/plugin.php:565 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/class-wp.php:830 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/functions.php:1336 { …}
  /var/www/vhosts/example.org/httpdocs/wp-blog-header.php:16 { …}
  /var/www/vhosts/example.org/httpdocs/index.php:17 { …}
  }
  }
  ]</p>
  <p>Any assistance would be greatly appreciated.</p>
  <p>Thank you.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-10T09:40:48.830Z
Comments.Text: Are you using Paypal Standard?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-10T20:20:15.580Z
Comments.Text: @Pradeep - We are using PayPal Express
Comments.UserDisplayName: markd
Tags: <wordpress><civievent><upgrade><paypal>
Title: Upgrade from 5.65.1 to 5.74.0 - Error "Expected to find one Participant record, but there were zero." when registering for an event
ThreadText: # Upgrade from 5.65.1 to 5.74.0 - Error "Expected to find one Participant record, but there were zero." when registering for an event
  
  (Asked by: username_0 on 2024-06-10)
  
  I performed a Civi upgrade from v5.65.1 to 5.74.0 on Wordpress 6.5.4.
  I am running Php 8.2.19.
  
  I have also added.... define('CIVICRM\_SMARTY\_AUTOLOAD\_PATH',
  '/var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/smarty4/vendor/autoload.php');
  into civicrm.settings.php
  
  The upgrade was successful, however we are getting this error when registering for an event "Expected to find one Participant record, but there were zero."
  
  Error log is as follows:-
  
  [error]
  $Fatal Error Details = array:3 [
  "message" => "Expected to find one Participant record, but there were zero."
  "code" => null
  "exception" => CRM\_Core\_Exception {#13091
  #message: "Expected to find one Participant record, but there were zero."
  #code: 0
  #file: "/var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/Array.php"
  #line: 1245
  #cause: null
  -\_trace: null
  -errorData: array:1 [
  "error\_code" => 0
  ]
  trace: {
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/Array.php:1245 {
  CRM\_Utils\_Array::single(iterable $items, string $recordTypeLabel = 'record')
  › if ($result === NULL) {
  › throw new \CRM\_Core\_Exception("Expected to find one {$recordTypeLabel}, but there were zero.");
  › }
  }
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Result.php:90 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment.php:1245 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalImpl.php:258 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalImpl.php:897 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:1168 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Event/Form/Registration/Register.php:899 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:646 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php:153 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php:120 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:355 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:333 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/civicrm.php:1231 { …}
  /var/www/vhosts/example.org/httpdocs/wp-content/plugins/civicrm/includes/civicrm.basepage.php:425 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/class-wp-hook.php:324 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/class-wp-hook.php:348 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/plugin.php:565 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/class-wp.php:830 { …}
  /var/www/vhosts/example.org/httpdocs/wp-includes/functions.php:1336 { …}
  /var/www/vhosts/example.org/httpdocs/wp-blog-header.php:16 { …}
  /var/www/vhosts/example.org/httpdocs/index.php:17 { …}
  }
  }
  ]
  
  Any assistance would be greatly appreciated.
  
  Thank you.
  
  **Tags:** wordpress, civievent, upgrade, paypal
  
  > **Comments:**
  > **username_1**: Are you using Paypal Standard?  
  > **username_0**: @username_1 - We are using PayPal Express  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-06-10. Score: 0
  
  It was a regression issue caused by a recent change.
  
  I have submitted a [PR](https://github.com/civicrm/civicrm-core/pull/30389/commits) for the fix and should be available in the next release. Alternatively, you can apply the [patch](https://github.com/civicrm/civicrm-core/pull/30389.patch)
  
  > **Comments:**
  > **username_0**: @ username_1 - can you please provide more information on how I apply this patch. Do I copy this code into the file. thx  
  > **username_1**: yes that's correct  
  > **username_0**: I removed line 361 and  added the new line as per your line in the file PayPalImpl.php   $args['cancelURL'] = $this->getCancelUrl($params['qfKey'], ($params['participantID'] ?? NULL));   however I still got the same error.  
  > **username_1**: Did you the same line?  
  > **username_1**: Apply this patch https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/30392.patch  
  > **username_0**: @username_1...yes  I did the same line.  I have reverted the first patch. Question - Do I need both patches?  
  > **username_1**: Nope, the latest one only.  
  > **username_0**: it looks like the latest patch worked on my production server....hence I am very appreciative of your assistance.  
  > **username_2**: The latest release contains the fix now  
  > **username_0**: @username_1 - as mentioned above we are not getting the error and PayPal payment goes thru and we do receive the funds. However we have noticed that the new registered participant is not being added to the event. When we look at the new participant record -in the Event tab -it shows that the participant has the status as "Pending (incomplete transaction)".  Could you pls suggest what we do here.  
  > **username_3**: @username_1 is this patch supposed to work for stripe checkout as well?  
  > **username_1**: yes or you can upgrade to latest civi  
  
  ---
  
  