diff --git a/_config.php b/_config.php
index 0943fd88..eec9e6af 100644
--- a/_config.php
+++ b/_config.php
@@ -1,6 +1,9 @@
admin/pages'
diff --git a/code/BatchActions/CMSBatchAction_Archive.php b/code/BatchActions/CMSBatchAction_Archive.php
index a9a5a6f1..4664c7f7 100644
--- a/code/BatchActions/CMSBatchAction_Archive.php
+++ b/code/BatchActions/CMSBatchAction_Archive.php
@@ -7,9 +7,6 @@ use SilverStripe\ORM\SS_List;
/**
* Archives a page, removing it from both live and stage
- *
- * @package cms
- * @subpackage batchaction
*/
class CMSBatchAction_Archive extends CMSBatchAction
{
diff --git a/code/BatchActions/CMSBatchAction_Delete.php b/code/BatchActions/CMSBatchAction_Delete.php
index ac70fb4a..b959f157 100644
--- a/code/BatchActions/CMSBatchAction_Delete.php
+++ b/code/BatchActions/CMSBatchAction_Delete.php
@@ -8,9 +8,6 @@ use SilverStripe\Admin\CMSBatchAction;
/**
* Delete items batch action.
- *
- * @package cms
- * @subpackage batchaction
*/
class CMSBatchAction_Delete extends CMSBatchAction {
public function getActionTitle() {
diff --git a/code/BatchActions/CMSBatchAction_Publish.php b/code/BatchActions/CMSBatchAction_Publish.php
index 1912b13f..a7ea593d 100644
--- a/code/BatchActions/CMSBatchAction_Publish.php
+++ b/code/BatchActions/CMSBatchAction_Publish.php
@@ -7,9 +7,6 @@ use SilverStripe\ORM\SS_List;
/**
* Publish items batch action.
- *
- * @package cms
- * @subpackage batchaction
*/
class CMSBatchAction_Publish extends CMSBatchAction
{
diff --git a/code/BatchActions/CMSBatchAction_Restore.php b/code/BatchActions/CMSBatchAction_Restore.php
index d69b78e2..1644e6e4 100644
--- a/code/BatchActions/CMSBatchAction_Restore.php
+++ b/code/BatchActions/CMSBatchAction_Restore.php
@@ -11,8 +11,6 @@ use SilverStripe\Security\Permission;
/**
* Batch restore of pages
- * @package cms
- * @subpackage batchaction
*/
class CMSBatchAction_Restore extends CMSBatchAction
{
diff --git a/code/BatchActions/CMSBatchAction_Unpublish.php b/code/BatchActions/CMSBatchAction_Unpublish.php
index 8f4c043a..37e4f1bd 100644
--- a/code/BatchActions/CMSBatchAction_Unpublish.php
+++ b/code/BatchActions/CMSBatchAction_Unpublish.php
@@ -7,9 +7,6 @@ use SilverStripe\ORM\SS_List;
/**
* Unpublish items batch action.
- *
- * @package cms
- * @subpackage batchaction
*/
class CMSBatchAction_Unpublish extends CMSBatchAction
{
diff --git a/code/Controllers/CMSMain.php b/code/Controllers/CMSMain.php
index 53441e9b..667fb726 100644
--- a/code/Controllers/CMSMain.php
+++ b/code/Controllers/CMSMain.php
@@ -2,61 +2,59 @@
namespace SilverStripe\CMS\Controllers;
-use FormField;
-use Injector;
-use ResetFormAction;
-use SilverStripe\ORM\FieldType\DBHTMLText;
-use SilverStripe\ORM\SS_List;
-use SilverStripe\ORM\Versioning\Versioned;
-use SilverStripe\ORM\HiddenClass;
-use SilverStripe\ORM\ArrayList;
-use SilverStripe\ORM\DataObject;
-use SilverStripe\ORM\DataList;
-use SilverStripe\ORM\DB;
-use SilverStripe\Security\Member;
-use SilverStripe\Security\Security;
-use SilverStripe\Security\SecurityToken;
-use SilverStripe\Security\Permission;
-use SilverStripe\Security\PermissionProvider;
use SilverStripe\Admin\AdminRootController;
-use SilverStripe\Admin\LeftAndMain;
use SilverStripe\Admin\CMSBatchActionHandler;
use SilverStripe\Admin\CMSPreviewable;
-use SilverStripe\CMS\Model\SiteTree;
-use SilverStripe\CMS\Model\RedirectorPage;
+use SilverStripe\Admin\LeftAndMain;
use SilverStripe\CMS\Model\CurrentPageIdentifier;
-use SS_HTTPRequest;
-use TabSet;
+use SilverStripe\CMS\Model\RedirectorPage;
+use SilverStripe\CMS\Model\SiteTree;
+use SilverStripe\Control\Controller;
+use SilverStripe\Control\Director;
+use SilverStripe\Control\Session;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Control\SS_HTTPResponse_Exception;
+use SilverStripe\Core\Convert;
+use SilverStripe\Core\Injector\Injector;
+use SilverStripe\Core\SS_Cache;
+use SilverStripe\Forms\DateField;
+use SilverStripe\Forms\DropdownField;
+use SilverStripe\Forms\FieldGroup;
+use SilverStripe\Forms\FieldList;
+use SilverStripe\Forms\Form;
+use SilverStripe\Forms\FormAction;
+use SilverStripe\Forms\GridField\GridField;
+use SilverStripe\Forms\GridField\GridFieldConfig;
+use SilverStripe\Forms\GridField\GridFieldDataColumns;
+use SilverStripe\Forms\GridField\GridFieldLevelup;
+use SilverStripe\Forms\GridField\GridFieldPaginator;
+use SilverStripe\Forms\GridField\GridFieldSortableHeader;
+use SilverStripe\Forms\HiddenField;
+use SilverStripe\Forms\LabelField;
+use SilverStripe\Forms\LiteralField;
+use SilverStripe\Forms\RequiredFields;
+use SilverStripe\Forms\ResetFormAction;
+use SilverStripe\Forms\TextField;
+use SilverStripe\ORM\ArrayList;
+use SilverStripe\ORM\DataList;
+use SilverStripe\ORM\DataObject;
+use SilverStripe\ORM\DB;
+use SilverStripe\ORM\FieldType\DBHTMLText;
+use SilverStripe\ORM\HiddenClass;
+use SilverStripe\ORM\SS_List;
+use SilverStripe\ORM\Versioning\Versioned;
+use SilverStripe\Security\Member;
+use SilverStripe\Security\Permission;
+use SilverStripe\Security\PermissionProvider;
+use SilverStripe\Security\Security;
+use SilverStripe\Security\SecurityToken;
+use SilverStripe\View\ArrayData;
+use SilverStripe\View\Requirements;
use Translatable;
-use Requirements;
-use Controller;
-use Director;
use Page;
-use TextField;
-use DateField;
-use DropdownField;
-use FieldGroup;
-use FieldList;
-use FormAction;
-use Form;
-use SS_Cache;
use Zend_Cache;
-use Convert;
-use ArrayData;
-use HiddenField;
-use LiteralField;
-use RequiredFields;
-use LabelField;
use InvalidArgumentException;
-use GridFieldConfig;
-use GridFieldSortableHeader;
-use GridFieldDataColumns;
-use GridFieldPaginator;
-use GridFieldLevelup;
-use GridField;
-use SS_HTTPResponse_Exception;
-use Session;
-use SS_HTTPResponse;
+
/**
* The main "content" area of the CMS.
@@ -64,8 +62,6 @@ use SS_HTTPResponse;
* This class creates a 2-frame layout - left-tree and right-form - to sit beneath the main
* admin menu.
*
- * @package cms
- * @subpackage controller
* @todo Create some base classes to contain the generic functionality that will be replicated.
*
* @mixin LeftAndMainPageIconsExtension
@@ -869,7 +865,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
}
$gridField = new GridField('Page','Pages', $list, $gridFieldConfig);
/** @var GridFieldDataColumns $columns */
- $columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
+ $columns = $gridField->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns');
// Don't allow navigating into children nodes on filtered lists
$fields = array(
@@ -878,7 +874,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
'LastEdited' => _t('SiteTree.LASTUPDATED', 'Last Updated'),
);
/** @var GridFieldSortableHeader $sortableHeader */
- $sortableHeader = $gridField->getConfig()->getComponentByType('GridFieldSortableHeader');
+ $sortableHeader = $gridField->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldSortableHeader');
$sortableHeader->setFieldSorting(array('getTreeTitle' => 'Title'));
$gridField->getState()->ParentID = $parentID;
diff --git a/code/Controllers/CMSPageAddController.php b/code/Controllers/CMSPageAddController.php
index 76f0413a..3bdf2863 100644
--- a/code/Controllers/CMSPageAddController.php
+++ b/code/Controllers/CMSPageAddController.php
@@ -2,25 +2,23 @@
namespace SilverStripe\CMS\Controllers;
+use SilverStripe\CMS\Model\SiteTree;
+use SilverStripe\Control\Controller;
+use SilverStripe\Control\Session;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Forms\FieldList;
+use SilverStripe\Forms\Form;
+use SilverStripe\Forms\FormAction;
+use SilverStripe\Forms\LiteralField;
+use SilverStripe\Forms\OptionsetField;
+use SilverStripe\Forms\SelectionGroup;
+use SilverStripe\Forms\SelectionGroup_Item;
+use SilverStripe\Forms\TreeDropdownField;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Security\Member;
use SilverStripe\Security\Security;
-use FieldList;
-use LiteralField;
-use SelectionGroup;
-use SelectionGroup_Item;
-use SS_HTTPResponse;
-use TreeDropdownField;
-use OptionsetField;
-use FormAction;
-use Form;
-use Session;
-use Controller;
-use SilverStripe\CMS\Model\SiteTree;
-
-
class CMSPageAddController extends CMSPageEditController {
@@ -160,6 +158,7 @@ class CMSPageAddController extends CMSPageEditController {
}
));
}
+ return null;
});
$form->addExtraClass('cms-add-form cms-content center cms-edit-form ' . $this->BaseCSSClasses());
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
diff --git a/code/Controllers/CMSPageEditController.php b/code/Controllers/CMSPageEditController.php
index bcbcdb69..360e2187 100644
--- a/code/Controllers/CMSPageEditController.php
+++ b/code/Controllers/CMSPageEditController.php
@@ -2,9 +2,12 @@
namespace SilverStripe\CMS\Controllers;
-use Convert;
use SilverStripe\Admin\AddToCampaignHandler;
-use SS_HTTPResponse;
+use SilverStripe\Control\SS_HTTPRequest;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Core\Convert;
+use SilverStripe\Forms\Form;
+use SilverStripe\ORM\FieldType\DBHTMLText;
/**
* @package cms
@@ -48,18 +51,19 @@ class CMSPageEditController extends CMSMain {
$handler = AddToCampaignHandler::create($this, $record);
$results = $handler->addToCampaign($record, $data['Campaign']);
- if (!is_null($results)) {
- $request = $this->getRequest();
- if($request->getHeader('X-Formschema-Request')) {
- $data = $this->getSchemaForForm($handler->Form($record));
- $data['message'] = $results;
-
- $response = new SS_HTTPResponse(Convert::raw2json($data));
- $response->addHeader('Content-Type', 'application/json');
- return $response;
- }
- return $results;
+ if (is_null($results)) {
+ return null;
}
+ $request = $this->getRequest();
+ if($request->getHeader('X-Formschema-Request')) {
+ $data = $this->getSchemaForForm($handler->Form($record));
+ $data['message'] = $results;
+
+ $response = new SS_HTTPResponse(Convert::raw2json($data));
+ $response->addHeader('Content-Type', 'application/json');
+ return $response;
+ }
+ return $results;
}
/**
diff --git a/code/Controllers/CMSPageHistoryController.php b/code/Controllers/CMSPageHistoryController.php
index f6ad93b2..75a80c62 100644
--- a/code/Controllers/CMSPageHistoryController.php
+++ b/code/Controllers/CMSPageHistoryController.php
@@ -3,25 +3,21 @@
namespace SilverStripe\CMS\Controllers;
use SilverStripe\CMS\Model\SiteTree;
+use SilverStripe\Control\Controller;
+use SilverStripe\Control\SS_HTTPRequest;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Forms\CheckboxField;
+use SilverStripe\Forms\FieldList;
+use SilverStripe\Forms\Form;
+use SilverStripe\Forms\FormAction;
+use SilverStripe\Forms\HiddenField;
+use SilverStripe\Forms\LiteralField;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\Versioning\Versioned;
use SilverStripe\Security\Security;
-use Form;
-use FieldList;
-use FormAction;
-use HiddenField;
-use Controller;
-use LiteralField;
-use SS_HTTPRequest;
-use SS_HTTPResponse;
-use ViewableData;
-use CheckboxField;
+use SilverStripe\View\ViewableData;
-/**
- * @package cms
- * @subpackage controllers
- */
class CMSPageHistoryController extends CMSMain {
private static $url_segment = 'pages/history';
@@ -181,7 +177,7 @@ class CMSPageHistoryController extends CMSMain {
new LiteralField('CurrentlyViewingMessage', $this->customise(array(
'Content' => DBField::create_field('HTMLFragment', $message),
'Classes' => 'notice'
- ))->renderWith(array('CMSMain_notice'))),
+ ))->renderWith($this->getTemplatesWithSuffix('_notice'))),
"Title"
);
diff --git a/code/Controllers/CMSPageSettingsController.php b/code/Controllers/CMSPageSettingsController.php
index ab06decc..77a077e1 100644
--- a/code/Controllers/CMSPageSettingsController.php
+++ b/code/Controllers/CMSPageSettingsController.php
@@ -2,9 +2,6 @@
namespace SilverStripe\CMS\Controllers;
-/**
- * @package cms
- */
class CMSPageSettingsController extends CMSMain {
private static $url_segment = 'pages/settings';
diff --git a/code/Controllers/CMSPagesController.php b/code/Controllers/CMSPagesController.php
index 16334f03..07ae0e92 100644
--- a/code/Controllers/CMSPagesController.php
+++ b/code/Controllers/CMSPagesController.php
@@ -3,14 +3,11 @@
namespace SilverStripe\CMS\Controllers;
use SilverStripe\CMS\Model\SiteTree;
+use SilverStripe\Control\Controller;
use SilverStripe\ORM\DataObject;
+use SilverStripe\View\ArrayData;
use stdClass;
-use Controller;
-use ArrayData;
-/**
- * @package cms
- */
class CMSPagesController extends CMSMain {
private static $url_segment = 'pages';
diff --git a/code/Controllers/CMSSiteTreeFilter.php b/code/Controllers/CMSSiteTreeFilter.php
index a3361be5..c5b57fc6 100644
--- a/code/Controllers/CMSSiteTreeFilter.php
+++ b/code/Controllers/CMSSiteTreeFilter.php
@@ -2,15 +2,14 @@
namespace SilverStripe\CMS\Controllers;
+use SilverStripe\Admin\LeftAndMain_SearchFilter;
use SilverStripe\CMS\Model\SiteTree;
+use SilverStripe\Core\ClassInfo;
+use SilverStripe\Core\Object;
+use SilverStripe\Forms\DateField;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\Versioning\Versioned;
-use Object;
-use ClassInfo;
-use DateField;
-use SilverStripe\Admin\LeftAndMain_SearchFilter;
-
/**
* Base class for filtering the subtree for certain node statuses.
@@ -22,9 +21,6 @@ use SilverStripe\Admin\LeftAndMain_SearchFilter;
* If you wish to make a more complex tree, you can overload includeInTree($page) to return true/
* false depending on whether the given page should be included. Note that you will need to include
* parent helper pages yourself.
- *
- * @package cms
- * @subpackage content
*/
abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFilter {
diff --git a/code/Controllers/CMSSiteTreeFilter_ChangedPages.php b/code/Controllers/CMSSiteTreeFilter_ChangedPages.php
index 4459455a..0ab8a807 100644
--- a/code/Controllers/CMSSiteTreeFilter_ChangedPages.php
+++ b/code/Controllers/CMSSiteTreeFilter_ChangedPages.php
@@ -6,9 +6,6 @@ use SilverStripe\ORM\Versioning\Versioned;
/**
* Gets all pages which have changed on stage.
- *
- * @package cms
- * @subpackage content
*/
class CMSSiteTreeFilter_ChangedPages extends CMSSiteTreeFilter
{
diff --git a/code/Controllers/CMSSiteTreeFilter_DeletedPages.php b/code/Controllers/CMSSiteTreeFilter_DeletedPages.php
index 9f204b4a..624fbd58 100644
--- a/code/Controllers/CMSSiteTreeFilter_DeletedPages.php
+++ b/code/Controllers/CMSSiteTreeFilter_DeletedPages.php
@@ -8,9 +8,6 @@ use SilverStripe\ORM\Versioning\Versioned;
* Works a bit different than the other filters:
* Shows all pages *including* those deleted from stage and live.
* It does not filter out pages still existing in the different stages.
- *
- * @package cms
- * @subpackage content
*/
class CMSSiteTreeFilter_DeletedPages extends CMSSiteTreeFilter
{
diff --git a/code/Controllers/CMSSiteTreeFilter_PublishedPages.php b/code/Controllers/CMSSiteTreeFilter_PublishedPages.php
index 7917b820..aecbdca1 100644
--- a/code/Controllers/CMSSiteTreeFilter_PublishedPages.php
+++ b/code/Controllers/CMSSiteTreeFilter_PublishedPages.php
@@ -11,9 +11,6 @@ use SilverStripe\ORM\Versioning\Versioned;
* pages that is currently published.
*
* Note that this does not check canView permissions that might hide pages from certain visitors
- *
- * @package cms
- * @subpackage content
*/
class CMSSiteTreeFilter_PublishedPages extends CMSSiteTreeFilter
{
diff --git a/code/Controllers/CMSSiteTreeFilter_Search.php b/code/Controllers/CMSSiteTreeFilter_Search.php
index 3b0d1a39..6cedb889 100644
--- a/code/Controllers/CMSSiteTreeFilter_Search.php
+++ b/code/Controllers/CMSSiteTreeFilter_Search.php
@@ -4,10 +4,6 @@ namespace SilverStripe\CMS\Controllers;
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\Versioning\Versioned;
-/**
- * @package cms
- * @subpackage content
- */
class CMSSiteTreeFilter_Search extends CMSSiteTreeFilter
{
diff --git a/code/Controllers/CMSSiteTreeFilter_StatusDeletedPages.php b/code/Controllers/CMSSiteTreeFilter_StatusDeletedPages.php
index 7cfc0bf3..8d277092 100644
--- a/code/Controllers/CMSSiteTreeFilter_StatusDeletedPages.php
+++ b/code/Controllers/CMSSiteTreeFilter_StatusDeletedPages.php
@@ -8,9 +8,6 @@ use SilverStripe\ORM\Versioning\Versioned;
/**
* Filters pages which have a status "Deleted".
- *
- * @package cms
- * @subpackage content
*/
class CMSSiteTreeFilter_StatusDeletedPages extends CMSSiteTreeFilter
{
diff --git a/code/Controllers/CMSSiteTreeFilter_StatusDraftPages.php b/code/Controllers/CMSSiteTreeFilter_StatusDraftPages.php
index c65a8452..6893465e 100644
--- a/code/Controllers/CMSSiteTreeFilter_StatusDraftPages.php
+++ b/code/Controllers/CMSSiteTreeFilter_StatusDraftPages.php
@@ -8,9 +8,6 @@ use SilverStripe\ORM\Versioning\Versioned;
/**
* Filters pages which have a status "Draft".
- *
- * @package cms
- * @subpackage content
*/
class CMSSiteTreeFilter_StatusDraftPages extends CMSSiteTreeFilter
{
diff --git a/code/Controllers/CMSSiteTreeFilter_StatusRemovedFromDraftPages.php b/code/Controllers/CMSSiteTreeFilter_StatusRemovedFromDraftPages.php
index 874ab051..aab48573 100644
--- a/code/Controllers/CMSSiteTreeFilter_StatusRemovedFromDraftPages.php
+++ b/code/Controllers/CMSSiteTreeFilter_StatusRemovedFromDraftPages.php
@@ -8,9 +8,6 @@ use SilverStripe\ORM\Versioning\Versioned;
/**
* Filters pages which have a status "Removed from Draft".
- *
- * @package cms
- * @subpackage content
*/
class CMSSiteTreeFilter_StatusRemovedFromDraftPages extends CMSSiteTreeFilter
{
diff --git a/code/Controllers/ContentController.php b/code/Controllers/ContentController.php
index 6a0a5ae6..35618b06 100755
--- a/code/Controllers/ContentController.php
+++ b/code/Controllers/ContentController.php
@@ -2,35 +2,34 @@
namespace SilverStripe\CMS\Controllers;
-use SilverStripe\ORM\DataObject;
-use SilverStripe\ORM\DataModel;
+use SilverStripe\CMS\Model\SiteTree;
+use SilverStripe\Control\Controller;
+use SilverStripe\Control\Director;
+use SilverStripe\Control\Session;
+use SilverStripe\Control\SS_HTTPRequest;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Control\SS_HTTPResponse_Exception;
+use SilverStripe\Core\Convert;
+use SilverStripe\i18n\i18n;
use SilverStripe\ORM\ArrayList;
+use SilverStripe\ORM\DataModel;
+use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\ORM\FieldType\DBField;
+use SilverStripe\ORM\FieldType\DBHTMLText;
+use SilverStripe\ORM\FieldType\DBVarchar;
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\Versioning\Versioned;
-use SilverStripe\ORM\FieldType\DBVarchar;
-use SilverStripe\ORM\FieldType\DBHTMLText;
-use SilverStripe\Security\Security;
-use SilverStripe\Security\MemberAuthenticator;
use SilverStripe\Security\Member;
+use SilverStripe\Security\MemberAuthenticator;
use SilverStripe\Security\Permission;
-use Controller;
+use SilverStripe\Security\Security;
+use SilverStripe\SiteConfig\SiteConfig;
+use SilverStripe\View\ArrayData;
+use SilverStripe\View\Requirements;
+use SilverStripe\View\SSViewer;
use Page;
-use SiteConfig;
-use SS_HTTPRequest;
use Translatable;
-use i18n;
-use SS_HTTPResponse;
-use SS_HTTPResponse_Exception;
-use Director;
-use Requirements;
-use Convert;
-use SSViewer;
-use ArrayData;
-use Session;
-use SilverStripe\CMS\Model\SiteTree;
-
/**
* The most common kind of controller; effectively a controller linked to a {@link DataObject}.
@@ -47,9 +46,6 @@ use SilverStripe\CMS\Model\SiteTree;
* a controller based on the URLSegment action variable, by looking in the SiteTree table.
*
* @todo Can this be used for anything other than SiteTree controllers?
- *
- * @package cms
- * @subpackage control
*/
class ContentController extends Controller {
@@ -423,10 +419,10 @@ HTML;
// Find templates by dataRecord
SSViewer::get_templates_by_class(get_class($this->dataRecord), $action, "SilverStripe\\CMS\\Model\\SiteTree"),
// Next, we need to add templates for all controllers
- SSViewer::get_templates_by_class(get_class($this), $action, "Controller"),
+ SSViewer::get_templates_by_class(get_class($this), $action, "SilverStripe\\Control\\Controller"),
// Fail-over to the same for the "index" action
SSViewer::get_templates_by_class(get_class($this->dataRecord), "", "SilverStripe\\CMS\\Model\\SiteTree"),
- SSViewer::get_templates_by_class(get_class($this), "", "Controller")
+ SSViewer::get_templates_by_class(get_class($this), "", "SilverStripe\\Control\\Controller")
);
return new SSViewer($templates);
diff --git a/code/Controllers/ErrorPageControllerExtension.php b/code/Controllers/ErrorPageControllerExtension.php
index 26715d82..3ae2fcf8 100644
--- a/code/Controllers/ErrorPageControllerExtension.php
+++ b/code/Controllers/ErrorPageControllerExtension.php
@@ -2,17 +2,14 @@
namespace SilverStripe\CMS\Controllers;
-use Extension;
-use SS_HTTPRequest;
-use SS_HTTPResponse_Exception;
use SilverStripe\CMS\Model\ErrorPage;
-
+use SilverStripe\Control\Director;
+use SilverStripe\Control\SS_HTTPRequest;
+use SilverStripe\Control\SS_HTTPResponse_Exception;
+use SilverStripe\Core\Extension;
/**
* Enhances error handling for a controller with ErrorPage generated output
- *
- * @package cms
- * @subpackage controller
*/
class ErrorPageControllerExtension extends Extension {
@@ -24,7 +21,7 @@ class ErrorPageControllerExtension extends Extension {
* @throws SS_HTTPResponse_Exception
*/
public function onBeforeHTTPError($statusCode, $request) {
- if (\Director::is_ajax()) {
+ if (Director::is_ajax()) {
return;
}
$response = ErrorPage::response_for($statusCode);
diff --git a/code/Controllers/LeftAndMainPageIconsExtension.php b/code/Controllers/LeftAndMainPageIconsExtension.php
index 7c97c677..c088fc4a 100644
--- a/code/Controllers/LeftAndMainPageIconsExtension.php
+++ b/code/Controllers/LeftAndMainPageIconsExtension.php
@@ -2,16 +2,13 @@
namespace SilverStripe\CMS\Controllers;
-use Extension;
-use Requirements;
-use ClassInfo;
-use Director;
+use SilverStripe\View\Requirements;
+use SilverStripe\Core\ClassInfo;
+use SilverStripe\Control\Director;
+use SilverStripe\Core\Extension;
/**
* Extension to include custom page icons
- *
- * @package cms
- * @subpackage controller
*/
class LeftAndMainPageIconsExtension extends Extension {
diff --git a/code/Controllers/ModelAsController.php b/code/Controllers/ModelAsController.php
index b1b9002d..0524ec04 100644
--- a/code/Controllers/ModelAsController.php
+++ b/code/Controllers/ModelAsController.php
@@ -2,31 +2,27 @@
namespace SilverStripe\CMS\Controllers;
-use NestedController;
+use SilverStripe\CMS\Model\SiteTree;
+use SilverStripe\Control\Controller;
+use SilverStripe\Control\Director;
+use SilverStripe\Control\NestedController;
+use SilverStripe\Control\RequestHandler;
+use SilverStripe\Control\SS_HTTPRequest;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Control\SS_HTTPResponse_Exception;
+use SilverStripe\Core\ClassInfo;
+use SilverStripe\Core\Injector\Injector;
+use SilverStripe\Dev\Debug;
+use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\DataModel;
-use SilverStripe\ORM\DB;
use SilverStripe\ORM\DataObject;
-use Controller;
-use ClassInfo;
-use Injector;
-use SS_HTTPRequest;
-use Director;
-use RequestHandler;
-use SS_HTTPResponse;
-use SS_HTTPResponse_Exception;
+use SilverStripe\ORM\DB;
use Exception;
use Translatable;
-use Debug;
-use Deprecation;
-use SilverStripe\CMS\Model\SiteTree;
-
/**
* ModelAsController deals with mapping the initial request to the first {@link SiteTree}/{@link ContentController}
* pair, which are then used to handle the request.
- *
- * @package cms
- * @subpackage control
*/
class ModelAsController extends Controller implements NestedController {
@@ -46,9 +42,13 @@ class ModelAsController extends Controller implements NestedController {
} else {
$ancestry = ClassInfo::ancestry($sitetree->class);
while ($class = array_pop($ancestry)) {
- if (class_exists($class . "_Controller")) break;
+ if (class_exists($class . "_Controller")) {
+ break;
+ }
}
- $controller = ($class !== null) ? "{$class}_Controller" : "SilverStripe\\CMS\\Controllers\\ContentController";
+ $controller = ($class !== null)
+ ? "{$class}_Controller"
+ : "SilverStripe\\CMS\\Controllers\\ContentController";
}
if($action && class_exists($controller . '_' . ucfirst($action))) {
diff --git a/code/Controllers/OldPageRedirector.php b/code/Controllers/OldPageRedirector.php
index 9fadde54..bb5bbd9d 100644
--- a/code/Controllers/OldPageRedirector.php
+++ b/code/Controllers/OldPageRedirector.php
@@ -2,14 +2,14 @@
namespace SilverStripe\CMS\Controllers;
-use SilverStripe\ORM\Queries\SQLSelect;
use SilverStripe\CMS\Model\SiteTree;
-use Extension;
-use Director;
-use SS_HTTPRequest;
-use SS_HTTPResponse;
-use Controller;
-use SS_HTTPResponse_Exception;
+use SilverStripe\Control\Controller;
+use SilverStripe\Control\Director;
+use SilverStripe\Control\SS_HTTPRequest;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Control\SS_HTTPResponse_Exception;
+use SilverStripe\Core\Extension;
+use SilverStripe\ORM\Queries\SQLSelect;
class OldPageRedirector extends Extension {
diff --git a/code/Controllers/RootURLController.php b/code/Controllers/RootURLController.php
index c1a6d868..5832fdea 100644
--- a/code/Controllers/RootURLController.php
+++ b/code/Controllers/RootURLController.php
@@ -3,21 +3,17 @@
namespace SilverStripe\CMS\Controllers;
use SilverStripe\CMS\Model\SiteTree;
+use SilverStripe\Control\Controller;
+use SilverStripe\Control\Director;
+use SilverStripe\Control\SS_HTTPRequest;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Core\ClassInfo;
+use SilverStripe\Core\Config\Config;
+use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\DataModel;
use SilverStripe\ORM\DB;
-use Controller;
-use SS_HTTPResponse;
use Translatable;
-use Config;
-use Deprecation;
-use SS_HTTPRequest;
-use ClassInfo;
-use Director;
-/**
- * @package cms
- * @subpackage control
- */
class RootURLController extends Controller {
/**
diff --git a/code/Controllers/SilverStripeNavigator.php b/code/Controllers/SilverStripeNavigator.php
index 73fdefa7..5acf7618 100644
--- a/code/Controllers/SilverStripeNavigator.php
+++ b/code/Controllers/SilverStripeNavigator.php
@@ -2,14 +2,12 @@
namespace SilverStripe\CMS\Controllers;
+use SilverStripe\Admin\CMSPreviewable;
+use SilverStripe\Core\ClassInfo;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\SS_List;
-use ViewableData;
-use ClassInfo;
-use SilverStripe\Admin\CMSPreviewable;
-use SiteTreeFutureState;
-
+use SilverStripe\View\ViewableData;
/**
* Utility class representing links to different views of a record
@@ -20,9 +18,6 @@ use SiteTreeFutureState;
* New item types can be defined by extending the {@link SilverStripeNavigatorItem} class,
* for example the "cmsworkflow" module defines a new "future state" item with a date selector
* to view embargoed data at a future point in time. So the item doesn't always have to be a simple link.
- *
- * @package cms
- * @subpackage content
*/
class SilverStripeNavigator extends ViewableData {
diff --git a/code/Controllers/SilverStripeNavigatorItem.php b/code/Controllers/SilverStripeNavigatorItem.php
index 5834e4ea..4c248bb6 100644
--- a/code/Controllers/SilverStripeNavigatorItem.php
+++ b/code/Controllers/SilverStripeNavigatorItem.php
@@ -5,15 +5,12 @@ use SilverStripe\Admin\CMSPreviewable;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\Versioning\Versioned;
use SilverStripe\Security\Member;
-use ViewableData;
+use SilverStripe\View\ViewableData;
/**
* Navigator items are links that appear in the $SilverStripeNavigator bar.
* To add an item, extend this class - it will be automatically picked up.
* When instanciating items manually, please ensure to call {@link canView()}.
- *
- * @package cms
- * @subpackage content
*/
abstract class SilverStripeNavigatorItem extends ViewableData
{
@@ -66,6 +63,7 @@ abstract class SilverStripeNavigatorItem extends ViewableData
*/
public function getLink()
{
+ return null;
}
/**
@@ -73,6 +71,7 @@ abstract class SilverStripeNavigatorItem extends ViewableData
*/
public function getMessage()
{
+ return null;
}
/**
diff --git a/code/Controllers/SilverStripeNavigatorItem_ArchiveLink.php b/code/Controllers/SilverStripeNavigatorItem_ArchiveLink.php
index 8248bffa..dd3161f1 100644
--- a/code/Controllers/SilverStripeNavigatorItem_ArchiveLink.php
+++ b/code/Controllers/SilverStripeNavigatorItem_ArchiveLink.php
@@ -7,10 +7,6 @@ use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\Versioning\Versioned;
-/**
- * @package cms
- * @subpackage content
- */
class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem
{
/** @config */
diff --git a/code/Controllers/SilverStripeNavigatorItem_CMSLink.php b/code/Controllers/SilverStripeNavigatorItem_CMSLink.php
index d04d901e..73798eca 100644
--- a/code/Controllers/SilverStripeNavigatorItem_CMSLink.php
+++ b/code/Controllers/SilverStripeNavigatorItem_CMSLink.php
@@ -1,14 +1,10 @@
URLSegment property, and suggest input based on the serverside rules
* defined through {@link SiteTree->generateURLSegment()} and {@link URLSegmentFilter}.
*
* Note: The actual conversion for saving the value takes place in the model layer.
- *
- * @package cms
- * @subpackage forms
*/
class SiteTreeURLSegmentField extends TextField {
diff --git a/code/Forms/SiteTreeURLSegmentField_Readonly.php b/code/Forms/SiteTreeURLSegmentField_Readonly.php
index 28501b24..e9b0886b 100644
--- a/code/Forms/SiteTreeURLSegmentField_Readonly.php
+++ b/code/Forms/SiteTreeURLSegmentField_Readonly.php
@@ -1,11 +1,9 @@
getTitle();
}
diff --git a/code/Model/CurrentPageIdentifier.php b/code/Model/CurrentPageIdentifier.php
index 169a1611..9794f6fb 100644
--- a/code/Model/CurrentPageIdentifier.php
+++ b/code/Model/CurrentPageIdentifier.php
@@ -6,8 +6,6 @@ use SilverStripe\ORM\DataObject;
/**
* This interface lets us set up objects that will tell us what the current page is.
- * @package cms
- * @subpackage model
*/
interface CurrentPageIdentifier {
diff --git a/code/Model/ErrorPage.php b/code/Model/ErrorPage.php
index 4bf3c6fb..9cf699d8 100644
--- a/code/Model/ErrorPage.php
+++ b/code/Model/ErrorPage.php
@@ -2,23 +2,21 @@
namespace SilverStripe\CMS\Model;
-use FieldList;
-use SilverStripe\Filesystem\Storage\GeneratedAssetHandler;
+use SilverStripe\Assets\Storage\GeneratedAssetHandler;
+use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\DataModel;
use SilverStripe\ORM\Versioning\Versioned;
use SilverStripe\ORM\DB;
-use Page;
-use Requirements;
use SilverStripe\CMS\Controllers\ModelAsController;
-use SS_HTTPRequest;
-use SS_HTTPResponse;
-use DropdownField;
-use File;
-use Config;
-use Director;
-use Injector;
-use Page_Controller;
-
+use SilverStripe\View\Requirements;
+use SilverStripe\Control\SS_HTTPRequest;
+use SilverStripe\Control\SS_HTTPResponse;
+use SilverStripe\Forms\DropdownField;
+use SilverStripe\Assets\File;
+use SilverStripe\Core\Config\Config;
+use SilverStripe\Control\Director;
+use SilverStripe\Core\Injector\Injector;
+use Page;
/**
* ErrorPage holds the content for the page of an error response.
@@ -31,7 +29,6 @@ use Page_Controller;
* @see Debug::friendlyError()
*
* @property int $ErrorCode HTTP Error code
- * @package cms
*/
class ErrorPage extends Page {
@@ -299,7 +296,7 @@ class ErrorPage extends Page {
// Run the page (reset the theme, it might've been disabled by LeftAndMain::init())
Config::nest();
- Config::inst()->update('SSViewer', 'theme_enabled', true);
+ Config::inst()->update('SilverStripe\\View\\SSViewer', 'theme_enabled', true);
$response = Director::test(Director::makeRelative($this->Link()));
Config::unnest();
$errorContent = $response->getBody();
diff --git a/code/Model/ErrorPage_Controller.php b/code/Model/ErrorPage_Controller.php
index b396704f..517bfbe8 100644
--- a/code/Model/ErrorPage_Controller.php
+++ b/code/Model/ErrorPage_Controller.php
@@ -1,15 +1,14 @@
get('ContentNegotiator', 'encoding');
+ $charset = Config::inst()->get('SilverStripe\\Control\\ContentNegotiator', 'encoding');
$tags[] = FormField::create_tag('meta', array(
'http-equiv' => 'Content-Type',
'content' => 'text/html; charset=' . $charset,
@@ -1704,7 +1701,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
}
if(!self::config()->nested_urls || !$this->ParentID) {
- if(class_exists($this->URLSegment) && is_subclass_of($this->URLSegment, 'RequestHandler')) return false;
+ if(class_exists($this->URLSegment) && is_subclass_of($this->URLSegment, 'SilverStripe\\Control\\RequestHandler')) return false;
}
// Filters by url, id, and parent
@@ -1928,7 +1925,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$dependentPages
);
/** @var GridFieldDataColumns $dataColumns */
- $dataColumns = $dependentTable->getConfig()->getComponentByType('GridFieldDataColumns');
+ $dataColumns = $dependentTable->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns');
$dataColumns
->setDisplayFields($dependentColumns)
->setFieldFormatting(array(
@@ -1963,7 +1960,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$helpText = (self::config()->nested_urls && $this->Children()->count())
? $this->fieldLabel('LinkChangeNote')
: '';
- if(!Config::inst()->get('URLSegmentFilter', 'default_allow_multibyte')) {
+ if(!Config::inst()->get('SilverStripe\\View\\Parsers\\URLSegmentFilter', 'default_allow_multibyte')) {
$helpText .= $helpText ? '
' : '';
$helpText .= _t('SiteTreeURLSegmentField.HelpChars', ' Special characters are automatically converted or removed.');
}
@@ -2036,12 +2033,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
. "
[image src="/assets/FileLinkTrackingTest/55b443b601/testscript-test-file.jpg" id="%d"]
', @@ -66,7 +70,7 @@ class FileLinkTrackingTest extends SapphireTest { ); Versioned::set_stage(Versioned::DRAFT); - $file = $this->objFromFixture('Image', 'file1'); + $file = $this->objFromFixture('SilverStripe\\Assets\\Image', 'file1'); $file->Name = 'renamed-test-file.jpg'; $file->write(); @@ -125,7 +129,7 @@ class FileLinkTrackingTest extends SapphireTest { $svp->publishRecursive(); // Rename the file - $file = $this->objFromFixture('Image', 'file1'); + $file = $this->objFromFixture('SilverStripe\\Assets\\Image', 'file1'); $file->Name = 'renamed-test-file.jpg'; $file->write(); @@ -154,7 +158,7 @@ class FileLinkTrackingTest extends SapphireTest { $this->assertFalse($page->getIsModifiedOnStage()); // Rename the file - $file = $this->objFromFixture('Image', 'file1'); + $file = $this->objFromFixture('SilverStripe\\Assets\\Image', 'file1'); $file->Name = 'renamed-test-file.jpg'; $file->write(); @@ -178,13 +182,13 @@ class FileLinkTrackingTest extends SapphireTest { // Rename the file twice Versioned::set_stage(Versioned::DRAFT); - $file = $this->objFromFixture('Image', 'file1'); + $file = $this->objFromFixture('SilverStripe\\Assets\\Image', 'file1'); $file->Name = 'renamed-test-file.jpg'; $file->write(); // TODO Workaround for bug in DataObject->getChangedFields(), which returns stale data, // and influences File->updateFilesystem() - $file = DataObject::get_by_id('File', $file->ID); + $file = DataObject::get_by_id('SilverStripe\\Assets\\File', $file->ID); $file->Name = 'renamed-test-file-second-time.jpg'; $file->write(); $file->publishRecursive(); diff --git a/tests/model/FileLinkTrackingTest.yml b/tests/model/FileLinkTrackingTest.yml index 6c061472..983de4fd 100644 --- a/tests/model/FileLinkTrackingTest.yml +++ b/tests/model/FileLinkTrackingTest.yml @@ -1,12 +1,12 @@ # These need to come first so that SiteTree has the link meta-data written. -Image: +SilverStripe\Assets\Image: file1: FileFilename: testscript-test-file.jpg FileHash: 55b443b60176235ef09801153cca4e6da7494a0c Name: testscript-test-file.jpg -Page: +Page: page1: Title: page1 URLSegment: page1 - # Content is set via test setup \ No newline at end of file + # Content is set via test setup diff --git a/tests/model/RedirectorPageTest.php b/tests/model/RedirectorPageTest.php index 41ee7e54..75b7780a 100644 --- a/tests/model/RedirectorPageTest.php +++ b/tests/model/RedirectorPageTest.php @@ -2,6 +2,11 @@ use SilverStripe\CMS\Model\RedirectorPage; use SilverStripe\CMS\Model\RedirectorPage_Controller; +use SilverStripe\Control\Director; +use SilverStripe\Dev\FunctionalTest; +use SilverStripe\Core\Extension; +use SilverStripe\Dev\TestOnly; + class RedirectorPageTest extends FunctionalTest { protected static $fixture_file = 'RedirectorPageTest.yml'; diff --git a/tests/model/SiteTreeActionsTest.php b/tests/model/SiteTreeActionsTest.php index 12a72454..44833394 100644 --- a/tests/model/SiteTreeActionsTest.php +++ b/tests/model/SiteTreeActionsTest.php @@ -3,6 +3,9 @@ use SilverStripe\ORM\Versioning\Versioned; use SilverStripe\ORM\DB; use SilverStripe\Security\Permission; +use SilverStripe\Dev\FunctionalTest; +use SilverStripe\Dev\TestOnly; + /** * Possible actions: diff --git a/tests/model/SiteTreeBacklinksTest.php b/tests/model/SiteTreeBacklinksTest.php index 7dbab0f6..98ad52ba 100644 --- a/tests/model/SiteTreeBacklinksTest.php +++ b/tests/model/SiteTreeBacklinksTest.php @@ -2,6 +2,13 @@ use SilverStripe\ORM\Versioning\Versioned; use SilverStripe\ORM\DataExtension; +use SilverStripe\Control\HTTP; +use SilverStripe\Control\Director; +use SilverStripe\Dev\SapphireTest; +use SilverStripe\Forms\FieldList; +use SilverStripe\Forms\HTMLEditor\HTMLEditorField; +use SilverStripe\Dev\TestOnly; + /** * Tests {@see SiteTreeLinkTracking} broken links feature: LinkTracking diff --git a/tests/model/SiteTreeBrokenLinksTest.php b/tests/model/SiteTreeBrokenLinksTest.php index d9cc8be8..311efa24 100644 --- a/tests/model/SiteTreeBrokenLinksTest.php +++ b/tests/model/SiteTreeBrokenLinksTest.php @@ -5,6 +5,9 @@ use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DB; use SilverStripe\CMS\Model\VirtualPage; use SilverStripe\CMS\Model\RedirectorPage; +use SilverStripe\Assets\File; +use SilverStripe\Dev\SapphireTest; + /** diff --git a/tests/model/SiteTreeHTMLEditorFieldTest.php b/tests/model/SiteTreeHTMLEditorFieldTest.php index 3f9ad877..bdff016a 100644 --- a/tests/model/SiteTreeHTMLEditorFieldTest.php +++ b/tests/model/SiteTreeHTMLEditorFieldTest.php @@ -1,6 +1,12 @@ logInWithPermission('ADMIN'); // Write file contents - $files = File::get()->exclude('ClassName', 'Folder'); + $files = File::get()->exclude('ClassName', 'SilverStripe\\Assets\\Folder'); foreach($files as $file) { $destPath = AssetStoreTest_SpyStore::getLocalPath($file); Filesystem::makeFolder(dirname($destPath)); @@ -67,7 +73,7 @@ class SiteTreeHTMLEditorFieldTest extends FunctionalTest { public function testFileLinkTracking() { $sitetree = $this->objFromFixture('SilverStripe\\CMS\\Model\\SiteTree', 'home'); $editor = new HTMLEditorField('Content'); - $fileID = $this->idFromFixture('File', 'example_file'); + $fileID = $this->idFromFixture('SilverStripe\\Assets\\File', 'example_file'); $editor->setValue(sprintf( '', @@ -124,7 +130,7 @@ class SiteTreeHTMLEditorFieldTest extends FunctionalTest { public function testImageTracking() { $sitetree = $this->objFromFixture('SilverStripe\\CMS\\Model\\SiteTree', 'home'); $editor = new HTMLEditorField('Content'); - $file = $this->objFromFixture('Image', 'example_image'); + $file = $this->objFromFixture('SilverStripe\\Assets\\Image', 'example_image'); $editor->setValue(sprintf('[image src="%s" id="%d"]', $file->getURL(), $file->ID)); $editor->saveInto($sitetree); @@ -181,7 +187,7 @@ class SiteTreeHTMLEditorFieldTest extends FunctionalTest { $editor->setValue(sprintf ( '', - $this->idFromFixture('File', 'example_file') + $this->idFromFixture('SilverStripe\\Assets\\File', 'example_file') )); $sitetree->HasBrokenFile = false; $editor->saveInto($sitetree); diff --git a/tests/model/SiteTreeHTMLEditorFieldTest.yml b/tests/model/SiteTreeHTMLEditorFieldTest.yml index d6372dd9..efe29582 100644 --- a/tests/model/SiteTreeHTMLEditorFieldTest.yml +++ b/tests/model/SiteTreeHTMLEditorFieldTest.yml @@ -6,13 +6,13 @@ SilverStripe\CMS\Model\SiteTree: contact: Title: Contact Us -File: +SilverStripe\Assets\File: example_file: FileFilename: example.pdf FileHash: 55b443b60176235ef09801153cca4e6da7494a0c Name: example.pdf -Image: +SilverStripe\Assets\Image: example_image: FileFilename: example.jpg FileHash: 55b443b60176235ef09801153cca4e6da7494a0c diff --git a/tests/model/SiteTreeLinkTrackingTest.php b/tests/model/SiteTreeLinkTrackingTest.php index bd16291d..88032373 100644 --- a/tests/model/SiteTreeLinkTrackingTest.php +++ b/tests/model/SiteTreeLinkTrackingTest.php @@ -1,6 +1,10 @@ objFromFixture('Page', 'inheritWithNoParent'); - $siteconfig = $this->objFromFixture('SiteConfig', 'default'); + $siteconfig = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); $editor = $this->objFromFixture('SilverStripe\\Security\\Member', 'editor'); $editorGroup = $this->objFromFixture('SilverStripe\\Security\\Group', 'editorgroup'); @@ -430,7 +434,7 @@ class SiteTreePermissionsTest extends FunctionalTest { public function testInheritCanEditFromSiteConfig() { $page = $this->objFromFixture('Page', 'inheritWithNoParent'); - $siteconfig = $this->objFromFixture('SiteConfig', 'default'); + $siteconfig = $this->objFromFixture('SilverStripe\\SiteConfig\\SiteConfig', 'default'); $editor = $this->objFromFixture('SilverStripe\\Security\\Member', 'editor'); $user = $this->objFromFixture('SilverStripe\\Security\\Member', 'websiteuser'); $editorGroup = $this->objFromFixture('SilverStripe\\Security\\Group', 'editorgroup'); diff --git a/tests/model/SiteTreePermissionsTest.yml b/tests/model/SiteTreePermissionsTest.yml index c573a330..06faa371 100644 --- a/tests/model/SiteTreePermissionsTest.yml +++ b/tests/model/SiteTreePermissionsTest.yml @@ -1,4 +1,4 @@ -SiteConfig: +SilverStripe\SiteConfig\SiteConfig: default: Title: My test site Tagline: There is no doubt this is a great test site diff --git a/tests/model/SiteTreeTest.php b/tests/model/SiteTreeTest.php index f2b0fecc..21c6f2b9 100644 --- a/tests/model/SiteTreeTest.php +++ b/tests/model/SiteTreeTest.php @@ -11,6 +11,17 @@ use SilverStripe\Security\Permission; use SilverStripe\Security\Group; use SilverStripe\CMS\Model\SiteTree; use SilverStripe\CMS\Model\SiteTreeExtension; +use SilverStripe\Core\Config\Config; +use SilverStripe\SiteConfig\SiteConfig; +use SilverStripe\Control\Session; +use SilverStripe\View\Parsers\ShortcodeParser; +use SilverStripe\Control\Director; +use SilverStripe\i18n\i18n; +use SilverStripe\Dev\SapphireTest; +use SilverStripe\Dev\TestOnly; +use SilverStripe\View\Parsers\HTMLCleaner; +use SilverStripe\View\Parsers\Diff; + /** @@ -81,7 +92,7 @@ class SiteTreeTest extends SapphireTest { 'product3' => 'another-product-2', 'product4' => 'another-product-3', 'object' => 'object', - 'controller' => 'controller-2', + 'controller' => 'controller', 'numericonly' => '1930', ); @@ -806,7 +817,7 @@ class SiteTreeTest extends SapphireTest { */ public function testValidURLSegmentClassNameConflicts() { $sitetree = new SiteTree(); - $sitetree->URLSegment = 'Controller'; + $sitetree->URLSegment = 'SilverStripe\\Control\\Controller'; $this->assertFalse($sitetree->validURLSegment(), 'Class name conflicts are recognised'); } @@ -846,8 +857,8 @@ class SiteTreeTest extends SapphireTest { } public function testURLSegmentMultiByte() { - $origAllow = Config::inst()->get('URLSegmentFilter', 'default_allow_multibyte'); - Config::inst()->update('URLSegmentFilter', 'default_allow_multibyte', true); + $origAllow = Config::inst()->get('SilverStripe\\View\\Parsers\\URLSegmentFilter', 'default_allow_multibyte'); + Config::inst()->update('SilverStripe\\View\\Parsers\\URLSegmentFilter', 'default_allow_multibyte', true); $sitetree = new SiteTree(); $sitetree->write(); @@ -862,7 +873,7 @@ class SiteTreeTest extends SapphireTest { $sitetreeLive = Versioned::get_one_by_stage('SilverStripe\\CMS\\Model\\SiteTree', 'Live', '"SiteTree"."ID" = ' .$sitetree->ID, false); $this->assertEquals($sitetreeLive->URLSegment, rawurlencode('brötchen')); - Config::inst()->update('URLSegmentFilter', 'default_allow_multibyte', $origAllow); + Config::inst()->update('SilverStripe\\View\\Parsers\\URLSegmentFilter', 'default_allow_multibyte', $origAllow); } public function testVersionsAreCreated() { @@ -1134,7 +1145,7 @@ class SiteTreeTest extends SapphireTest { // Test with title $meta = $page->MetaTags(); - $charset = Config::inst()->get('ContentNegotiator', 'encoding'); + $charset = Config::inst()->get('SilverStripe\\Control\\ContentNegotiator', 'encoding'); $this->assertContains('assertContains('assertContains('mockController, 'SilverStripe\\CMS\\Search\\SearchForm'); - $dontShowInSearchFile = $this->objFromFixture('File', 'dontShowInSearchFile'); + $dontShowInSearchFile = $this->objFromFixture('SilverStripe\\Assets\\File', 'dontShowInSearchFile'); $dontShowInSearchFile->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE); - $showInSearchFile = $this->objFromFixture('File', 'showInSearchFile'); + $showInSearchFile = $this->objFromFixture('SilverStripe\\Assets\\File', 'showInSearchFile'); $showInSearchFile->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE); $results = $sf->getResults(null, array('Search'=>'dontShowInSearchFile')); diff --git a/tests/search/SearchFormTest.yml b/tests/search/SearchFormTest.yml index d0838f97..b5e57525 100644 --- a/tests/search/SearchFormTest.yml +++ b/tests/search/SearchFormTest.yml @@ -34,7 +34,7 @@ SilverStripe\CMS\Model\SiteTree: pageWithSpecialChars: Title: Brötchen Content: Frisch vom Bäcker -File: +SilverStripe\Assets\File: showInSearchFile: Title: showInSearchFile ShowInSearch: 1 diff --git a/tests/tasks/MigrateSiteTreeLinkingTaskTest.php b/tests/tasks/MigrateSiteTreeLinkingTaskTest.php index 2db39f6d..99c32f77 100644 --- a/tests/tasks/MigrateSiteTreeLinkingTaskTest.php +++ b/tests/tasks/MigrateSiteTreeLinkingTaskTest.php @@ -2,6 +2,8 @@ use SilverStripe\ORM\DataObject; use SilverStripe\CMS\Tasks\MigrateSiteTreeLinkingTask; +use SilverStripe\Dev\SapphireTest; + /** diff --git a/tests/tasks/RemoveOrphanedPagesTaskTest.php b/tests/tasks/RemoveOrphanedPagesTaskTest.php index 474d282f..cef05259 100644 --- a/tests/tasks/RemoveOrphanedPagesTaskTest.php +++ b/tests/tasks/RemoveOrphanedPagesTaskTest.php @@ -1,6 +1,8 @@ Fixture tree