Bugfix: Don't assume all forms have a URLSegment field

This commit is contained in:
Mike Cochrane 2017-12-14 14:17:30 +13:00 committed by GitHub
parent 33622c440b
commit 157db89dbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,9 @@ class SiteTreeSubsites extends DataExtension
}
$urlsegment = $fields->dataFieldByName('URLSegment');
$urlsegment->setURLPrefix($baseLink);
if ($urlsegment) {
$urlsegment->setURLPrefix($baseLink);
}
}
}