Drupal 10 deprecated code

Created on 29 August 2022, over 2 years ago
Updated 1 November 2023, over 1 year ago

Problem/Motivation

Drupal 10 will be using Twig 3.0 β†’ . Below is a list of deprecations found which will need to be fixed to be compatible with Drupal 10.

The spaceless tag is deprecated since Twig 2.7, use the "spaceless" filter with the "apply" tag instead. See https://drupal.org/node/3071078

  • /templates/input/input--checkbox.html.twig
  • /templates/input/input--file.html.twig
  • /templates/input/input--form-control.html.twig
  • /templates/input/input--radio.html.twig
  • /templates/input/input--range.html.twig
  • /templates/input/input--submit.html.twig
  • /templates/input/input.html.twig
  • /templates/input/select.html.twig
  • /templates/navigation/toolbar.html.twig

Using an "if" condition on "for" tag is deprecated since Twig 2.10.0, use a "filter" filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). See https://drupal.org/node/3071078

  • templates/dataset/forum-list.html.twig

Using the spaceless tag at the root level of a child template is deprecated since Twig 2.5.0 and will become a syntax error in 3.0. See https://drupal.org/node/3071078

  • templates/input/input--form-control.html.twig

Nesting a block definition under a non-capturing node is deprecated since Twig 2.5.0 and will become a syntax error in 3.0. See https://drupal.org/node/3071078

  • templates/input/input--form-control.html.twig

Value of core_version_requirement: ^9 is not compatible with the next major version of Drupal core.

  • uswds_base.info.yml

Proposed resolution

  • Determine if use of spaceless tag is needed in each template.
  • Replace any spaceless tags with {% apply spaceless %}
  • Fix all other deprecations.
πŸ“Œ Task
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pcate

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.71.5 2024