Problem/Motivation
https://git.drupalcode.org/project/quicktabs/-/jobs/8919549
1 test triggered 2 deprecations:
1) /builds/project/quicktabs/vendor/symfony/deprecation-contracts/function.php:25
The "cache.backend.memory" service is deprecated in drupal:11.3.0 and is removed from drupal:13.0.0. Use cache.backend.memory.memory instead. See https://www.drupal.org/node/3546856Triggered by:
* Drupal\Tests\quicktabs\Kernel\QuickTabsTitleRenderTest::testTabTitleIsEscapedOnlyOnce
/builds/project/quicktabs/tests/src/Kernel/QuickTabsTitleRenderTest.php:342) /builds/project/quicktabs/web/core/lib/Drupal/Core/Plugin/Discovery/AttributeDiscoveryWithAnnotations.php:98
Using @EntityType annotation for plugin with ID quicktabs_instance is deprecated and is removed from drupal:13.0.0. Use a Drupal\Core\Entity\Attribute\EntityType attribute instead. See https://www.drupal.org/node/3395575Triggered by:
* Drupal\Tests\quicktabs\Kernel\QuickTabsTitleRenderTest::testTabTitleIsEscapedOnlyOnce
/builds/project/quicktabs/tests/src/Kernel/QuickTabsTitleRenderTest.php:34FAILURES!
Tests: 1, Assertions: 1, Failures: 1, Deprecations: 2.
CI is failing due to two deprecations introduced in Drupal 11.3. These are triggered during the QuickTabsTitleRenderTest kernel test.
The cache.backend.memory service is deprecated and will be removed in Drupal 13. It should be replaced with cache.backend.memory.memory.Needs 11.3- The @EntityType annotation used for the quicktabs_instance plugin is deprecated. Drupal now expects entity types to be defined using the
Drupal\Core\Entity\Attribute\EntityTypePHP attribute.
Both deprecations cause the test suite to fail because deprecations are treated as failures in CI.
Steps to reproduce
- Run the test suite on Drupal 11.3 or later.
- Execute the kernel tests.
Example:
phpunit tests/src/Kernel/QuickTabsTitleRenderTest.php
Result:
Two deprecations are triggered and CI fails.
Proposed resolution
Replace usage of the deprecated cache.backend.memory service with cache.backend.memory.memory.</li>- Convert the quicktabs_instance entity definition from the deprecated @EntityType annotation to the Drupal\Core\Entity\Attribute\EntityType attribute.
This will remove the deprecations and restore compatibility with Drupal 11.3+.
Remaining tasks
- Replace deprecated cache.backend.memory service usage.
- Convert @EntityType annotation to the new attribute syntax.
- Run the test suite to confirm the deprecations are resolved.
- Ensure compatibility with supported Drupal core versions.
API changes
Entity type definitions will move from annotation-based discovery to PHP attribute-based discovery.
Issue fork quicktabs-3579240
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
joelpittetWe've got the annotations in og module and PHP attributes which should help a bit. The memory backend is likely not going to change here as it needs a minimum 11.3. So I will shrink the scope here.
Comment #4
joelpittetComment #7
joelpittetMerged this in