From eb0696fcd20c935e82f0f6549c97e144766e9b83 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Mon, 10 Jul 2023 20:34:34 +0300 Subject: [PATCH 1/5] EWPP-3457: Add drop of patch for Drupal 10 in .drone.yml file. --- .drone.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.drone.yml b/.drone.yml index ba52eed..2e45930 100644 --- a/.drone.yml +++ b/.drone.yml @@ -35,6 +35,17 @@ services: - NODE_MAX_SESSION=5 pipeline: + composer-drop-patch: + group: warmup + image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci + volumes: + - /cache:/cache + commands: + # Drop Drupal patch that is needed only for 9.4.x. + - composer config --unset --json "extra.patches.drupal/core" + when: + matrix: + CORE_VERSION: "10.0" composer-install: group: prepare image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci From 51e087163522e06248b24ce9f3c6e636b352e522 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Tue, 25 Jul 2023 15:00:44 +0200 Subject: [PATCH 2/5] EWPP-3457: Add documentation about patch in D10. --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3f52df7..6152343 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Once a content type is equipped with an open vocabulary field, users with approp # Requirements -This module unfortunately requires a patch to Drupal core, due to a bug that prevents placing the generated fields +This module unfortunately requires a patch to Drupal core 9.x releases, due to a bug that prevents placing the generated fields programmatically in the form display.\ -First require the component needed to apply the patch: +The patch is already included in this component composer.json. To have it installed, irst require the component needed to apply the patch: ```bash composer require cweagans/composer-patches ``` @@ -22,15 +22,17 @@ Then add in the `extra` section of your project `composer.json`: "extra": { "composer-exit-on-patch-failure": true, "enable-patching": true, - "patches": { - "drupal/core": { - "Entity display entities are incorrectly unserialized @see https://www.drupal.org/project/drupal/issues/3171333": "https://www.drupal.org/files/issues/2020-09-17/3171333-6.patch" - } - } + [...] } [...] ``` +If you require this module in Drupal 10 you must set said patch as ignored in your composer.json.\ +You can do this with the following command: +```bash +composer config --merge --json "extra.patches-ignore.openeuropa/open_vocabularies" '{"drupal/core": {"Entity display entities are incorrectly unserialized @see https://www.drupal.org/project/drupal/issues/3171333": "https://www.drupal.org/files/issues/2020-09-17/3171333-6.patch"}}' +``` + ## Development setup You can build the development site by running the following steps: From cbadd4ba252a03a260d62c7ae54174075aa0bc28 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Tue, 25 Jul 2023 15:03:34 +0200 Subject: [PATCH 3/5] EWPP-3457: Bump tests to 9.5.x. --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2e45930..d3a54d3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -41,7 +41,7 @@ pipeline: volumes: - /cache:/cache commands: - # Drop Drupal patch that is needed only for 9.4.x. + # Drop Drupal patch that is needed only for 9.x. - composer config --unset --json "extra.patches.drupal/core" when: matrix: @@ -82,9 +82,9 @@ pipeline: matrix: include: - - CORE_VERSION: 9.4.0 + - CORE_VERSION: 9.5.0 PHP_VERSION: 8.0 - - CORE_VERSION: 9.4.0 + - CORE_VERSION: 9.5.0 PHP_VERSION: 8.1 - CORE_VERSION: 10.0 PHP_VERSION: 8.1 From 26e84051f57691e9831996a13a0ffd2fad9e376f Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Tue, 25 Jul 2023 17:43:43 +0200 Subject: [PATCH 4/5] EWPP-3457: Handle D10 modals for delete operations. --- .../OpenVocabularyAssociationFormTest.php | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/src/FunctionalJavascript/OpenVocabularyAssociationFormTest.php b/tests/src/FunctionalJavascript/OpenVocabularyAssociationFormTest.php index 7e35e66..5643390 100644 --- a/tests/src/FunctionalJavascript/OpenVocabularyAssociationFormTest.php +++ b/tests/src/FunctionalJavascript/OpenVocabularyAssociationFormTest.php @@ -291,9 +291,23 @@ public function testVocabularyAssociationCreationUpdateDeletion(): void { $this->drupalGet('/admin/structure/open-vocabulary-association'); $assert_session->buttonExists('List additional actions')->press(); $this->clickLink('Delete'); - $assert_session->pageTextContainsOnce('Are you sure you want to delete the vocabulary association Association 1?'); - $assert_session->linkExists('Cancel'); - $assert_session->buttonExists('Delete')->press(); + + // Drupal 10 introduces modals for all delete operations. + if (version_compare(\Drupal::VERSION, '10.0.0') >= 0) { + $this->assertEquals( + 'Are you sure you want to delete the vocabulary association Association 1?', + $assert_session->waitForElement('css', '.ui-dialog-title')->getText() + ); + $form_actions = $assert_session->elementExists('css', '.ui-dialog-buttonset'); + $assert_session->buttonExists('Cancel', $form_actions); + $assert_session->buttonExists('Delete', $form_actions)->press(); + } + else { + $assert_session->pageTextContainsOnce('Are you sure you want to delete the vocabulary association Association 1?'); + $assert_session->linkExists('Cancel'); + $assert_session->buttonExists('Delete')->press(); + } + $assert_session->pageTextContains('The vocabulary association Association 1 has been deleted.'); } From da61d63d7d97a7ccd82ee06a4ad3b379353de222 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Tue, 25 Jul 2023 18:06:36 +0200 Subject: [PATCH 5/5] EWPP-3457: Typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6152343..c9a8842 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Once a content type is equipped with an open vocabulary field, users with approp This module unfortunately requires a patch to Drupal core 9.x releases, due to a bug that prevents placing the generated fields programmatically in the form display.\ -The patch is already included in this component composer.json. To have it installed, irst require the component needed to apply the patch: +The patch is already included in this component composer.json. To have it installed, first require the component needed to apply the patch: ```bash composer require cweagans/composer-patches ```