diff --git a/tests/features/update/deploy_108900.feature b/tests/features/update/deploy_108900.feature new file mode 100644 index 0000000000000000000000000000000000000000..bc43364b28183c338b80c3e39f57b67273fa8d9a --- /dev/null +++ b/tests/features/update/deploy_108900.feature @@ -0,0 +1,15 @@ +@api @group-clone +Feature: Covers \joinup_core_deploy_108900(). + + Scenario: Test that news creation works. + + Given I am logged in as a moderator + And I am on the homepage + When I click "Interoperable Europe" + And I click "News" + Then the url should match "/interoperable-europe/latest-news" + + When I click "Add news" in the plus button menu + Then the response status code should be 200 + And the url should match "/interoperable-europe/news/add" + And I should see the heading "Add news" diff --git a/web/modules/custom/joinup_core/joinup_core.deploy.php b/web/modules/custom/joinup_core/joinup_core.deploy.php index d23968e7228443fda98e0ee39020ff58a89ecadd..6de171874d2cc455e2481bac456720acb54d6640 100644 --- a/web/modules/custom/joinup_core/joinup_core.deploy.php +++ b/web/modules/custom/joinup_core/joinup_core.deploy.php @@ -13,3 +13,17 @@ */ declare(strict_types = 1); + +use Drupal\pathauto\PathautoState; + +/** + * Fix Interoperable Europe news creation link. + */ +function joinup_core_deploy_108900(): void { + $entityTypeManager = \Drupal::entityTypeManager(); + $entityTypeManager->getStorage('node')->load(704825)->set('path', [ + 'pathauto' => PathautoState::SKIP, + 'alias' => '/interoperable-europe/latest-news', + ])->save(); + $entityTypeManager->getStorage('path_alias')->load(84170)->delete(); +}