mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
#1562 - Group codes don't appear to be generated upon creation of group
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44002 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
367cc65019
commit
eefc4ffc06
@ -159,6 +159,14 @@ class Group extends DataObject {
|
|||||||
public function setCode($val){
|
public function setCode($val){
|
||||||
$this->setField("Code",SiteTree::generateURLSegment($val));
|
$this->setField("Code",SiteTree::generateURLSegment($val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onBeforeWrite() {
|
||||||
|
parent::onBeforeWrite();
|
||||||
|
|
||||||
|
if(stripos($this->Code, 'new-') === 0) {
|
||||||
|
$this->setCode($this->Title);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
class Group_Unsecure extends Group {
|
class Group_Unsecure extends Group {
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user