mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Upgrading docs on new APIs in Versioned
This commit is contained in:
parent
7351caf487
commit
28255b79eb
@ -3,6 +3,7 @@
|
|||||||
## Overview {#overview}
|
## Overview {#overview}
|
||||||
|
|
||||||
* Disable session-based stage setting in `Versioned` (see [#1578](https://github.com/silverstripe/silverstripe-cms/issues/1578))
|
* Disable session-based stage setting in `Versioned` (see [#1578](https://github.com/silverstripe/silverstripe-cms/issues/1578))
|
||||||
|
* Deprecated `FunctionalTest::useDraftSite()`. You should use querystring args instead for setting stage.
|
||||||
|
|
||||||
## Upgrading {#upgrading}
|
## Upgrading {#upgrading}
|
||||||
|
|
||||||
@ -38,3 +39,24 @@ SilverStripe\Versioned\Versioned:
|
|||||||
|
|
||||||
Check our [versioning docs](/developer_guides/model/versioning#controllers)
|
Check our [versioning docs](/developer_guides/model/versioning#controllers)
|
||||||
for more details.
|
for more details.
|
||||||
|
|
||||||
|
### New Versioned API
|
||||||
|
|
||||||
|
The following methods have been added to [api:SilverStripe\Versioned\Versioned] class:
|
||||||
|
|
||||||
|
* `withVersionedMode()` Allows users to execute a closure which may internally modify
|
||||||
|
the current stage, but will guarantee these changes are reverted safely on return.
|
||||||
|
Helpful when temporarily performing a task in another stage or view mode.
|
||||||
|
* `get_draft_site_secured()` / `set_draft_site_secured()` Enables the explicit toggle
|
||||||
|
of draft site security. By setting this to false, you can expose a draft mode to
|
||||||
|
unauthenticated users. Replaces `unsecuredDraftSite` session var.
|
||||||
|
* `get_default_reading_mode()` / `set_default_reading_mode()` The default reading
|
||||||
|
mode is now configurable. Any non-default reading mode must have querystring args
|
||||||
|
to be visible. This will be the mode choosen for requests that do not have these args.
|
||||||
|
Note that the default mode for CMS is now draft, but is live on the frontend.
|
||||||
|
|
||||||
|
A new class [api:SilverStripe\Versioned\ReadingMode] has also been added to assist with
|
||||||
|
conversion of the reading mode between:
|
||||||
|
- Reading mode string
|
||||||
|
- DataQuery parameters
|
||||||
|
- Querystring parameters
|
||||||
|
Loading…
Reference in New Issue
Block a user