Problem/Motivation

Drupal 12 added a second required parameter to EntityListBuilder::getDefaultOperations():

// core/lib/Drupal/Core/Entity/EntityListBuilder.php:155
protected function getDefaultOperations(EntityInterface $entity, CacheableMetadata $cacheability)

EntityQueueListBuilder overrides this method but still declares only the original one-parameter signature:

// src/EntityQueueListBuilder.php:155 (1.10.0)
public function getDefaultOperations(EntityInterface $entity)

On PHP 8.5 (required by Drupal 12) this causes an InvalidArgumentException from ClassResolver when the entity queue list page is rendered, making /admin/structure/entityqueue inaccessible.

This is separate from #3597890 (the Rector/LegacyHook migration pass), which does not touch EntityQueueListBuilder.

Proposed resolution

Add ?CacheableMetadata $cacheability = NULL to EntityQueueListBuilder::getDefaultOperations() and pass it through to parent::. Making it nullable with a default preserves backwards compatibility with Drupal 10/11 callers that do not pass the parameter.

Remaining tasks

Review and commit patch

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

aangel created an issue. See original summary.

amateescu made their first commit to this issue’s fork.

amateescu’s picture

Title: EntityQueueListBuilder::getDefaultOperations() missing CacheableMetadata parameter — fatal on Drupal 12 » Drupal 12 compatibility followup
Version: 8.x-1.10 » 8.x-1.x-dev
Status: Active » Needs review

Found a few more issue that were missed in #3597890: Drupal 12 compatibility.

  • amateescu committed d3aea1f2 on 8.x-1.x authored by aangel
    fix: #3606806 Drupal 12 compatibility followup
    
    By: aangel
    By: amateescu
    
amateescu’s picture

Status: Needs review » Fixed

Merged, thanks!

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.