mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX Dont generate urlsegments if we dont need to
This commit is contained in:
parent
4e78e581fd
commit
c29438fd1a
@ -35,6 +35,10 @@ class BlogMemberExtension extends DataExtension {
|
|||||||
public function onBeforeWrite() {
|
public function onBeforeWrite() {
|
||||||
$count = 1;
|
$count = 1;
|
||||||
|
|
||||||
|
if ($this->owner->URLSegment && !$this->owner->isChanged('FirstName') && !$this->owner->isChanged('Surname')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->owner->URLSegment = $this->generateURLSegment();
|
$this->owner->URLSegment = $this->generateURLSegment();
|
||||||
|
|
||||||
while(!$this->validURLSegment()) {
|
while(!$this->validURLSegment()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user