-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing error on Transfer Participant and allow multiple #26365
Fix missing error on Transfer Participant and allow multiple #26365
Conversation
(Standard links)
|
CRM/Event/Form/SelfSvcTransfer.php
Outdated
@@ -288,7 +295,8 @@ public static function checkRegistration($fields, $self, $contact_id, &$errors) | |||
if (!empty($to_event_id)) { | |||
foreach ($to_event_id as $id) { | |||
if ($id == $self->_event_id) { | |||
$errors['email'] = $display_name . ts(" is already registered for this event"); | |||
$error_field = $fields['contact_id'] ? 'contact_id' : 'email'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this array key always set or do you need to use !empty()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixed. Actually, further testing showed this was a little funky because it was only matching on email and so if you entered an email address with a different name, it came back with an error about the name associated with that email address, when the email address was the actual error, so I've corrected that too.
9d5c5bb
to
2f5896d
Compare
2f5896d
to
a0ebf09
Compare
I decided just to fix the whole function properly, the way it worked was a bit silly and hard to read. |
jenkins, test this please (failures don't look related) |
Before
If you attempt to transfer an event registration to a contact who is already registered for an event on the back end, the form fails validation, but no error is shown.
If you attempt to transfer an event registration to a contact who is already registered for an event when Allow same email and multiple registrations? is enabled, you cannot transfer the registration.
After
You can transfer an event registration to an already registered contact if Allow same email and multiple registrations? is enabled.
An error is shown on both front and back end if you cannot transfer an event registration because the contact is already registered for the event.