Merge branch '4.5' into 4

This commit is contained in:
Serge Latyntcev 2020-04-15 14:49:19 +12:00
commit cb36aab80c
5 changed files with 28 additions and 6 deletions

View File

@ -111,6 +111,28 @@ Note that any File object which is not in the `File.allowed_extensions` config w
from the database during migration. Any invalid file on the filesystem will not be deleted,
but will no longer be attached to a dataobject anymore, and should be cleaned up manually.
### If you were using the versionedfiles on your 3.x site
If you have had [versionedfiles](https://github.com/symbiote/silverstripe-versionedfiles) module installed, it is very important to run
an extra task that would clean up the `_versions` folders. Otherwise, files in those folders may be left exposed to public access
through your web server via guessable URLs. This includes all the unpublished versions of your files.
The task for the job is `VersionedFilesMigrationTask`, and you may run it as follows:
`$ vendor/bin/sake dev/tasks/migrate-versionedfiles strategy=[delete|protect]`
Before you run it, it is important to choose an appropriate strategy that suits your project best.
- `delete` (default) - delete all `_versions` folders
- `protect` - create a protective `.htaccess` file in every `_versions` folder (Apache specific)
If you choose `delete`, it may be wise to take a snapshot of your `public/assets` folder.
Shall you consider `protect` as the method, please beware that it may not always work, depending on your server setup.
In that case it is important to make sure your web server is Apache and that it allows `.htaccess` for all subfolders.
## Automatic migration
To disable this, set the following config:
```yaml

View File

@ -217,7 +217,7 @@ class FormRequestHandler extends RequestHandler
// Action handlers may throw ValidationExceptions.
try {
// Or we can use the Valiator attached to the form
// Or we can use the Validator attached to the form
$result = $this->form->validationResult();
if (!$result->isValid()) {
return $this->getValidationErrorResponse($result);
@ -247,7 +247,7 @@ class FormRequestHandler extends RequestHandler
return $this->invokeFormHandler($field, ...$args);
}
} catch (ValidationException $e) {
// The ValdiationResult contains all the relevant metadata
// The ValidationResult contains all the relevant metadata
$result = $e->getResult();
$this->form->loadMessagesFrom($result);
return $this->getValidationErrorResponse($result);

View File

@ -184,7 +184,7 @@ class DataList extends ViewableData implements SS_List, Filterable, Sortable, Li
* Returns the SQL query that will be used to get this DataList's records. Good for debugging. :-)
*
* @param array $parameters Out variable for parameters required for this query
* @return string The resulting SQL query (may be paramaterised)
* @return string The resulting SQL query (may be parameterised)
*/
public function sql(&$parameters = [])
{
@ -363,7 +363,7 @@ class DataList extends ViewableData implements SS_List, Filterable, Sortable, Li
}
/**
* Return a copy of this list which only includes items with these charactaristics
* Return a copy of this list which only includes items with these characteristics
*
* @see SS_List::filter()
*

View File

@ -729,7 +729,7 @@ class Permission extends DataObject implements TemplateGlobalProvider, Resettabl
public function provideI18nEntities()
{
$keys = parent::provideI18nEntities(); // TODO: Change the autogenerated stub
$keys = parent::provideI18nEntities();
// Localise all permission categories
$keys[__CLASS__ . '.AdminGroup'] = 'Administrator';

View File

@ -30,7 +30,7 @@ class DatetimeFieldTest extends SapphireTest
{
DBDatetime::clear_mock_now();
date_default_timezone_set($this->timezone);
parent::tearDown(); // TODO: Change the autogenerated stub
parent::tearDown();
}
public function testFormSaveInto()