Skip to content

Commit

Permalink
Merge pull request #200 from openeuropa/OEL-2782
Browse files Browse the repository at this point in the history
OEL-2782: Update to use PHP 8.1/8.2 and Drupal 10.0.x/10.1.x.
  • Loading branch information
brummbar authored Dec 21, 2023
2 parents b33a264 + d6af188 commit 379f712
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 20 deletions.
14 changes: 8 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ pipeline:
volumes:
- /cache:/cache
commands:
# Drop Drupal patch that is needed only for 9.x.
# Drop Drupal patch that is needed only for 10.0.x.
- "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\"}}' --ansi --no-interaction --no-plugins --no-scripts"
when:
matrix:
CORE_VERSION: "10.0"
CORE_VERSION: "10.1.0"

composer-install:
group: prepare
Expand Down Expand Up @@ -89,9 +89,11 @@ pipeline:

matrix:
include:
- CORE_VERSION: 9.4.0
PHP_VERSION: 8.0
- CORE_VERSION: 9.4.0
- CORE_VERSION: 10.0.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.0
- CORE_VERSION: 10.0.0
PHP_VERSION: 8.2
- CORE_VERSION: 10.1.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.1.0
PHP_VERSION: 8.2
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.0",
"drupal/core": "^9.4 || ^10",
"php": ">=8.1",
"drupal/core": "^10",
"drupal/entity_meta_relation": "^1.3",
"drupal/facets": "^2.0",
"drupal/multivalue_form_element": "^1.0@beta",
Expand All @@ -18,8 +18,8 @@
"composer/installers": "^1.11",
"drupal/address": "^1.8",
"drupal/config_devel": "^1.2",
"drupal/core-composer-scaffold": "^9.4 || ^10",
"drupal/core-dev": "^9.4 || ^10",
"drupal/core-composer-scaffold": "^10",
"drupal/core-dev": "^10",
"drupal/extra_field": "^2.1",
"drupal/inline_entity_form": "^1.0-rc15",
"drush/drush": "^11.1",
Expand Down Expand Up @@ -86,7 +86,8 @@
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"phpro/grumphp": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"php-http/discovery": false
},
"github-oauth": {

Expand Down
7 changes: 7 additions & 0 deletions src/ListBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ class ListBuilder implements ListBuilderInterface {
*/
protected $entityRepository;

/**
* The facet manager wrapper.
*
* @var \Drupal\oe_list_pages\ListFacetManagerWrapper
*/
protected ListFacetManagerWrapper $facetManager;

/**
* The form builder.
*
Expand Down
8 changes: 8 additions & 0 deletions src/MultiselectFilterFieldPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Drupal\Component\Utility\SortArray;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\facets\FacetInterface;
Expand All @@ -18,6 +19,13 @@ class MultiselectFilterFieldPluginManager extends DefaultPluginManager {

use FacetManipulationTrait;

/**
* The entity field manager.
*
* @var \Drupal\Core\Entity\EntityFieldManagerInterface
*/
protected EntityFieldManagerInterface $entityFieldManager;

/**
* Constructs a new multiselect filter field plugin manager.
*
Expand Down
4 changes: 2 additions & 2 deletions tests/src/FunctionalJavascript/ListPagePluginFormTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function assertListPagePresetFilterValidations(string $default_value_name
$this->assertDefaultValueForFilters([
[
'key' => '',
'value' => t('No default values set'),
'value' => 'No default values set',
],
]);

Expand Down Expand Up @@ -390,7 +390,7 @@ public function assertListPagePresetFilters(string $default_value_name_prefix, s
$this->assertDefaultValueForFilters([
[
'key' => '',
'value' => t('No default values set'),
'value' => 'No default values set',
],
]);
// Set a preset filter for Select two.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function testCustomFieldWithDefaultStatus(): void {
$this->assertSession()->assertWaitOnAjaxRequest();
$filter_id = DefaultFilterConfigurationBuilder::generateFilterId($facet->id());
$filter_selector = 'emr_plugins_oe_list_page[wrapper][default_filter_values][wrapper][edit][' . $filter_id . ']';
$this->getSession()->getPage()->selectFieldOption($filter_selector . '[' . $facet->id() . '][0][list]', 2);
$this->getSession()->getPage()->selectFieldOption($filter_selector . '[' . $facet->id() . '][0][list]', '2');
$this->getSession()->getPage()->pressButton('Set default value');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->getSession()->getPage()->pressButton('Save');
Expand Down
6 changes: 3 additions & 3 deletions tests/src/Kernel/ListBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ class ListBuilderTest extends ListsSourceTestBase {
*/
public function testFacetCacheTags(): void {
$default_list_id = ListSourceFactory::generateFacetSourcePluginId('entity_test_mulrev_changed', 'item');
$this->facet = $this->createFacet('created', $default_list_id, '', 'oe_list_pages_multiselect', []);
$this->facet->addProcessor([
$facet = $this->createFacet('created', $default_list_id, '', 'oe_list_pages_multiselect', []);
$facet->addProcessor([
'processor_id' => 'oe_list_pages_date_status_processor',
'weights' => [],
'settings' => [],
]);
$this->facet->save();
$facet->save();

$configuration = [
'entity_type' => 'entity_test_mulrev_changed',
Expand Down
6 changes: 3 additions & 3 deletions tests/src/Kernel/ListFacetsFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class ListFacetsFormTest extends ListsSourceTestBase {
*/
public function testFacetCacheTags(): void {
$default_list_id = ListSourceFactory::generateFacetSourcePluginId('entity_test_mulrev_changed', 'item');
$this->facet = $this->createFacet('created', $default_list_id, '', 'oe_list_pages_multiselect', []);
$this->facet->addProcessor([
$facet = $this->createFacet('created', $default_list_id, '', 'oe_list_pages_multiselect', []);
$facet->addProcessor([
'processor_id' => 'oe_list_pages_date_status_processor',
'weights' => [],
'settings' => [],
]);

$this->facet->save();
$facet->save();

$list = $this->listFactory->get('entity_test_mulrev_changed', 'item');

Expand Down

0 comments on commit 379f712

Please sign in to comment.