Problem/Motivation

  • The MyrestRouteMetatagStorageInterface::loadMultiple method has a return type hint (: array) that is incompatible with the base EntityStorageInterface in Drupal 11, causing a fatal error.
  • The MyrestRouteMetatag configuration entity incorrectly specifies a storage_schema handler, which is not applicable to configuration entities and can lead to initialization issues.
  • Helper services (MyrestMetatagHelper, MyrestRouteMetatagEvaluator) load entity storages and configurations directly in their constructors, which can trigger circular reference exceptions during service container initialization.

Proposed resolution

  • Remove the : array return type from MyrestRouteMetatagStorageInterface::loadMultiple() to match the core signature.
  • Remove the storage_schema handler from the MyrestRouteMetatag entity annotation and delete the corresponding schema class.
  • Refactor helper services to use lazy initialization (getter methods) for entity storages and configurations instead of loading them in constructors.

Remaining tasks

Review and test the fixes.

User interface changes

None.

API changes

The loadMultiple method in MyrestRouteMetatagStorageInterface no longer has a strict return type hint.

Data model changes

Removal of invalid SQL storage schema for the myrest_route_metatag configuration entity.

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

sergeydruua created an issue. See original summary.

  • sergeydruua committed 14befca6 on 1.0.x
    Issue #3574521: Fix Drupal 11 compatibility and circular dependencies in...
sergeydruua’s picture

Status: Active » Fixed

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.

sergeydruua’s picture

Status: Fixed » Closed (fixed)