From 685d47d9765b3e58218f8027f71f63a19e82b0b2 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Tue, 22 Feb 2022 18:27:41 +0100 Subject: [PATCH 1/6] OEL-1204: Update to Drupal ^9.2 and php 7.4. --- .drone.yml | 2 +- composer.json | 9 ++++----- docker-compose.yml | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0c5766fc4..eb428d871 100644 --- a/.drone.yml +++ b/.drone.yml @@ -102,4 +102,4 @@ matrix: - lowest - highest PHP_VERSION: - - 7.3 + - 7.4 diff --git a/composer.json b/composer.json index d60defbaa..ef0b61779 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,8 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=7.3", - "drupal/core": "^8.9.20 || ^9.1", + "php": ">=7.4", + "drupal/core": "^9.2", "drupal/ui_patterns": "^1.2", "drupal/ui_patterns_settings": "^1.1", "openeuropa/ecl-twig-loader": "^3.1" @@ -15,7 +15,8 @@ "require-dev": { "composer/installers": "^1.11", "drupal/config_devel": "~1.8", - "drupal/core-composer-scaffold": "^8.9 || ^9.1", + "drupal/core-composer-scaffold": "^9.2", + "drupal/core-dev": "^9.2", "drupal/description_list_field": "^1.0@alpha", "drupal/drupal-extension": "^4.1", "drupal/file_link": "^2.0.6", @@ -23,11 +24,9 @@ "drush/drush": "^10.3", "easyrdf/easyrdf": "1.0.0 as 0.9.2", "openeuropa/code-review": "~1.6", - "openeuropa/drupal-core-require-dev": "^8.9 || ^9.1", "openeuropa/oe_content": "^2.7.0", "openeuropa/oe_media": "^1.14", "openeuropa/oe_paragraphs": "dev-OEL-775", - "openeuropa/task-runner": "dev-master as 1.0.0-beta7", "openeuropa/task-runner-drupal-project-symlink": "^1.0", "phpspec/prophecy-phpunit": "^1 || ^2" }, diff --git a/docker-compose.yml b/docker-compose.yml index 5f4a4fa97..0f74b87c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: web: - image: fpfis/httpd-php-dev:7.3 + image: fpfis/httpd-php-dev:7.4 working_dir: /var/www/html ports: - 8080:8080 From d0630ede430364042e6d7bcc002fec2111e36328 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Tue, 22 Feb 2022 18:46:57 +0100 Subject: [PATCH 2/6] OEL-1204: Use latest master for oe_paragraphs. --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ef0b61779..115feec5a 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "openeuropa/code-review": "~1.6", "openeuropa/oe_content": "^2.7.0", "openeuropa/oe_media": "^1.14", - "openeuropa/oe_paragraphs": "dev-OEL-775", + "openeuropa/oe_paragraphs": "^1.11", "openeuropa/task-runner-drupal-project-symlink": "^1.0", "phpspec/prophecy-phpunit": "^1 || ^2" }, @@ -67,6 +67,9 @@ "patches": { "drupal/ui_patterns": { "Fix unable to detect a pattern from default theme having same id as the pattern in the base theme @see https://github.com/nuvoleweb/ui_patterns/issues/304": "https://patch-diff.githubusercontent.com/raw/nuvoleweb/ui_patterns/pull/318.diff" + }, + "openeuropa/oe_paragraphs": { + "Latest master": "https://github.com/openeuropa/oe_paragraphs/compare/1.11.0..master.diff" } } }, From d4c538149fef4bf3573ccde1dcd58863a7d62b84 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Tue, 22 Feb 2022 18:51:24 +0100 Subject: [PATCH 3/6] OEL-1204: Newer release of symlink is needed for 7.4. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 115feec5a..5596e19aa 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "openeuropa/oe_content": "^2.7.0", "openeuropa/oe_media": "^1.14", "openeuropa/oe_paragraphs": "^1.11", - "openeuropa/task-runner-drupal-project-symlink": "^1.0", + "openeuropa/task-runner-drupal-project-symlink": "^1.0-beta5", "phpspec/prophecy-phpunit": "^1 || ^2" }, "scripts": { From 2e006012bc759d3ee8d82514bca84fa11e4221d2 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Wed, 23 Feb 2022 14:02:19 +0100 Subject: [PATCH 4/6] OEL-1204: Add composer-patches library as it's a direct dependency needed. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 5596e19aa..24f4956ed 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "prefer-stable": true, "require": { "php": ">=7.4", + "cweagans/composer-patches": "^1.7", "drupal/core": "^9.2", "drupal/ui_patterns": "^1.2", "drupal/ui_patterns_settings": "^1.1", From 234be4fad22577f43311044ddf4bece9605d53c3 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Wed, 23 Feb 2022 14:56:00 +0100 Subject: [PATCH 5/6] OEL-1204: Add required dependencies for Drupal 9.2 support. --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 24f4956ed..bd2c75db7 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "drupal/styleguide": "^1.0@beta", "drush/drush": "^10.3", "easyrdf/easyrdf": "1.0.0 as 0.9.2", + "egulias/email-validator": "^2.1.22 || ^3.0", "openeuropa/code-review": "~1.6", "openeuropa/oe_content": "^2.7.0", "openeuropa/oe_media": "^1.14", @@ -72,7 +73,10 @@ "openeuropa/oe_paragraphs": { "Latest master": "https://github.com/openeuropa/oe_paragraphs/compare/1.11.0..master.diff" } - } + }, + "_readme": [ + "Explicit requirement for egulias/email-validator due to https://www.drupal.org/project/drupal/issues/3061074#comment-14300579. It can be removed when Drupal core 9.2 support is droppped." + ] }, "config": { "sort-packages": true From 55e806c0046548c5e858cbe0d3e1503f8f23799a Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Wed, 23 Feb 2022 15:24:15 +0100 Subject: [PATCH 6/6] OEL-1204: Fix coding standards for lower deps. --- composer.json | 2 +- .../oe_bootstrap_theme_helper.module | 4 +++- .../oe_bootstrap_theme_paragraphs.module | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index bd2c75db7..dcddc9929 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "drush/drush": "^10.3", "easyrdf/easyrdf": "1.0.0 as 0.9.2", "egulias/email-validator": "^2.1.22 || ^3.0", - "openeuropa/code-review": "~1.6", + "openeuropa/code-review": "^1.7", "openeuropa/oe_content": "^2.7.0", "openeuropa/oe_media": "^1.14", "openeuropa/oe_paragraphs": "^1.11", diff --git a/modules/oe_bootstrap_theme_helper/oe_bootstrap_theme_helper.module b/modules/oe_bootstrap_theme_helper/oe_bootstrap_theme_helper.module index 54db6e41b..0fe00f7cf 100644 --- a/modules/oe_bootstrap_theme_helper/oe_bootstrap_theme_helper.module +++ b/modules/oe_bootstrap_theme_helper/oe_bootstrap_theme_helper.module @@ -37,7 +37,9 @@ function oe_bootstrap_theme_helper_field_widget_settings_summary_alter(array &$s || ($context['widget']->getPluginId() == 'options_buttons' && $context['field_definition']->getFieldStorageDefinition()->isMultiple()) ) { $summary[] = \Drupal::translation() - ->formatPlural($context['widget']->getPluginId() === 'boolean_checkbox', 'Switch: @is_switch', 'Switches: @is_switch', ['@is_switch' => ($context['widget']->getThirdPartySetting('oe_bootstrap_theme_helper', 'switch') ? t('Yes') : t('No'))]); + ->formatPlural($context['widget']->getPluginId() === 'boolean_checkbox', 'Switch: @is_switch', 'Switches: @is_switch', [ + '@is_switch' => ($context['widget']->getThirdPartySetting('oe_bootstrap_theme_helper', 'switch') ? t('Yes') : t('No')), + ]); } } diff --git a/modules/oe_bootstrap_theme_paragraphs/oe_bootstrap_theme_paragraphs.module b/modules/oe_bootstrap_theme_paragraphs/oe_bootstrap_theme_paragraphs.module index ffd36ad7a..48b69d6d4 100644 --- a/modules/oe_bootstrap_theme_paragraphs/oe_bootstrap_theme_paragraphs.module +++ b/modules/oe_bootstrap_theme_paragraphs/oe_bootstrap_theme_paragraphs.module @@ -158,7 +158,10 @@ function oe_bootstrap_theme_preprocess_paragraph__oe_text_feature_media(array &$ } $variant = $paragraph->get('oe_paragraphs_variant')->value ?? 'default'; - $variables['text_position'] = str_replace(['_featured', '_simple'], '', $variant); + $variables['text_position'] = str_replace([ + '_featured', + '_simple', + ], '', $variant); if ($is_image) { $thumbnail = $media->get('thumbnail')->first();