From 5ed8ae1781cc9b25edc0c2fe4a6463670d2c1527 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 14 Nov 2024 13:28:30 +0100 Subject: [PATCH 1/6] Add node query to GraphQl schema --- composer.json | 5 +- .../graphql/thunder_pages.extension.graphqls | 1 + .../ThunderPagesSchemaExtension.php | 2 + .../tests/examples/node.query.graphql | 51 ++++++++++++++ .../tests/examples/node.response.json | 69 +++++++++++++++++++ .../tests/examples/node.variables.json | 3 + 6 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 modules/thunder_gqls/tests/examples/node.query.graphql create mode 100644 modules/thunder_gqls/tests/examples/node.response.json create mode 100644 modules/thunder_gqls/tests/examples/node.variables.json diff --git a/composer.json b/composer.json index fddd4824e..c3ac9db3d 100644 --- a/composer.json +++ b/composer.json @@ -46,6 +46,9 @@ }, "drupal/gin": { "Issue #3455558: There is no visible change to a toggle when pressed (but it does trigger conditional fields, value is saved, etc)": "https://www.drupal.org/files/issues/2024-08-06/3455558-Refactor-toggle-styles-mr438.patch" + }, + "drupal/autosave_form": { + "Issue #3487459: Deprecation error on user edit form": "https://git.drupalcode.org/project/autosave_form/-/merge_requests/19.diff" } } }, @@ -55,7 +58,7 @@ "drupal/access_unpublished": "^1.5", "drupal/admin_toolbar": "^3.4", "drupal/autofill": "^1.1", - "drupal/autosave_form": "^1.6", + "drupal/autosave_form": "1.7", "drupal/blazy": "^2.14", "drupal/checklistapi": "^2.1", "drupal/core-recommended": "~10.3.0@stable", diff --git a/modules/thunder_gqls/graphql/thunder_pages.extension.graphqls b/modules/thunder_gqls/graphql/thunder_pages.extension.graphqls index 0f0c42c12..e1ac11f9c 100644 --- a/modules/thunder_gqls/graphql/thunder_pages.extension.graphqls +++ b/modules/thunder_gqls/graphql/thunder_pages.extension.graphqls @@ -5,4 +5,5 @@ extend type Query { channel(uuid: String!): Channel user(uuid: String!): User page(path: String!): Page + node(uuid: String!): Page } diff --git a/modules/thunder_gqls/src/Plugin/GraphQL/SchemaExtension/ThunderPagesSchemaExtension.php b/modules/thunder_gqls/src/Plugin/GraphQL/SchemaExtension/ThunderPagesSchemaExtension.php index cdcd5e66c..0dc426453 100644 --- a/modules/thunder_gqls/src/Plugin/GraphQL/SchemaExtension/ThunderPagesSchemaExtension.php +++ b/modules/thunder_gqls/src/Plugin/GraphQL/SchemaExtension/ThunderPagesSchemaExtension.php @@ -43,6 +43,8 @@ protected function resolveFields(): void { $this->fromRoute($this->builder->fromArgument('path')) ); + $this->resolvePageInterfaceQueryFields('node', 'node'); + // Teaser. $this->addSimpleCallbackFields('Teaser', ['image', 'text']); diff --git a/modules/thunder_gqls/tests/examples/node.query.graphql b/modules/thunder_gqls/tests/examples/node.query.graphql new file mode 100644 index 000000000..82f1a3c0b --- /dev/null +++ b/modules/thunder_gqls/tests/examples/node.query.graphql @@ -0,0 +1,51 @@ +query ($uuid: String!) { + node(uuid: $uuid) { + uuid + url + name + entity + language + entityLinks { + canonical + } + ... on Article { + published + author { + uuid + name + mail + entity + language + } + channel { + uuid + published + name + url + parent { + name + id + url + } + } + tags { + uuid + name + url + } + seoTitle + content { + __typename + } + teaser { + text + image { + uuid + derivative(style: "medium") { + width + } + } + } + } + } +} diff --git a/modules/thunder_gqls/tests/examples/node.response.json b/modules/thunder_gqls/tests/examples/node.response.json new file mode 100644 index 000000000..3572fd50b --- /dev/null +++ b/modules/thunder_gqls/tests/examples/node.response.json @@ -0,0 +1,69 @@ +{ + "data": { + "node": { + "uuid": "36b2e2b2-3df0-43eb-a282-d792b0999c07", + "url": "/come-drupalcon-new-orleans", + "name": "Come to DrupalCon New Orleans", + "entity": "node", + "language": "en", + "entityLinks": { + "canonical": "/come-drupalcon-new-orleans" + }, + "published": true, + "author": { + "uuid": "be8e7a25-8a41-4bda-a854-b4b9bb1b0a02", + "name": "test-seo", + "mail": null, + "entity": "user", + "language": "en" + }, + "channel": { + "uuid": "0bb70443-8172-4d8e-9335-2876bc32e356", + "published": true, + "name": "Events", + "url": "/events", + "parent": null + }, + "tags": [ + { + "uuid": "35bdba6e-9b45-472a-8fda-11e7e69de71b", + "name": "Drupal", + "url": "/drupal" + } + ], + "seoTitle": "Come to DrupalCon New Orleans", + "content": [ + { + "__typename": "ParagraphGallery" + }, + { + "__typename": "ParagraphText" + }, + { + "__typename": "ParagraphTwitter" + }, + { + "__typename": "ParagraphLink" + }, + { + "__typename": "ParagraphQuote" + }, + { + "__typename": "ParagraphVideo" + }, + { + "__typename": "ParagraphPinterest" + } + ], + "teaser": { + "text": "The Drupal community is one of the largest open source communities in the world. We're developers, designers, strategists, coordinators, editors, translators, and more. Each year, we meet at DrupalCamps, meetups, and other events in more than 200 countries. But once a year, our community comes together at the biggest Drupal event in the world: DrupalCon North America. This year, from May 9-13, we'll be in New Orleans.", + "image": { + "uuid": "a4c1035a-5b27-4713-8ba3-40ba5942486d", + "derivative": { + "width": 220 + } + } + } + } + } +} diff --git a/modules/thunder_gqls/tests/examples/node.variables.json b/modules/thunder_gqls/tests/examples/node.variables.json new file mode 100644 index 000000000..6860c9fba --- /dev/null +++ b/modules/thunder_gqls/tests/examples/node.variables.json @@ -0,0 +1,3 @@ +{ + "uuid": "36b2e2b2-3df0-43eb-a282-d792b0999c07" +} From e467676a4632e9dc8f52be7cadfad6dd80bb20cb Mon Sep 17 00:00:00 2001 From: mrmishmash Date: Thu, 14 Nov 2024 13:55:34 +0100 Subject: [PATCH 2/6] Make private methods in SearchApiResponse protected. --- .../thunder_gqls/src/Wrappers/SearchApiResponse.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/thunder_gqls/src/Wrappers/SearchApiResponse.php b/modules/thunder_gqls/src/Wrappers/SearchApiResponse.php index 612c56d03..b75727e7d 100644 --- a/modules/thunder_gqls/src/Wrappers/SearchApiResponse.php +++ b/modules/thunder_gqls/src/Wrappers/SearchApiResponse.php @@ -80,7 +80,7 @@ public static function create(ContainerInterface $container): self { * @param \Drupal\search_api\Query\QueryInterface $query * The query. */ - public function setQuery(QueryInterface $query): SearchApiResponse { + public function setQuery(QueryInterface $query): static { $this->query = $query; return $this; } @@ -91,7 +91,7 @@ public function setQuery(QueryInterface $query): SearchApiResponse { * @param array $facetMapping * The facet mapping. */ - public function setFacetMapping(array $facetMapping): SearchApiResponse { + public function setFacetMapping(array $facetMapping): static { $this->facetMapping = $facetMapping; return $this; } @@ -102,7 +102,7 @@ public function setFacetMapping(array $facetMapping): SearchApiResponse { * @param string $bundle * The bundle. */ - public function setBundle(string $bundle): SearchApiResponse { + public function setBundle(string $bundle): static { $this->bundle = $bundle; return $this; } @@ -113,7 +113,7 @@ public function setBundle(string $bundle): SearchApiResponse { * @param array $facets * The facets. */ - public function setFacets(array $facets): SearchApiResponse { + public function setFacets(array $facets): static { $this->facets = $facets; return $this; } @@ -205,7 +205,7 @@ public function total(): int { * @return array * The processed facet results. */ - private function processFacetResults( + protected function processFacetResults( Facet $facet, array $facetResults, ): array { @@ -238,7 +238,7 @@ private function processFacetResults( * @return array * The processed facet results. */ - private function processFacetResultsFromFieldConfig( + protected function processFacetResultsFromFieldConfig( Facet $facet, array $facetResults, ): array { From 1e425b2dae8019e71c523b4079c330523854122c Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 20 Nov 2024 12:33:12 +0100 Subject: [PATCH 3/6] Add patch from issue #3487031 * Add patch from issue #3487031 * Update patch --------- Co-authored-by: Christian Fritsch --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index c3ac9db3d..9cc60b043 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ "installer-name": "thunder", "patches": { "drupal/core": { + "Issue #3487031: Performance Degraded after update to twig 3.14.2": "https://www.drupal.org/files/issues/2024-11-20/3487031-33.patch", "Fix Claro styles for exposed views filters wrapped in fieldsets": "https://www.drupal.org/files/issues/2021-05-31/3133639.19.patch", "Let users configure the text of the \"Add media\" button": "https://www.drupal.org/files/issues/2021-10-01/3169956-34.patch" }, From 59b12e1e5aa3ecd5893c3423e4e68816a1d033e1 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 20 Nov 2024 13:17:12 +0100 Subject: [PATCH 4/6] Issue #3488601: Release Thunder 7.3.8 --- CHANGELOG.md | 9 +++++++++ composer.json | 5 +---- thunder.info.yml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b752b0697..b9ffbe262 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [7.3.8](https://github.com/thunder/thunder-distribution/tree/7.3.8) 2024-11-20 + +[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.3.7...7.3.8) + +* Pin autosave_form to 1.7 and apply patch from issue [#3487459](https://www.drupal.org/i/3487459) +* Add a node Graphql query to fetch a single node by its UUID +* Make private methods in SearchApiResponse protected. +* Add Drupal core patch from issue [#3487031](https://www.drupal.org/i/3487031) because of a performance regression. + ## [7.3.7](https://github.com/thunder/thunder-distribution/tree/7.3.7) 2024-10-14 [Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.3.6...7.3.7) diff --git a/composer.json b/composer.json index 9cc60b043..a303fa77b 100644 --- a/composer.json +++ b/composer.json @@ -42,9 +42,6 @@ "drupal/diff": { "Back button for comparison page": "https://www.drupal.org/files/issues/back_button_for-2853193-4.patch" }, - "drupal/focal_point": { - "Issue #3462165: Preview results in Error: Call to a member function getDefinitions() on null": "https://www.drupal.org/files/issues/2024-07-18/Preview-results-in-Error-3462165.patch" - }, "drupal/gin": { "Issue #3455558: There is no visible change to a toggle when pressed (but it does trigger conditional fields, value is saved, etc)": "https://www.drupal.org/files/issues/2024-08-06/3455558-Refactor-toggle-styles-mr438.patch" }, @@ -74,7 +71,7 @@ "drupal/entity_reference_actions": "^1.1.1", "drupal/entity_reference_revisions": "^1.3", "drupal/field_group": "^3.4", - "drupal/focal_point": "2.1.1", + "drupal/focal_point": "^2.1.2", "drupal/facets": "^2.0.6", "drupal/gin": "3.0-rc11", "drupal/gin_toolbar": "^1.0-rc6", diff --git a/thunder.info.yml b/thunder.info.yml index f3058559a..d2ec050a8 100644 --- a/thunder.info.yml +++ b/thunder.info.yml @@ -3,7 +3,7 @@ type: profile description: 'The Drupal based CMS for professional publishing.' project: thunder core_version_requirement: ~10.3.0 -version: '7.3.7' +version: '7.3.8' distribution: name: Thunder From 3ec48b1b4c00917286f0c5fa4f843be7de7497a3 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 25 Nov 2024 11:21:22 +0100 Subject: [PATCH 5/6] Remove committed core patch #3487031 Co-authored-by: Christian Fritsch --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index a303fa77b..6a5341730 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,6 @@ "installer-name": "thunder", "patches": { "drupal/core": { - "Issue #3487031: Performance Degraded after update to twig 3.14.2": "https://www.drupal.org/files/issues/2024-11-20/3487031-33.patch", "Fix Claro styles for exposed views filters wrapped in fieldsets": "https://www.drupal.org/files/issues/2021-05-31/3133639.19.patch", "Let users configure the text of the \"Add media\" button": "https://www.drupal.org/files/issues/2021-10-01/3169956-34.patch" }, From 206a448a37da3dd83e17d75fbfb7322e4b1e2080 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 25 Nov 2024 12:16:58 +0100 Subject: [PATCH 6/6] Release 7.3.9 Co-authored-by: Christian Fritsch --- CHANGELOG.md | 6 ++++++ thunder.info.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9ffbe262..cfadc8cfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [7.3.9](https://github.com/thunder/thunder-distribution/tree/7.3.9) 2024-11-25 + +[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.3.8...7.3.9) + +* Remove Drupal core patch [#3487031](https://www.drupal.org/i/3487031), because it was merged upstream. + ## [7.3.8](https://github.com/thunder/thunder-distribution/tree/7.3.8) 2024-11-20 [Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.3.7...7.3.8) diff --git a/thunder.info.yml b/thunder.info.yml index d2ec050a8..6a0973a46 100644 --- a/thunder.info.yml +++ b/thunder.info.yml @@ -3,7 +3,7 @@ type: profile description: 'The Drupal based CMS for professional publishing.' project: thunder core_version_requirement: ~10.3.0 -version: '7.3.8' +version: '7.3.9' distribution: name: Thunder