mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Fix Member::mapInGroups() and Member::mapInCMSGroups() to not use deprecated.
This commit is contained in:
parent
ed5f72b055
commit
beb10ef4be
@ -1012,9 +1012,8 @@ class Member extends DataObject {
|
|||||||
if(empty($groupIDList))
|
if(empty($groupIDList))
|
||||||
return Member::map();
|
return Member::map();
|
||||||
|
|
||||||
return new SQLMap(singleton('Member')->extendedSQL(
|
return DataList::create("Member")->where("\"GroupID\" IN (" . implode( ',', $groupIDList ) . ")")
|
||||||
"\"GroupID\" IN (" . implode( ',', $groupIDList ) .
|
->sort("\"Surname\", \"FirstName\"")->map();
|
||||||
")", "Surname, FirstName", "", "INNER JOIN \"Group_Members\" ON \"MemberID\"=\"Member\".\"ID\""));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1040,8 +1039,7 @@ class Member extends DataObject {
|
|||||||
|
|
||||||
$SQL_perms = "'" . implode("', '", Convert::raw2sql($perms)) . "'";
|
$SQL_perms = "'" . implode("', '", Convert::raw2sql($perms)) . "'";
|
||||||
|
|
||||||
$groups = DataObject::get('Group', "", "",
|
$groups = DataObject::get('Group')->innerJoin("Permission", "\"Permission\".\"GroupID\" = \"Group\".\"ID\" AND \"Permission\".\"Code\" IN ($SQL_perms)");
|
||||||
"INNER JOIN \"Permission\" ON \"Permission\".\"GroupID\" = \"Group\".\"ID\" AND \"Permission\".\"Code\" IN ($SQL_perms)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$groupIDList = array();
|
$groupIDList = array();
|
||||||
@ -1058,9 +1056,10 @@ class Member extends DataObject {
|
|||||||
? "\"GroupID\" IN (" . implode( ',', $groupIDList ) . ")"
|
? "\"GroupID\" IN (" . implode( ',', $groupIDList ) . ")"
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
return new SQLMap(singleton('Member')->extendedSQL($filterClause,
|
return DataList::create("Member")->where($filterClause)->sort("\"Surname\", \"FirstName\"")
|
||||||
"Surname, FirstName", "",
|
->innerJoin("Group_Members", "\"MemberID\"=\"Member\".\"ID\"")
|
||||||
"INNER JOIN \"Group_Members\" ON \"MemberID\"=\"Member\".\"ID\" INNER JOIN \"Group\" ON \"Group\".\"ID\"=\"GroupID\""));
|
->innerJoin("Group", "\"Group\".\"ID\"=\"GroupID\"")
|
||||||
|
->map();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user