-
Notifications
You must be signed in to change notification settings - Fork 67
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
DOC Document new class_description and deprecated DBEnum::flushCache() #626
DOC Document new class_description and deprecated DBEnum::flushCache() #626
Conversation
class Player extends DataObject | ||
{ | ||
private static $class_description = 'Sports ball player'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is theoretically the first docs that show how to create a DataObject
class so I'm adding best practice here.
I'm not adding it to all docs that show creating a DataObject
class because a) that's a lot of examples and b) it's not really relevant for most of them.
|
||
We've now implemented this concept in `DataObject` directly with the new [`DataObject.class_description`](api:SilverStripe\ORM\DataObject->class_description) configuration property. It is now considered best practice to add a description of `DataObject` subclasses using this configuration. You can use the new [`DataObject::classDescription()`](api:SilverStripe\ORM\DataObject::classDescription()) and [`DataObject::i18n_classDescription()`](api:SilverStripe\ORM\DataObject::i18n_classDescription()) methods if you need a description of any `DataObject` class. Those methods already existed on `SiteTree` but have been moved up the hierarchy so they can be called on any `DataObject` class. | ||
|
||
For now this is only used in the same places that used to use the deprecated configuration, but future minor releases are likely to broaden the scope of its usage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see it being used as a tooltip when hovering over elemental blocks in the "Add new block" list and added to the GridFieldAddNewMultiClass
component in gridfield extensions at the very least.
en/08_Changelogs/5.4.0.md
Outdated
|
||
As a part of this change, the [`SiteTree.description`](api:SilverStripe\CMS\Model\SiteTree->description) and [`BaseElement.description`](api:DNADesign\Elemental\Models\BaseElement->description) configuration properties are now deprecated. Use `class_description` instead. | ||
|
||
The `SilverStripe\CMS\Model\SiteTree.DESCRIPTION` localisation key (along with the `.DESCRIPTION` suffix for any `SiteTree` subclass) is also deprecated - use `SilverStripe\CMS\Model\SiteTree.CLASS_DESCRIPTION` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `SilverStripe\CMS\Model\SiteTree.DESCRIPTION` localisation key (along with the `.DESCRIPTION` suffix for any `SiteTree` subclass) is also deprecated - use `SilverStripe\CMS\Model\SiteTree.CLASS_DESCRIPTION` instead. |
We don't "deprecate" translation keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I literally did though, see the framework PR. The code in CMS 6 won't be using the old key, it'll be using a new key. So the old key is therefore deprecated.
We don't have a policy about how or when to deprecate those, sure. but SiteTree is such a high traffic class that it feels appropriate to give notice about this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree offline to remove the translation deprecation notices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't discuss the changelog in that discussion.
I'd like to still mention it in the changelog, though I'm okay with not using the word "deprecated".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to not use "deprecated" language
@@ -28,6 +28,8 @@ use SilverStripe\ORM\DataObject; | |||
|
|||
class Player extends DataObject | |||
{ | |||
private static $class_description = 'Sports ball player'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static $class_description = 'Sports ball player'; | |
private static $class_description = 'Sports player'; |
Sports ball player sounds a bit weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RIP joke.
Done.
90a85f3
to
bbb5448
Compare
bbb5448
to
5f0d4a1
Compare
Documents changes in silverstripe/silverstripe-framework#11461, silverstripe/silverstripe-cms#3023, and silverstripe/silverstripe-elemental#1272
Issue
SiteTree
inCMSMain
silverstripe-cms#2947