From 2fd29c28e81b3d490e9b7e85a0b6ba78618ec155 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Tue, 15 Oct 2024 19:03:33 +0300 Subject: [PATCH 1/2] EWPP-4739: Update label of szech-republic option to 'Czechia'. --- src/EventSubscriber/OptionsSubscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EventSubscriber/OptionsSubscriber.php b/src/EventSubscriber/OptionsSubscriber.php index 58f2d690..1a9ef601 100644 --- a/src/EventSubscriber/OptionsSubscriber.php +++ b/src/EventSubscriber/OptionsSubscriber.php @@ -107,7 +107,7 @@ public function getFlagOptions(FlagOptionsEvent $event): void { 'bulgaria' => $this->t('Bulgaria'), 'croatia' => $this->t('Croatia'), 'cyprus' => $this->t('Cyprus'), - 'czech-republic' => $this->t('Czech republic'), + 'czech-republic' => $this->t('Czechia'), 'denmark' => $this->t('Denmark'), 'estonia' => $this->t('Estonia'), 'EU' => $this->t('EU'), From c5229bd13987e0aee5f227329f3f4b3b38f4e00b Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Tue, 15 Oct 2024 19:28:02 +0300 Subject: [PATCH 2/2] EWPP-4739: Fix coder issues. --- .../oe_paragraphs_illustrations_lists.module | 4 ++-- oe_paragraphs.module | 4 ++-- tests/Traits/FieldsTrait.php | 2 +- tests/src/Functional/ParagraphsTestBase.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/oe_paragraphs_illustrations_lists/oe_paragraphs_illustrations_lists.module b/modules/oe_paragraphs_illustrations_lists/oe_paragraphs_illustrations_lists.module index 82cdc4d1..20cded6d 100644 --- a/modules/oe_paragraphs_illustrations_lists/oe_paragraphs_illustrations_lists.module +++ b/modules/oe_paragraphs_illustrations_lists/oe_paragraphs_illustrations_lists.module @@ -28,7 +28,7 @@ use Drupal\oe_paragraphs_illustrations_lists\Event\RatioOptionsEvent; * * @see options_allowed_values() */ -function _oe_paragraphs_illustrations_lists_allowed_values_ratios(FieldStorageDefinitionInterface $definition, FieldableEntityInterface $entity = NULL, &$cacheable = TRUE): array { +function _oe_paragraphs_illustrations_lists_allowed_values_ratios(FieldStorageDefinitionInterface $definition, ?FieldableEntityInterface $entity = NULL, &$cacheable = TRUE): array { $event = new RatioOptionsEvent(); \Drupal::service('event_dispatcher')->dispatch($event, RatioOptionsEvent::class); @@ -51,7 +51,7 @@ function _oe_paragraphs_illustrations_lists_allowed_values_ratios(FieldStorageDe * * @see options_allowed_values() */ -function _oe_paragraphs_illustrations_lists_allowed_values_columns(FieldStorageDefinitionInterface $definition, FieldableEntityInterface $entity = NULL, &$cacheable = TRUE): array { +function _oe_paragraphs_illustrations_lists_allowed_values_columns(FieldStorageDefinitionInterface $definition, ?FieldableEntityInterface $entity = NULL, &$cacheable = TRUE): array { $event = new ColumnOptionsEvent(); \Drupal::service('event_dispatcher')->dispatch($event, ColumnOptionsEvent::class); diff --git a/oe_paragraphs.module b/oe_paragraphs.module index ba69fcaa..ac0c6a55 100644 --- a/oe_paragraphs.module +++ b/oe_paragraphs.module @@ -54,7 +54,7 @@ function oe_paragraphs_entity_base_field_info(EntityTypeInterface $entity_type): * * @see options_allowed_values() */ -function _oe_paragraphs_allowed_values_icons(FieldStorageDefinitionInterface $definition, FieldableEntityInterface $entity = NULL, &$cacheable = TRUE) { +function _oe_paragraphs_allowed_values_icons(FieldStorageDefinitionInterface $definition, ?FieldableEntityInterface $entity = NULL, &$cacheable = TRUE) { $event = new IconOptionsEvent(); $event_dispatcher = \Drupal::service('event_dispatcher'); @@ -78,7 +78,7 @@ function _oe_paragraphs_allowed_values_icons(FieldStorageDefinitionInterface $de * * @see options_allowed_values() */ -function _oe_paragraphs_allowed_values_flags(FieldStorageDefinitionInterface $definition, FieldableEntityInterface $entity = NULL, &$cacheable = TRUE): array { +function _oe_paragraphs_allowed_values_flags(FieldStorageDefinitionInterface $definition, ?FieldableEntityInterface $entity = NULL, &$cacheable = TRUE): array { $event = new FlagOptionsEvent(); \Drupal::service('event_dispatcher')->dispatch($event, FlagOptionsEvent::class); diff --git a/tests/Traits/FieldsTrait.php b/tests/Traits/FieldsTrait.php index e66e4c79..9e2aa598 100644 --- a/tests/Traits/FieldsTrait.php +++ b/tests/Traits/FieldsTrait.php @@ -82,7 +82,7 @@ protected function getMultipleCardinalityFieldTable(string $field, int $position * @return \Behat\Mink\Element\NodeElement|null * The field if found, NULL otherwise. */ - protected function findField(string $label, NodeElement $container = NULL): ?NodeElement { + protected function findField(string $label, ?NodeElement $container = NULL): ?NodeElement { $container = $container ?? $this->getSession()->getPage(); // Try to find the field with the standard method. diff --git a/tests/src/Functional/ParagraphsTestBase.php b/tests/src/Functional/ParagraphsTestBase.php index ba57b252..e3d4f80b 100644 --- a/tests/src/Functional/ParagraphsTestBase.php +++ b/tests/src/Functional/ParagraphsTestBase.php @@ -4,9 +4,9 @@ namespace Drupal\Tests\oe_paragraphs\Functional; +use Drupal\Tests\BrowserTestBase; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\Tests\BrowserTestBase; /** * Base class to test paragraphs.