From 6eae67dbf10a9c91f942576a3850880b0555208d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 27 May 2016 13:07:22 +1200 Subject: [PATCH] Removed duplicate changelog (#5600) Introduced by https://github.com/silverstripe/silverstripe-framework/commit/75d9f6e58906c81fe44613a81d7e90bce65f03db Ported the additional Controller::doInit() references over the main changelog, and shortened them to avoid too much noise in the 4.0.0 changelog (already way too long!) --- docs/en/04_Changelogs/4.0.0.md | 1 + docs/en/changelogs/4.0.0.md | 98 ---------------------------------- 2 files changed, 1 insertion(+), 98 deletions(-) delete mode 100644 docs/en/changelogs/4.0.0.md diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 7d6546ea1..5721084e9 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -13,6 +13,7 @@ * `DataObject::db` now returns composite fields. * `DataObject::ClassName` field has been refactored into a `DBClassName` type field. * Image manipulations have been moved into a new `[api:ImageManipulation]` trait. + * `Controller::init` visibility changed to protected. Use `Controller::doInit()` instead. * `CMSFileAddController` removed. * `UploadField::setAllowedFileCategories('image')` now excludes non-resizeable images. 'unresizeable_image' is can be used to validate these types. diff --git a/docs/en/changelogs/4.0.0.md b/docs/en/changelogs/4.0.0.md deleted file mode 100644 index 488bfb7f3..000000000 --- a/docs/en/changelogs/4.0.0.md +++ /dev/null @@ -1,98 +0,0 @@ -# 4.0.0 (unreleased) - -## Overview - -### Framework - - * Deprecate `SQLQuery` in favour `SQLSelect` - * `DataList::filter` by null now internally generates "IS NULL" or "IS NOT NULL" conditions appropriately on queries - * `Controller::init` visibility changed to protected - * Initialising controllers now the responsibility of `Controller::doInit()` - * `handleRequest` - -## Upgrading - -### Update code that uses SQLQuery - -SQLQuery is still implemented, but now extends the new SQLSelect class and has some methods -deprecated. Previously this class was used for both selecting and deleting, but these -have been superceded by the specialised SQLSelect and SQLDelete classes. - -Take care for any code or functions which expect an object of type `SQLQuery`, as -these references should be replaced with `SQLSelect`. Legacy code which generates -`SQLQuery` can still communicate with new code that expects `SQLSelect` as it is a -subclass of `SQLSelect`, but the inverse is not true. - -### Update implementations of augmentSQL - -Since this method now takes a `SQLSelect` as a first parameter, existing code referencing the deprecated `SQLQuery` -type will raise a PHP error. - -E.g. - -Before: - - :::php - function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) { - $locale = Translatable::get_current_locale(); - if(!preg_match('/("|\'|`)Locale("|\'|`)/', implode(' ', $query->getWhere()))) { - $qry = sprintf('"Locale" = \'%s\'', Convert::raw2sql($locale)); - $query->addWhere($qry); - } - } - -After: - - :::php - function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) { - $locale = Translatable::get_current_locale(); - if(!preg_match('/("|\'|`)Locale("|\'|`)/', implode(' ', $query->getWhereParameterised($parameters)))) { - $query->addWhere(array( - '"Locale"' => $locale - )); - } - } - - -### Update to Controller initialisation - -`Controller::init` is now protected, so any overloaded instances of this method need to have their visibility changed to -`protected` - -Before: - - :::php - public function init() { - parent::init(); - - if (!Member::currentMemberID()) { - Security::permissionFailure($this); - } - } - -After: - - :::php - protected function init() { - parent::init(); - - if (!Member::currentMemberID()) { - Security::permissionFailure($this); - } - } - -Initialising controllers now need to be done with the `doInit` method. - -Before: - - :::php - - $controller = ModelAsController::controller_for(Page::get()->first()); - $controller->init(); - -After: - - :::php - - $controller = ModelAsController::controller_for(Page::get()->first()); - $controller->doInit(); \ No newline at end of file