mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
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:
commit
1a5666182e
@ -8,3 +8,5 @@ SilverStripe\Core\Injector\Injector:
|
|||||||
properties:
|
properties:
|
||||||
Middlewares:
|
Middlewares:
|
||||||
SubsitesStateMiddleware: %$SilverStripe\Subsites\Middleware\InitStateMiddleware
|
SubsitesStateMiddleware: %$SilverStripe\Subsites\Middleware\InitStateMiddleware
|
||||||
|
SilverStripe\Dev\Tasks\MigrateFileTask:
|
||||||
|
class: SilverStripe\Subsites\Tasks\SubsiteMigrateFileTask
|
||||||
|
19
src/Tasks/SubsiteMigrateFileTask.php
Normal file
19
src/Tasks/SubsiteMigrateFileTask.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user