Whenever someone registers for an event, this error displays instead of the thank you page: enter image description here

I'm using Wordpress and I have a civicrm page, and I have the Wordpress base page set to the civicrm page on the CMS Database Integration page in civi. The url for the error page displayed is: ?page=CiviCRM&q=civicrm%2Fevent%2Fregister&_qf_ThankYou_display=true&qfKey=

I see the error below in the the civi debug log.

A thank you email is sent as requested. I'm usisng CiviCRM 5.4.1 and Wordpress 4.9.9.

What do I need to configure or change to fix this problem?

ETA: The thank-you page used to display properly. I think it stopped working when Wordpress was automatically updated to 4.9.9. Any ideas?

Update: We are using credit cards through Paypal Website Payments Pro for payments. The transactions go through and are marked as complete.

We also get this error when people register with a discount code giving them a free registration, thus no paypal transactions are required, or if they register using the pay later option. For donations and memberships, the orginal donation or membership screen is displayed instead of the thank you screen.


I finally found the correct debug log. We have a subsite and I was looking at the main site ConfigAndLog. Here's the error and backtrace:

Jan 07 11:01:08  [info] $Fatal Error Details = Array
     [message] => Could not find valid value for id
     [code] =>  

Jan 07 11:01:08  [info] $backTrace = #0 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(381): > CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php(121): CRM_Core_Error::fatal("Could not find valid value for id")
#2 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE)
#3 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php(47): CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), TRUE)
#4 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(304): CRM_Event_Controller_Registration->__construct("Event Registration", TRUE, "null", NULL, "false")
#5 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15))
#6 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#7 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke((Array:3))
#8 /var/www/vhosts/site/httpdocs/wp-content/plugins/civicrm/includes/civicrm.basepage.php(141): CiviCRM_For_WordPress->invoke()
#9 [internal function](): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#10 /var/www/vhosts/site/httpdocs/wp-includes/class-wp-hook.php(286): call_user_func_array((Array:2), (Array:1))
#11 /var/www/vhosts/site/httpdocs/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#12 /var/www/vhosts/site/httpdocs/wp-includes/plugin.php(515): WP_Hook->do_action((Array:1))
13 /var/www/vhosts/site/httpdocs/wp-includes/class-wp.php(728): do_action_ref_array("wp", (Array:1))
#14 /var/www/vhosts/site/httpdocs/wp-includes/functions.php(960): WP->main("")
#15 /var/www/vhosts/site/httpdocs/wp-blog-header.php(16): wp()
#16 /var/www/vhosts/site/httpdocs/index.php(17): require("/var/www/vhosts/site/httpdocs/wp-blog-header.php")
#17 {main}
  • 1
    may be a duplicate of civicrm.stackexchange.com/questions/15531/…
    – petednz - fuzion
    Commented Jan 7, 2019 at 19:48
  • pls update your Q with payment processor details
    – petednz - fuzion
    Commented Jan 7, 2019 at 19:48
  • Any time you see an error with a yellow background like this, there should be an entry in the Civi log. Are you checking the log in the ConfigAndLog directory? You can also see these errors directly on the page with Administer menu » System Settings » Debugging and Error Handling. Set both Debugging and Backtrace to Yes and save, then replicate the bug. Please edit your question to include the full debug/backtrace. Finally, please copy/paste the text, not a screenshot so others can search your error. Thanks! Commented Jan 7, 2019 at 19:51
  • you didn't say which version of PayPal you are using but i suspect this is duplicate of the ticket if pasted in first comment. did you read that other Question?
    – petednz - fuzion
    Commented Jan 8, 2019 at 0:09
  • Sorry....Yes, I read the first question. We're using PayPal Payments Pro.
    – kzburn
    Commented Jan 8, 2019 at 1:55

1 Answer 1


I am fairly confident that your issue is that the WordPress redirect_canonical function is rewriting your unescaped CiviCRM URLs and redirecting to properly escaped URLs during the registration process. This would cause your session to be cleared during the redirect.

I recently fixed the as much of the code as I could find where CiviCRM generates URLs and updated it to produce valid URLs that wouldn't be caught by redirect_canonical. The latest CiviCRM has the fixes (so upgrading is as always recommended) but here are the relevant PRs in case you want to back-port them to your version:

As the question is also Paypal-related, you should also be aware of:

I haven't verified that jgillmanjr's fix works, but the logic looks right to me.

  • i'm scratching my head on this for a couple of weeks now trying to get an installation updated from 5.28 .. where it worked fine. also with 5.33 which i tested for verification. but with 5.44 i can't get no 'thank you' page displayed after registration. URLs look fine - the key after _qf_Confirm_display=true&qfKey= is identical with the one on _qf_ThankYou_display=true&qfKey= we are not using any payment provider, civicrm 5.44, wordpress 5.8.2
    – markusk
    Commented Dec 28, 2021 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.