diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe26bbb..37730e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,12 +15,12 @@ on: jobs: - silverstripe_411_php74: - name: "Silverstripe 4.11 | PHP 7.4" + silverstripe_5_php81: + name: "Silverstripe 5.0 | PHP 8.1" runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')" env: - php_version: 7.4 + php_version: 8.1 php_extensions: ctype, dom, fileinfo, hash, intl, mbstring, session, simplexml, tokenizer, xml, pdo, mysqli, gd, zip services: mysql: @@ -69,8 +69,8 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-ss411-php74-${{ hashFiles('**/composer.json') }}-${{ hashFiles('.github/workflows/ci.yml') }} - restore-keys: ${{ runner.os }}-composer-ss411-php74- + key: ${{ runner.os }}-composer-ss5-php81-${{ hashFiles('**/composer.json') }}-${{ hashFiles('.github/workflows/ci.yml') }} + restore-keys: ${{ runner.os }}-composer-ss5-php81- - name: Install Composer dependencies env: @@ -78,8 +78,8 @@ jobs: run: | composer self-update --ansi || true if [[ $GITHUB_ACCESS_TOKEN ]]; then composer config --ansi -g github-oauth.github.com $GITHUB_ACCESS_TOKEN; fi - composer require silverstripe/admin 1.11.* --no-update - composer require silverstripe/versioned 1.11.* + composer require silverstripe/admin 2.0.* --no-update + composer require silverstripe/versioned 2.0.* composer install --verbose --no-interaction --no-progress --no-suggest --optimize-autoloader --ansi - name: Configure Environment @@ -177,7 +177,7 @@ jobs: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')" env: - php_version: 7.4 + php_version: 8.0 php_extensions: ctype, dom, fileinfo, hash, intl, mbstring, session, simplexml, tokenizer, xml, pdo, mysqli, gd, zip steps: diff --git a/composer.json b/composer.json index bb81046..1f1bd72 100644 --- a/composer.json +++ b/composer.json @@ -12,9 +12,8 @@ } ], "require": { - "silverstripe/framework": "~4.11", - "silverstripe/versioned": "^1.0", - "silverstripe/vendor-plugin": "^1.0" + "silverstripe/framework": "~4.11 | ^5", + "silverstripe/versioned": "^1 | ^2" }, "require-dev": { "phpunit/phpunit": "^9.5", diff --git a/src/Forms/GridFieldSortableRows.php b/src/Forms/GridFieldSortableRows.php index 8fa6a40..df21d18 100644 --- a/src/Forms/GridFieldSortableRows.php +++ b/src/Forms/GridFieldSortableRows.php @@ -223,7 +223,7 @@ class GridFieldSortableRows extends AbstractGridFieldComponent implements GridFi $list = clone $dataList; $list = $list->alterDataQuery(function ($query, SS_List $tmplist) { /** @var \SilverStripe\ORM\DataQuery $query */ - $query->limit([]); + $query->limit(null); return $query; }); diff --git a/tests/PHPUnit/Forms/AutoSortTest.php b/tests/PHPUnit/Forms/AutoSortTest.php index af0e211..c199b67 100644 --- a/tests/PHPUnit/Forms/AutoSortTest.php +++ b/tests/PHPUnit/Forms/AutoSortTest.php @@ -111,7 +111,7 @@ class AutoSortTest extends SapphireTest //Publish all records foreach ($list as $item) { - $item->publish('Stage', 'Live'); + $item->publishSingle(); } @@ -168,7 +168,7 @@ class AutoSortTest extends SapphireTest //Publish all records foreach ($list as $item) { - $item->publish('Stage', 'Live'); + $item->publishSingle(); } diff --git a/tests/PHPUnit/Forms/OrderingTest.php b/tests/PHPUnit/Forms/OrderingTest.php index 4d54002..f4da413 100644 --- a/tests/PHPUnit/Forms/OrderingTest.php +++ b/tests/PHPUnit/Forms/OrderingTest.php @@ -1,6 +1,7 @@ logOut(); + if (Security::getCurrentUser()) { + Injector::inst()->get(IdentityStore::class)->logOut(Controller::curr()->getRequest()); } $this->expectException(ValidationException::class); @@ -97,7 +99,7 @@ class OrderingTest extends SapphireTest //Publish all records foreach ($list as $item) { - $item->publish('Stage', 'Live'); + $item->publishSingle(); } $team1 = $this->objFromFixture(VTeam::class, 'team1'); diff --git a/tests/PHPUnit/Forms/PageSortingTest.php b/tests/PHPUnit/Forms/PageSortingTest.php index fc44df1..25d4615 100644 --- a/tests/PHPUnit/Forms/PageSortingTest.php +++ b/tests/PHPUnit/Forms/PageSortingTest.php @@ -107,7 +107,7 @@ class PageSortingTest extends SapphireTest //Publish all records foreach ($list as $item) { - $item->publish('Stage', 'Live'); + $item->publishSingle(); } @@ -154,7 +154,7 @@ class PageSortingTest extends SapphireTest //Publish all records foreach ($list as $item) { - $item->publish('Stage', 'Live'); + $item->publishSingle(); }