mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Fixed PHP notice potential error in MemberTableField->addtogroup()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@68935 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
63f5421296
commit
e0611be469
@ -191,8 +191,9 @@ class MemberTableField extends ComplexTableField {
|
||||
function addtogroup() {
|
||||
$data = $_REQUEST;
|
||||
unset($data['ID']);
|
||||
$ctfID = isset($data['ctf']) ? $data['ctf']['ID'] : null;
|
||||
|
||||
if(!is_numeric($data['ctf']['ID'])) {
|
||||
if(!is_numeric($ctfID)) {
|
||||
FormResponse::status_messsage(_t('MemberTableField.ADDINGFIELD', 'Adding failed'), 'bad');
|
||||
}
|
||||
|
||||
@ -202,13 +203,10 @@ class MemberTableField extends ComplexTableField {
|
||||
$record->update($data);
|
||||
|
||||
$valid = $record->validate();
|
||||
|
||||
if($valid->valid()) {
|
||||
$record->write();
|
||||
|
||||
// To Avoid duplication in the Group_Members table if the ComponentSet.php is not modified just uncomment le line below
|
||||
|
||||
//if( ! $record->inGroup( $data['ctf']['ID'] ) )
|
||||
$record->Groups()->add( $data['ctf']['ID'] );
|
||||
$record->Groups()->add($ctfID);
|
||||
|
||||
$this->sourceItems();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user