Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
#2427637: Remove usages of deprecated entity_get_bundles() introduced a couple of wrong type hints to EntityTypeBundleInfo, but they should be EntityTypeBundleInfoInterface. This breaks the test cases in Rules which replace the entity_type.bundle.info service with a mock class implementing that interface but not inheriting from EntityTypeBundleInfo. This breaks any site using a contrib/custom module that replaces the entity_type.bundle.info service in the same way.
Proposed resolution
Always type hint to the interface.
Remaining tasks
Patch.
User interface changes
None.
API changes
Type hints will be changed to the interface.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | interface-2780255-2.patch | 7.72 KB | klausi |
Comments
Comment #2
klausiPatch to get the Rules tests working.
Comment #3
Mile23So do you want to wait until the 8.3.x release to get your tests working again? :-)
Setting to 8.2.x to fix the regression. Patch applies to 8.2.x cleanly. Re-running tests.
Comment #4
BerdirYeah, we missed this. Looks good.
Comment #5
alexpottCommitted and pushed f0fe2a07f30c3d41ac1f9c1b61d656ce7b439d4e to 8.3.x and 5a6931b to 8.2.x. Thanks!
A typehint widening is fine to go into the beta.