Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Use new class_description configuration #1272

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ class BaseElement extends DataObject implements CMSPreviewable
*
* @config
* @var string
* @deprecated 5.4.0 use class_description instead.
*/
private static $description = 'Base element class';

private static $class_description = 'Base element class';

/**
* List of fields to exclude from CMS SiteTree seatch
* @see ElementSiteTreeFilterSearch::applyDefaultFilters()
Expand Down Expand Up @@ -1140,18 +1143,14 @@ 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.
* @deprecated 5.3.0 Use i18n_classDescription() 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);
}
return '';
Deprecation::notice('5.3.0', 'Use i18n_classDescription() instead.');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was deprecated in 5.3.0 so keeping that version there, though the advice is now different.

return $this->i18n_classDescription() ?? '';
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/Models/ElementContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ class ElementContent extends BaseElement

private static $plural_name = 'content blocks';

/**
* @deprecated 5.4.0 use class_description instead.
*/
private static $description = 'HTML text block';

private static $class_description = 'HTML text block';

/**
* Re-title the HTML field to Content
*
Expand Down
Loading