mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Returning ValidationResult from Member->onBeforeWrite() to ensure the ValidationException is compatible with MemberTableField (related to r103336) (from r103337)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112133 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1379f133ea
commit
eb43fb14ef
@ -605,12 +605,17 @@ class Member extends DataObject {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
if($existingRecord) {
|
if($existingRecord) {
|
||||||
throw new ValidationException(sprintf(
|
throw new ValidationException(new ValidationResult(false, sprintf(
|
||||||
'Can\'t overwrite existing member #%d with identical $unique_identifier_field (%s = %s))',
|
_t(
|
||||||
|
'Member.ValidationIdentifierFailed',
|
||||||
|
'Can\'t overwrite existing member #%d with identical identifier (%s = %s))',
|
||||||
|
PR_MEDIUM,
|
||||||
|
'The values in brackets show a fieldname mapped to a value, usually denoting an existing email address'
|
||||||
|
),
|
||||||
$existingRecord->ID,
|
$existingRecord->ID,
|
||||||
$identifierField,
|
$identifierField,
|
||||||
$this->$identifierField
|
$this->$identifierField
|
||||||
));
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user