more solid ID-detection in php()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47584 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-01-03 08:42:04 +00:00
parent b5aaa9b1e2
commit 1589785b18

View File

@ -1255,11 +1255,14 @@ class Member_Validator extends RequiredFields {
// if we are in a complex table field popup, use ctf[childID], else use // if we are in a complex table field popup, use ctf[childID], else use
// ID // ID
$id = (isset($_REQUEST['ctf']['childID'])) if(isset($_REQUEST['ctf']['childID']))
? $_REQUEST['ctf']['childID'] $id = $_REQUEST['ctf']['childID'];
: $_REQUEST['ID']; elseif(isset($_REQUEST['ID']))
$id = $_REQUEST['ID'];
else
$id = null;
if(is_object($member) && $member->ID != $id) { if($id && is_object($member) && $member->ID != $id) {
$emailField = $this->form->dataFieldByName('Email'); $emailField = $this->form->dataFieldByName('Email');
$this->validationError($emailField->id(), $this->validationError($emailField->id(),
_t('Member.VALIDATIONMEMBEREXISTS', "There already exists a member with this email"), _t('Member.VALIDATIONMEMBEREXISTS', "There already exists a member with this email"),