From ecf72efd34db090b637485c5f8025f7a0c06b534 Mon Sep 17 00:00:00 2001 From: Benjamin Rasmussen Date: Tue, 26 Nov 2024 14:02:18 +0100 Subject: [PATCH] Fixing `develop` issues, due to drush being locked in `dpl_graphql` Copying the `dpl_graphql` code to a seperate, new `dpl_graphql2` module. This is necessary, as the original graphql module includes code that does not work without simple_oauth, which cannot be installed, due to the Drush command not being able to run. We get around this, by moving the code into a new module (graphql2), leaving the old module as an empty boilerplate. This gives drush a chance to actually enable the dependencies. In a future release, we should rename the module again. --- config/sync/core.extension.yml | 2 +- .../custom/dpl_graphql/dpl_graphql.info.yml | 12 ++++------- .../dpl_graphql/dpl_graphql.services.yml | 4 ---- .../custom/dpl_graphql2/dpl_graphql2.info.yml | 11 ++++++++++ .../dpl_graphql2.install} | 6 +++--- .../dpl_graphql2/dpl_graphql2.services.yml | 4 ++++ .../DplDisallowSimpleOauthRequests.php | 2 +- .../DplConfigurationSchemaExtension.php | 2 +- .../SchemaType/DplConfigurationType.php | 2 +- .../SchemaType/UniloginConfigurationType.php | 2 +- .../custom/dpl_update/dpl_update.install | 20 ++++++++++++++++++- 11 files changed, 46 insertions(+), 21 deletions(-) delete mode 100644 web/modules/custom/dpl_graphql/dpl_graphql.services.yml create mode 100644 web/modules/custom/dpl_graphql2/dpl_graphql2.info.yml rename web/modules/custom/{dpl_graphql/dpl_graphql.install => dpl_graphql2/dpl_graphql2.install} (90%) create mode 100644 web/modules/custom/dpl_graphql2/dpl_graphql2.services.yml rename web/modules/custom/{dpl_graphql => dpl_graphql2}/src/PageCache/DplDisallowSimpleOauthRequests.php (96%) rename web/modules/custom/{dpl_graphql => dpl_graphql2}/src/Plugin/GraphQL/SchemaExtension/DplConfigurationSchemaExtension.php (98%) rename web/modules/custom/{dpl_graphql => dpl_graphql2}/src/Plugin/GraphQLCompose/SchemaType/DplConfigurationType.php (94%) rename web/modules/custom/{dpl_graphql => dpl_graphql2}/src/Plugin/GraphQLCompose/SchemaType/UniloginConfigurationType.php (93%) diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index f9cfe5e8b..f5ce128d1 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -44,7 +44,7 @@ module: dpl_fees: 0 dpl_filter_paragraphs: 0 dpl_footer: 0 - dpl_graphql: 0 + dpl_graphql2: 0 dpl_instant_loan: 0 dpl_library_agency: 0 dpl_library_token: 0 diff --git a/web/modules/custom/dpl_graphql/dpl_graphql.info.yml b/web/modules/custom/dpl_graphql/dpl_graphql.info.yml index 67ff5385b..8da753892 100644 --- a/web/modules/custom/dpl_graphql/dpl_graphql.info.yml +++ b/web/modules/custom/dpl_graphql/dpl_graphql.info.yml @@ -1,11 +1,7 @@ -name: 'DPL GraphQL' +name: 'DPL GraphQL (UNUSED)' type: module -description: 'Module used for handling graphql functionality.' +description: | + This is an empty module, necessary to get around a temporary issue + in release 2024.48.0. See dpl_update.install for more info.' package: DPL core_version_requirement: ^10 || ^11 -dependencies: - - graphql:graphql - - graphql_compose:graphql_compose - - dpl_unilogin:dpl_unilogin - - simple_oauth:simple_oauth - - dpl_consumers:dpl_consumers diff --git a/web/modules/custom/dpl_graphql/dpl_graphql.services.yml b/web/modules/custom/dpl_graphql/dpl_graphql.services.yml deleted file mode 100644 index 381544670..000000000 --- a/web/modules/custom/dpl_graphql/dpl_graphql.services.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: - dpl_graphql.page_cache_request_policy.disallow_oauth2_token_requests: - class: Drupal\dpl_graphql\PageCache\DplDisallowSimpleOauthRequests - decorates: simple_oauth.page_cache_request_policy.disallow_oauth2_token_requests diff --git a/web/modules/custom/dpl_graphql2/dpl_graphql2.info.yml b/web/modules/custom/dpl_graphql2/dpl_graphql2.info.yml new file mode 100644 index 000000000..67ff5385b --- /dev/null +++ b/web/modules/custom/dpl_graphql2/dpl_graphql2.info.yml @@ -0,0 +1,11 @@ +name: 'DPL GraphQL' +type: module +description: 'Module used for handling graphql functionality.' +package: DPL +core_version_requirement: ^10 || ^11 +dependencies: + - graphql:graphql + - graphql_compose:graphql_compose + - dpl_unilogin:dpl_unilogin + - simple_oauth:simple_oauth + - dpl_consumers:dpl_consumers diff --git a/web/modules/custom/dpl_graphql/dpl_graphql.install b/web/modules/custom/dpl_graphql2/dpl_graphql2.install similarity index 90% rename from web/modules/custom/dpl_graphql/dpl_graphql.install rename to web/modules/custom/dpl_graphql2/dpl_graphql2.install index ca908aff5..da44c057b 100644 --- a/web/modules/custom/dpl_graphql/dpl_graphql.install +++ b/web/modules/custom/dpl_graphql2/dpl_graphql2.install @@ -19,8 +19,8 @@ use Drupal\simple_oauth\Service\KeyGeneratorService; * We want to run the dpl_graphql_update_10001 on both * new and existing sites. */ -function dpl_graphql_install(): string { - $messages[] = dpl_graphql_update_10001(); +function dpl_graphql2_install(): string { + $messages[] = dpl_graphql2_update_10001(); return implode('\r\n', $messages); @@ -29,7 +29,7 @@ function dpl_graphql_install(): string { /** * Generates public and private keys used for the simple_oauth module. */ -function dpl_graphql_update_10001(): string { +function dpl_graphql2_update_10001(): string { $file_system = DrupalTyped::service(FileSystemInterface::class, 'file_system'); $key_generator = DrupalTyped::service(KeyGeneratorService::class, 'simple_oauth.key.generator'); diff --git a/web/modules/custom/dpl_graphql2/dpl_graphql2.services.yml b/web/modules/custom/dpl_graphql2/dpl_graphql2.services.yml new file mode 100644 index 000000000..826b8f79c --- /dev/null +++ b/web/modules/custom/dpl_graphql2/dpl_graphql2.services.yml @@ -0,0 +1,4 @@ +services: + dpl_graphql2.page_cache_request_policy.disallow_oauth2_token_requests: + class: Drupal\dpl_graphql2\PageCache\DplDisallowSimpleOauthRequests + decorates: simple_oauth.page_cache_request_policy.disallow_oauth2_token_requests diff --git a/web/modules/custom/dpl_graphql/src/PageCache/DplDisallowSimpleOauthRequests.php b/web/modules/custom/dpl_graphql2/src/PageCache/DplDisallowSimpleOauthRequests.php similarity index 96% rename from web/modules/custom/dpl_graphql/src/PageCache/DplDisallowSimpleOauthRequests.php rename to web/modules/custom/dpl_graphql2/src/PageCache/DplDisallowSimpleOauthRequests.php index 580cae9ac..44512d945 100644 --- a/web/modules/custom/dpl_graphql/src/PageCache/DplDisallowSimpleOauthRequests.php +++ b/web/modules/custom/dpl_graphql2/src/PageCache/DplDisallowSimpleOauthRequests.php @@ -1,6 +1,6 @@