diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 15cb4c04e..35ee191bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 989a9c641..825c32f0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/composer.json b/composer.json index a02345fa5..c3c392ac6 100644 --- a/composer.json +++ b/composer.json @@ -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" ] @@ -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", @@ -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", @@ -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", diff --git a/modules/thunder_article/src/Twig/FilterExtension.php b/modules/thunder_article/src/Twig/FilterExtension.php index 357c0102b..368cc8f42 100644 --- a/modules/thunder_article/src/Twig/FilterExtension.php +++ b/modules/thunder_article/src/Twig/FilterExtension.php @@ -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); } @@ -59,7 +59,7 @@ public static function plainText($value): string { */ public static function basicFormat($value): string { $element = self::render($value); - return strip_tags($element, ''); + return strip_tags((string) $element, ''); } /** 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/DataProducer/ThunderSearchApiProducerBase.php b/modules/thunder_gqls/src/Plugin/GraphQL/DataProducer/ThunderSearchApiProducerBase.php index e568b6971..bd3bcb0e2 100644 --- a/modules/thunder_gqls/src/Plugin/GraphQL/DataProducer/ThunderSearchApiProducerBase.php +++ b/modules/thunder_gqls/src/Plugin/GraphQL/DataProducer/ThunderSearchApiProducerBase.php @@ -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; } 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/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 { 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" +} diff --git a/modules/thunder_gqls/tests/src/Functional/JsonLdSchemaTest.php b/modules/thunder_gqls/tests/src/Functional/JsonLdSchemaTest.php index c2b62e4c2..4e60545e0 100644 --- a/modules/thunder_gqls/tests/src/Functional/JsonLdSchemaTest.php +++ b/modules/thunder_gqls/tests/src/Functional/JsonLdSchemaTest.php @@ -27,8 +27,8 @@ public function testSchema(): void { $query = $this->getQueryFromFile($schema); $variables = $this->getVariablesFromFile($schema); - $responseData = $this->jsonDecode(strip_tags($this->getResponseData($query, $variables)['jsonld'])); - $expectedData = $this->jsonDecode(strip_tags($this->jsonDecode($this->getExpectedResponseFromFile($schema))['data']['jsonld'])); + $responseData = $this->jsonDecode(strip_tags((string) $this->getResponseData($query, $variables)['jsonld'])); + $expectedData = $this->jsonDecode(strip_tags((string) $this->jsonDecode($this->getExpectedResponseFromFile($schema))['data']['jsonld'])); $this->assertEqualsCanonicalizing($expectedData, $responseData); diff --git a/modules/thunder_gqls/tests/src/Kernel/DataProducer/ThunderSearchApiTest.php b/modules/thunder_gqls/tests/src/Kernel/DataProducer/ThunderSearchApiTest.php new file mode 100644 index 000000000..c12a7236e --- /dev/null +++ b/modules/thunder_gqls/tests/src/Kernel/DataProducer/ThunderSearchApiTest.php @@ -0,0 +1,116 @@ +installSchema('search_api', [ + 'search_api_item', + ]); + $this->installEntitySchema('search_api_task'); + $this->installConfig('search_api'); + + // Create a test server. + $this->searchApiServer = Server::create([ + 'name' => 'Test Server', + 'id' => 'test_server', + 'status' => 1, + 'backend' => 'search_api_test', + ]); + $this->searchApiServer->save(); + + $this->searchApiIndex = Index::create([ + 'name' => 'Test Index', + 'id' => 'test_index', + 'status' => 1, + 'tracker_settings' => [ + 'default' => [], + ], + 'datasource_settings' => [ + 'entity:node' => [], + ], + 'server' => $this->searchApiServer->id(), + 'options' => ['index_directly' => FALSE], + ]); + $this->searchApiIndex->save(); + + $schema = <<setUpSchema($schema); + } + + /** + * Test cache metadata for the query. + */ + public function testQueryCacheMetadata(): void { + $query = <<mockResolver('Query', 'search', + $this->builder->produce('thunder_search_api') + ->map('index', $this->builder->fromValue('test_index')) + ->map('offset', $this->builder->fromValue(0)) + ->map('limit', $this->builder->fromValue(20)) + ); + $this->mockResolver('SearchApiResult', 'total', $this->builder->fromValue(1)); + + $metadata = $this->defaultCacheMetaData(); + $metadata->setCacheContexts(['languages:language_interface', 'user.permissions', 'user.node_grants:view']); + $metadata->addCacheTags(['config:search_api.index.test_index', 'node_list']); + + $this->assertResults($query, [], [ + 'search' => ['total' => '1'], + ], $metadata); + } + +} diff --git a/modules/thunder_workflow/src/ThunderWorkflowFormHelper.php b/modules/thunder_workflow/src/ThunderWorkflowFormHelper.php index a6e212384..b488ff968 100644 --- a/modules/thunder_workflow/src/ThunderWorkflowFormHelper.php +++ b/modules/thunder_workflow/src/ThunderWorkflowFormHelper.php @@ -141,6 +141,7 @@ public function moveStateToActions(NodeInterface $entity, array $form): array { if (count($transitions) > 1) { $form['actions']['submit']['#value'] = $this->t('Save as'); + $form['actions']['submit']['#weight'] = 50; } elseif (count($transitions) === 1) { $form['moderation_state']['#attributes']['style'] = 'display: none'; @@ -150,16 +151,10 @@ public function moveStateToActions(NodeInterface $entity, array $form): array { ['@state' => $transition->to()->label()]); } - unset($form['moderation_state']['#group']); - $form['moderation_state']['#weight'] = 90; - - $form['actions']['moderation_state'] = $form['moderation_state']; - unset($form['moderation_state']); - - // Promote moderation_state in gin theme to not end up in - // dropdown button. - $form['actions']['moderation_state']['#gin_action_item'] = TRUE; - $form['actions']['moderation_state']['widget'][0]['#attributes']['form'] = $form['#id']; + // Move to gin_sticky_actions and promote moderation_state in gin theme to + // not end up in dropdown button. + $form['moderation_state']['#group'] = 'gin_sticky_actions'; + $form['moderation_state']['widget'][0]['#attributes']['form'] = $form['#id']; return $form; } diff --git a/tests/src/Functional/ModeratedContentTest.php b/tests/src/Functional/ModeratedContentTest.php index a577b56f0..4de20dca9 100644 --- a/tests/src/Functional/ModeratedContentTest.php +++ b/tests/src/Functional/ModeratedContentTest.php @@ -82,7 +82,7 @@ public function testModerationWorkflow(): void { $this->drupalGet($node->toUrl('edit-form')); // Test, that hook_form_alter successfully moved moderation_state field. - $this->assertSession()->elementExists('css', '[data-drupal-selector="edit-actions"] > [data-drupal-selector="edit-moderation-state-wrapper"]'); + $this->assertSession()->elementExists('css', '[data-drupal-selector="edit-gin-sticky-actions"] > [data-drupal-selector="edit-moderation-state-wrapper"]'); $this->submitForm([ 'title[0][value]' => 'Test workflow article in draft 2', diff --git a/tests/src/FunctionalJavascript/MediaImageModifyTest.php b/tests/src/FunctionalJavascript/MediaImageModifyTest.php index 701fc3e8e..bfdad2ec5 100644 --- a/tests/src/FunctionalJavascript/MediaImageModifyTest.php +++ b/tests/src/FunctionalJavascript/MediaImageModifyTest.php @@ -100,16 +100,16 @@ public function testRemoveAdd(): void { /** @var \Drupal\file\FileInterface $file */ $file = $media->get($media->getSource()->getConfiguration()['source_field'])->entity; $this->assertFileExists($file->getFileUri()); - $this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-actions"] .gin-more-actions__trigger')->click(); - $this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-actions"]')->clickLink('Delete'); + $this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-gin-sticky-actions"] .gin-more-actions__trigger')->click(); + $this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-gin-sticky-actions"]')->clickLink('Delete'); $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', '#drupal-modal')); $this->assertSession()->fieldNotExists('also_delete_file'); $this->assertSession()->pageTextContains('This action cannot be undone.The file attached to this media is owned by admin so will be retained.'); Role::load(static::$defaultUserRole)->grantPermission('delete any file')->save(); $this->getSession()->reload(); - $this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-actions"] .gin-more-actions__trigger')->click(); - $this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-actions"]')->clickLink('Delete'); + $this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-gin-sticky-actions"] .gin-more-actions__trigger')->click(); + $this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-gin-sticky-actions"]')->clickLink('Delete'); $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', '#drupal-modal')); $this->assertSession()->fieldExists('also_delete_file')->check(); diff --git a/tests/src/FunctionalJavascript/ThunderJavascriptTrait.php b/tests/src/FunctionalJavascript/ThunderJavascriptTrait.php index 099b9c0f6..7f9636b0d 100644 --- a/tests/src/FunctionalJavascript/ThunderJavascriptTrait.php +++ b/tests/src/FunctionalJavascript/ThunderJavascriptTrait.php @@ -167,7 +167,7 @@ protected function assertPageTitle(string $expectedTitle): void { protected function clickSave(): void { $driver = $this->getSession()->getDriver(); - $driver->click('//div[@data-drupal-selector="edit-actions"]/input[@data-drupal-selector="edit-submit"]'); + $driver->click('//div[@data-drupal-selector="edit-gin-sticky-actions"]/input[@data-drupal-selector="gin-sticky-edit-submit"]'); } } diff --git a/tests/src/Traits/ThunderTestTrait.php b/tests/src/Traits/ThunderTestTrait.php index c42b21048..907ce8bd3 100644 --- a/tests/src/Traits/ThunderTestTrait.php +++ b/tests/src/Traits/ThunderTestTrait.php @@ -162,7 +162,7 @@ protected function tearDown(): void { // Output all errors for modules tested. $errors = []; foreach ($query->execute()->fetchAll() as $row) { - $errors[] = Unicode::truncate(Html::decodeEntities(strip_tags($controller->formatMessage($row))), 256, TRUE, TRUE); + $errors[] = Unicode::truncate(Html::decodeEntities(strip_tags((string) $controller->formatMessage($row))), 256, TRUE, TRUE); } throw new \Exception(print_r($errors, TRUE)); } @@ -176,12 +176,12 @@ protected function tearDown(): void { * @param string $uuid * The uuid. * - * @return \Drupal\media\MediaInterface|false|null + * @return \Drupal\media\MediaInterface * The media entity. * * @throws \Drupal\Core\Entity\EntityStorageException */ - protected function loadMediaByUuid(string $uuid) { + protected function loadMediaByUuid(string $uuid): MediaInterface { $media = \Drupal::getContainer()->get('entity.repository')->loadEntityByUuid('media', $uuid); assert($media instanceof MediaInterface); return $media; @@ -193,12 +193,12 @@ protected function loadMediaByUuid(string $uuid) { * @param string $uuid * The uuid. * - * @return \Drupal\node\NodeInterface|false|null + * @return \Drupal\node\NodeInterface * The node entity. * * @throws \Drupal\Core\Entity\EntityStorageException */ - protected function loadNodeByUuid(string $uuid) { + protected function loadNodeByUuid(string $uuid): NodeInterface { $node = \Drupal::getContainer()->get('entity.repository')->loadEntityByUuid('node', $uuid); assert($node instanceof NodeInterface); return $node; @@ -210,12 +210,12 @@ protected function loadNodeByUuid(string $uuid) { * @param string $uuid * The uuid. * - * @return \Drupal\taxonomy\TermInterface|false|null + * @return \Drupal\taxonomy\TermInterface * The term entity. * * @throws \Drupal\Core\Entity\EntityStorageException */ - protected function loadTermByUuid(string $uuid) { + protected function loadTermByUuid(string $uuid): TermInterface { $term = \Drupal::getContainer()->get('entity.repository')->loadEntityByUuid('taxonomy_term', $uuid); assert($term instanceof TermInterface); return $term; diff --git a/thunder.info.yml b/thunder.info.yml index f19b98216..39d1b5e04 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: ~11.0.0 -version: '7.3.7' +version: '8.1.0' distribution: name: Thunder