From 3701ff11bb91b80155ae1d196dd312a44378390f Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Tue, 4 Jun 2024 09:06:41 -0300 Subject: [PATCH 1/9] Deprecations in tests. --- .github/workflows/build-2.x.yml | 6 +++--- src/Plugin/Field/FieldType/MediaTrackItem.php | 2 +- tests/src/Functional/AddMediaToNodeTest.php | 4 ++-- tests/src/Functional/IslandoraFunctionalTestBase.php | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-2.x.yml b/.github/workflows/build-2.x.yml index 8cd9f1d1e..41b4362ad 100644 --- a/.github/workflows/build-2.x.yml +++ b/.github/workflows/build-2.x.yml @@ -48,7 +48,7 @@ jobs: - 61613:61613 steps: - + - name: Checkout code uses: actions/checkout@v4 with: @@ -74,7 +74,7 @@ jobs: sudo apt-get install -y mysql-client - name: Cache Composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/composer-cache key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} @@ -105,7 +105,7 @@ jobs: - name: Test scripts run: $SCRIPT_DIR/travis_scripts.sh - + - name: Start chromedriver if: matrix.test-suite == 'functional-javascript' run: |- diff --git a/src/Plugin/Field/FieldType/MediaTrackItem.php b/src/Plugin/Field/FieldType/MediaTrackItem.php index d281ed216..68756ae59 100644 --- a/src/Plugin/Field/FieldType/MediaTrackItem.php +++ b/src/Plugin/Field/FieldType/MediaTrackItem.php @@ -16,7 +16,7 @@ * id = "media_track", * label = @Translation("Media track"), * description = @Translation("This field stores the ID of a media track file as an integer value."), - * category = @Translation("Reference"), + * category = "reference", * default_widget = "media_track", * default_formatter = "file_default", * column_groups = { diff --git a/tests/src/Functional/AddMediaToNodeTest.php b/tests/src/Functional/AddMediaToNodeTest.php index 4b0b62c52..ab67a6604 100644 --- a/tests/src/Functional/AddMediaToNodeTest.php +++ b/tests/src/Functional/AddMediaToNodeTest.php @@ -3,7 +3,7 @@ namespace Drupal\Tests\islandora\Functional; use Drupal\Core\Url; -use Drupal\Tests\field\Traits\EntityReferenceTestTrait; +use Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait; /** * Tests the RelatedLinkHeader view alter. @@ -12,7 +12,7 @@ */ class AddMediaToNodeTest extends IslandoraFunctionalTestBase { - use EntityReferenceTestTrait; + use EntityReferenceFieldCreationTrait; /** * Node to hold the media. diff --git a/tests/src/Functional/IslandoraFunctionalTestBase.php b/tests/src/Functional/IslandoraFunctionalTestBase.php index 1ad8081d1..f9f472aa4 100644 --- a/tests/src/Functional/IslandoraFunctionalTestBase.php +++ b/tests/src/Functional/IslandoraFunctionalTestBase.php @@ -8,7 +8,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\link\LinkItemInterface; use Drupal\Tests\BrowserTestBase; -use Drupal\Tests\field\Traits\EntityReferenceTestTrait; +use Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait; use Drupal\Tests\media\Traits\MediaTypeCreationTrait; use Drupal\Tests\TestFileCreationTrait; @@ -17,7 +17,7 @@ */ class IslandoraFunctionalTestBase extends BrowserTestBase { - use EntityReferenceTestTrait; + use EntityReferenceFieldCreationTrait; use TestFileCreationTrait; use MediaTypeCreationTrait; use StringTranslationTrait; @@ -30,6 +30,7 @@ class IslandoraFunctionalTestBase extends BrowserTestBase { 'field_ui', 'islandora', 'menu_link_content', + ]; /** From b1c03b295ab4d018113ae2ee381d9edec07f4625 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Tue, 4 Jun 2024 09:08:02 -0300 Subject: [PATCH 2/9] Clean up extra space. --- tests/src/Functional/IslandoraFunctionalTestBase.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/src/Functional/IslandoraFunctionalTestBase.php b/tests/src/Functional/IslandoraFunctionalTestBase.php index f9f472aa4..e58ec0162 100644 --- a/tests/src/Functional/IslandoraFunctionalTestBase.php +++ b/tests/src/Functional/IslandoraFunctionalTestBase.php @@ -30,7 +30,6 @@ class IslandoraFunctionalTestBase extends BrowserTestBase { 'field_ui', 'islandora', 'menu_link_content', - ]; /** From 140c3cb4821e8a34df462c86f75795e3811637e3 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Wed, 5 Jun 2024 13:07:29 -0300 Subject: [PATCH 3/9] Backwards compatibility. --- islandora.module | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/islandora.module b/islandora.module index 8fa478a7f..6fde6912b 100644 --- a/islandora.module +++ b/islandora.module @@ -652,3 +652,16 @@ function islandora_preprocess_views_view_table(&$variables) { } } } + +/** + * Implements hook_field_info_alter(). + * + * @todo Remove once minimum version supported is at least 10.2.0. + */ +function islandora_field_info_alter(array &$info): void { + // Allow module to work with versions of older versions of Drupal. + if (\version_compare(\Drupal::VERSION, '10.1.9999', '<')) { + $info['reference']['category'] = new TranslatableMarkup("Reference"); + } +} + From c400bed9388053df2a140d89eb4e0ad4d96d3fe3 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Wed, 5 Jun 2024 13:41:39 -0300 Subject: [PATCH 4/9] use TranslatableMarkup. --- islandora.module | 1 + 1 file changed, 1 insertion(+) diff --git a/islandora.module b/islandora.module index 6fde6912b..af8407749 100644 --- a/islandora.module +++ b/islandora.module @@ -21,6 +21,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Site\Settings; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Url; use Drupal\file\FileInterface; use Drupal\islandora\Form\IslandoraSettingsForm; From f584139e01a1cbb18a0db62349975cd5984111fa Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Wed, 5 Jun 2024 13:54:18 -0300 Subject: [PATCH 5/9] Remove sneaky newline. --- islandora.module | 1 - 1 file changed, 1 deletion(-) diff --git a/islandora.module b/islandora.module index af8407749..1f8cab5e7 100644 --- a/islandora.module +++ b/islandora.module @@ -665,4 +665,3 @@ function islandora_field_info_alter(array &$info): void { $info['reference']['category'] = new TranslatableMarkup("Reference"); } } - From 9faa359af4265da2b5f0f1c0ea78c89a14e6aace Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Tue, 18 Jun 2024 15:46:55 -0300 Subject: [PATCH 6/9] Revert "Backwards compatibility." This reverts commit 140c3cb4821e8a34df462c86f75795e3811637e3. --- islandora.module | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/islandora.module b/islandora.module index 1f8cab5e7..13a0ffdcf 100644 --- a/islandora.module +++ b/islandora.module @@ -654,14 +654,3 @@ function islandora_preprocess_views_view_table(&$variables) { } } -/** - * Implements hook_field_info_alter(). - * - * @todo Remove once minimum version supported is at least 10.2.0. - */ -function islandora_field_info_alter(array &$info): void { - // Allow module to work with versions of older versions of Drupal. - if (\version_compare(\Drupal::VERSION, '10.1.9999', '<')) { - $info['reference']['category'] = new TranslatableMarkup("Reference"); - } -} From 831890e211a0b40aaed501050f6d35f03b12e848 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Tue, 18 Jun 2024 15:49:27 -0300 Subject: [PATCH 7/9] Declare compatibility as greater than Drupal 10.2. --- composer.json | 1 + islandora.info.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 79d5ef5a4..f272db1d7 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ ], "require": { "drupal/context": "^4 || ^5@RC", + "drupal/core": "^10.2", "drupal/ctools": "^3.8 || ^4", "drupal/eva" : "^3.0", "drupal/file_replace": "^1.1", diff --git a/islandora.info.yml b/islandora.info.yml index 6dd0597f2..a43196a42 100644 --- a/islandora.info.yml +++ b/islandora.info.yml @@ -4,7 +4,7 @@ name: 'islandora' description: "Islandora Core" type: module package: Islandora -core_version_requirement: ^9 || ^10 +core_version_requirement: ^10.2 dependencies: - context:context_ui - ctools:ctools From cc5ca358a3534f105eea9b634adb9c521609826f Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Wed, 19 Jun 2024 10:24:02 -0300 Subject: [PATCH 8/9] Update islandora.module --- islandora.module | 2 -- 1 file changed, 2 deletions(-) diff --git a/islandora.module b/islandora.module index 13a0ffdcf..8fa478a7f 100644 --- a/islandora.module +++ b/islandora.module @@ -21,7 +21,6 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Site\Settings; -use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Url; use Drupal\file\FileInterface; use Drupal\islandora\Form\IslandoraSettingsForm; @@ -653,4 +652,3 @@ function islandora_preprocess_views_view_table(&$variables) { } } } - From b94f6a9b30aa626ec436c8a7b0fa4540fdf87b11 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Fri, 28 Jun 2024 10:54:50 -0300 Subject: [PATCH 9/9] Remove drupal core from composer.json. --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index f272db1d7..79d5ef5a4 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ ], "require": { "drupal/context": "^4 || ^5@RC", - "drupal/core": "^10.2", "drupal/ctools": "^3.8 || ^4", "drupal/eva" : "^3.0", "drupal/file_replace": "^1.1",