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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klausi created an issue. See original summary.

klausi’s picture

Status: Active » Needs review
FileSize
7.72 KB

Patch to get the Rules tests working.

Mile23’s picture

Version: 8.3.x-dev » 8.2.x-dev

So 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.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Yeah, we missed this. Looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed f0fe2a07f30c3d41ac1f9c1b61d656ce7b439d4e to 8.3.x and 5a6931b to 8.2.x. Thanks!

A typehint widening is fine to go into the beta.

  • alexpott committed f0fe2a0 on 8.3.x
    Issue #2780255 by klausi: Replace incorrect EntityTypeBundleInfo type...

  • alexpott committed 5a6931b on 8.2.x
    Issue #2780255 by klausi: Replace incorrect EntityTypeBundleInfo type...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.