@@ -136,6 +136,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
136
136
* Used as a cache for `SiteTree::allowedChildren()`
137
137
* Drastically reduces admin page load when there are a lot of page types
138
138
* @var array
139
+ * @deprecated 5.4.0 will be moved to SilverStripe\ORM\Hierarchy\Hierarchy->cache_allowedChildren
139
140
*/
140
141
protected static $ _allowedChildren = [];
141
142
@@ -419,6 +420,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
419
420
*
420
421
* @config
421
422
* @var string
423
+ * @deprecated 5.4.0 use class_description instead.
422
424
*/
423
425
private static $ description = null ;
424
426
@@ -431,9 +433,15 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
431
433
*
432
434
* @config
433
435
* @var string
436
+ * @deprecated 5.4.0 use base_class_description instead.
434
437
*/
435
438
private static $ base_description = 'Generic content page ' ;
436
439
440
+ /**
441
+ * Description for Page and SiteTree classes, but not inherited by subclasses.
442
+ */
443
+ private static string $ base_class_description = 'Generic content page ' ;
444
+
437
445
/**
438
446
* @var array
439
447
*/
@@ -3248,25 +3256,22 @@ public function getPageIconURL()
3248
3256
*/
3249
3257
public function classDescription ()
3250
3258
{
3259
+ // Ensure base class has an appropriate description if not explicitly set,
3260
+ // since we can't set that config for projects.
3251
3261
$ base = in_array (static ::class, [Page::class, SiteTree::class]);
3252
3262
if ($ base ) {
3253
- return $ this ->config ()->get ('base_description ' );
3263
+ $ baseDescription = static ::config ()->get ('base_class_description ' );
3264
+ if (!$ baseDescription ) {
3265
+ $ baseDescription = static ::config ('base_description ' );
3266
+ }
3267
+ return $ baseDescription ;
3254
3268
}
3255
- return $ this ->config ()->get ('description ' );
3256
- }
3257
-
3258
- /**
3259
- * Get localised description for this page
3260
- *
3261
- * @return string|null
3262
- */
3263
- public function i18n_classDescription ()
3264
- {
3265
- $ description = $ this ->classDescription ();
3266
- if ($ description ) {
3267
- return _t (static ::class.'.DESCRIPTION ' , $ description );
3269
+ // Fall back to the deprecated config
3270
+ $ description = static ::config ()->get ('class_description ' , Config::UNINHERITED );
3271
+ if (!$ description ) {
3272
+ $ description = static ::config ()->get ('description ' );
3268
3273
}
3269
- return null ;
3274
+ return $ description ;
3270
3275
}
3271
3276
3272
3277
/**
0 commit comments