diff --git a/src/Models/BaseElement.php b/src/Models/BaseElement.php index e1078558..1b71d05b 100644 --- a/src/Models/BaseElement.php +++ b/src/Models/BaseElement.php @@ -34,6 +34,7 @@ use SilverStripe\View\Requirements; use SilverStripe\ORM\CMSPreviewable; use SilverStripe\Core\Config\Config; +use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\DataObjectSchema; /** @@ -553,7 +554,7 @@ public function getContentForCmsSearch(): string } // Allow projects to update contents of third-party elements. $this->extend('updateContentForCmsSearch', $contents); - + // Use |#| to delimit different fields rather than space so that you don't // accidentally join results of two columns that are next to each other in a table $content = implode('|#|', array_filter($contents)); @@ -1142,10 +1143,13 @@ public function getIcon() /** * Get a description for this content element, if available * + * @deprecated 5.3.0 Use the description configuration property and localisation API directly instead. + * * @return string */ public function getDescription() { + Deprecation::notice('5.3.0', 'Use getTypeNice() or the description configuration property directly instead.'); $description = $this->config()->uninherited('description'); if ($description) { return _t(__CLASS__ . '.Description', $description); @@ -1161,7 +1165,7 @@ public function getDescription() */ public function getTypeNice() { - $description = $this->getDescription(); + $description = Deprecation::withNoReplacement(fn () => $this->getDescription()); $desc = ($description) ? ' — ' . $description . '' : ''; return DBField::create_field(