You have requested a non-existent service "serializer.normalizer.content_entity.jsonapi"

Created on 8 September 2022, almost 2 years ago
Updated 24 February 2023, over 1 year ago

Problem/Motivation

After upgrading drupal from 9.3.1 to 9.4.2 with jsonapi_extras version 8.x-3.21 and this patch applied: https://www.drupal.org/files/issues/2020-12-02/3042467-50.patch β†’ from https://www.drupal.org/project/drupal/issues/3042467 ✨ Support entities that are neither content nor config entities Needs work

Resulted in Drupal throwing this error:

In ContainerBuilder.php line 1030:
                                                                                             
  You have requested a non-existent service "serializer.normalizer.content_entity.jsonapi". 

The https://www.drupal.org/files/issues/2020-12-02/3042467-50.patch β†’ patch both aliases and decorates the serializer.normalizer.content_entity.jsonapi which appears to work fine prior to drupal 9.4.2.

The supplied patch updates jsonapi_extras to decorate the alias instead and that allows drupal to bootrstrap once again.
To be honest I don't know why it works, but it does.

Steps to reproduce

I haven't had the chance yet to configure a core drupal with the appropriate patch.
But generally it should be.

* Install drupal 9.4.1

* Apply patch https://www.drupal.org/files/issues/2020-12-02/3042467-50.patch β†’ from https://www.drupal.org/project/drupal/issues/3042467 ✨ Support entities that are neither content nor config entities Needs work

* Update drupal to 9.4.2

* run drush cr

Get this error:

In ContainerBuilder.php line 1030:
                                                                                             
  You have requested a non-existent service "serializer.normalizer.content_entity.jsonapi". 

Proposed resolution

Modify jsonapi_extras.services.yml to decorate the alias provided by the patch rather than the core service name.

Remaining tasks

Update https://www.drupal.org/project/drupal/issues/3042467 ✨ Support entities that are neither content nor config entities Needs work to reflect this the appropriate fix probably should be in that issue.

API changes

The core serializer.normalizer.content_entity.jsonapi is renamed.

πŸ› Bug report
Status

Active

Version

3.21

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia thursday_bw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024