Provide upgrade path for the "node_type" condition

Created on 17 July 2023, 12 months ago
Updated 14 September 2023, 10 months ago

Problem/Motivation

After upgrading to Drupal 10, the following exception is thrown if the asset injector makes use of the now deprecated "node_type" plugin:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "node_type" plugin does not exist.

And is related to the https://www.drupal.org/node/2983299 change record.

The module requires an upgrade path to use the new plugin ID.

Steps to reproduce

Have an existing asset injector entity with the following condition:

conditions:
  node_type:
    id: node_type
    negate: false
    context_mapping:
      node: '@node.node_route_context:node'
    bundles:
      basic_page: basic_page

and attempt an upgrade to D10.

Proposed resolution

Provide an upgrade path from node_type to entity_bundle:node

The update hook should only be ran on Drupal 9.3 and up.

Remaining tasks

User interface changes

N/A

API changes

N/A

Data model changes

N/A.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024