Answers.Body: <p>After doing a lot of trial and error and closely analyzing the complaints we have received, I'm fairly sure that the cause of the problem is: you register one person, then click back on your browser and try to register a second. Your browser doesn't properly refresh the page and somehow the id of the event is lost in the process.</p>
  
  <p>I'm not sure what the best fix is - but I'm fairly certain that is the cause.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-24T22:23:00.980Z
Answers.Text: Unfortunately it looks like your problem has a different cause than mine - when we have tested and encountered this error, it's been after opening the direct event link in a new tab and registering - it hasn't let the first person register in the first place. Hope you're able to fix the issue you're facing though!
Answers.UserDisplayName: josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-22T18:05:14.700Z
Answers.LastActivityDate: 2019-02-22T18:05:14.700Z
Answers.UserDisplayName: Jamie
Answers.Body: <p>This <a href="https://civicrm.org/extensions/front-end-page-options" rel="nofollow noreferrer">extension</a> may help as it lets you set the 'redirect' page after a form is submitted. therefore it may help if you find folk are using the back page, ie set it so that after a submission the form redirects back to the original form (which would then have the id in)</p>
  
  <p>a risk though might be that folk might worry their submission wasn't successful. not sure. long time since i used it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-22T19:39:08.263Z
Answers.LastActivityDate: 2019-02-22T22:29:57.430Z
Answers.LastEditDate: 2019-02-22T22:29:57.430Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>@josh, before doing anything else, please upgrade your Drupal site: <a href="https://www.drupal.org/SA-CORE-2019-002" rel="nofollow noreferrer">https://www.drupal.org/SA-CORE-2019-002</a></p>
  
  <p>Your sysadmin may have applied the patch without running the upgrade.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-24T22:21:26.353Z
Answers.Text: Thanks John - didn't update my post but after posting I updated to 7.64.  Haven't tested to see whether this is still a problem 7.64 though
Answers.UserDisplayName: josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-23T00:31:54.970Z
Answers.LastActivityDate: 2019-02-23T00:31:54.970Z
Answers.UserDisplayName: JohnFF
Body: <p>Using CiviCRM 5.7.2, using Drupal 7.61.</p>
  
  <p>I thought I had fixed <a href="https://civicrm.stackexchange.com/questions/28193/civievents-confirmation-email-not-being-sent">this error</a> but it looks like my fix has created another problem... or at least another error has decided to appear. </p>
  
  <p>This is an intermittent error, have not been able to replicate yet but had it reported by a member of our staff.</p>
  
  <p>Upon registering for an event with event registration turned on, and confirmation screen / emails turned on, and payment turned off, the user receives this error message. </p>
  
  <pre><code>Could not find valid value for id
  </code></pre>
  
  <p>This error seems different to <a href="https://civicrm.stackexchange.com/questions/4793/civievent-error-when-registering-could-not-find-valid-value-for-id?rq=1">other similar reported errors</a> in that the registration <strong>does not</strong> go through. The user does not see the confirmation screen, they do not receive the confirmation email, and their registration does not feed into CiviCRM. </p>
  
  <p>Went into the drupal error logs and saw the following errors:</p>
  
  <pre><code>$Fatal Error Details = Array ( [message] =&gt; Could not find valid value for id [code] =&gt; )
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$backTrace = #0 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(381): CRM_Core_Error::backtrace("backTrace", TRUE) #1 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Utils/Request.php(121): CRM_Core_Error::fatal("Could not find valid value for id") #2 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE) #3 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Event/Controller/Registration.php(47): CRM_Event_StateMachine_Registration-&gt;__construct(Object(CRM_Event_Controller_Registration), TRUE) #4 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(304): CRM_Event_Controller_Registration-&gt;__construct("Event Registration", TRUE, "null", NULL, "false") #5 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15)) #6 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3)) #7 /home2/ppe/public_html/sites/all/modules/civicrm/drupal/civicrm.module(445): CRM_Core_Invoke::invoke((Array:3)) #8 /home2/ppe/public_html/includes/menu.inc(527): civicrm_invoke("event", "register") #9 /home2/ppe/public_html/index.php(21): menu_execute_active_handler() #10 {main}
  </code></pre>
  
  <p>(sorry, not sure how to put that code as a block rather than a massive horizontal scrolling box)</p>
  
  <p>Another user has also reported receiving a 500 error, I'm not sure if it's related. This is what Drupal error log says about their 500 error:</p>
  
  <pre><code>Warning: in_array() expects parameter 2 to be array, null given in CRM_Contact_BAO_Contact::formatProfileContactParams() (line 2128 of /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
  </code></pre>
  
  <p>Anyone encountered anything similar? For now I've just disabled confirmation emails altogether until I work this out.</p>
  
  <p>Cheers,</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T03:51:16.000Z
Comments.Text: Are you sure that you're using the right link to the event? I used to get that error because I had copied the link from the wrong place - I was using a link specific to me and therefore it didn't work for anyone else. But if I grab the link from the event config page (there's a menu item on the page to get the links), it would work fine.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T04:28:50.873Z
Comments.Text: @JenniSimonis thanks for your comment! Yup I am sure this is the correct link. The users were able to input their details on the registration page and pressed the "Continue/Confirm" button and then received these errors.
Comments.UserDisplayName: josh
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T04:35:21.570Z
Comments.Text: Yes, when I was using the wrong link, I still got the page and I could put in information. But once I hit the button to go to the next page, I would get the error. Same as what it appears you're reporting.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T04:56:32.210Z
Comments.Text: @JenniSimonis Yep it is correct link, I sent the same link to all staff and only one reported this problem :(
Comments.UserDisplayName: josh
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-05T20:29:31.140Z
Comments.Text: Exact same intermittent problem here to (C5.7.3, d7.61). I can see from the referrer field in our web log that the user clicked on the correct register link and the proper id=13 was present, yet CiviLog: /CRM/Utils/Request.php(121): CRM_Core_Error::fatal("Could not find valid value for id").
Comments.UserDisplayName: Jamie
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T22:54:30.977Z
Comments.Text: @Jamie have you found a solution for this yet?
Comments.UserDisplayName: josh
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-22T15:32:12.493Z
Comments.Text: Sadly no, but still getting reports of this problem from our users.
Comments.UserDisplayName: Jamie
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-03T20:56:13.897Z
Comments.Text: How frequent are your Drupal Cron and CiviCRM Cron? AND is Clean Up Temporary Data turned on?  Typically I see this error when the form is loaded but a session cache is cleared between the load and the submit. Temporary data only flushes data that is already old, but if the timestamps are not the same timezone as the site it can flush all current data. Check the logs for a form load/ cron run/ then submit failure pattern.
Comments.UserDisplayName: Tommy B
Tags: <civievent><drupal><error>
Title: CiviEvent: Could not find valid value for id (Drupal 7.6.1)
ThreadText: # CiviEvent: Could not find valid value for id (Drupal 7.6.1)
  
  (Asked by: username_0 on 2019-02-03)
  
  Using CiviCRM 5.7.2, using Drupal 7.61.
  
  I thought I had fixed [this error](https://civicrm.stackexchange.com/questions/28193/civievents-confirmation-email-not-being-sent) but it looks like my fix has created another problem... or at least another error has decided to appear.
  
  This is an intermittent error, have not been able to replicate yet but had it reported by a member of our staff.
  
  Upon registering for an event with event registration turned on, and confirmation screen / emails turned on, and payment turned off, the user receives this error message.
  
  ```
  Could not find valid value for id
  
  ```
  
  This error seems different to [other similar reported errors](https://civicrm.stackexchange.com/questions/4793/civievent-error-when-registering-could-not-find-valid-value-for-id?rq=1) in that the registration **does not** go through. The user does not see the confirmation screen, they do not receive the confirmation email, and their registration does not feed into CiviCRM.
  
  Went into the drupal error logs and saw the following errors:
  
  ```
  $Fatal Error Details = Array ( [message] => Could not find valid value for id [code] => )
  
  ```
  
  and
  
  ```
  $backTrace = #0 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(381): CRM_Core_Error::backtrace("backTrace", TRUE) #1 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Utils/Request.php(121): CRM_Core_Error::fatal("Could not find valid value for id") #2 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE) #3 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Event/Controller/Registration.php(47): CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), TRUE) #4 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(304): CRM_Event_Controller_Registration->__construct("Event Registration", TRUE, "null", NULL, "false") #5 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15)) #6 /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3)) #7 /home2/ppe/public_html/sites/all/modules/civicrm/drupal/civicrm.module(445): CRM_Core_Invoke::invoke((Array:3)) #8 /home2/ppe/public_html/includes/menu.inc(527): civicrm_invoke("event", "register") #9 /home2/ppe/public_html/index.php(21): menu_execute_active_handler() #10 {main}
  
  ```
  
  (sorry, not sure how to put that code as a block rather than a massive horizontal scrolling box)
  
  Another user has also reported receiving a 500 error, I'm not sure if it's related. This is what Drupal error log says about their 500 error:
  
  ```
  Warning: in_array() expects parameter 2 to be array, null given in CRM_Contact_BAO_Contact::formatProfileContactParams() (line 2128 of /home2/ppe/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
  
  ```
  
  Anyone encountered anything similar? For now I've just disabled confirmation emails altogether until I work this out.
  
  Cheers,
  
  **Tags:** civievent, drupal, error
  
  > **Comments:**
  > **username_1**: Are you sure that you're using the right link to the event? I used to get that error because I had copied the link from the wrong place - I was using a link specific to me and therefore it didn't work for anyone else. But if I grab the link from the event config page (there's a menu item on the page to get the links), it would work fine.  
  > **username_0**: @username_1 thanks for your comment! Yup I am sure this is the correct link. The users were able to input their details on the registration page and pressed the "Continue/Confirm" button and then received these errors.  
  > **username_1**: Yes, when I was using the wrong link, I still got the page and I could put in information. But once I hit the button to go to the next page, I would get the error. Same as what it appears you're reporting.  
  > **username_0**: @username_1 Yep it is correct link, I sent the same link to all staff and only one reported this problem :(  
  > **username_2**: Exact same intermittent problem here to (C5.7.3, d7.61). I can see from the referrer field in our web log that the user clicked on the correct register link and the proper id=13 was present, yet CiviLog: /CRM/Utils/Request.php(121): CRM_Core_Error::fatal("Could not find valid value for id").  
  > **username_0**: @username_2 have you found a solution for this yet?  
  > **username_2**: Sadly no, but still getting reports of this problem from our users.  
  > **username_3**: How frequent are your Drupal Cron and CiviCRM Cron? AND is Clean Up Temporary Data turned on?  Typically I see this error when the form is loaded but a session cache is cleared between the load and the submit. Temporary data only flushes data that is already old, but if the timestamps are not the same timezone as the site it can flush all current data. Check the logs for a form load/ cron run/ then submit failure pattern.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2019-02-22. Score: 2
  
  After doing a lot of trial and error and closely analyzing the complaints we have received, I'm fairly sure that the cause of the problem is: you register one person, then click back on your browser and try to register a second. Your browser doesn't properly refresh the page and somehow the id of the event is lost in the process.
  
  I'm not sure what the best fix is - but I'm fairly certain that is the cause.
  
  > **Comments:**
  > **username_0**: Unfortunately it looks like your problem has a different cause than mine - when we have tested and encountered this error, it's been after opening the direct event link in a new tab and registering - it hasn't let the first person register in the first place. Hope you're able to fix the issue you're facing though!  
  
  ---
  
  ### Answer by username_4 on 2019-02-22. Score: 1
  
  This [extension](https://civicrm.org/extensions/front-end-page-options) may help as it lets you set the 'redirect' page after a form is submitted. therefore it may help if you find folk are using the back page, ie set it so that after a submission the form redirects back to the original form (which would then have the id in)
  
  a risk though might be that folk might worry their submission wasn't successful. not sure. long time since i used it.
  
  
  ---
  
  ### Answer by username_5 on 2019-02-23. Score: 0
  
  @username_0, before doing anything else, please upgrade your Drupal site: <https://www.drupal.org/SA-CORE-2019-002>
  
  Your sysadmin may have applied the patch without running the upgrade.
  
  > **Comments:**
  > **username_0**: Thanks John - didn't update my post but after posting I updated to 7.64.  Haven't tested to see whether this is still a problem 7.64 though  
  
  ---
  
  