2

I have a simple and largely up to date Wordpress 6.02/Civi 5.53 site running registrations for a single paid event. I'm taking payments using the Stripe extension. It couldn't get much more straightforward.

However I'm seeing an error "Could not find valid value for id" that is stopping some people from registering.

I've checked through other posts here on this issue, including:

CiviEvent - Error when registering: Could not find valid value for id

and

"Could not find valid value for id" after event registration on WordPress 5.9.1 and CiviCRM 5.47.2

and I can't see anything wrong with my set-up. Clean URLs, base page, permalinks are all good. I'm not using a shortcode for the event registration form.

It looks like the majority of registrations are working fine, but I've had a few people get in touch reporting the error.

Here's what gets logged:

$Fatal Error Details = array:3 [
  "message" => "Could not find valid value for id"
  "code" => null
  "exception" => CRM_Core_Exception {#6388
    -errorData: array:1 [
      "error_code" => 0
    ]
    #cause: null
    -_trace: null
    #message: "Could not find valid value for id"
    #code: 0
    #file: "/home/wf/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php"
    #line: 98
    trace: {
      /home/wf/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php:98 {
        ?~@? if (!isset($value) && $abort) {
        ?~@?   throw new CRM_Core_Exception(ts('Could not find valid value for %1', [1 => $name]));
        ?~@? }
      }
      /home/wf/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php:27 { ?~@?}
      /home/wf/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php:27 { ?~@?}
      /home/wf/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:314 { ?~@?}
      /home/wf/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { ?~@?}
      /home/wf/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { ?~@?}
      /home/wf/sites/default/wp-content/plugins/civicrm/civicrm.php:1199 { ?~@?}
      /home/wf/sites/default/wp-content/plugins/civicrm/includes/civicrm.basepage.php:380 { ?~@?}
      /home/wf/sites/default/wp-includes/class-wp-hook.php:307 { ?~@?}
      /home/wf/sites/default/wp-includes/class-wp-hook.php:331 { ?~@?}
      /home/wf/sites/default/wp-includes/plugin.php:524 { ?~@?}
      /home/wf/sites/default/wp-includes/class-wp.php:787 { ?~@?}
      /home/wf/sites/default/wp-includes/functions.php:1330 { ?~@?}
      /home/wf/sites/default/wp-blog-header.php:16 { ?~@?}
      /home/wf/sites/default/index.php:17 { ?~@?}
    }
  }
]

I'm now at a loss as to how to begin resolving this.

1
  • Now that you've shifted to the shortcode, are users still reporting the issue? We've seen this previously on WP when using the direct Civi register link (not embedding the form in a WP page); going the shortcode route was the only way we found to resolve it. (We also confirmed the clean URL settings were good, etc.) Commented Oct 19, 2022 at 20:55

1 Answer 1

0

Can you check your civicrm.settings.php have exact below code for clean url?

if (!defined('CIVICRM_CLEANURL')) {
  if (function_exists('variable_get') && variable_get('clean_url', '0') != '0') {
    define('CIVICRM_CLEANURL', 1 );
  }
  elseif ( function_exists('config_get') && config_get('system.core', 'clean_url') != 0) {
    define('CIVICRM_CLEANURL', 1 );
  }
  elseif( function_exists('get_option') && get_option('permalink_structure') != '' ) {
    define('CIVICRM_CLEANURL', 1 );
  }
  else {
    define('CIVICRM_CLEANURL', 0);
  }
}

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.