Problem/motivation

Just like all of the ModuleHandler interface issues referenced by this issue: #3277301: Adapt to centralised hook dispatcher in Drupal 9.4

Both EntityTypeManagerInterface and RendererInterface are typehinted with their default/concrete implementation, rather than an interface. Additionally, there are incorrect doc typehinting in the same line.

This prevents other code from changing the Renderer and EntityTypeManager services by changing their default class or by using service decoration, in the case of Pinto Theme in my case.

Combined, when loading the AllowedBlocksForm form, a fatal exception is thrown.

Steps to repro

Install and enable layout_builder_restrictions_by_region + pinto_theme

Load the AllowedBlocksForm form

See: error 500

Proposed resolution

Change to interfaces as is standard.

This module uses Gitlab CI for automated testing of proposed code changes. To contribute code changes, create a merge request. Patch files will not trigger automated testing and are not sufficient for review.
Command icon 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

dpi created an issue. See original summary.

dpi’s picture

Issue summary: View changes
dpi’s picture

Status: Active » Needs review
mark_fullmer’s picture

Status: Needs review » Fixed

This change makes sense. Thanks for identifying it and providing the code changes necessary!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

dpi’s picture

Thanks @mark_fullmer!

Status: Fixed » Closed (fixed)

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