Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EWPP-3026: Drupal 10 compatibility. #219

Merged
merged 14 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ pipeline:
PHP_VERSION: "8.0"

matrix:
CORE_VERSION:
- 9.4.0
- 9.5.0
PHP_VERSION:
- 8.0
- 8.1
include:
- CORE_VERSION: 9.4.0
PHP_VERSION: 8.0
- CORE_VERSION: 9.4.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.0
PHP_VERSION: 8.1
62 changes: 30 additions & 32 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,42 @@
"require": {
"php": ">=8.0",
"cweagans/composer-patches": "^1.7",
"drupal/core": "^9.4",
"drupal/daterange_compact": "^2.0",
"drupal/twig_field_value": "^2.0",
"drupal/core": "^9.4 || ^10",
"drupal/daterange_compact": "^2.0.1",
"drupal/twig_field_value": "^2.0.2",
"openeuropa/composer-artifacts": "^1.0.0-alpha1",
"openeuropa/oe_bootstrap_theme": "^1.3.0"
},
"require-dev": {
"composer/installers": "^1.11",
"drupal/better_exposed_filters": "^5.0",
"drupal/composite_reference": "^2.1",
"drupal/config_devel": "~1.2",
"drupal/core-composer-scaffold": "^9.4",
"drupal/core-dev": "^9.4",
"drupal/better_exposed_filters": "^6.0.3",
"drupal/composite_reference": "^2.2",
"drupal/config_devel": "~1.9",
"drupal/core-composer-scaffold": "^9.4 || ^10",
"drupal/core-dev": "^9.4 || ^10",
"drupal/description_list_field": "^1.0@alpha",
"drupal/entity_reference_revisions": "^1.9",
"drupal/extra_field": "^2.1",
"drupal/facets_form": "1.0.0-alpha3",
"drupal/field_group": "^3.2",
"drupal/search_api": "^1.21",
"drupal/search_api_autocomplete": "^1.5",
"drupal/entity_reference_revisions": "^1.10",
"drupal/extra_field": "^2.3",
"drupal/facets_form": "1.0.0-alpha6",
Copy link
Member

@sergepavle sergepavle Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this package is still locked in composer.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I also don't find anything in the _readme.

"drupal/field_group": "^3.4",
"drupal/search_api": "^1.29",
"drupal/search_api_autocomplete": "^1.7",
"drupal/typed_link": "^2.0.1",
"drush/drush": "^11.1",
"mikey179/vfsstream": "^1.6.10",
"openeuropa/code-review": "^2.0",
"openeuropa/oe_authentication": "^1.8",
"openeuropa/oe_contact_forms": "~1.5",
"openeuropa/oe_content": "^3.0.0-alpha4",
"openeuropa/oe_content_extra": "^1.0.0-beta2",
"openeuropa/oe_corporate_blocks": "^4.8",
"openeuropa/oe_list_pages": "^0.20",
"openeuropa/code-review": "^2.0.0-alpha6",
"openeuropa/oe_authentication": "^1.11",
"openeuropa/oe_contact_forms": "~1.11",
"openeuropa/oe_content": "^3.0.0-alpha11",
"openeuropa/oe_content_extra": "^1.1.0",
"openeuropa/oe_corporate_blocks": "^4.13",
"openeuropa/oe_list_pages": "^1.0.0",
"openeuropa/oe_multilingual": "^1.14",
"openeuropa/oe_paragraphs": "^1.17",
"openeuropa/oe_starter_content": "^1.0.0",
"openeuropa/oe_paragraphs": "^1.19",
"openeuropa/oe_starter_content": "^1.2.0",
"openeuropa/task-runner-drupal-project-symlink": "^1.0-beta6",
"phpspec/prophecy-phpunit": "^2"
"phpspec/prophecy-phpunit": "^2",
"symfony/validator": "~v4.4.48 || ~v6.2.5"
},
"scripts": {
"post-install-cmd": "./vendor/bin/run drupal:site-setup",
Expand Down Expand Up @@ -85,18 +86,14 @@
"https://www.drupal.org/project/entity_reference_revisions/issues/2937835": "https://www.drupal.org/files/issues/2021-03-26/entity_reference_revisions-field_formatter_label-2937835-36.patch"
}
},
"patches-ignore": {
"openeuropa/oe_content": {
"drupal/typed_link": {
"Outdated": "https://www.drupal.org/files/issues/2022-02-09/typed_link_constraints-3263477-2.patch"
}
}
},
"drupal-scaffold": {
"locations": {
"web-root": "./build"
}
},
"_readme": [
"Limit symfony/validator to 6.2 see https://www.drupal.org/project/drupal/issues/3363798."
],
"installer-paths": {
"build/core": [
"type:drupal-core"
Expand All @@ -120,7 +117,8 @@
"drupal/core-composer-scaffold": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpro/grumphp": true
"phpro/grumphp": true,
"phpstan/extension-installer": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Whitelabel Theme contact forms
type: module
description: OpenEuropa Whitelabel contact forms tools.
package: OpenEuropa Whitelabel Theme
core_version_requirement: ^9.3
core_version_requirement: ^9.4 || ^10

dependencies:
- oe_contact_forms:oe_contact_forms
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ContactFormRenderTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'oe_bootstrap_theme_helper',
'ui_patterns',
'ui_patterns_library',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Whitelabel Content Extra Project
type: module
description: Module to override content extra project.
package: OpenEuropa Whitelabel Theme
core_version_requirement: ^9.3
core_version_requirement: ^9.4 || ^10
dependencies:
- extra_field:extra_field
- oe_content_extra:oe_content_extra_project
Expand Down
2 changes: 1 addition & 1 deletion modules/oe_whitelabel_helper/oe_whitelabel_helper.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Whitelabel Theme Helper
type: module
description: OpenEuropa Whitelabel Theme helpers and tools.
package: OpenEuropa Whitelabel Theme
core_version_requirement: ^9.3
core_version_requirement: ^9.4 || ^10

dependencies:
- drupal:node
Expand Down
2 changes: 1 addition & 1 deletion modules/oe_whitelabel_helper/oe_whitelabel_helper.module
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use Drupal\Core\Form\FormStateInterface;
* Implements hook_locale_translation_projects_alter().
*/
function oe_whitelabel_helper_locale_translation_projects_alter(&$projects) {
$projects['oe_whitelabel_helper']['info']['interface translation server pattern'] = drupal_get_path('module', 'oe_whitelabel_helper') . '/translations/%project-%language.po';
$projects['oe_whitelabel_helper']['info']['interface translation server pattern'] = \Drupal::service('extension.list.module')->getPath('oe_whitelabel_helper') . '/translations/%project-%language.po';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class FloatEndSortWidgetTest extends BetterExposedFiltersKernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
'bef_test',
protected static $modules = [
'better_exposed_filters',
'field',
'filter',
'node',
'oe_whitelabel_helper',
'oewt_views_test',
'options',
'system',
'taxonomy',
Expand All @@ -36,24 +36,23 @@ class FloatEndSortWidgetTest extends BetterExposedFiltersKernelTestBase {
/**
* {@inheritdoc}
*/
public static $testViews = ['bef_test'];
protected function setUp($import_test_views = TRUE): void {
parent::setUp($import_test_views);

// @todo Use bef_test once it's fixed for d10.
// @see https://www.drupal.org/project/better_exposed_filters/issues/3365130
$this->installConfig(['oewt_views_test']);
}

/**
* Tests the rendering of the FloatEndSortWidget.
*/
public function testFloatEndSortWidget() {
$view = Views::getView('bef_test');
$view->storage->getDisplay('default');

$this->setBetterExposedOptions($view, [
// @todo Add combined sort.
'sort' => [
'plugin_id' => 'oe_whitelabel_float_end_sort',
],
]);
$view = Views::getView('oewt');

// Render the exposed form.
$this->renderExposedForm($view);

$crawler = new Crawler($this->content->__toString());
$widget = $crawler->filter('form.bef-exposed-form');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Whitelabel List Pages
type: module
description: Companion module for the OE List Pages module.
package: OpenEuropa Whitelabel Theme
core_version_requirement: ^9.3
core_version_requirement: ^9.4 || ^10

dependencies:
- extra_field:extra_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: OpenEuropa Whitelabel List Pages Test
type: module
description: The test module for OE Whitelabel List Pages. Provides EventSubscriber, facets, index and content ready.
package: OpenEuropa Whitelabel Theme
core_version_requirement: ^9.3
core_version_requirement: ^9.4 || ^10
dependencies:
- oe_whitelabel_list_pages
- oe_whitelabel_starter_news
- oe_whitelabel:oe_whitelabel_list_pages
- oe_whitelabel:oe_whitelabel_starter_news
- search_api:search_api_db

config_devel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: OpenEuropa Whitelabel Multilingual
type: module
description: Adds additional functionality to the Multilingual module
package: OpenEuropa Whitelabel Theme
core_version_requirement: ^9.3
core_version_requirement: ^9.4 || ^10
dependencies:
- openeuropa:oe_multilingual
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Whitelabel Paragraphs
type: module
description: Companion module to add support and customisations for oe_paragraphs.
package: OpenEuropa Whitelabel Theme
core_version_requirement: ^9.3
core_version_requirement: ^9.4 || ^10
dependencies:
- drupal:description_list_field
- oe_content:oe_content_timeline_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function _oe_whitelabel_paragraphs_install_migrate_field_data(array $field_names
$query = $paragraphs_storage->getQuery();
$query->allRevisions();
$query->condition('type', array_keys($field_names_by_bundle), 'IN');
$paragraph_ids = $query->execute();
$paragraph_ids = $query->accessCheck(FALSE)->execute();

foreach ($paragraph_ids as $revision_id => $paragraph_id) {
// Revision can't be NULL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ function oe_whitelabel_preprocess_paragraph__oe_banner(array &$variables): void
}

$variables['image'] = ImageValueObject::fromArray([
'src' => file_create_url($uri),
'src' => \Drupal::service('file_url_generator')->generateAbsoluteString($uri),
'alt' => $source->getMetadata($media, 'thumbnail_alt_value') ?? $media->label(),
'name' => $media->getName(),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: OE Whitelabel - Legacy Paragraphs Test
type: module
description: Provides legacy configuration as in oe_bootstrap_theme_paragraphs.
package: Testing
core_version_requirement: ^9.4 || ^10
hidden: true
dependencies:
- drupal:description_list_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ public function testCarouselParagraph(): void {
$assert = $this->assertSession();
$fixtures_path = \Drupal::service('extension.list.module')->getPath('oe_whitelabel_paragraphs') . '/tests/fixtures/';

$file_1 = file_save_data(file_get_contents($fixtures_path . 'example_1.jpeg'), 'public://example_1.jpeg');
$file_1 = \Drupal::service('file.repository')->writeData(file_get_contents($fixtures_path . 'example_1.jpeg'), 'public://example_1.jpeg');
$file_1->setPermanent();
$file_1->save();

$file_2 = file_save_data(file_get_contents($fixtures_path . 'example_1.jpeg'), 'public://example_2.jpeg');
$file_2 = \Drupal::service('file.repository')->writeData(file_get_contents($fixtures_path . 'example_1.jpeg'), 'public://example_2.jpeg');
$file_2->setPermanent();
$file_2->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ public function testRendering(): void {

$fixtures_path = \Drupal::service('extension.list.module')->getPath('oe_whitelabel_paragraphs') . '/tests/fixtures/';
// Create English files.
$en_image = file_save_data(file_get_contents($fixtures_path . 'example_1.jpeg'), 'public://example_1_en.jpeg');
$en_image = \Drupal::service('file.repository')->writeData(file_get_contents($fixtures_path . 'example_1.jpeg'), 'public://example_1_en.jpeg');
$en_image->setPermanent();
$en_image->save();

// Create Bulgarian files.
$bg_image = file_save_data(file_get_contents($fixtures_path . 'example_1.jpeg'), 'public://example_1_bg.jpeg');
$bg_image = \Drupal::service('file.repository')->writeData(file_get_contents($fixtures_path . 'example_1.jpeg'), 'public://example_1_bg.jpeg');
$bg_image->setPermanent();
$bg_image->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ public function testWithInpageNavigationRendering(): void {
$this->assertStringContainsString('Accordion item 2', $accordion_items->eq(1)->text());
$this->assertStringContainsString('Accordion item 3', $accordion_items->eq(2)->text());
// Check that the wrappers where added to the correct paragraphs.
$this->assertSame('bcl-inpage-item-1', $rich_text_title->parents()->eq(0)->attr('id'));
$this->assertSame('bcl-inpage-item-6', $facts_figures->parents()->eq(0)->attr('id'));
$this->assertSame('bcl-inpage-item-8', $social_media_title->parents()->eq(1)->attr('id'));
$this->assertSame('bcl-inpage-item-1', $rich_text_title->getNode(0)->parentNode->getAttribute('id'));
$this->assertSame('bcl-inpage-item-6', $facts_figures->getNode(0)->parentNode->getAttribute('id'));
$this->assertSame('bcl-inpage-item-8', $social_media_title->getNode(0)->parentNode->parentNode->getAttribute('id'));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function testRendering(): void {
'file' => [
'title' => 'Local PDF file',
'language' => 'English',
'url' => file_create_url($uri_en),
'url' => \Drupal::service('file_url_generator')->generateAbsoluteString($uri_en),
'meta' => '(2.96 KB - PDF)',
'icon' => 'file-pdf-fill',
],
Expand Down Expand Up @@ -167,7 +167,7 @@ public function testRendering(): void {
[
'title' => 'Italian translation',
'language' => 'Italian',
'url' => file_create_url($uri_it),
'url' => \Drupal::service('file_url_generator')->generateAbsoluteString($uri_it),
'meta' => '(2.96 KB - PDF)',
],
];
Expand Down
Loading