From 02e0b20210f26d6ab67df30e4c6c6b4bc8a5efa7 Mon Sep 17 00:00:00 2001 From: Jayden Seric Date: Fri, 9 Sep 2016 17:00:05 +1000 Subject: [PATCH] Fixed name-spacing for SilverStripe v4 compatibility Used [silverstripe-upgrader](https://github.com/silverstripe/silverstripe-upgrader) to fix name-spacing for SilverStripe v4. I then alphabetically sorted the use declarations for readability. Fixes: https://github.com/silverstripe-australia/silverstripe-gridfieldextensions/issues/166. --- code/GridFieldAddExistingSearchButton.php | 6 ++++++ code/GridFieldAddExistingSearchHandler.php | 11 +++++++++- code/GridFieldAddNewInlineButton.php | 13 ++++++++++++ code/GridFieldAddNewMultiClass.php | 14 ++++++++++++- code/GridFieldAddNewMultiClassHandler.php | 4 ++++ code/GridFieldEditableColumns.php | 19 ++++++++++++++++- code/GridFieldExtensions.php | 3 +++ code/GridFieldExternalLink.php | 4 ++++ code/GridFieldOrderableRows.php | 24 ++++++++++++++++++++-- code/GridFieldRequestHandler.php | 15 +++++++++++++- code/GridFieldTitleHeader.php | 5 +++++ tests/GridFieldAddNewMultiClassTest.php | 5 +++++ tests/GridFieldOrderableRowsTest.php | 7 +++++++ 13 files changed, 124 insertions(+), 6 deletions(-) diff --git a/code/GridFieldAddExistingSearchButton.php b/code/GridFieldAddExistingSearchButton.php index 78638a2..d300d1c 100755 --- a/code/GridFieldAddExistingSearchButton.php +++ b/code/GridFieldAddExistingSearchButton.php @@ -1,4 +1,10 @@ context->getFields(), new FieldList( FormAction::create('doSearch', _t('GridFieldExtensions.SEARCH', 'Search')) diff --git a/code/GridFieldAddNewInlineButton.php b/code/GridFieldAddNewInlineButton.php index d30af17..559de71 100755 --- a/code/GridFieldAddNewInlineButton.php +++ b/code/GridFieldAddNewInlineButton.php @@ -1,4 +1,17 @@ param('ClassName'); $classes = $this->getClasses($grid); - $component = $grid->getConfig()->getComponentByType('GridFieldDetailForm'); + $component = $grid->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDetailForm'); if(!$component) { throw new Exception('The add new multi class component requires the detail form component.'); diff --git a/code/GridFieldAddNewMultiClassHandler.php b/code/GridFieldAddNewMultiClassHandler.php index cf99b5b..fe87a36 100644 --- a/code/GridFieldAddNewMultiClassHandler.php +++ b/code/GridFieldAddNewMultiClassHandler.php @@ -1,4 +1,8 @@ getConfig()->getComponentByType('GridFieldPaginator')) { + if(!$paginator = $grid->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldPaginator')) { $this->httpError(404, 'Paginator component not found'); } @@ -461,7 +481,7 @@ class GridFieldOrderableRows extends RequestHandler implements $isVersioned = false; $class = $list->dataClass(); if ($class == $this->getSortTable($list)) { - $isVersioned = $class::has_extension('Versioned'); + $isVersioned = $class::has_extension('SilverStripe\\ORM\\Versioning\\Versioned'); } // Loop through each item, and update the sort values which do not diff --git a/code/GridFieldRequestHandler.php b/code/GridFieldRequestHandler.php index 4391f70..c06c324 100644 --- a/code/GridFieldRequestHandler.php +++ b/code/GridFieldRequestHandler.php @@ -1,4 +1,17 @@