Drupal 11 compatibility

Created on 1 April 2024, 2 months ago
Updated 16 May 2024, 17 days ago

Multiple, yet minor changes are necessary to make the module work on Drupal 11.

Original issue description

Problem/Motivation

When I run kernel tests, I get these errors and deprecation notices:

There was 1 error:

1) Drupal\Tests\field_permissions\Kernel\Plugin\FieldPermissionType\ManagerTest::testCreateInstance
Drupal\Core\Field\FieldException: Attempt to create a field storage of unknown type text.

/opt/drupal/web/core/modules/field/src/Entity/FieldStorageConfig.php:296
/opt/drupal/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:235
/opt/drupal/web/core/lib/Drupal/Core/Entity/EntityBase.php:523
/opt/drupal/web/modules/contrib/field_permissions/tests/src/Kernel/Plugin/FieldPermissionType/ManagerTest.php:72
/opt/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:729

ERRORS!
Tests: 6, Assertions: 49, Errors: 1.

Remaining self deprecation notices (4)

  3x: Installing the table sequences with the method KernelTestBase::installSchema() is deprecated in drupal:10.2.0 and is removed from drupal:12.0.0. See https://www.drupal.org/node/3349345
    1x in ManagerTest::testCreateInstance from Drupal\Tests\field_permissions\Kernel\Plugin\FieldPermissionType
    1x in ManagerTest::testGetDefinitions from Drupal\Tests\field_permissions\Kernel\Plugin\FieldPermissionType
    1x in ManagerTest::testAppliesToField from Drupal\Tests\field_permissions\Kernel\Plugin\FieldPermissionType

  1x: The Drupal\Tests\field\Traits\EntityReferenceTestTrait is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Instead, use \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait. See https://www.drupal.org/node/3401941
    1x in KernelTestSuite::suite from Drupal\Tests\TestSuites

Steps to reproduce

Run $ phpunit --testsuite="kernel" --group="field_permissions".

📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

🇨🇦Canada ryanrobinson_wlu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024