From 83a3937e1817b312f3c2cfc4e10fb41e752ab156 Mon Sep 17 00:00:00 2001 From: vincent-gao Date: Wed, 20 Oct 2021 09:34:36 +1100 Subject: [PATCH] compatible with drupal 9 (#5) * compatible with drupal 9 --- .circleci/config.yml | 2 +- composer.json | 8 ++++---- tests/behat/features/jsonapi.profile.feature | 6 +++--- tide_profile.info.yml | 2 +- tide_profile.install | 2 ++ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eff62f9..f35e1f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ aliases: - &job-build working_directory: /app docker: - - image: &builder-image integratedexperts/ci-builder + - image: &builder-image singledigital/bay-ci-builder:4.x environment: INSTALL_NEW_SITE: 1 LAGOON_ENVIRONMENT_TYPE: ci diff --git a/composer.json b/composer.json index 531988c..1d23a02 100644 --- a/composer.json +++ b/composer.json @@ -4,12 +4,12 @@ "type": "drupal-module", "license": "GPL-2.0-or-later", "require": { - "dpc-sdp/tide_core": "^2.0.0", - "dpc-sdp/tide_landing_page": "^2.0.0", - "dpc-sdp/tide_media": "^1.5.1" + "dpc-sdp/tide_core": "^3.0.0", + "dpc-sdp/tide_landing_page": "^3.0.0", + "dpc-sdp/tide_media": "^3.0.0" }, "suggest": { - "dpc-sdp/tide_api:^1.2.6": "Allows to use Drupal in headless mode" + "dpc-sdp/tide_api:^3.0.0": "Allows to use Drupal in headless mode" }, "repositories": { "drupal": { diff --git a/tests/behat/features/jsonapi.profile.feature b/tests/behat/features/jsonapi.profile.feature index c894a21..8b80f63 100644 --- a/tests/behat/features/jsonapi.profile.feature +++ b/tests/behat/features/jsonapi.profile.feature @@ -7,7 +7,7 @@ Feature: JSON API Profile Scenario: Request to "profile" collection endpoint Given I am an anonymous user When I send a GET request to "api/v1/node/profile" - Then the rest response status code should be 200 + Then the response code should be 200 And the response should be in JSON And the JSON node "jsonapi.version" should be equal to "1.0" And the JSON node "links" should exist @@ -24,7 +24,7 @@ Feature: JSON API Profile Given I am an anonymous user When I send a GET request to "api/v1/node/profile/99999999-aaaa-bbbb-ccc-000000000001" - Then the rest response status code should be 200 + Then the response code should be 200 And the response should be in JSON And the JSON node "links" should exist And the JSON node "links.self.href" should contain "api/v1/node/profile" @@ -33,7 +33,7 @@ Feature: JSON API Profile And the JSON node "data.id" should be equal to "99999999-aaaa-bbbb-ccc-000000000001" When I send a GET request to "api/v1/node/profile?sort=-created" - Then the rest response status code should be 200 + Then the response code should be 200 And the response should be in JSON And the JSON node "jsonapi.version" should be equal to "1.0" And the JSON node "links" should exist diff --git a/tide_profile.info.yml b/tide_profile.info.yml index 340e17e..aa14643 100644 --- a/tide_profile.info.yml +++ b/tide_profile.info.yml @@ -3,7 +3,7 @@ type: module description: 'Provides Profile content type and related configuration. ' type: module package: Tide -core: 8.x +core_version_requirement: ^8.9 || ^9 dependencies: - dpc-sdp:tide_core - dpc-sdp:tide_landing_page diff --git a/tide_profile.install b/tide_profile.install index 3666539..ea036a7 100644 --- a/tide_profile.install +++ b/tide_profile.install @@ -51,6 +51,7 @@ function tide_profile_install() { $bundles = $config->get('bundles'); if ($bundles) { foreach ($bundles as $bundle) { + $enabled_bundles = []; $enabled_bundles[] = $bundle['bundle']; } if (!in_array('profile', $enabled_bundles)) { @@ -185,6 +186,7 @@ function tide_profile_update_8002() { $bundles = $config->get('bundles'); if ($bundles) { foreach ($bundles as $bundle) { + $enabled_bundles = []; $enabled_bundles[] = $bundle['bundle']; } if (!in_array('profile', $enabled_bundles)) {