Upgrading to SilverStripe 2.3.0

Changelog

Translatable Problems

Don't use Translatable for multilingual database content. Don't upgrade to 2.3.0 if you're already using Translatable.

The Translatable extension is currently marked as unstable for the initial 2.3 release. If your site uses more than one language for page content, don't upgrade to this release. We're working on bugfixes which will be contained in a minor 2.3.x release soon. Check our release announcements for updates on Translatable bugfixes.

Notable feature changes

BasicAuth disabled on test sites by default

Basic auth isn't enabled by default on test sites. If you need this, put this in your _config.php

if(Director::isTest()) BasicAuth::enable();

/silverstripe and /cms no longer work as aliases to /admin

Removed certain URL aliases for CMS interface to allow for common page URLs like “silverstripe” or “cms”. Please use /admin as the main URL to access the CMS. See http://open.silverstripe.com/ticket/3267

SiteTree Access tab now lets you select multiple groups

In order to do this, SiteTree→ViewersGroup and SiteTree→EditorsGroup have been changed from has_one relations to many_many relations.

Your group-assignements for “Who can view this page” and “Who can edit this page” should be automatically migrated upon calling dev/build. See #2847

Core features that have been moved into modules

In order to keep the core CMS and framework nice and lean, we have moved a number of features into modules. By doing this, we have less code that the core team needs to keep stable, and we have more scope for bringing on contributors to help out with a single module.

For best results, please download and install all the modules that your make use of before running dev/build.

Newsletter

Newsletter functionality has been moved into its own module called newsletter. If you were previously using this as a feature out of the box with SilverStripe, then you will need to download the userforms module to continue using it.

If you don't require the functionality, it's safe to delete these database tables:

  • Newsletter
  • NewsletterType
  • SubscribeForm
  • UnsubscribeRecord

auth_openid

The auth_openid module has been removed from default installation. Please install the module separately from silverstripe.org

GenericDataAdmin and RelatedDataEditor

GenericDataAdmin functionality has been moved into its own module called genericdataadmin. If you were previously using this as a feature out of the box with SilverStripe, then you will need to download this module to continue using it.

User Defined Form

User Defined Form has been moved into its own module called userforms. If you were previously using this as a feature out of the box with SilverStripe, then you will need to download the userforms module to continue using it.

Important note: If you do have an existing page of User Defined Form type in your CMS site tree, it's best to install the module first as shown above. If you run dev/build?flush=1 without installing userforms, you'll lose the User Defined Form page type until you install it then run dev/build?flush=1.

If you don't require the User Defined Form functionality, it's safe to delete these database tables:

  • EditableCheckbox
  • EditableCheckboxOption
  • EditableDropdownOption
  • EditableEmailField
  • EditableFileField
  • EditableFormField
  • EditableMemberListField
  • EditableRadioOption
  • EditableTextField
  • SubmittedFileField
  • SubmittedForm
  • SubmittedFormField
  • UserDefinedForm
  • UserDefinedForm_Live
  • UserDefinedForm_versions

PostBackup

PostBackup has been moved into a module. See postbackup module.

Changes to Developer tools

These are not strictly end-user features, but developer tools that you may have been familiar with.

/db/build/?flush=1 is now called /dev/build

Flushing the manifest with ?flush=1 doesn't need to be explicitly added.

Other

API Changes

We have made a number of changes to the developer APIs, for example in situations where we had duplicate implementations of functionality. If you use any of the methods or classes listed below, you will need to change your code as instructed.

Core

  • Removed ViewableData→setVal(), use ViewableData→setValue() ===
  • Removed Director::isLiveMode(), use Director::isLive() ===
  • Removed DataObjectSet→append(), use DataObjectSet→push() or DataObjectSet→merge()
  • Removed Controller→LinkTo(), use Controller→join_links()
  • Removed DataObject→getLastWriteFields(), use DataObject→getChangedFields()
  • Removed Convert::raw2attr(), use Convert::raw2att()
  • Removed Member→isAdmin(), use Permission::check('ADMIN')
  • Removed Debug::warning(), use user_error(“your message”, E_USER_WARNING)
  • Removed SiteTree→canView_page(), Use instance-specific SiteTree→canView() instead by checking for $this→ID.

Director::addRules()

If you have made your own custom director rules with Director::addRules, you will need to add a double-slash into the rule, to separate the part of the URL that specifies “this is how I get to this controller” from the part that specifies “these are arguments to the controller”.

In other words, change this:

Director::addRules(50, array(
	'admin/ImageEditor/$Action' => 'ImageEditor',
));

To this:

Director::addRules(50, array(
	'admin/ImageEditor//$Action' => 'ImageEditor',
));

Decorators

  • Renamed DataObjectDecorator→extraDBFields() to extraStatics() (see r65065)
  • DataObjectDecorator→updateCMSFields() is now called from DataObject→getCMSFields(), instead of only SiteTree instances
  • Changed return values for DataObjectDecorator→updateCMSActions() to FieldSet, rather than an array.

Data Model

  • Removed Datetime class, use SSDatetime instead (it was conflicting with PHP 5.2 integrated classes)
  • Removed Text→Att(), use Text→ATT_val() instead

Forms

  • Removed NoScriptField, use LiteralField
  • Removed EncryptField, use PasswordField
  • Removed NamedLabelField, use LabelField
  • Removed NoScriptFormAction, use unobtrusive scripting
  • Removed FormField→setExtraClass(), use FormField→addExtraClass()
  • Removed deprecated ComplexRequiredFields, RequiredFields and custom javascript instead
  • If you have created your own FormField classes, FormField::performReadonlyTransformation() and FormField::performDisabledTransformation() must return new form fields, e.g., cloned instances, or unit tests will fail.

Templates

  • '$Top' in templates has changed its behaviour; if you call $Top from inside a template that is rendered separately (eg, a Form template), it will point to the top element of that template execution (in this case, the Form object) rather than the top element of the outermost template (which would presumably be the page in question). This was a bug that we have fixed, but some people may rely on it. See http://open.silverstripe.com/ticket/2781
  • A <legend> element has been added before any <fieldset> in all SilverStripe forms. SearchForm.ss and Form.ss are where it has been added. This now validates the form HTML for W3C compliance. Please verify that your forms visually look okay after upgrading. Legend can be set by calling →setLegend('my legend here') on your Form object.

CMS menu API

We have deprecated the LeftAndMain menu customisation API.

  • Don't set any menu-item static variables any more.
  • For the most part, you won't need to add anything to _config.php to add CMS menu items; just define the static variables $menu_title and $url_segment on your LeftAndMain subclasses.
  • If you want to add a menu item that's not a subclass of LeftAndMain (eg, help or a link to a webstats package), use CMSMenu::add_menu_item()
  • To remove a menu item, use CMSMenu::remove_menu_item(). It identifies items by classname rather than arbitrary $code value.

ContentNegotatior is now disabled by default, mostly

The ContentNegotatior system was a bit of voodoo that confused a lot of people, so we have disabled it by default for regular templates. It will still enabled by default for templates that include the <?xml ?> header, because these are the only templates that benefit from it significantly.

If you want to enable it for your HTML4 templates, then you can do so by calling ContentNegotiator::enable(). Note also that the DOCTYPE altering, which was a frequent cause of pain, only executes if your original template had the <?xml ?> header.

Other

  • Removed deprecated File::loadallcontent(), use Upload class
  • Image→URL returns relative instead of absolute URL. Use Image→AbsoluteURL instead.
  • Moved DataReport and SQLReport into the ecommerce module. If you're using these classes, please download the ecommerce module.

Other notes

These changes shouldn't necessitate any changes to your site when you upgrade, but you might want to be aware of them.

Default mysite/_config.php

The installer includes a default configuration file: mysite/_config.php. If you have already have your own mysite/_config.php, you can safely keep your own version and disregard the new file.

Default validators for Form instances (PHP and JavaScript)

Enforcing usage of a Validator instance in Forms if its not explicitly passed to the Form constructor. By default a new RequiredField instance is used without any fields marked as required. This was necessary because some FormField implementations rely on their validate() method, sometimes as a wrongly placed processing hook, but mostly for security reasons. One example are file extension checks in FileField subclasses. In most cases this won't have any effect on existing forms, although you might get additional JavaScript dependencies like Validator.js and behaviour.js. If you want to disable JavaScript validation across forms, add the following to your _config.php:

Validator::set_javascript_validation_handler('none');

See http://open.silverstripe.com/changeset/69688

 
upgrading/2.3.0.txt · Last modified: 2010/05/05 23:38 (external edit)

Please use comments for notes, tips and corrections about the described functionality.
Use the Silverstripe Forum to ask questions.

blog comments powered by Disqus
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Creative Commons LicenseSilverStripe Documentation by SilverStripe is licensed under a Creative Commons Attribution 3.0 New Zealand License.
Based on a work at doc.silverstripe.com
Recent changes RSS feed Driven by DokuWiki