Merge remote-tracking branch 'origin/4.6' into 4

This commit is contained in:
Ingo Schommer 2020-07-11 09:07:39 +12:00
commit 8d6a248431
6 changed files with 44 additions and 99 deletions

View File

@ -952,8 +952,6 @@ skipConfigs:
excludedPaths:
- '*fixtures*'
- '*vendor*'
doctorTasks:
SilverStripe\Dev\Upgrade\UpgradeBootstrap: src/Dev/Upgrade/UpgradeBootstrap.php
warnings:
classes:
'Object':

View File

@ -1,10 +1,13 @@
# 4.6.0 (Unreleased)
# 4.6.0
## Overview {#overview}
* [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)
* [Simplify customisation of ModelAdmin](#modeladmin-customisation)
* [Login forms module ships with installer](#loginforms)
## MySQL tables are auto-converted from MyISAM to InnoDB {#myisam}
@ -63,7 +66,7 @@ HTMLEditorField. The "image placement" and "file link" forms that show when inse
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
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 your project uses the popular [jonom/focuspoint](https://github.com/jonom/silverstripe-focuspoint) community
@ -86,6 +89,41 @@ 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}
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).
## Simplify customisation of ModelAdmin {#modeladmin-customisation}
`ModelAdmin::getEditForm()` has been split into smaller more discrete protected methods:
* `getGridField()`
* `getGridFieldConfig()`.
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.
<!--- Changes below this line will be automatically regenerated -->
<!--- Changes above this line will be automatically regenerated -->

View File

@ -223,6 +223,7 @@ class DebugView
->resolveURL('silverstripe/framework:client/styles/debug.css');
$output = '<!DOCTYPE html><html><head><title>' . $url . '</title>';
$output .= '<link rel="stylesheet" type="text/css" href="' . $debugCSS . '" />';
$output .= '<meta name="robots" content="noindex">';
$output .= '</head>';
$output .= '<body>';

View File

@ -1,94 +0,0 @@
<?php
namespace SilverStripe\Dev\Upgrade;
use BadMethodCallException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Provides upgrade interface for bootstrapping.
*
* Note: This class is intended to be loaded from outside of a SilverStripe application
* and should not reference any SilverStripe API.
*
* See https://github.com/silverstripe/silverstripe-upgrader/ for information
* on running this task.
*/
class UpgradeBootstrap
{
/**
* List of files to install.
* Set to true if the file should be re-installed if it doesn't exist.
*
* @var array
*/
protected $files = [
'.htaccess' => 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 <info>{$file}</info>");
$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));
}
}

View File

@ -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 {

View File

@ -319,6 +319,8 @@ class TempDatabase
$this->kill();
$this->build();
$this->rebuildTables($extraDataObjects);
$this->skippedException = null;
}
}
}