After drupal core upgraded from 8 to 9 faced issue like deprecation template must contain the "%alias_id%" placeholder at Alias.php

Created on 3 January 2024, about 1 year ago
Updated 25 January 2024, about 1 year ago

Problem/Motivation

System Requirement
OS : Windows 10
PHP Version: 7.4.24
Apache Version: 2.4.49

Upgraded Drupal version from 8.9.19 to 9.5.11 and ended up with a deprecation template that must contain the "%alias_id%" placeholder issue after the core update is completed.

The below steps were followed while doing the upgrade.

1) Installed upgrade Status module to check the Requirements, Incompatible Contrib, custom modules, and theme. Fixed all the Incompatible contrib, custom, and theme issues.
2) Run the Drupal core update commands
composer require 'drupal/core-recommended:^9' 'drupal/core-composer-scaffold:^9' 'drupal/core-project-message:^9' --update-with-dependencies --no-update

composer update

The drupal9 upgrade was completed successfully.

After upgrade completion, run the Drush clear cache command

It returns "In Alias.php line 107:

The deprecation template must contain the "%alias_id%" placeholder. " in Drush

In the Apache error log found below error:

Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException:
The deprecation template must contain the "%alias_id%" placeholder. in
C:\\xampp\\htdocs\\developerPortal\\docroot\\vendor\\symfony\\dependency-injection\\Alias.php on line 107
#0 C:\\xampp\\htdocs\\developerPortal\\docroot\\core\\lib\\Drupal\\Core\\DependencyInjection\\YamlFileLoader.php(240):
Symfony\\Component\\DependencyInjection\\Alias->setDeprecated(true, 'The "%service_i...')\n#1
C:\\xampp\\htdocs\\developerPortal\\docroot\\core\\lib\\Drupal\\Core\\DependencyInjection\\YamlFileLoader.php
(134): Drupal\\Core\\DependencyInjection\\YamlFileLoader->parseDefinition('serializer.norm...', Array, 'core/modules/js...',
Array)\n#2 C:\\xampp\\htdocs\\developerPortal\\docroot\\core\\lib\\Drupal\\Core\\DependencyInjection\\YamlFileLoader.php(101): Drupal\\Core\\DependencyInjection\\YamlFileLoader->parseDefinitions(Array, 'core/modules/js...')\n#3
C:\\xampp\\htdocs\\developerPortal\\docroot\\core\\lib\\Drupal\\Core\\DrupalKernel.php(1317):
Drupal\\Core\\DependencyInjection\\YamlFileLoader->load('core/modules/js...')\n#4
C:\\xampp\\htdocs\\developerPortal\\docroot\\core\\lib\\Drupal\\Core\\DrupalKernel.php(948):
Drupal\\Core\\DrupalKernel->compileContainer()\n#5
C:\\xampp\\htdocs\\developerPortal\\docroot\\core\\lib\\Drupal\\Core\\DrupalKernel.php(487):
Drupal\\Core\\DrupalKernel->initializeContainer()\n#6
C:\\xampp\\htdocs\\developerPortal\\docroot\\core\\lib\\Drupal\\Core\\DrupalKernel.php(716):
Drupal\\Core\\DrupalKernel->boot()\n#7 C:\\xampp\\htdocs\\developerPortal\\docroot\\index.php(19):
Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#8 {main}

💬 Support request
Status

Postponed: needs info

Version

9.5

Component
Other 

Last updated about 17 hours ago

Created by

🇮🇳India muthukris

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

Comments & Activities

  • Issue created by @muthukris
  • Status changed to Postponed: needs info about 1 year ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Can you provide the error message in full or a stack trace, thanks

  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Something is reading a module from `core/modules/js...` that has a services.yml

    Guessing its jsonapi

    Can you check the file matches https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/modules/json...

  • 🇮🇳India muthukris

    Thanks for the quick turnaround @larowlan. Let me check and update.

  • 🇮🇳India muthukris

    Yes, there is a difference in the jsonapi.services.yml file when I compare it with my local.

    The below lines are missing in the services.yml file.

    alias: serializer.normalizer.fieldable_entity.jsonapi
    deprecated: The "%service_id%" service is deprecated. You should use the 'serializer.normalizer.fieldable_entity.jsonapi' service instead.
    serializer.normalizer.fieldable_entity.jsonapi:
    class: Drupal\jsonapi\Normalizer\FieldableEntityDenormalizer

    After applying this code , introduce new error like below.

    FieldStorageConfigStorage.php line 167:

    Unable to determine class for field type 'viewsreference' found in the 'field.storage.paragraph.field_view' configuration

    In DiscoveryTrait.php line 53:

    The "viewsreference" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FieldTypePluginManager are: app_callback_url, comment, datetime, entity_reference_re
    visions, file, file_uri, file_link, fontawesome_icon, image, link, list_float, list_integer, list_string, path, text, text_long, text_with_summary, boolean, changed, c
    reated, decimal, email, entity_reference, float, integer, language, map, password, string, string_long, timestamp, uri, uuid

  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Is that provided by a contrib module?

  • 🇮🇳India muthukris

    Apologies for the late response. Yes, it is provided by contrib module.

Production build 0.71.5 2024