Registration error for multiple participants when their email already exists
We've run into an error when registering multiple participants and the 2nd, or subsequent registrant, has an email that already exists for a contact.
This only happens when:
- Registering multiple participants for an event
- 2nd (or later) Participant has an email that already exists in the database. If the email for the 1st participant (primary one registering others) exists it seems OK.
- Event can be Free or Paid
- Have tried event configuration with various deduplication rules, but any that contain an email seem to trigger the error
Have tried this with various Duplicate Matching rules and the only way to complete the multiple participant registrations is to either:
- Make the email optional for additional participants (not desirable as duplicate contacts are created) or
- Enter a unique email not attached to an existing contact (not practical as an existing email is often entered)
The base url and base pages are set as per the documentation in the config.
This is running on: CiviCrm v5.41.0 (also tested on v5.40.4, v5.38.0, v5.38.1) Wordpress 5.7.2 (multisite, by subdirectory. The Civicrm site is the main website on the network)
- Click on Events -> Manage event -> Event links -> Online registration. Have the Event configured to use a de-duplication rule that checks for a matching email.
- Select 2 or more participants. Enter an existing email for participant 2 (not the same email as participant 1). Follow prompts to complete registration.
- Got an error "Fatal error: Could not find valid value for id" instead of the thankyou screen.
The error displayed is "Could not find valid value for id". #file: "/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php" #line: 104
This is called from /httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php:28
The redirect url is consistently generated without a value for qfKey e.g. https://mysite.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fevent%2Fregister&_qf_Register_display=true&qfKey
I'm assuming that is causing the ID to not be found throwing the error above.
I also replicated the same problem on the tadpole.cc WP demo which is running the same Wordpress and Civi versions but with demo content.
The event thankyou screen should display.
- Browser: Firefox 92.0/Chrome 93.0.4577/Safari 14.1.1
- CiviCRM: 5.41.0/5.40.4/5.38.1
- PHP: 7.3/7.4
- CMS: WordPress 5.7.2
- Database: MariaDB 10.4
- Web Server: Apache 2.4
NOTE: Initially I thought this was multisite specific, but I've now also verified that the same issue happens on a single site setup.