By john.oltman on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
3.4.x
Introduced in version:
3.4.0
Issue links:
Description:
Registration entity validation now includes a check to ensure the current user has permission to create the registration. Previously, this check was performed as part of form validation. Developers with custom modules that perform registration validation will need to ensure that permission to register is assigned to the appropriate roles.
If validation that previously succeeded is now failing in your custom module, and assigning a register permission is not possible, violation filtering may be an option:
Before
// Code in a custom module.
$violations = $registration->validate();
if ($violations->count() == 0) {
// Passed validation.
}
After
// Code in a custom module.
$violations = $registration->validate();
$violations->filterByFields(['anon_mail', 'user_uid']);
if ($violations->count() == 0) {
// Passed validation.
}
This may have unwanted side effects, so the preferred option is to add register permission to the appropriate roles.
Impacts:
Module developers