mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Require subsite title (fixes #26)
This commit is contained in:
parent
6a9003e8df
commit
b49c86bd0b
@ -143,6 +143,15 @@ class Subsite extends DataObject implements PermissionProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function validate() {
|
||||||
|
$result = parent::validate();
|
||||||
|
if(!$this->Title) {
|
||||||
|
$result->error(_t('Subsite.ValidateTitle', 'Please add a "Title"'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whenever a Subsite is written, rewrite the hostmap
|
* Whenever a Subsite is written, rewrite the hostmap
|
||||||
*
|
*
|
||||||
|
@ -200,7 +200,9 @@ class SubsiteTest extends BaseSubsiteTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function createSubsiteWithDomains($domains) {
|
protected function createSubsiteWithDomains($domains) {
|
||||||
$subsite = new Subsite();
|
$subsite = new Subsite(array(
|
||||||
|
'Title' => 'My Subsite'
|
||||||
|
));
|
||||||
$subsite->write();
|
$subsite->write();
|
||||||
foreach($domains as $domainStr => $isPrimary) {
|
foreach($domains as $domainStr => $isPrimary) {
|
||||||
$domain = new SubsiteDomain(array(
|
$domain = new SubsiteDomain(array(
|
||||||
|
Loading…
Reference in New Issue
Block a user