Answers.Body: <p>The two versions Stuart mentions are different extensions. </p>
  
  <p><a href="https://civicrm.org/extensions/sparkpost-civicrm-integration" rel="nofollow noreferrer">https://civicrm.org/extensions/sparkpost-civicrm-integration</a> is the PESC extension from <a href="https://github.com/proexchange/com.pesc.sparkpost" rel="nofollow noreferrer">https://github.com/proexchange/com.pesc.sparkpost</a> and the replacement used by Stuart is the Cividesk extension.</p>
  
  <p>I had the same problem experienced by Stuart with the PESC version on a D6 system running CiviCRM 5.0.0. I seem to have fixed it using Stuart's sleuthing - I simply edited the sparkpost.php file and replaced <em>source_record_id</em> with <em>source_contact_id</em></p>
  
  <p>Everything seems to now work. (I'll report back if I find other problems).</p>
  
  <p>UPDATE: The latest version 1.3.7 of com.pesc.sparkpost fixes the problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-15T17:31:01.950Z
Answers.LastActivityDate: 2018-07-18T09:11:14.277Z
Answers.LastEditDate: 2018-07-18T09:11:14.277Z
Answers.UserDisplayName: Davy Ivins
Answers.Body: <p>I think I've found the problem, which is to do with mailing and not primarily events. I had upgraded to what I thought was the latest version (v1.3.5) of the Sparkpost extension, which does all the emails for my installation of Civi. (see <a href="https://civicrm.org/extensions/sparkpost-civicrm-integration" rel="nofollow noreferrer">https://civicrm.org/extensions/sparkpost-civicrm-integration</a>)</p>
  
  <p>However, it seems that there is a bug in the main sparkpost.php file which has source_record_id instead of source_contact_id. So I think the error was caused because source_contact_id was being left undefined.</p>
  
  <p>Anyway, I've now found a more up to date master version of this extension on Github (although it's called v1.1), and I've installed that and it's working fine so far. :-)
  <a href="https://github.com/cividesk/com.cividesk.email.sparkpost" rel="nofollow noreferrer">https://github.com/cividesk/com.cividesk.email.sparkpost</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-04T11:24:17.910Z
Answers.LastActivityDate: 2018-05-04T11:24:17.910Z
Answers.UserDisplayName: Stuart Parker
Body: <p>When someone registers for an event, it now registers them but crashes on to an error page, stating that "source_contact_id is not a valid integer".</p>
  
  <p>I think this has been happening since Civi 5.0.1</p>
  
  <p>I am using Civi 5.0.2 and Drupal 7.59</p>
  
  <p>The Fatal Error Page from the error log is very long, but here's the first bit:</p>
  
  <blockquote>
    <p>$Fatal Error Details = array(3) { ["message"]=> string(40)
    "source_contact_id is not a valid integer" ["code"]=> NULL
    ["exception"]=> object(CiviCRM_API3_Exception)#420 (8) {
    ["extraParams":"CiviCRM_API3_Exception":private]=> array(3) {
    ["is_error"]=> int(1) ["error_message"]=> string(40)
    "source_contact_id is not a valid integer" ["error_code"]=> string(9)
    "undefined" } ["message":protected]=> string(40) "source_contact_id is
    not a valid integer" ["string":"Exception":private]=> string(0) ""
    ["code":protected]=> int(0) ["file":protected]=> string(88)</p>
  </blockquote>
  
  <p>Anyone else having this problem or have any ideas?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-26T19:23:05.773Z
Comments.Text: One way of getting this type of question answered is to replicate the problem on dmaster.demo.civicrm.org - assuming that there isn't something about the set up that is beyond the features that 'demo' user has access to.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T09:53:37.253Z
Comments.Text: Thanks for the tip, petednz. The demo site doesn't give the same error, but that might be because it's on 5.2.alpha or because outbound email is disabled. This error I've described is failing to send out confirmatory emails, so that might be part of it
Comments.UserDisplayName: Stuart Parker
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T20:30:38.143Z
Comments.Text: True - but demo can be set to 'send to database' which should mimic that process. also "source_contact_id is not a valid integer" does not sound related to an email process. It sounds like it is complaining about the value being submitted
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T20:32:57.847Z
Comments.Text: Did you see this? I don't know if it is related if you are not using civirules: https://github.com/CiviCooP/org.civicoop.civirules/issues/152
Comments.UserDisplayName: petednz - fuzion
Tags: <civievent><registration>
Title: Event registration fatal error since v5.0.1
ThreadText: # Event registration fatal error since v5.0.1
  
  (Asked by: username_0 on 2018-04-26)
  
  When someone registers for an event, it now registers them but crashes on to an error page, stating that "source\_contact\_id is not a valid integer".
  
  I think this has been happening since Civi 5.0.1
  
  I am using Civi 5.0.2 and Drupal 7.59
  
  The Fatal Error Page from the error log is very long, but here's the first bit:
  
  > $Fatal Error Details = array(3) { ["message"]=> string(40)
  > "source\_contact\_id is not a valid integer" ["code"]=> NULL
  > ["exception"]=> object(CiviCRM\_API3\_Exception)#420 (8) {
  > ["extraParams":"CiviCRM\_API3\_Exception":private]=> array(3) {
  > ["is\_error"]=> int(1) ["error\_message"]=> string(40)
  > "source\_contact\_id is not a valid integer" ["error\_code"]=> string(9)
  > "undefined" } ["message":protected]=> string(40) "source\_contact\_id is
  > not a valid integer" ["string":"Exception":private]=> string(0) ""
  > ["code":protected]=> int(0) ["file":protected]=> string(88)
  
  Anyone else having this problem or have any ideas?
  
  **Tags:** civievent, registration
  
  > **Comments:**
  > **username_1**: One way of getting this type of question answered is to replicate the problem on dmaster.demo.civicrm.org - assuming that there isn't something about the set up that is beyond the features that 'demo' user has access to.  
  > **username_0**: Thanks for the tip, username_1. The demo site doesn't give the same error, but that might be because it's on 5.2.alpha or because outbound email is disabled. This error I've described is failing to send out confirmatory emails, so that might be part of it  
  > **username_1**: True - but demo can be set to 'send to database' which should mimic that process. also "source_contact_id is not a valid integer" does not sound related to an email process. It sounds like it is complaining about the value being submitted  
  > **username_1**: Did you see this? I don't know if it is related if you are not using civirules: https://github.com/CiviCooP/org.civicoop.civirules/issues/152  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-05-15. Score: 2
  
  The two versions username_0 mentions are different extensions.
  
  <https://civicrm.org/extensions/sparkpost-civicrm-integration> is the PESC extension from <https://github.com/proexchange/com.pesc.sparkpost> and the replacement used by username_0 is the Cividesk extension.
  
  I had the same problem experienced by username_0 with the PESC version on a D6 system running CiviCRM 5.0.0. I seem to have fixed it using username_0's sleuthing - I simply edited the sparkpost.php file and replaced *source\_record\_id* with *source\_contact\_id*
  
  Everything seems to now work. (I'll report back if I find other problems).
  
  UPDATE: The latest version 1.3.7 of com.pesc.sparkpost fixes the problem.
  
  
  ---
  
  ### Answer by username_0 on 2018-05-04. Score: 1
  
  I think I've found the problem, which is to do with mailing and not primarily events. I had upgraded to what I thought was the latest version (v1.3.5) of the Sparkpost extension, which does all the emails for my installation of Civi. (see <https://civicrm.org/extensions/sparkpost-civicrm-integration>)
  
  However, it seems that there is a bug in the main sparkpost.php file which has source\_record\_id instead of source\_contact\_id. So I think the error was caused because source\_contact\_id was being left undefined.
  
  Anyway, I've now found a more up to date master version of this extension on Github (although it's called v1.1), and I've installed that and it's working fine so far. :-)
  <https://github.com/cividesk/com.cividesk.email.sparkpost>
  
  
  ---
  
  