Skip to content

Commit f5b2062

Browse files
committed
3484814: Drupal 11 compatibility for version 3.4 by @albertosilva
1 parent 712bd73 commit f5b2062

File tree

13 files changed

+28
-16
lines changed

13 files changed

+28
-16
lines changed

graphql.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ type: module
33
description: "Base module for integrating GraphQL with Drupal."
44
package: GraphQL
55
configure: graphql.config_page
6-
core_version_requirement: ^9 || ^10
6+
core_version_requirement: ^9 || ^10 || ^11

modules/graphql_core/graphql_core.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: GraphQL Core
22
type: module
33
description: "Provides type system plugins and derivers on behalf of core modules."
44
package: GraphQL
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
dependencies:
77
- graphql:graphql
88
- drupal:path_alias

modules/graphql_core/tests/modules/graphql_block_test/graphql_block_test.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "GraphQL Test: Blocks"
22
type: module
33
package: Testing
4-
core_version_requirement: ^9 || ^10
4+
core_version_requirement: ^9 || ^10 || ^11
55
hidden: TRUE
66
dependencies:
77
- drupal:block

modules/graphql_core/tests/modules/graphql_breadcrumbs_test/graphql_breadcrumbs_test.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: GraphQL Breadcrumbs test
22
type: module
33
description: "Test for breadcrumbs."
44
package: Testing
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
hidden: TRUE
77
dependencies:
88
- graphql:graphql_core

modules/graphql_core/tests/modules/graphql_context_test/graphql_context_test.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: module
22
name: GraphQL Context Test
33
description: Test contexts in graphql schema.
44
package: Testing
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
hidden: TRUE
77
dependencies:
88
- graphql:graphql_core

modules/graphql_core/tests/modules/graphql_requests_test/graphql_requests_test.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: module
22
name: GraphQL Requests Test
33
description: Dummy callbacks for internal request testing.
44
package: Testing
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
hidden: TRUE
77
dependencies:
88
- graphql:graphql_core
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "GraphQL Tests: Menu"
22
type: module
33
package: Testing
4-
core_version_requirement: ^9 || ^10
4+
core_version_requirement: ^9 || ^10 || ^11
55
hidden: TRUE
66
dependencies:
77
- drupal:system

src/Controller/SchemaOverviewController.php

+15-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Drupal\graphql\Controller;
44

55
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
6+
use Drupal\Core\Extension\ModuleExtensionList;
67
use Drupal\Core\Extension\ModuleHandlerInterface;
78
use Drupal\Core\StringTranslation\StringTranslationTrait;
89
use Drupal\graphql\Plugin\SchemaPluginManager;
@@ -26,12 +27,20 @@ class SchemaOverviewController implements ContainerInjectionInterface {
2627
*/
2728
protected $moduleHandler;
2829

30+
/**
31+
* The module extension list service.
32+
*
33+
* @var \Drupal\Core\Extension\ModuleExtensionList
34+
*/
35+
protected $moduleExtensionList;
36+
2937
/**
3038
* {@inheritdoc}
3139
*/
3240
public static function create(ContainerInterface $container) {
3341
return new static(
3442
$container->get('module_handler'),
43+
$container->get('extension.list.module'),
3544
$container->get('plugin.manager.graphql.schema')
3645
);
3746
}
@@ -40,12 +49,15 @@ public static function create(ContainerInterface $container) {
4049
* SchemaOverviewController constructor.
4150
*
4251
* @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
43-
* The module handler srevice.
52+
* The module handler service.
53+
* @param \Drupal\Core\Extension\ModuleExtensionList $moduleExtensionList
54+
* The module extension list service
4455
* @param \Drupal\graphql\Plugin\SchemaPluginManager $schemaManager
4556
* The schema plugin manager service.
4657
*/
47-
public function __construct(ModuleHandlerInterface $moduleHandler, SchemaPluginManager $schemaManager) {
58+
public function __construct(ModuleHandlerInterface $moduleHandler, ModuleExtensionList $moduleExtensionList, SchemaPluginManager $schemaManager) {
4859
$this->schemaManager = $schemaManager;
60+
$this->moduleExtensionList = $moduleExtensionList;
4961
$this->moduleHandler = $moduleHandler;
5062
}
5163

@@ -74,7 +86,7 @@ public function listSchemas() {
7486
];
7587

7688
$table["schema:$key"]['provider'] = [
77-
'#plain_text' => $this->moduleHandler->getName($definition['provider']),
89+
'#plain_text' => $this->moduleExtensionList->getName($definition['provider']),
7890
];
7991

8092
$table["schema:$key"]['operations'] = $this->buildOperations($key, $definition);

src/Plugin/GraphQL/Traits/DescribablePluginTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ trait DescribablePluginTrait {
1010
* @return null|string
1111
*/
1212
protected function buildDescription($definition) {
13-
if (!empty($definition['description'])) {
14-
return (string) $definition['description'];
13+
if (!empty($definition['description']) && !is_null($definition['description'])) {
14+
return (string) ($definition['description']);
1515
}
1616

1717
return NULL;

tests/modules/graphql_enum_test/graphql_enum_test.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: module
22
name: GraphQL Enumeration Test
33
description: Test enumeration plugins.
44
package: Testing
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
hidden: TRUE
77
dependencies:
88
- graphql:graphql

tests/modules/graphql_override_test/graphql_override_test.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: module
22
name: GraphQL Override Test
33
description: Test plugin overrides in graphql schema.
44
package: Testing
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
hidden: TRUE
77
dependencies:
88
- graphql:graphql_plugin_test

tests/modules/graphql_plugin_test/graphql_plugin_test.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: module
22
name: GraphQL Plugin Test
33
description: Test plugin based graphql schema.
44
package: Testing
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
hidden: TRUE
77
dependencies:
88
- graphql:graphql

tests/modules/graphql_test/graphql_test.info.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: module
22
name: GraphQL Test
33
description: Provides a default schema plugin for testing.
44
package: Testing
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
hidden: TRUE
77
dependencies:
88
- graphql:graphql

0 commit comments

Comments
 (0)