Updated group filter

Updated group filter
This commit is contained in:
andrewvt 2013-11-01 07:22:13 -04:00
parent 389bdb4ddf
commit 953dec8863

View File

@ -882,7 +882,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
* @param string $groupcode
*/
public function removeFromGroupByCode($groupcode) {
$group = DataObject::get_one('Group', "\"Code\" = '" . Convert::raw2sql($groupcode). "'");
$group = Group::get()->filter(array('Code' => $groupcode))->first();
if($group) {
$this->Groups()->remove($group);