diff --git a/.upgrade.yml b/.upgrade.yml new file mode 100644 index 0000000..cee0c8b --- /dev/null +++ b/.upgrade.yml @@ -0,0 +1,24 @@ +mappings: + MultisitesCMSMainExtension: 'Symbiote\Multisites\Admin\MultisitesCMSMainExtension' + MultisitesCMSPageAddController: 'Symbiote\Multisites\Admin\MultisitesCMSPageAddController' + MultisitesModelAdminExtension: 'Symbiote\Multisites\Admin\MultisitesModelAdminExtension' + MultisitesFrontController: 'Symbiote\Multisites\Control\MultisitesFrontController' + MultisitesRootController: 'Symbiote\Multisites\Control\MultisitesRootController' + RobotsTxtController: 'Symbiote\Multisites\Control\RobotsTxtController' + MultisitesAware: 'Symbiote\Multisites\Extension\MultisitesAware' + MultisitesContentControllerExtension: 'Symbiote\Multisites\Extension\MultisitesContentControllerExtension' + MultisitesControllerExtension: 'Symbiote\Multisites\Extension\MultisitesControllerExtension' + MultisitesErrorPageExtension: 'Symbiote\Multisites\Extension\MultisitesErrorPageExtension' + MultisitesFileFieldExtension: 'Symbiote\Multisites\Extension\MultisitesFileFieldExtension' + MultisitesHtmlEditorField_ToolbarExtension: 'Symbiote\Multisites\Extension\MultisitesHtmlEditorField_ToolbarExtension' + MultisitesMemberExtension: 'Symbiote\Multisites\Extension\MultisitesMemberExtension' + MultisitesReport: 'Symbiote\Multisites\Extension\MultisitesReport' + MultisitesSecurityExtension: 'Symbiote\Multisites\Extension\MultisitesSecurityExtension' + MultisitesSiteConfigExtension: 'Symbiote\Multisites\Extension\MultisitesSiteConfigExtension' + MultisitesSiteTreeExtension: 'Symbiote\Multisites\Extension\MultisitesSiteTreeExtension' + SiteSearchForm: 'Symbiote\Multisites\Form\SiteSearchForm' + MultisitesInitAssetsTask: 'Symbiote\Multisites\Job\MultisitesInitAssetsTask' + TidySiteTask: 'Symbiote\Multisites\Job\TidySiteTask' + Site: 'Symbiote\Multisites\Model\Site' + Multisites: 'Symbiote\Multisites\Multisites' + MultisiteSiteTest: 'Symbiote\Multisites\Tests\MultisiteSiteTest' diff --git a/_config/upgrade.yml b/_config/upgrade.yml new file mode 100644 index 0000000..e7fd374 --- /dev/null +++ b/_config/upgrade.yml @@ -0,0 +1,6 @@ +--- +name: multisites-upgrade +--- +SilverStripe\ORM\DatabaseAdmin: + classname_value_remapping: + Site: 'Symbiote\Multisites\Model\Site' diff --git a/src/Extension/MultisitesControllerExtension.php b/src/Extension/MultisitesControllerExtension.php index 6485beb..6276eda 100644 --- a/src/Extension/MultisitesControllerExtension.php +++ b/src/Extension/MultisitesControllerExtension.php @@ -81,7 +81,7 @@ public function onBeforeHTTPError($code, $request) if ($errorPage) { Requirements::clear(); Requirements::clear_combined_files(); - $response = ModelAsController::controller_for($errorPage)->handleRequest($request, DataModel::inst()); + $response = ModelAsController::controller_for($errorPage)->handleRequest($request); throw new HTTPResponse_Exception($response, $code); } } diff --git a/src/Model/Site.php b/src/Model/Site.php index 9a933ac..28b4e39 100644 --- a/src/Model/Site.php +++ b/src/Model/Site.php @@ -182,7 +182,7 @@ public function onBeforeWrite() { $this->Host = $normalise($this->Host); - if($aliases = $this->HostAliases->getValue()) { + if(!is_array($this->HostAliases) && ($aliases = $this->HostAliases->getValue())) { $this->HostAliases = array_map($normalise, $aliases); }