mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
6f9d01f621
Renders into <span class="description"> instead of "title" attribute
5.2 KiB
5.2 KiB
3.1.0 (unreleased)
Overview
Upgrading
Grouped CMS Buttons
The CMS buttons are now grouped, in order to hide minor actions by default and declutter the interface.
This required changing the form field structure from a simple FieldList
to a FieldList
which contains a CompositeField
for all "major actions",
and a TabSet
with a single tab for all "minor actions".
If you have previously added, removed or altered built-in CMS actions in any way,
you'll need to adjust your code.
:::php
class MyPage extends Page {
function getCMSActions() {
$actions = parent::getCMSActions();
// Inserting a new toplevel action (old)
$actions->push(new FormAction('MyAction'));
// Inserting a new toplevel action (new)
$actions->insertAfter(new FormAction('MyAction'), 'MajorActions');
// Removing an action, both toplevel and nested (no change required)
$actions->removeByName('action_unpublish');
// Inserting a new minor action (new)
$actions->addFieldToTab(
'Root.ActionMenus.MoreOptions',
new FormAction('MyMinorAction')
);
// Finding a toplevel action (no change required)
$match = $actions->dataFieldByName('action_save');
// Finding a nested action (new)
$match = $actions->fieldByName('ActionMenus.MoreOptions')
->fieldByName('action_MyMinorAction');
return $actions;
}
}
Other
TableListField
,ComplexTableField
,TableField
,HasOneComplexTableField
,HasManyComplexTableField
andManyManyComplexTableField
have been removed from the core and placed into a module called "legacytablefields" located at https://github.com/silverstripe-labs/legacytablefieldsprototype.js
andbehaviour.js
have been removed from the core, they are no longer used. If you have custom code relying on these two libraries, please update your code to include the files yourselfObject::has_extension()
andObject::add_extension()
deprecated in favour of using late static binding, please use{class}::has_extension()
and{class}::add_extension()
instead, where {class} is the class name of your DataObject class.- Removed
SiteTree.MetaTitle
andSiteTree.MetaKeywords
since they are irrelevant in terms of SEO (1, 2) and general page informancy - Deprecated
Profiler
class, use third-party solutions like xhprof - Removed defunct or unnecessary debug GET parameters:
debug_profile
,debug_memory
,profile_trace
,debug_javascript
,debug_behaviour
- Removed
Member_ProfileForm
, useCMSProfileController
instead SiteTree::$nested_urls
enabled by default. To disable, callSiteTree::disable_nested_urls()
.- Removed CMS permission checks from
File->canEdit()
andFile->canDelete()
. If you have unsecured controllers relying on these permissions, please override them through aDataExtension
. - Moved email bounce handling to new "emailbouncehandler" module,
including
Email_BounceHandler
andEmail_BounceRecord
classes, as well as theMember->Bounced
property. - Deprecated global email methods
htmlEmail()
andplaintextEmail
, as well as various email helper methods likeencodeMultipart()
. Use theEmail
API, or theMailer
class where applicable. - Removed non-functional
$inlineImages
option for sending emails - Removed support for keyed arrays in
SelectionGroup
, use newSelectionGroup_Item
object to populate the list instead (see API docs). FormField->setDescription()
now renders in a<span class="description">
by default, rather than atitle
attribute * RemovedForm->Name()
: Use getName()- Removed
FormField->setContainerFieldSet()
: Use setContainerFieldList() - Removed
FormField->rootFieldSet()
: Use rootFieldList() - Removed
Group::map()
: Use DataList::("Group")->map() - Removed
Member->generateAutologinHash()
: Tokens are no longer saved directly into the database in plaintext. Use the return value of the Member::generateAutologinTokenAndHash to get the token - Removed
Member->sendInfo()
: use Member_ChangePasswordEmail or Member_ForgotPasswordEmail directly - Removed
SQLMap::map()
: Use DataList::("Member")->map() - Removed
SQLMap::mapInGroups()
: Use Member::map_in_groups() - Removed
PasswordEncryptor::register()/unregister()
: Use config system instead - Methods on DataList and ArrayList that used to both modify the existing list & return a new version now just return a new version. Make sure you change statements like
$list->filter(...)
to $list = $list->filter(...)
for these methods:ArrayList#reverse
ArrayList#sort
ArrayList#filter
ArrayList#exclude
DataList#where
DataList#limit
DataList#sort
DataList#addFilter
DataList#applyFilterContext
DataList#innerJoin
DataList#leftJoin
DataList#find
DataList#byIDs
DataList#reverse
DataList#dataQuery
has been changed to return a clone of the query, and so can't be used to modify the list's query directly. UseDataList#alterDataQuery
instead to modify dataQuery in a safe manner.