FIX Dont generate urlsegments if we dont need to

This commit is contained in:
Daniel Hensby 2017-07-19 17:33:38 +01:00
parent 4e78e581fd
commit c29438fd1a
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -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()) {