Skip to content

Commit

Permalink
Some fixes for Drupal 11.0.x compatibility (#4354)
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeder authored Feb 4, 2025
1 parent 9938972 commit 933c38d
Show file tree
Hide file tree
Showing 24 changed files with 114 additions and 304 deletions.
22 changes: 19 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ commands:
description: 'PHP major.minor for DDev to use.'
default: '8.2'
type: string
database_version:
description: 'Database version for DDev to use.'
default: '5.7'
type: string
addon_branch:
description: 'Repo branch name for the DKAN DDev add-on you want to test against.'
default: 'main'
Expand All @@ -50,10 +54,12 @@ commands:
which ddev
ddev --version
ddev config --project-name test-$CIRCLE_WORKFLOW_JOB_ID --project-type drupal9 --docroot docroot --create-docroot
ddev get https://github.com/GetDKAN/dkan-ddev-addon/archive/refs/heads/<< parameters.addon_branch >>.tar.gz
ddev add-on get https://github.com/GetDKAN/dkan-ddev-addon/archive/refs/heads/<< parameters.addon_branch >>.tar.gz
bash -c 'echo COMPOSER_AUTH=$COMPOSER_AUTH' > .ddev/.env
# Modify config to use our PHP version.
sed -i 's/^php_version.*$/php_version: "<< parameters.php_version >>"/' .ddev/config.dkan.yaml
# Modify config to use our PHP version and database.
yq '.database.version ="<< parameters.database_version >>"' -i .ddev/config.dkan.yaml
yq '.php_version ="<< parameters.php_version >>"' -i .ddev/config.dkan.yaml
cat .ddev/config.dkan.yaml
ddev restart
ddev status
ddev dkan-init --project-version << parameters.dkan_recommended_branch>> --force
Expand Down Expand Up @@ -122,6 +128,10 @@ jobs:
description: 'PHP major.minor for DDev to use.'
default: '8.1'
type: string
database_version:
description: 'Database version for DDev to use.'
default: '5.7'
type: string
dkan_recommended_branch:
description: 'Branch of getdkan/recommended-project to use.'
default: '10.2.x-dev'
Expand All @@ -137,6 +147,7 @@ jobs:
steps:
- prepare_build:
php_version: << parameters.php_version >>
database_version: << parameters.database_version >>
dkan_recommended_branch: << parameters.dkan_recommended_branch >>
- prepare_site:
upgrade: << parameters.upgrade >>
Expand Down Expand Up @@ -189,6 +200,10 @@ jobs:
description: 'PHP major.minor for DDev to use.'
default: '8.2'
type: string
database_version:
description: 'Database version for DDev to use.'
default: '5.7'
type: string
dkan_recommended_branch:
description: 'Branch of getdkan/recommended-project to use.'
default: '10.2.x-dev'
Expand All @@ -200,6 +215,7 @@ jobs:
steps:
- prepare_build:
php_version: << parameters.php_version >>
database_version: << parameters.database_version >>
dkan_recommended_branch: << parameters.dkan_recommended_branch >>
- prepare_site:
upgrade: << parameters.upgrade >>
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ tagfile
/tests/reports
/web
.phpunit.result.cache
.phpunit.cache
docs/build
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"drupal/facets": "^3.0@beta",
"drupal/moderated_content_bulk_publish": "~2.0.20",
"drupal/search_api": "^1.15",
"drupal/select2": "^1.13",
"drupal/select2": "^2.0",
"drupal/select_or_other": "^4.2.0",
"drupal/views_bulk_operations": "^4.0",
"ezyang/htmlpurifier": "^4.11",
Expand All @@ -31,9 +31,9 @@
"ilbee/csv-response": "^1.2.0",
"justinrainbow/json-schema": "^5.2",
"m1x0n/opis-json-schema-error-presenter": "^0.5.3",
"npm-asset/select2": "^4.0",
"npm-asset/select2": "^4.0 || dev-develop",
"oomphinc/composer-installers-extender": "^2.0",
"ramsey/uuid": "^3.8.0",
"ramsey/uuid": "^3.8.0 || ^4",
"stolt/json-merge-patch": "^2.0",
"symfony/polyfill-php80": "^1.27"
},
Expand Down
123 changes: 0 additions & 123 deletions modules/common/src/LoggerTrait.php

This file was deleted.

84 changes: 0 additions & 84 deletions modules/common/tests/src/Traits/LoggerTraitTest.php

This file was deleted.

4 changes: 4 additions & 0 deletions modules/common/tests/src/Unit/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class Connection extends CoreConnection {
*/
protected $statementClass;

public function upsert($table, array $options = []) { }

public function schema() { }

/**
* {@inheritdoc}
*/
Expand Down
4 changes: 2 additions & 2 deletions modules/common/tests/src/Unit/Events/EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use Drupal\common\EventDispatcherTrait;
use Drupal\common\Events\Event;
use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher;
use MockChain\Chain;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\EventDispatcher\EventDispatcher;

class EventTest extends TestCase
{
Expand All @@ -19,7 +19,7 @@ public function testDataIntegrityAcrossEventSubscribers() {
->add(Container::class)
->getMock();

$dispatcher = new ContainerAwareEventDispatcher($containerx);
$dispatcher = new EventDispatcher($containerx);
$dispatcher->addListener('test_event', function(Event $event) {
$event->setData(1);
});
Expand Down
30 changes: 0 additions & 30 deletions modules/common/tests/src/Unit/LoggerTraitTest.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class QueryDataProvider {
/**
*
*/
public function getAllData($return): array {
public static function getAllData(): array {
$tests = [
'noPropertiesQuery',
'propertiesQuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\common\DatasetInfo;
use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher;
use Drupal\datastore\Controller\QueryController;
use Drupal\datastore\DatastoreService;
use Drupal\datastore\Service\Query;
Expand All @@ -24,6 +23,7 @@
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;

Expand All @@ -46,7 +46,7 @@ protected function setUp(): void {
// Set cache services.
$options = (new Options)
->add('cache_contexts_manager', CacheContextsManager::class)
->add('event_dispatcher', ContainerAwareEventDispatcher::class)
->add('event_dispatcher', EventDispatcher::class)
->index(0);
$chain = (new Chain($this))
->add(ContainerInterface::class, 'get', $options)
Expand Down
Loading

0 comments on commit 933c38d

Please sign in to comment.