Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Merge pull request #59 from openeuropa/EWPP-1914
Browse files Browse the repository at this point in the history
EWPP-1914: Update to PHP8
  • Loading branch information
hernani authored Feb 8, 2022
2 parents 01e65bc + 09cbdeb commit 4c54b19
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 26 deletions.
14 changes: 8 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci
environment:
- DOCUMENT_ROOT=/test/entity_meta_relation
- COMPOSERVER=--2
mysql:
image: registry.fpfis.eu/fpfis/sql:percona-5.7
command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3
Expand All @@ -30,10 +31,8 @@ pipeline:
volumes:
- /cache:/cache
commands:
# @todo remove "composer install" step once the following issue is fixed.
# @link https://webgate.ec.europa.eu/CITnet/jira/browse/OPENEUROPA-1234
- composer install --ansi --no-suggest --no-progress
- composer update --prefer-lowest --prefer-stable --ansi --no-suggest --no-progress
- composer self-update --2
- composer update --prefer-lowest --prefer-stable --ansi --no-progress
when:
matrix:
COMPOSER_BOUNDARY: lowest
Expand All @@ -44,14 +43,16 @@ pipeline:
volumes:
- /cache:/cache
commands:
- composer install --ansi --no-suggest --no-progress
- composer self-update --2
- composer install --ansi --no-progress
when:
matrix:
COMPOSER_BOUNDARY: highest

site-install:
image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci
commands:
- while ! mysqladmin ping -h mysql --silent; do sleep 1; done
- ./vendor/bin/run drupal:site-install

grumphp:
Expand All @@ -77,4 +78,5 @@ matrix:
- lowest
- highest
PHP_VERSION:
- 7.3
- 7.4
- 8.0
29 changes: 20 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.3",
"drupal/core": "^8.9 || ^9.1",
"php": ">=7.4",
"drupal/core": "^9.2",
"drupal/entity_reference_revisions": "^1.6",
"drupal/inline_entity_form": "^1.0"
},
"require-dev": {
"composer/installers": "~1.5",
"drupal/core-composer-scaffold": "^8.9 || ^9.1",
"drupal/core-composer-scaffold": "^9.2",
"drupal/config_devel": "^1.2",
"drupal/core-dev": "^9.2",
"drupal/drupal-extension": "^4.0",
"drush/drush": "^10.3",
"openeuropa/code-review": "^1.6",
"openeuropa/drupal-core-require-dev": "^8.9 || ^9.1",
"openeuropa/task-runner-drupal-project-symlink": "^1.0",
"egulias/email-validator": "^2.1.22 || ^3.0",
"openeuropa/code-review": "^2.0",
"openeuropa/task-runner-drupal-project-symlink": "^1.0.0-beta5",
"phpspec/prophecy-phpunit": "^1 || ^2"
},
"scripts": {
Expand All @@ -39,7 +40,7 @@
},
"autoload-dev": {
"psr-4": {
"Drupal\\Tests\\emr\\": "./tests/"
"Drupal\\Tests\\emr\\": "./tests/src/"
}
},
"extra": {
Expand All @@ -55,9 +56,19 @@
"locations": {
"web-root": "./build"
}
}
},
"_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
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"phpro/grumphp": true
}
}
}
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
version: '2'
services:
web:
image: fpfis/httpd-php-dev:7.3
image: fpfis/httpd-php-dev:8.0
working_dir: /var/www/html
ports:
- 8080:8080
volumes:
- .:/var/www/html # Non Mac users.
# - nfsmount:/var/www/html # Mac Users with the nfsmount volume.
environment:
COMPOSERVER: "--2"
XDEBUG_CONFIG: "client_host=172.17.0.1" # Non-Mac users.
# XDEBUG_CONFIG: "client_host=host.docker.internal" # Mac users.
XDEBUG_MODE: "develop, debug"
Expand Down
2 changes: 1 addition & 1 deletion emr.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Entity Meta Relation
type: module
description: 'Provides an entity meta relation entity and associated behaviors for relations.'
package: Entity Meta Relation
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- entity_reference_revisions:entity_reference_revisions
3 changes: 3 additions & 0 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ parameters:
- php
- theme
- yml
grumphp:
git_hook_variables:
EXEC_GRUMPHP_COMMAND: 'docker-compose exec -T web'
2 changes: 1 addition & 1 deletion modules/emr_node/emr_node.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Entity Meta Relation Node
type: module
description: 'Configure entity meta relations for nodes.'
package: Entity Meta Relation
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- entity_meta_relation:emr
Expand Down
2 changes: 1 addition & 1 deletion modules/entity_meta_example/entity_meta_example.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Entity Meta Example
type: module
description: 'Defines an example meta entity to be related with nodes'
package: Entity Meta Relation
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- entity_meta_relation:emr_node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Entity Meta Audio
type: module
description: 'Defines an example meta entity for audio information'
package: Entity Meta Relation
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- entity_meta_relation:emr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Entity Meta Force
type: module
description: 'Defines an example meta entity for force information'
package: Entity Meta Relation
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- entity_meta_relation:emr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Entity Meta Speed
type: module
description: 'Defines an example meta entity for speed information'
package: Entity Meta Relation
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- entity_meta_relation:emr_node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Entity Meta Visual
type: module
description: 'Defines an example meta entity for visual information'
package: Entity Meta Relation
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- entity_meta_relation:emr_node
Expand Down
2 changes: 1 addition & 1 deletion src/EntityMetaRelationInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected function updateTargetBundlesInField(string $emr_bundle, string $field_
throw new FieldException("Field config 'entity_meta_relation.{$emr_bundle}.{$field_name}' not found. Without this field, we cannot properly configure Entity Meta type.");
}
$handler_settings = $field_config->getSetting('handler_settings');
$old_target_bundles = isset($handler_settings['target_bundles']) ? $handler_settings['target_bundles'] : [];
$old_target_bundles = $handler_settings['target_bundles'] ?? [];
$handler_settings['target_bundles'] = array_unique(array_merge($old_target_bundles, $target_bundles));
$field_config->setSetting('handler_settings', $handler_settings);
$field_config->save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class EntityMetaRelationContentFormTest extends BrowserTestBase {
'access administration pages',
'administer content types',
'administer nodes',
'create entity_meta_example_ct content',
'create entity_meta_multi_example_ct content',
'edit any entity_meta_example_ct content',
'edit own entity_meta_example_ct content',
'edit any entity_meta_multi_example_ct content',
'edit own entity_meta_multi_example_ct content',
'access content overview',
];

Expand Down

0 comments on commit 4c54b19

Please sign in to comment.