feat: #3643887 Restore Drupal 10 support

Description

Issue: https://www.drupal.org/project/entity_embed/issues/3643887

Restores Drupal 10 support on 8.x-1.x without dropping Drupal 12: the module now requires ^10.6 || ^11.3 || ^12. Drupal 10.6 and 11.3 are the oldest minors that still get security fixes, and the ones CI's previous major and previous minor jobs test. Sites on older minors can keep using 8.x-1.7.

  • entity_embed.module and the test modules' .module files: #[LegacyHook] functions that call the hook classes, for core before 11.1.
  • *.services.yml: register the hook classes for Drupal 10.
  • template_preprocess_entity_embed_container(): for core before 11.2, which ignores the theme hook's "initial preprocess" callback. Later versions skip it.
  • EntityEmbedFakeEntity: the @ContentEntityType annotation is back next to the attribute, which core only reads from 11.1.
  • Tests: @group and @dataProvider annotations next to the PHPUnit attributes, for Drupal 10's PHPUnit 9. EntityReferenceFieldFormatterTest expects the node search view modes before Drupal 11.4, which moved them to Search (#3587564). CKEditor5IntegrationTest only sets the list styles setting from 11.3, which added its schema (#3274635), and EntityEmbedFilterTest always expects the user.roles:authenticated cache context, which 10.6 adds too. ConfigurationUiTest, which needs CKEditor 4, now skips on Drupal 10 as well.
  • CI: the previous major jobs are back on, and phpstan.neon ignores the Drupal 11 attribute classes Drupal 10 doesn't have.
  • README.md and AGENTS.md: the new requirements.

On Drupal 10 it needs Embed 8.x-1.13: 8.x-1.12 requires Drupal 11.3.

Testing instructions

  1. On a Drupal 10.6 site with Embed 8.x-1.13, install Entity Embed from this branch, and check that it installs.
  2. Add a "Node" embed button to a CKEditor 5 text format, embed a node in an article's body, and check that the embedded node shows on the saved article.
  3. Repeat on a Drupal 11 site.
  4. Check that this MR's composer (previous major), phpstan (previous major) and phpunit (previous major) jobs pass.

Remaining tasks

AI disclosure

Generated with the help of Claude Code. I decided to restore Drupal 10 support while keeping Drupal 12. Claude Code found what Drupal 10 lacks (OOP hooks, "initial preprocess", the ContentEntityType attribute, PHPUnit attributes, the moved search view modes) and wrote the shims and annotations. I reviewed the changes, and the tests, phpcs and phpstan pass locally on Drupal 11.4.

🤖 Generated with Claude Code

Edited by Dave Reid

Merge request reports

Loading
Loading