mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
* FIX: Fixes #2110 added default Title value for saved pages. * FIX: Fixes #2110 fixed linting and unit test failure * BUG Rename default wording for untitled page
This commit is contained in:
parent
d4571d927d
commit
0b56a563c0
@ -1559,6 +1559,15 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
$this->URLSegment = "page-$this->ID";
|
$this->URLSegment = "page-$this->ID";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// need to set the default values of a page e.g."Untitled [Page type]"
|
||||||
|
if (empty($this->Title)) {
|
||||||
|
$this->Title = _t(
|
||||||
|
'SilverStripe\\CMS\\Model\\SiteTree.UNTITLED',
|
||||||
|
'Untitled {pagetype}',
|
||||||
|
['pagetype' => $this->i18n_singular_name()]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
// Ensure that this object has a non-conflicting URLSegment value.
|
// Ensure that this object has a non-conflicting URLSegment value.
|
||||||
$count = 2;
|
$count = 2;
|
||||||
|
@ -222,7 +222,7 @@ class SiteTreeTest extends SapphireTest
|
|||||||
$obj->write();
|
$obj->write();
|
||||||
$this->assertTrue($obj->publishRecursive());
|
$this->assertTrue($obj->publishRecursive());
|
||||||
|
|
||||||
$this->assertNull(DB::query("SELECT \"Title\" FROM \"SiteTree_Live\" WHERE \"ID\" = '$obj->ID'")->value());
|
$this->assertNotNull(DB::query("SELECT \"Title\" FROM \"SiteTree_Live\" WHERE \"ID\" = '$obj->ID'")->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testParentNodeCachedInMemory()
|
public function testParentNodeCachedInMemory()
|
||||||
|
Loading…
Reference in New Issue
Block a user