Skip to content

Commit

Permalink
Merge pull request #49 from openeuropa/EWPP-3457
Browse files Browse the repository at this point in the history
EWPP-3457: Update composer.json file.
  • Loading branch information
brummbar authored Jul 25, 2023
2 parents 770928e + da61d63 commit eb59818
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
15 changes: 13 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.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
Expand Down Expand Up @@ -71,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
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, first require the component needed to apply the patch:
```bash
composer require cweagans/composer-patches
```
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}

Expand Down

0 comments on commit eb59818

Please sign in to comment.