Skip to content

Commit

Permalink
Merge branch '7.4.x' into d11-compatibility
Browse files Browse the repository at this point in the history
* 7.4.x:
  Thunder 7.4 release
  Cast to string in strip_tags
  Load entity types and add cache tags and contexts in search api producer
  Drupal 10.4
  Release 7.3.9
  Remove committed core patch #3487031
  Issue #3488601: Release Thunder 7.3.8
  Add patch from issue #3487031
  Make private methods in SearchApiResponse protected.
  Add node query to GraphQl schema
  • Loading branch information
Christian Fritsch committed Jan 7, 2025
2 parents 4448beb + dcd69d7 commit 2a6b3bd
Show file tree
Hide file tree
Showing 19 changed files with 286 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ jobs:

- name: Install suggested dependencies
run: |
composer require "league/container:^4.2" "drupal/core-dev:^10.3" --no-update --no-progress --working-dir=/tmp/test/thunder/install
composer require "league/container:^4.2" "drupal/core-dev:^10.4" --no-update --no-progress --working-dir=/tmp/test/thunder/install
composer config allow-plugins.php-http/discovery true --no-plugins --working-dir=/tmp/test/thunder/install
- name: Build the docroot
Expand Down
111 changes: 0 additions & 111 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,112 +1 @@
# Changelog

## [7.3.0](https://github.com/thunder/thunder-distribution/tree/7.1.0) 2024-06-024

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.2.2...7.3.0)

* Drupal 10.3 compatibility.
* Updated Gin theme.
* PHP8.3 compatibility.

## [7.2.2](https://github.com/thunder/thunder-distribution/tree/7.2.2) 2024-04-30

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.2.1...7.2.2)

* Fix menu links active trail data producer
* Update simple_sitemap and diff modules
* Bring back paragraphs split!
* [Possible break of Thunder GraphQL schema with drupal/graphql:4.6.0](https://www.drupal.org/node/3401211)

## [7.2.1](https://github.com/thunder/thunder-distribution/tree/7.2.1) 2024-04-10

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.2.0...7.2.1)

* Fix thunder redirect data producer with query strings.
* Move xymatic GraphQL schema to base.
* Update to gin rc9.
* Update graphql module to 4.7.0 and remove patch.

## [7.2.0](https://github.com/thunder/thunder-distribution/tree/7.2.0) 2024-03-07

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.1.7...7.2.0)

Support Drupal 10.2

## [7.1.7](https://github.com/thunder/thunder-distribution/tree/7.1.7) 2024-02-14

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.1.6...7.1.7)

* Add patch to fix [Checkbox for Media library modal missing after search](https://www.drupal.org/project/drupal/issues/3388913)

## [7.1.6](https://github.com/thunder/thunder-distribution/tree/7.1.6) 2024-01-09

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.1.5...7.1.6)

* Allow update_helper version "^4.0" in composer.json

## [7.1.5](https://github.com/thunder/thunder-distribution/tree/7.1.5) 2023-12-21

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.1.4...7.1.5)

* Improved update path from Thunder 6 to 7

## [7.1.4](https://github.com/thunder/thunder-distribution/tree/7.1.4) 2023-12-04

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.1.3...7.1.4)

* Fix possible break of Thunder GraphQL schema with drupal/graphql:4.6.0
* Fix warning on missing entityLinks keys in GraphQL

## [7.1.3](https://github.com/thunder/thunder-distribution/tree/7.1.3) 2023-11-07

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.1.2...7.1.3)

* Update to gin rc7
* Fix issue with form fields for media
* Bump Drupal version number in thunder.profile
* Update focal point patch

## [7.1.2](https://github.com/thunder/thunder-distribution/tree/7.1.2) 2023-09-01

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.1.1...7.1.2)

* Fix yaml error in xymatic config.

## [7.1.1](https://github.com/thunder/thunder-distribution/tree/7.1.1) 2023-08-28

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.1.0...7.1.1)

* Update Gin to RC5.
* Change paragraphs_feature requirement to ^2.0.0-beta3.
* Remove all entity browser permissions in all roles during the Thunder 6 to 7 migration.

## [7.1.0](https://github.com/thunder/thunder-distribution/tree/7.1.0) 2023-07-03

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.0.0...7.1.0)

* Drupal 10.1 compatibility.

## [7.0.0](https://github.com/thunder/thunder-distribution/tree/7.0.0) 2023-06-15

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.0.0-beta2...7.0.0)

* Add decoratable type resolver for GraphQL.
* Add integration for the Xymatic module.
* A new content type "News Article", that is similar to the "Article" content type, but has different metadata.

## [7.0.0-beta2](https://github.com/thunder/thunder-distribution/tree/7.0.0-beta2) 2023-03-13

[Full Changelog](https://github.com/thunder/thunder-distribution/compare/7.0.0-beta1...7.0.0-beta2)

Remove merged Gin patches and update to latest Gin release candidate.

## [7.0.0-beta1](https://github.com/thunder/thunder-distribution/tree/7.0.0-beta1) 2023-03-09

First beta of Thunder 7.0.0 with Drupal 10 support.

Besides being Drupal 10 compatible the most notable changes are the retirement of the Thunder admin theme in favor
of the community driven Gin theme and the switch from Entity Browser to Drupal core Media Library.

Manual update steps from Thunder 6 are required and can be found here:

[Migrate Thunder 6 to Thunder 7](https://thunder.github.io/developer-guide/migration/migrate-6-7.html)
21 changes: 7 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,15 @@
"drupal/diff": {
"Back button for comparison page": "https://www.drupal.org/files/issues/back_button_for-2853193-4.patch"
},
"drupal/paragraphs_features": {
"#3433828: D11": "https://www.drupal.org/files/issues/2024-03-24/paragraphs_features.2.0.0-beta4.rector.patch"
},
"drupal/select2": {
"#3454104: D11": "https://git.drupalcode.org/project/select2/-/merge_requests/38.diff"
},
"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"
"drupal/field_group": {
"Drupal 10.4 RC1 error with field_ui.js": "https://git.drupalcode.org/project/field_group/-/merge_requests/88.diff"
}
},
"drupal-lenient": {
"allowed-list": [
"drupal/paragraphs_features",
"drupal/select2",
"drupal/paragraphs_paste"
]
Expand All @@ -68,7 +61,7 @@
"drupal/access_unpublished": "^1.5",
"drupal/admin_toolbar": "^3.4",
"drupal/autofill": "^1.1",
"drupal/autosave_form": "dev-1.x",
"drupal/autosave_form": "^1.7",
"drupal/checklistapi": "^2.1.3",
"drupal/core-recommended": "~11.0.0",
"drupal/config_selector": "^3.0",
Expand All @@ -80,10 +73,10 @@
"drupal/empty_fields": "^1.0",
"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/field_group": "3.6",
"drupal/focal_point": "^2.1.2",
"drupal/facets": "^2.0.7",
"drupal/gin": "3.0-rc11",
"drupal/gin": "^3.0-rc15",
"drupal/gin_toolbar": "^1.0-rc6",
"drupal/graphql": "^4.7",
"drupal/inline_entity_form": "^3.0.0-rc20",
Expand All @@ -100,7 +93,7 @@
"drupal/metatag": "^2.0.2",
"drupal/metatag_async_widget": "^1.0-alpha2",
"drupal/paragraphs": "^1.18",
"drupal/paragraphs_features": "^2.0.0-beta3",
"drupal/paragraphs_features": "^2.1.0",
"drupal/paragraphs_paste": "^2.0-beta3",
"drupal/password_policy": "^4.0.3",
"drupal/pathauto": "^1.12",
Expand Down
4 changes: 2 additions & 2 deletions modules/thunder_article/src/Twig/FilterExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getName(): string {
*/
public static function plainText($value): string {
$element = self::render($value);
$element = strip_tags($element);
$element = strip_tags((string) $element);
return html_entity_decode($element, ENT_QUOTES);
}

Expand All @@ -59,7 +59,7 @@ public static function plainText($value): string {
*/
public static function basicFormat($value): string {
$element = self::render($value);
return strip_tags($element, '<a><em><strong><b><i>');
return strip_tags((string) $element, '<a><em><strong><b><i>');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ extend type Query {
channel(uuid: String!): Channel
user(uuid: String!): User
page(path: String!): Page
node(uuid: String!): Page
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ protected function buildBaseQuery(

$query->range($offset, $limit);
$cacheContext->addCacheableDependency($searchIndex);
foreach ($searchIndex->getDatasources() as $datasource) {
$storage = $this->entityTypeManager->getStorage($datasource->getEntityTypeId());
$entityType = $storage->getEntityType();

$cacheContext->addCacheTags($entityType->getListCacheTags());
$cacheContext->addCacheContexts($entityType->getListCacheContexts());
}

return $query;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ protected function resolveFields(): void {
$this->fromRoute($this->builder->fromArgument('path'))
);

$this->resolvePageInterfaceQueryFields('node', 'node');

// Teaser.
$this->addSimpleCallbackFields('Teaser', ['image', 'text']);

Expand Down
12 changes: 6 additions & 6 deletions modules/thunder_gqls/src/Wrappers/SearchApiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -238,7 +238,7 @@ private function processFacetResults(
* @return array
* The processed facet results.
*/
private function processFacetResultsFromFieldConfig(
protected function processFacetResultsFromFieldConfig(
Facet $facet,
array $facetResults,
): array {
Expand Down
51 changes: 51 additions & 0 deletions modules/thunder_gqls/tests/examples/node.query.graphql
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
}
}
Loading

0 comments on commit 2a6b3bd

Please sign in to comment.