Merge pull request #458 from dhensby/pulls/2.0/fix-url-segment-generation

FIX Dont generate urlsegments if we dont need to
This commit is contained in:
Loz Calver 2017-07-20 09:07:06 +01:00 committed by GitHub
commit 6f5d4bd658
2 changed files with 4 additions and 5 deletions

View File

@ -12,8 +12,6 @@ env:
- DB=MYSQL CORE_RELEASE=3.1 - DB=MYSQL CORE_RELEASE=3.1
matrix: matrix:
allow_failures:
- php: hhvm-nightly
include: include:
- php: 5.6 - php: 5.6
env: DB=MYSQL env: DB=MYSQL
@ -23,9 +21,6 @@ matrix:
env: DB=MYSQL env: DB=MYSQL
- php: 5.3 - php: 5.3
env: DB=MYSQL env: DB=MYSQL
- php: hhvm
env: DB=MYSQL
before_install:
before_script: before_script:

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