Problem/Motivation

\Drupal\metatag\MetatagServiceProvider::alter triggers the following deprecation:

Not marking service definitions as public is deprecated in drupal:9.2.0 and is required in drupal:10.0.0. Call $definition->setPublic(TRUE) before calling ::setDefinition(). See https://www.drupal.org/node/3194517

setPublic() exists, so this should be safe to fix anytime.

Reporting this mostly because it's not trivial to find which service is actually causing this in a project with a lot of modules, unfortunately the deprecation messages does not mention which service is causing it.

Steps to reproduce

Proposed resolution

add $definition->setPublic(TRUE)

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#11 3240989-not-marking-service.patch882 bytesanagomes

Issue fork metatag-3240989

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

Berdir created an issue. See original summary.

anagomes’s picture

Assigned: Unassigned » anagomes

anagomes’s picture

Status: Active » Needs review

So, the changes in the code seem to be working and correct. Although it says it's not mergeable, if you open the request you see there is no error showing and it is ready to be merged.

anagomes’s picture

Assigned: anagomes » Unassigned
damienmckenna’s picture

Maybe upload the changes a patch and see how it works?

anagomes’s picture

StatusFileSize
new882 bytes

As DamienMcKenna suggested, I'm uploading the changes in a patch.

damienmckenna’s picture

Thanks. Everything is a-ok with 9.2, so let's see what happens with 8.9.

damienmckenna’s picture

The next release will be the first one since Drupal 8 hit EOL, so this is ok to commit.

berdir’s picture

This is compatible with D8 anyway, the method isn't new, just having to call it will be required.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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