I have a bunch of members without email addresses (from earlier versions of SS). After recent upgrade to SS5.3, I now get a validation error due to blank email address. Is there any way to turn off the requirement for an email address for specific sub-classes of Member (given that they can’t login with a blank email address anyway)?
There is no such thing… do you mean silverstripe/framework 5.3? Or 4.13 maybe?
given that they can’t login with a blank email address anyway
They can’t login and they can’t recover their password… what’s the point of having a user who can’t do any user things? The validation is there to prevent exactly that scenario.
In any case, that validation is provided by Member_Validator - if you really don’t want that validation to be applied in your subclass you can override getValidator().
If you’re not actually using subclasses and want to change the validation for Member, you can implement an extension with the updateValidator() extension hook method.
I have members that make bookings on trips; some book as individuals, some book as family / friends groups under a single email address. As part of this, need to store personal information on every member booking onto a trip, but also handle email addresses - given that email must be unique, email can only be associated with the primary member making the booking and other group members must therefore have a blank email address. All members make bookings through the same form, so having a separate class for those without email addresses would be unnecessarily tedious.
Got it working with DataExtension on Member:
public function updateValidator($validator){
// remove email requirement
$validator->removeRequiredField('Email');
}