From bdc05b3ce57d0af40b01646a6389481dc3139632 Mon Sep 17 00:00:00 2001 From: Al Date: Thu, 31 Aug 2023 07:32:48 +0000 Subject: [PATCH] feat!: upgrade module to work with SS5 --- .github/workflows/tests.yml | 10 +++++----- composer.json | 12 ++++++++++-- src/Extensions/SecurityAdminExtension.php | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2106dd9..0fd541f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,10 +39,10 @@ jobs: uses: actions/checkout@v3 with: persist-credentials: false - - name: Use PHP 7.1 + - name: Use PHP 8.1 uses: shivammathur/setup-php@v2 with: - php-version: 7.1 + php-version: 8.1 tools: composer:v2 - name: Get composer cache directory id: composer-cache @@ -51,8 +51,8 @@ jobs: uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-php7.1-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer-php7.1- + key: ${{ runner.os }}-composer-php8.1-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer-php8.1- - name: Install dependencies run: composer install --prefer-dist --no-progress --no-interaction --no-scripts --no-plugins - name: Lint code @@ -67,7 +67,7 @@ jobs: DB: mysql strategy: matrix: - php_version: ['7.1'] + php_version: ['8.1'] services: mysql: image: mysql:5.7-debian diff --git a/composer.json b/composer.json index 8c33dd8..a71b9a1 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,10 @@ "description": "SilverStripe module to allow you to masquerade as other users", "type": "silverstripe-vendormodule", "require": { - "silverstripe/framework": "^4" + "silverstripe/framework": "^5" }, "require-dev": { - "phpunit/phpunit": "^5.7", + "phpunit/phpunit": "*", "squizlabs/php_codesniffer": "^3.7" }, "config": { @@ -42,6 +42,14 @@ "dev-master": "0.x-dev" } }, + "config": { + "allow-plugins": { + "composer/installers": true, + "silverstripe/recipe-plugin": true, + "silverstripe/vendor-plugin": true, + "php-http/discovery": true + } + }, "prefer-stable": true, "minimum-stability": "dev" } diff --git a/src/Extensions/SecurityAdminExtension.php b/src/Extensions/SecurityAdminExtension.php index 8c82906..540d8f4 100644 --- a/src/Extensions/SecurityAdminExtension.php +++ b/src/Extensions/SecurityAdminExtension.php @@ -12,7 +12,7 @@ class SecurityAdminExtension extends Extension public function updateEditForm(Form $form) { /** @var GridField $gridField */ - $gridField = $form->Fields()->dataFieldByName('Members'); + $gridField = $form->Fields()->dataFieldByName('users'); $gridField->getConfig() ->addComponent(new GridFieldMasqueradeButton()); }