Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

 

Three is a charm: SilverStripe 4.0.0 alpha 3 released!

This update brings a lot more polish and feature completion to many of the new major features in SilverStripe 4

Read post

This update brings a lot more polish and feature completion to many of the new major features in SilverStripe 4. Also included are several bugfixes and stability enhancements, as well as implementation of user feedback received between now and the last alpha. We expect that this release will be a lot more user friendly.

React Forms Feature Enrichment

Enhancements to react forms in both the campaigns and asset-admin sections brings feature completion up to a similar level of traditional silverstripe forms. Form validation and error checking has been implemented at both the server and the client, with new schema enhancements designed to allow business logic to be applied at every level.

In addition, a new experimental FormFactory API has been implemented within the new assets section, with the intent to decouple form scaffolding from the legacy getCMSFields behaviour within DataObjects. We would love feedback on how our users feel about the shape of this API, so that we can iron out any issues or weaknesses before extending this to the rest of the CMS.

Much improved CMS responsive behaviour

The CMS now behaves a lot more like an adult, with less reliance on javascript for on-the-fly resizing, and more reliance on flexbox and bootstrap. This ensures a much better user experience on portable devices, and much more fluid interaction on the desktop.

Humanised Versioning

In response to feedback from the initial rewrite of versioning, we've gone back to look at ways we can make the behaviour of versioned objects act more predictably.

We've removed the concept of separate but equal stages, and introduced the concept of draft as the "source of truth" for all versioned records. Even when creating or modifying records on the live stage, these changes will be written back to draft to ensure these changes are present in the CMS.

We've also improved the presentation of deletion and archive terminology around the CMS. Where archiving a page would remove it from draft and also remove it from the live site, the archive action will be called "Unpublish and Archive". This is different to where draft-only pages would have an "Archive" action instead. "Delete from draft" has, for the time being, been removed because of the concept above.

Many Many Many Enhancements

Many-many database relationships now support mapping tables backed by concrete DataObject classes. When declaring many_many, you can now use a brand new syntax to apply your mapping class.


class Restaurant extends DataObject { private static $many_many = [ 'Reviewers' => [ 'through' => 'Review', 'from' => 'Restaurant', 'to' => 'Reviewer', ] ]; } class Person extends DataObject { private static $belongs_many_many = [ 'Reviewed' => 'Restaurant.Reviewers', ]; } class Review extends DataObject { private static $db = [ 'Rating' => 'Int', ]; private static $has_one = [ 'Restaurant' => 'Restaurant', 'Reviewer' => 'Person' ]; }

Setup your class with two has_one relations pointing to either end of your many_many relation, and simply declare this class and the names of these relationships in the parent.

This feature allows the user of other SilverStripe core functionality to be applied to the mapping table, as well as the relationship itself, such as versioning and ownership. No more having to declare many_many_extraFields!

Breaking the build

As with other major version alpha releases, this includes breaking changes that will require upgrade of user code, not only to update references to renamed or namespaced classes, but also to business logic, which relies on framework behaviour.

For information on how this release could affect you, please read the updated 4.0.0 upgrade guide at https://docs.silverstripe.org/en/4.0/changelogs/4.0.0/

Plans for the next alpha

There are many "not for disclosure" secrets we are planning for the next release. I could tell you about drag-drop support for files, rework of our i18n API, improved form and model validation, removing the old Object class, and the splitting out of the admin module (and maybe a few others). However, I'm not allowed, and thus will keep these a tight secret.

Another major secret, which you should certainly not read about and recommend to your friends, is plans to introduce GraphQL as a core feature and the standard solution to restful based services, which you certainly didn’t hear about in this blog post.

 

About the author
Damian Mooyman

Damian is a developer who has been stuck into SilverStripe for a few years, and a part of the company for a while too. He’ll be around on github under the handle @tractorcow if you need him.

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments

Like what you have read?

Sign up for our weekly blog digest sent to your inbox.

Subscribe