Merge pull request #396 from open-sausages/pulls/2.0/352-fix-migrate-file-task

BUG: Fix `MigrateFileTask` not migrating files for subsites
This commit is contained in:
Robbie Averill 2018-10-18 11:37:21 +02:00 committed by GitHub
commit 1a5666182e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -8,3 +8,5 @@ SilverStripe\Core\Injector\Injector:
properties:
Middlewares:
SubsitesStateMiddleware: %$SilverStripe\Subsites\Middleware\InitStateMiddleware
SilverStripe\Dev\Tasks\MigrateFileTask:
class: SilverStripe\Subsites\Tasks\SubsiteMigrateFileTask

View File

@ -0,0 +1,19 @@
<?php
namespace SilverStripe\Subsites\Tasks;
use SilverStripe\Dev\Tasks\MigrateFileTask;
use SilverStripe\Subsites\Model\Subsite;
class SubsiteMigrateFileTask extends MigrateFileTask
{
public function run($request)
{
$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
Subsite::disable_subsite_filter(true);
parent::run($request);
Subsite::disable_subsite_filter($origDisableSubsiteFilter);
}
}