Answers.Body: <p>use the civicrm events register link after /civicrm/ not after root.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-21T00:07:57.147Z
Answers.LastActivityDate: 2016-05-21T00:07:57.147Z
Answers.UserDisplayName: Stoycho
Answers.Body: <p>The error message indicates that the <code>id</code> parameter (the event ID) is not being found in the URL or the form object that gets carried from step to step through the event registration process.  Obviously the event ID is set at one point: the correct event is showing up.  However, it's failing later.</p>
  
  <p>WPEngine has very aggressive caching.  I haven't tried using CiviCRM there in years, but it used to have serious problems with things like this.  Certain aspects of a page would be cached so that certain URL parameters would never have any effect.  Basically, WPEngine knows how to cache in ways that retain distinctions between WordPress pages, but it might not know all of the CiviCRM URL parameters to pay attention to.</p>
  
  <p>Absent any other glaring issue with your setup (though you really should set a base page), you might try the site on a more traditional server environment.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-23T17:07:47.083Z
Answers.Text: not in this case, WPEngine does not cache on staging.
  On Live if you /civicrm/ as a base page and exclude it from caching - /civicrm/* - it should be fine. It is CiviCRM that has to display some message about this in the admin area - i.e. to use /civicrm/ as a base page
Answers.UserDisplayName: Stoycho
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-23T19:07:01.607Z
Answers.Text: I agree about the lack of warning: originally there was no support for alternate base pages--I built the feature for a client of ours soon after CiviCRM started supporting WordPress.  Starting in 4.6, all of a sudden CiviCRM started presuming that everyone has a base page since it started creating one for everyone on install.  Sites upgrading to 4.6 never got any notice that they should set one up, though.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-10T00:28:48.337Z
Answers.Text: I hope this helps someone else - I installed and upgraded to Civi 4.7, w/WP frontend. Events are listed on a Calendar plugin. After loading and converting the database, I got this error. Event though I had defined a civicrm base page, I noticed on the browser tab that that page wasn't what was displayed. I had to re-enter the links to Events in the shortcode for the WP calendar. Otherwise, using the links from the Calendar would result in "Could not find valid value for id"
Answers.UserDisplayName: Lesley Evensen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-10T00:33:10.903Z
Answers.Text: And just for anyone who gets into technical details, the error comes after the call to controller->reset - the event ID is no longer stored in the session, and the next time the controller in Events is instantiated that is the error that comes from Request:retrieve($name, $type, $store)
Answers.UserDisplayName: Lesley Evensen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-21T03:51:53.653Z
Answers.LastActivityDate: 2016-05-21T03:51:53.653Z
Answers.UserDisplayName: Andie Hunt
Answers.Body: <p>I had this problem intermittently for some time when embedding event registration forms using a Wordpress shortcode. It has to do with page caching. CiviCRM parses the shortcode to capture the event ID and adds the id value to the global $_GET object. If the page is loaded from cache (usually when the back/forward button is pressed) the code that parses the shortcode does not run, and the event ID is not added to $_GET.</p>
  <p>I was able to fix this issue by making a page cache exception with the caching plugin I'm using.</p>
  <p>I think this behavior is essentially a bug and CiviCRM should output a hidden form variable with the event ID so that it still gets passed to the &quot;Thank You&quot; page if the registration form is loaded from cache.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-13T19:41:30.760Z
Answers.LastActivityDate: 2021-10-13T19:41:30.760Z
Answers.UserDisplayName: dsmith63
Body: <p>I have the same issue as the one here: <a href="https://civicrm.stackexchange.com/questions/4793/civievent-error-when-registering-could-not-find-valid-value-for-id">CiviEvent - Error when registering: Could not find valid value for id</a>
  However the solution mentioned does not work for me. Besides on the demo site <a href="http://wpmaster.demo.civicrm.org/" rel="nofollow noreferrer">http://wpmaster.demo.civicrm.org/</a> no base page is set and it works. Any help is greatly appreciated.</p>
  
  <p>I'm on WP 4.4.2, civi 4.7.7</p>
  
  <p>The error from the log is below:</p>
  
  <pre><code>May 20 10:06:31  [info] $Fatal Error Details = Array
  (
      [message] =&gt; Could not find valid value for id
      [code] =&gt; 
  )
  
  
  May 20 10:06:31  [info] $backTrace = #0 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(371): CRM_Core_Error::backtrace("backTrace", TRUE)
  
  1 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php(120): CRM_Core_Error::fatal("Could not find valid value for id")
  
  2 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE)
  
  3 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php(47): CRM_Event_StateMachine_Registration-&gt;__construct(Object(CRM_Event_Controller_Registration), TRUE)
  
  4 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(307): CRM_Event_Controller_Registration-&gt;__construct("Event Registration", TRUE, "null", NULL, "false")
  
  5 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
  
  6 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
  
  7 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm.php(1229): CRM_Core_Invoke::invoke((Array:3))
  
  8 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/includes/civicrm.basepage.php(132): CiviCRM_For_WordPress-&gt;invoke()
  
  9 [internal function](): CiviCRM_For_WordPress_Basepage-&gt;basepage_handler(Object(WP))
  
  10 /nas/content/staging/theexecnet/wp-includes/plugin.php(601): call_user_func_array((Array:2), (Array:1))
  
  11 /nas/content/staging/theexecnet/wp-includes/class-wp.php(692): do_action_ref_array("wp", (Array:1))
  
  12 /nas/content/staging/theexecnet/wp-includes/functions.php(952): WP-&gt;main("")
  
  13 /nas/content/staging/theexecnet/wp-blog-header.php(14): wp()
  
  14 /nas/content/staging/theexecnet/index.php(17): require("/nas/content/staging/theexecnet/wp-blog-header.php")
  
  15 {main}
  </code></pre>
  
  <p><a href="https://i.sstatic.net/CTkfT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CTkfT.png" alt="enter image description here"></a>
  <a href="https://i.sstatic.net/Iowyn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Iowyn.png" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-20T10:29:42.383Z
Comments.Text: please check civicrm log message for more detailed error - even this is not helping this can be for any reason
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-20T10:33:15.307Z
Comments.Text: Also i can see that you are getting a Thankyou page screen - so everything in Civi should be alright - event should have been completed - I guess
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-20T10:47:55.633Z
Comments.Text: I've added the log message in the question. Yes, event registration is completed (same as the other bug), but how do I get rid of this error screen.
Comments.UserDisplayName: Stoycho
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-20T10:55:55.177Z
Comments.Text: did you manage test contribution page - is it working ?
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-20T12:05:29.800Z
Comments.Text: yes contributions are working
Comments.UserDisplayName: Stoycho
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-20T13:08:34.973Z
Comments.Text: Is their anyway you can provide me an access for the same so i can test ?
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-20T13:30:43.630Z
Comments.Text: give me your email or skype
Comments.UserDisplayName: Stoycho
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-20T13:35:30.263Z
Comments.Text: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/40060/discussion-between-stoycho-and-ramesh).
Comments.UserDisplayName: Stoycho
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-25T12:08:09.383Z
Comments.Text: "use the civicrm events register link after /civicrm/ not after root." That's what I'm doing (and I have the same problem as @Stoycho): the link is `https://domain.tld/civicrm/event/register/?id=3&reset=1`. But the error still comes up. I'm using CiviCRM 5.47.2, and WordPress 5.9.2.
Comments.UserDisplayName: Steve
Tags: <civievent><wordpress>
Title: Error when registering CiviEvent: "Could not find valid value for id"
ThreadText: # Error when registering CiviEvent: "Could not find valid value for id"
  
  (Asked by: username_0 on 2016-05-20)
  
  I have the same issue as the one here: [CiviEvent - Error when registering: Could not find valid value for id](https://civicrm.stackexchange.com/questions/4793/civievent-error-when-registering-could-not-find-valid-value-for-id)
  However the solution mentioned does not work for me. Besides on the demo site <http://wpmaster.demo.civicrm.org/> no base page is set and it works. Any help is greatly appreciated.
  
  I'm on WP 4.4.2, civi 4.7.7
  
  The error from the log is below:
  
  ```
  May 20 10:06:31  [info] $Fatal Error Details = Array
  (
      [message] => Could not find valid value for id
      [code] => 
  )
  
  May 20 10:06:31  [info] $backTrace = #0 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(371): CRM_Core_Error::backtrace("backTrace", TRUE)
  
  1 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php(120): CRM_Core_Error::fatal("Could not find valid value for id")
  
  2 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE)
  
  3 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php(47): CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), TRUE)
  
  4 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(307): CRM_Event_Controller_Registration->__construct("Event Registration", TRUE, "null", NULL, "false")
  
  5 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
  
  6 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
  
  7 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/civicrm.php(1229): CRM_Core_Invoke::invoke((Array:3))
  
  8 /nas/content/staging/theexecnet/wp-content/plugins/civicrm/includes/civicrm.basepage.php(132): CiviCRM_For_WordPress->invoke()
  
  9 [internal function](): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
  
  10 /nas/content/staging/theexecnet/wp-includes/plugin.php(601): call_user_func_array((Array:2), (Array:1))
  
  11 /nas/content/staging/theexecnet/wp-includes/class-wp.php(692): do_action_ref_array("wp", (Array:1))
  
  12 /nas/content/staging/theexecnet/wp-includes/functions.php(952): WP->main("")
  
  13 /nas/content/staging/theexecnet/wp-blog-header.php(14): wp()
  
  14 /nas/content/staging/theexecnet/index.php(17): require("/nas/content/staging/theexecnet/wp-blog-header.php")
  
  15 {main}
  
  ```
  
  [![enter image description here](https://i.sstatic.net/CTkfT.png)](https://i.sstatic.net/CTkfT.png)
  [![enter image description here](https://i.sstatic.net/Iowyn.png)](https://i.sstatic.net/Iowyn.png)
  
  **Tags:** civievent, wordpress
  
  > **Comments:**
  > **username_1**: please check civicrm log message for more detailed error - even this is not helping this can be for any reason  
  > **username_1**: Also i can see that you are getting a Thankyou page screen - so everything in Civi should be alright - event should have been completed - I guess  
  > **username_0**: I've added the log message in the question. Yes, event registration is completed (same as the other bug), but how do I get rid of this error screen.  
  > **username_1**: did you manage test contribution page - is it working ?  
  > **username_0**: yes contributions are working  
  > **username_1**: Is their anyway you can provide me an access for the same so i can test ?  
  > **username_0**: give me your email or skype  
  > **username_0**: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/40060/discussion-between-username_0-and-username_1).  
  > **username_2**: "use the civicrm events register link after /civicrm/ not after root." That's what I'm doing (and I have the same problem as @username_0): the link is `https://domain.tld/civicrm/event/register/?id=3&reset=1`. But the error still comes up. I'm using CiviCRM 5.47.2, and WordPress 5.9.2.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2016-05-21. Score: 0 | Accepted answer
  
  use the civicrm events register link after /civicrm/ not after root.
  
  
  ---
  
  ### Answer by username_3 on 2016-05-21. Score: 0
  
  The error message indicates that the `id` parameter (the event ID) is not being found in the URL or the form object that gets carried from step to step through the event registration process. Obviously the event ID is set at one point: the correct event is showing up. However, it's failing later.
  
  WPEngine has very aggressive caching. I haven't tried using CiviCRM there in years, but it used to have serious problems with things like this. Certain aspects of a page would be cached so that certain URL parameters would never have any effect. Basically, WPEngine knows how to cache in ways that retain distinctions between WordPress pages, but it might not know all of the CiviCRM URL parameters to pay attention to.
  
  Absent any other glaring issue with your setup (though you really should set a base page), you might try the site on a more traditional server environment.
  
  > **Comments:**
  > **username_0**: not in this case, WPEngine does not cache on staging. On Live if you /civicrm/ as a base page and exclude it from caching - /civicrm/* - it should be fine. It is CiviCRM that has to display some message about this in the admin area - i.e. to use /civicrm/ as a base page  
  > **username_3**: I agree about the lack of warning: originally there was no support for alternate base pages--I built the feature for a client of ours soon after CiviCRM started supporting WordPress.  Starting in 4.6, all of a sudden CiviCRM started presuming that everyone has a base page since it started creating one for everyone on install.  Sites upgrading to 4.6 never got any notice that they should set one up, though.  
  > **username_4**: I hope this helps someone else - I installed and upgraded to Civi 4.7, w/WP frontend. Events are listed on a Calendar plugin. After loading and converting the database, I got this error. Event though I had defined a civicrm base page, I noticed on the browser tab that that page wasn't what was displayed. I had to re-enter the links to Events in the shortcode for the WP calendar. Otherwise, using the links from the Calendar would result in "Could not find valid value for id"  
  > **username_4**: And just for anyone who gets into technical details, the error comes after the call to controller->reset - the event ID is no longer stored in the session, and the next time the controller in Events is instantiated that is the error that comes from Request:retrieve($name, $type, $store)  
  
  ---
  
  ### Answer by username_5 on 2021-10-13. Score: 0
  
  I had this problem intermittently for some time when embedding event registration forms using a Wordpress shortcode. It has to do with page caching. CiviCRM parses the shortcode to capture the event ID and adds the id value to the global $\_GET object. If the page is loaded from cache (usually when the back/forward button is pressed) the code that parses the shortcode does not run, and the event ID is not added to $\_GET.
  
  I was able to fix this issue by making a page cache exception with the caching plugin I'm using.
  
  I think this behavior is essentially a bug and CiviCRM should output a hidden form variable with the event ID so that it still gets passed to the "Thank You" page if the registration form is loaded from cache.
  
  
  ---
  
  