From b4669ad1bb06228c4d5b79890ee9beafa3be8bbe Mon Sep 17 00:00:00 2001 From: Serge Latyntcev Date: Mon, 22 Jun 2020 16:17:14 +1200 Subject: [PATCH 01/10] FIX 4.6 regression in the TempDatabase reset schema logic --- src/ORM/Connect/TempDatabase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ORM/Connect/TempDatabase.php b/src/ORM/Connect/TempDatabase.php index 46c38d930..4a5a30b5a 100644 --- a/src/ORM/Connect/TempDatabase.php +++ b/src/ORM/Connect/TempDatabase.php @@ -319,6 +319,8 @@ class TempDatabase $this->kill(); $this->build(); $this->rebuildTables($extraDataObjects); + + $this->skippedException = null; } } } From 658ca4deb17f9a16affae041ba1e2e13b0658200 Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Thu, 25 Jun 2020 12:09:28 +1200 Subject: [PATCH 02/10] MINOR: Add noindex metatag to debugview --- src/Dev/DebugView.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Dev/DebugView.php b/src/Dev/DebugView.php index 24200bf8e..a87f49b71 100644 --- a/src/Dev/DebugView.php +++ b/src/Dev/DebugView.php @@ -223,6 +223,7 @@ class DebugView ->resolveURL('silverstripe/framework:client/styles/debug.css'); $output = '' . $url . ''; $output .= ''; + $output .= ''; $output .= ''; $output .= ''; From 35d31919f2c68781b857488d9bb6aeae97d1fb54 Mon Sep 17 00:00:00 2001 From: Garion Herman Date: Thu, 25 Jun 2020 15:05:13 +1200 Subject: [PATCH 03/10] DOCS Expand upgrade notes for Insert Media modal in 4.6.0 release --- docs/en/04_Changelogs/4.6.0.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/en/04_Changelogs/4.6.0.md b/docs/en/04_Changelogs/4.6.0.md index bb90ac113..7fa33c7ea 100644 --- a/docs/en/04_Changelogs/4.6.0.md +++ b/docs/en/04_Changelogs/4.6.0.md @@ -56,18 +56,28 @@ class MyDataObject extends DataObject } ``` -## Editing files directly in the insert-media modal{#in-modal-editing} +## Editing files directly in the Insert Media modal {#in-modal-editing} -Editors can now directly edit file details when selecting a file in an UploadField or when inserting media in a -HTMLEditorField. The "image placement" and "file link" forms that show when inserting an image or a link in an -HTMLEditorField have been simplified. +Authors can now directly edit file details when selecting a file in an +`UploadField` or when inserting media in a `HTMLEditorField`. The "image +placement" and "file link" forms that show when inserting an image or a link in +an `HTMLEditorField` have been simplified. -This does mean that the order and structure of fields have changed somewhat. If you have customised the forms in the -asset administration area or in the "Insert Media Modal", you should do some regression testing when upgrading to -make sure your customisations still work as expected. +If you have customised the fields in the asset administration UI or Insert Media +modal, you will need to do some regression testing when upgrading, and will +likely need to make some minor adjustments to your code. -If your project uses the popular [jonom/focuspoint](https://github.com/jonom/silverstripe-focuspoint) community -module, you should upgrade it as well. +Implementing the new Edit Details UI required filtering the fields generated in +`File::getCMSFields()` into two `Form`s. The implementation in 4.6.0 does not +expose a clear API to custom fields for differentiating between the `Form`s, and +by default any fields added via an extension will appear in both views. For the +time being, a simple way to resolve this is to check for the presence of the +`Editor.Details.Title` field and add your field based on this. See the community +module [jonom/focuspoint](https://github.com/jonom/silverstripe-focuspoint/pull/78/files#diff-cc697eb8345aa25a5f88c89d1a87ff6aR27-R34) +for an example implementation, and ensure you update this module during your +upgrade to 4.6.0 if you have it installed. + +We intend to improve this pattern in a future release of Silverstripe CMS. ## MIME Type validation now a core module {#mime-validator} From 2931ce20ef6415151486a7fa54a485fa755411a5 Mon Sep 17 00:00:00 2001 From: Garion Herman Date: Thu, 25 Jun 2020 15:05:38 +1200 Subject: [PATCH 04/10] DOCS Tidy up formatting / spelling in 4.6.0 changelog --- docs/en/04_Changelogs/4.6.0.md | 47 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/docs/en/04_Changelogs/4.6.0.md b/docs/en/04_Changelogs/4.6.0.md index 7fa33c7ea..4b37689cc 100644 --- a/docs/en/04_Changelogs/4.6.0.md +++ b/docs/en/04_Changelogs/4.6.0.md @@ -9,40 +9,38 @@ ## MySQL tables are auto-converted from MyISAM to InnoDB {#myisam} Beginning with [4.4.0](https://docs.silverstripe.org/en/4/changelogs/4.4.0/), -our minimum requirement for MySQL is 5.6 (since MySQL 5.5 end of life reached in December 2018). -Starting with MySQL 5.6, [InnoDB](https://dev.mysql.com/doc/refman/5.6/en/innodb-introduction.html) -is the new default storage engine, -replacing the older [MyISAM](https://dev.mysql.com/doc/refman/5.6/en/myisam-storage-engine.html) engine. +our minimum requirement for MySQL is 5.6 (since MySQL 5.5 end of life reached in +December 2018). Starting with MySQL 5.6, [InnoDB](https://dev.mysql.com/doc/refman/5.6/en/innodb-introduction.html) +is the new default storage engine, replacing the older [MyISAM](https://dev.mysql.com/doc/refman/5.6/en/myisam-storage-engine.html) +engine. -Silverstripe CMS already creates InnoDB tables by default, -mainly in order to benefit from their better support for database transactions. -Before MySQL 5.6, InnoDB didn't have a `FULLTEXT` search index, -requiring us to enforce the MyISAM engine when devs opted into this index type -in their particular setup. There are a few ways in which this opt-in can happen: +Silverstripe CMS already creates InnoDB tables by default, mainly in order to +benefit from their better support for database transactions. Before MySQL 5.6, +InnoDB didn't have a `FULLTEXT` search index, requiring us to enforce the MyISAM +engine when devs opted into this index type in their particular setup. There are +a few ways in which this opt-in can happen: * Adding the [FulltextSearchable](https://github.com/silverstripe/silverstripe-framework/blob/4/src/ORM/Search/FulltextSearchable.php) - extension to a DataObject, as described in our - [search docs](https://docs.silverstripe.org/en/4/developer_guides/search/fulltextsearch/) + extension to a DataObject, as described in our [search docs](https://docs.silverstripe.org/en/4/developer_guides/search/fulltextsearch/) * Defining `'type' => 'fulltext'` in `DataObject::$db` column definitions * Implementing [DBIndexable](https://github.com/silverstripe/silverstripe-framework/blob/4/src/ORM/FieldType/DBIndexable.php) on a custom `DBField` subclass. * Setting `'ENGINE=MyISAM'` in `DataObject::$create_table_options` -This search index is not required to enable simple text search -in the "Pages" section of the CMS, or any ModelAdmin implementations. -We generally recommend to choose a more powerful -[search addon](https://addons.silverstripe.org/add-ons?search=fulltext&type=&sort=downloads) +This search index is not required to enable simple text search in the "Pages" +section of the CMS, or any ModelAdmin implementations. We generally recommend +choosing a more powerful [search addon](https://addons.silverstripe.org/add-ons?search=fulltext&type=&sort=downloads) (e.g. based on Solr or ElasticSearch) for website frontend search use cases. As of 4.6.0, a `dev/build` will automatically switch MyISAM tables to InnoDB, which automatically recreates any indexes required. If you have large indexes, -this can extend the duration if this task. As usual, back up your database -before upgrading, and test upgrades on non-production systems first. -Our tests indicate that indexes with thousands of records and screen pages -worth of content (15MB index size) are converted in a few seconds. +this can extend the duration of this task. As usual, back up your database +before upgrading, and test upgrades on non-production systems first. Our tests +indicate that indexes with thousands of records and screen pages worth of +content (15MB index size) are converted in a few seconds. -In order to opt out of this change, you can set the engine explicitly -for your DataObject implementations: +In order to opt out of this change, you can set the engine explicitly for your +DataObject implementations: ```php use SilverStripe\ORM\Connect\MySQLSchemaManager; @@ -81,9 +79,12 @@ We intend to improve this pattern in a future release of Silverstripe CMS. ## MIME Type validation now a core module {#mime-validator} -`silverstripe/mimevalidator` is now a core module and will ship by default on new projects. Projects referencing `silverstripe/recipe-core` will automatically install `silverstripe/mimevalidator` when they upgrade to 4.6.0. +`silverstripe/mimevalidator` is now a core module and will ship by default on +new projects. Projects referencing `silverstripe/recipe-core` will automatically +install `silverstripe/mimevalidator` when they upgrade to 4.6.0. -Read [Allowed file types](Developer_Guides/Files/Allowed_file_types) in the Silverstripe CMS doc for all the details. +Read [Allowed file types](Developer_Guides/Files/Allowed_file_types) in the +Silverstripe CMS doc for all the details. From b62288cc92bd7e58182e1b02b083eeb474366d52 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Thu, 17 Oct 2019 13:03:04 +1300 Subject: [PATCH 05/10] BUG Disabled the UpgradeBootstrap upgrader doctor task --- .upgrade.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.upgrade.yml b/.upgrade.yml index a2d4baa0e..8e9407635 100644 --- a/.upgrade.yml +++ b/.upgrade.yml @@ -952,8 +952,6 @@ skipConfigs: excludedPaths: - '*fixtures*' - '*vendor*' -doctorTasks: - SilverStripe\Dev\Upgrade\UpgradeBootstrap: src/Dev/Upgrade/UpgradeBootstrap.php warnings: classes: 'Object': From ec83959f2c3ff7784fdd9503601732b5d006de13 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Tue, 30 Jun 2020 21:35:51 +1200 Subject: [PATCH 06/10] API Remove UpgradeBootstrap (not part of our official API) --- src/Dev/Upgrade/UpgradeBootstrap.php | 94 ---------------------------- 1 file changed, 94 deletions(-) delete mode 100644 src/Dev/Upgrade/UpgradeBootstrap.php diff --git a/src/Dev/Upgrade/UpgradeBootstrap.php b/src/Dev/Upgrade/UpgradeBootstrap.php deleted file mode 100644 index 101fe987a..000000000 --- a/src/Dev/Upgrade/UpgradeBootstrap.php +++ /dev/null @@ -1,94 +0,0 @@ - true, - 'index.php' => true, - 'install.php' => false, - ]; - - /** - * @param InputInterface $input - * @param OutputInterface $output - * @param $basePath - */ - public function __invoke(InputInterface $input, OutputInterface $output, $basePath) - { - $publicPath = file_exists("{$basePath}/public") ? "{$basePath}/public" : $basePath; - - // Fail if destination isn't writable - $this->ensureWritable($publicPath); - - // Check source - $source = $basePath . '/vendor/silverstripe/recipe-core/public'; - if (!is_dir($source)) { - throw new BadMethodCallException("silverstripe/recipe-core is not installed."); - } - - // Copy scaffolded files from recipe-core - $output->writeln("Upgrading project bootstrapping files:"); - foreach ($this->files as $file => $canCreate) { - $fileSource = $source . '/' . $file; - $fileDest = $publicPath . '/' . $file; - - // Skip if we should only upgrade existing files - if (!$canCreate && !file_exists($fileDest)) { - continue; - } - $output->writeln(" - Upgrading {$file}"); - $this->copyFile( - $fileSource, - $fileDest - ); - } - } - - /** - * Ensure path is writable - * - * @param string $path - */ - protected function ensureWritable($path) - { - if (!is_writable($path)) { - throw new BadMethodCallException("Path $path is not writable"); - } - } - - /** - * Copy file - * - * @param string $source - * @param string $dest - */ - protected function copyFile($source, $dest) - { - // Ensure existing file can be overwritten - if (file_exists($dest)) { - $this->ensureWritable($dest); - } - file_put_contents($dest, file_get_contents($source)); - } -} From e40c01221071d2d2bef8863c5d130a1d02c2b1e1 Mon Sep 17 00:00:00 2001 From: Serge Latyntcev Date: Mon, 6 Jul 2020 09:58:43 +1200 Subject: [PATCH 07/10] DOC Add Regressions to 4.6.0 changelog --- docs/en/04_Changelogs/4.6.0.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/en/04_Changelogs/4.6.0.md b/docs/en/04_Changelogs/4.6.0.md index 4b37689cc..0aad5c6b3 100644 --- a/docs/en/04_Changelogs/4.6.0.md +++ b/docs/en/04_Changelogs/4.6.0.md @@ -86,6 +86,12 @@ install `silverstripe/mimevalidator` when they upgrade to 4.6.0. Read [Allowed file types](Developer_Guides/Files/Allowed_file_types) in the Silverstripe CMS doc for all the details. + +## Regressions + + - [File section, icons broken until page is refreshed](https://github.com/silverstripe/silverstripe-admin/issues/1064) + + From 12a4c006e7b1460f7e0fac1aff16beb591e666a2 Mon Sep 17 00:00:00 2001 From: Bryn Whyman Date: Wed, 8 Jul 2020 13:22:36 +1200 Subject: [PATCH 08/10] DOCS add note to changelog for Solr changes (#9576) * DOCS add note to changelog for Solr changes --- docs/en/04_Changelogs/4.6.0.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/en/04_Changelogs/4.6.0.md b/docs/en/04_Changelogs/4.6.0.md index 0aad5c6b3..d5003b04c 100644 --- a/docs/en/04_Changelogs/4.6.0.md +++ b/docs/en/04_Changelogs/4.6.0.md @@ -5,6 +5,7 @@ * [MySQL tables are auto-converted from MyISAM to InnoDB](#myisam) * [Editing files directly in the insert-media modal](#in-modal-editing) * [MIME Type validation now a core module](#mime-validator) + * [Solr no longer indexes draft/restricted content](#solr-updates) ## MySQL tables are auto-converted from MyISAM to InnoDB {#myisam} @@ -86,6 +87,18 @@ install `silverstripe/mimevalidator` when they upgrade to 4.6.0. Read [Allowed file types](Developer_Guides/Files/Allowed_file_types) in the Silverstripe CMS doc for all the details. +## Solr no longer indexes draft/restricted content {#solr-updates} + +At the time of this release a new version of the popular [silverstripe/fulltextsearch module](https://github.com/silverstripe/silverstripe-fulltextsearch) is also available, introducing more secure defaults. Most notably, draft and restricted content will no longer be indexed by default, due to a `canView()` check being performed against an anonymous user prior to (re)indexing. Restricted content means that it has a permission level of either 'Logged-in users' or 'Only these groups'. + +If your project uses this module, after upgrading your website, ensure that you run the `Solr_Reindex` task on your production environment to remove previously indexed content that should no longer be there. + +If your website requires draft or restricted content to be indexed, you can opt-out of the new secure defaults on a per-model basis. + +This is a great opportunity to make sure that any custom indexes/search controllers in your project are correctly filtering results based on permissions and search visibility, which you can now achieve via a unified method (see `SilverStripe\FullTextSearch\Search\Services\SearchableService::isSearchable()`.) + +The [silverstripe/fulltextsearch module readme provides additional information](https://github.com/silverstripe/silverstripe-fulltextsearch). + ## Regressions @@ -95,4 +108,3 @@ Silverstripe CMS doc for all the details. - From d3d81ad96c48e8bab94dd2c32a207cfc08ce3796 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Wed, 8 Jul 2020 13:29:27 +1200 Subject: [PATCH 09/10] DOC Add details about ModelAdmin and Login Forms to 4.6 changelogs (#9525) --- docs/en/04_Changelogs/4.6.0.md | 111 +++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 46 deletions(-) diff --git a/docs/en/04_Changelogs/4.6.0.md b/docs/en/04_Changelogs/4.6.0.md index d5003b04c..65fea1a07 100644 --- a/docs/en/04_Changelogs/4.6.0.md +++ b/docs/en/04_Changelogs/4.6.0.md @@ -1,4 +1,4 @@ -# 4.6.0 (Unreleased) +# 4.6.0 ## Overview {#overview} @@ -6,42 +6,46 @@ * [Editing files directly in the insert-media modal](#in-modal-editing) * [MIME Type validation now a core module](#mime-validator) * [Solr no longer indexes draft/restricted content](#solr-updates) + * [Simplify customisation of ModelAdmin](#modeladmin-customisation) + * [Login forms module ships with installer](#loginforms) ## MySQL tables are auto-converted from MyISAM to InnoDB {#myisam} Beginning with [4.4.0](https://docs.silverstripe.org/en/4/changelogs/4.4.0/), -our minimum requirement for MySQL is 5.6 (since MySQL 5.5 end of life reached in -December 2018). Starting with MySQL 5.6, [InnoDB](https://dev.mysql.com/doc/refman/5.6/en/innodb-introduction.html) -is the new default storage engine, replacing the older [MyISAM](https://dev.mysql.com/doc/refman/5.6/en/myisam-storage-engine.html) -engine. +our minimum requirement for MySQL is 5.6 (since MySQL 5.5 end of life reached in December 2018). +Starting with MySQL 5.6, [InnoDB](https://dev.mysql.com/doc/refman/5.6/en/innodb-introduction.html) +is the new default storage engine, +replacing the older [MyISAM](https://dev.mysql.com/doc/refman/5.6/en/myisam-storage-engine.html) engine. -Silverstripe CMS already creates InnoDB tables by default, mainly in order to -benefit from their better support for database transactions. Before MySQL 5.6, -InnoDB didn't have a `FULLTEXT` search index, requiring us to enforce the MyISAM -engine when devs opted into this index type in their particular setup. There are -a few ways in which this opt-in can happen: +Silverstripe CMS already creates InnoDB tables by default, +mainly in order to benefit from their better support for database transactions. +Before MySQL 5.6, InnoDB didn't have a `FULLTEXT` search index, +requiring us to enforce the MyISAM engine when devs opted into this index type +in their particular setup. There are a few ways in which this opt-in can happen: * Adding the [FulltextSearchable](https://github.com/silverstripe/silverstripe-framework/blob/4/src/ORM/Search/FulltextSearchable.php) - extension to a DataObject, as described in our [search docs](https://docs.silverstripe.org/en/4/developer_guides/search/fulltextsearch/) + extension to a DataObject, as described in our + [search docs](https://docs.silverstripe.org/en/4/developer_guides/search/fulltextsearch/) * Defining `'type' => 'fulltext'` in `DataObject::$db` column definitions * Implementing [DBIndexable](https://github.com/silverstripe/silverstripe-framework/blob/4/src/ORM/FieldType/DBIndexable.php) on a custom `DBField` subclass. * Setting `'ENGINE=MyISAM'` in `DataObject::$create_table_options` -This search index is not required to enable simple text search in the "Pages" -section of the CMS, or any ModelAdmin implementations. We generally recommend -choosing a more powerful [search addon](https://addons.silverstripe.org/add-ons?search=fulltext&type=&sort=downloads) +This search index is not required to enable simple text search +in the "Pages" section of the CMS, or any ModelAdmin implementations. +We generally recommend to choose a more powerful +[search addon](https://addons.silverstripe.org/add-ons?search=fulltext&type=&sort=downloads) (e.g. based on Solr or ElasticSearch) for website frontend search use cases. As of 4.6.0, a `dev/build` will automatically switch MyISAM tables to InnoDB, which automatically recreates any indexes required. If you have large indexes, -this can extend the duration of this task. As usual, back up your database -before upgrading, and test upgrades on non-production systems first. Our tests -indicate that indexes with thousands of records and screen pages worth of -content (15MB index size) are converted in a few seconds. +this can extend the duration if this task. As usual, back up your database +before upgrading, and test upgrades on non-production systems first. +Our tests indicate that indexes with thousands of records and screen pages +worth of content (15MB index size) are converted in a few seconds. -In order to opt out of this change, you can set the engine explicitly for your -DataObject implementations: +In order to opt out of this change, you can set the engine explicitly +for your DataObject implementations: ```php use SilverStripe\ORM\Connect\MySQLSchemaManager; @@ -55,37 +59,35 @@ class MyDataObject extends DataObject } ``` -## Editing files directly in the Insert Media modal {#in-modal-editing} +## Editing files directly in the insert-media modal{#in-modal-editing} -Authors can now directly edit file details when selecting a file in an -`UploadField` or when inserting media in a `HTMLEditorField`. The "image -placement" and "file link" forms that show when inserting an image or a link in -an `HTMLEditorField` have been simplified. +Editors can now directly edit file details when selecting a file in an UploadField or when inserting media in a +HTMLEditorField. The "image placement" and "file link" forms that show when inserting an image or a link in an +HTMLEditorField have been simplified. -If you have customised the fields in the asset administration UI or Insert Media -modal, you will need to do some regression testing when upgrading, and will -likely need to make some minor adjustments to your code. +This does mean that the order and structure of fields have changed somewhat. If you have customised the forms in the +asset administration area or in the "Insert Media Modal", you should do some regression testing when upgrading to +make sure your customisations still work as expected. -Implementing the new Edit Details UI required filtering the fields generated in -`File::getCMSFields()` into two `Form`s. The implementation in 4.6.0 does not -expose a clear API to custom fields for differentiating between the `Form`s, and -by default any fields added via an extension will appear in both views. For the -time being, a simple way to resolve this is to check for the presence of the -`Editor.Details.Title` field and add your field based on this. See the community -module [jonom/focuspoint](https://github.com/jonom/silverstripe-focuspoint/pull/78/files#diff-cc697eb8345aa25a5f88c89d1a87ff6aR27-R34) -for an example implementation, and ensure you update this module during your -upgrade to 4.6.0 if you have it installed. - -We intend to improve this pattern in a future release of Silverstripe CMS. +If your project uses the popular [jonom/focuspoint](https://github.com/jonom/silverstripe-focuspoint) community +module, you should upgrade it as well. ## MIME Type validation now a core module {#mime-validator} -`silverstripe/mimevalidator` is now a core module and will ship by default on -new projects. Projects referencing `silverstripe/recipe-core` will automatically -install `silverstripe/mimevalidator` when they upgrade to 4.6.0. +`silverstripe/mimevalidator` is now a core module and will ship by default on new projects. Projects referencing `silverstripe/recipe-core` will automatically install `silverstripe/mimevalidator` when they upgrade to 4.6.0. -Read [Allowed file types](Developer_Guides/Files/Allowed_file_types) in the -Silverstripe CMS doc for all the details. +Read [Allowed file types](Developer_Guides/Files/Allowed_file_types) in the Silverstripe CMS doc for all the details. + +## File status icons in the file manager + +![File status icons](https://raw.githubusercontent.com/silverstripe/silverstripe-framework/blob/4/docs/en/04_Changelogs/_images/file-status-icons.png "A screenshot of file status icons being displayed in the file manager") + +Files and folders with permissions of either "Logged in users" or "Only these groups (choose from list)" now show +a "Restricted access" icon in the file manager. These permissions can either be directly on the DataObject or +they can be inherited from the parent folder. + +Websites with the optional [UserForms](https://github.com/silverstripe/silverstripe-userforms) module installed will +show a "Form submission" icon on files uploaded through a UserForm. UserForm uploaded files without a "Restricted access" icon show a "Form submission, unrestricted access" icon instead. ## Solr no longer indexes draft/restricted content {#solr-updates} @@ -99,11 +101,28 @@ This is a great opportunity to make sure that any custom indexes/search controll The [silverstripe/fulltextsearch module readme provides additional information](https://github.com/silverstripe/silverstripe-fulltextsearch). +## Simplify customisation of ModelAdmin {#modeladmin-customisation} -## Regressions +`ModelAdmin::getEditForm()` has been split into smaller more discrete protected methods: +* `getGridField()` +* `getGridFieldConfig()`. - - [File section, icons broken until page is refreshed](https://github.com/silverstripe/silverstripe-admin/issues/1064) +Two matching extension hooks have been added as well: +* `updateGridField()` +* `updateGridFieldConfig()`. +This will make it easier for developers to customise GridFields in their ModelAdmins. + +Learn how to [alter the ModelAdmin GridField or Form](/developer_guides/customising_the_admin_interface/modeladmin/#altering-the-modeladmin-gridfield-or-form) + +## Login forms module ships with installer {#loginforms} + +The `silverstripe/login-forms` module is now part of the default installer. This alters the login form to provide +consistent styling and behaviour that's independent from the specifics in your project. Only new projects will +get the new login form. Older projects can manually require the `silverstripe/login-forms` module to get the new +login form. + +View the [Silverstripe Login Forms readme](https://github.com/silverstripe/silverstripe-login-forms) on Github for more details. From 1f0a78e57b1710b90c0c1827381e13ebe8b33dd7 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 9 Jul 2020 09:33:21 +1200 Subject: [PATCH 10/10] FIX More context for GridFieldDataColumns callbacks This emulates the callback signature from GridFieldEditableColumns in the symbiote/silverstripe-gridfieldextensions module, which extends GridFieldDataColumns. In case canEdit() fails, this component passes control back to the parent (rendering a standard column content rather than a formfield). Which can become an issue if you've defined custom 'callback' handlers on setDisplayFields() - GridFieldDataColumns passes in only one arg (`$record`), while GridFieldEditableColumns passes in three (`$record`, `$col` and `$grid`). While you could argue that this is a bug in the other module, I think this additional context is beneficial for the main GridFieldDataColumns use case as well, and it just happens to fix that bug. --- src/Forms/GridField/GridFieldDataColumns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/GridField/GridFieldDataColumns.php b/src/Forms/GridField/GridFieldDataColumns.php index 0afa2e51a..afb7cf43c 100644 --- a/src/Forms/GridField/GridFieldDataColumns.php +++ b/src/Forms/GridField/GridFieldDataColumns.php @@ -159,7 +159,7 @@ class GridFieldDataColumns implements GridField_ColumnProvider // Allow callbacks if (is_array($columnInfo) && isset($columnInfo['callback'])) { $method = $columnInfo['callback']; - $value = $method($record); + $value = $method($record, $columnName, $gridField); // This supports simple FieldName syntax } else {