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.moduleand the test modules'.modulefiles:#[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@ContentEntityTypeannotation is back next to the attribute, which core only reads from 11.1.- Tests:
@groupand@dataProviderannotations next to the PHPUnit attributes, for Drupal 10's PHPUnit 9.EntityReferenceFieldFormatterTestexpects the node search view modes before Drupal 11.4, which moved them to Search (#3587564).CKEditor5IntegrationTestonly sets the liststylessetting from 11.3, which added its schema (#3274635), andEntityEmbedFilterTestalways expects theuser.roles:authenticatedcache 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.neonignores the Drupal 11 attribute classes Drupal 10 doesn't have. README.mdandAGENTS.md: the new requirements.
On Drupal 10 it needs Embed 8.x-1.13: 8.x-1.12 requires Drupal 11.3.
Testing instructions
- On a Drupal 10.6 site with Embed 8.x-1.13, install Entity Embed from this branch, and check that it installs.
- 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.
- Repeat on a Drupal 11 site.
- Check that this MR's
composer (previous major),phpstan (previous major)andphpunit (previous major)jobs pass.
Remaining tasks
- Release Embed 8.x-1.13 with embed#3612600 (closed), then re-run this MR's pipeline.
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.