diff --git a/docs/en/02_Developer_Guides/07_Debugging/03_Template_debugging.md b/docs/en/02_Developer_Guides/07_Debugging/03_Template_debugging.md index fe1cf8654..e637fd07b 100644 --- a/docs/en/02_Developer_Guides/07_Debugging/03_Template_debugging.md +++ b/docs/en/02_Developer_Guides/07_Debugging/03_Template_debugging.md @@ -10,7 +10,7 @@ to track down a template or two. The template engine can help you along by displ source code comments indicating which template is responsible for rendering each block of html on your page. - ::::yaml + :::yaml --- Only: environment: 'dev' diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 97251163f..ab03f5f57 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -267,6 +267,47 @@ instead, or if used in an actual XML file use `.CDATA` (see [template casting](/ Where your code once used SQLQuery you should now use SQLSelect in all cases, as this has been removed (check the [3.2.0](3.2.0) upgrading notes). +#### Upgrade code that uses UploadField + +This field has been superceded by a new class provided by the +[asset-admin](https://github.com/silverstripe/silverstripe-asset-admin) module, which provides a more +streamlined simpler mechanism for uploading File dataobjects. + +A helper service `FileHandleField` is provided to assist with dependency injection. Where the asset-admin +module is not installed this service will fall back to the `FileField` class instead. + +Usages of UploadField will need to be upgraded as below: + +3.x code + + + :::php + class MyClass extends DataObject { + public function getCMSFields() { + return new FieldList( + new UploadField('Files') + ); + } + } + + +4.x code + + + :::php + use SilverStripe\ORM\DataObject; + use SilverStripe\Forms\FieldList; + use SilverStripe\Forms\FileHandleField; + + class MyClass extends DataObject { + public function getCMSFields() { + return FieldList::create( + Injector::inst()->create(FileHandleField::class, 'Files') + ); + } + } + + #### Upgrade code that uses i18n In many cases, localisation strings which worked in 3.x will continue to work in 4.0, however certain patterns