PluginNotFoundException: The "node_type" plugin does not exist

Created on 21 November 2017, about 7 years ago
Updated 1 April 2024, 9 months ago

I've run in to a major issue with Pathauto where as soon as you try and add in a new Pattern that only targets a specific content type, it throws the following error:

The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "node_type" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Digging around I found a somewhat related isse over on Ctools: https://www.drupal.org/project/ctools/issues/2638380 β†’
But I'm using a much newer version of the module so I wouldn't think it would be the cause of this issue.

Setup:
* Drupal 8.39
* PathAuto 1.0+3-dev
* CTools 8.3
* Token 1.0

And according to the release notes, required should be:
ctools 8.x-3.0
token 8.x-1.0

so we should be right.

Steps to reproduce

* Create a new Pattern via /admin/config/search/path/patterns
* Make the Pattern Type = "Content"
* Set whatever settings and titles you want and select just one content type for it to apply to
* Try and save the pattern
* See error message, changes to the pattern are not saved

πŸ’¬ Support request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia marblegravy

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.

  • πŸ‡ΊπŸ‡ΈUnited States JeffC518

    I looked at @daniel_j's comment first (#3) which was spot on, except for one minor thing:

    you can search-and-replace on all your pathauto.pattern.*.yml, changing references to node_type to entity_bundle.node.

    It should be entity_bundle:node

    Per example, in a pathauto.pattern.page_by_menu.yml, mine was:

    pattern: '[node:menu-link:parent]/[node:title]'
    selection_criteria:
      511dc248-86a2-425b-bb21-90da8d45e2d1:
        id: <strong>node_type</strong>
        bundles:
          contact_page: contact_page

    but should be:

    pattern: '[node:menu-link:parent]/[node:title]'
    selection_criteria:
      511dc248-86a2-425b-bb21-90da8d45e2d1:
        id: <strong>entity_bundle:node</strong>
        bundles:
          contact_page: contact_page

    .. assuming it's a node of course.

  • πŸ‡ΊπŸ‡ΈUnited States loopy1492

    Thank you so much @JeffC518!!!!

    This cropped up during our Drupal 10 upgrade.

    We run `blt install:drupal` during ci build on the server and when it tried importing these into a fresh database, it choked and died with the OP's error. Changing the slection_criteria id to entity_bundle:node solved it.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Hi,

    Where exactly is has to be changes ? I dont see any pathauto.pattern.* yaml files with already mentioned code :

    pattern: '[node:menu-link:parent]/[node:title]'
    selection_criteria:
      511dc248-86a2-425b-bb21-90da8d45e2d1:
        id: node_type
        bundles:
          contact_page: contact_page
  • πŸ‡ΈπŸ‡°Slovakia coaston

    Edit . It works now. I had to change it in different module, Not here in pathauto.

  • Hi @coaston, which module did you change it in? I'm facing a similar thing

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Hi gshreeGs

    in my case it was triggered by different module View Mode Page and this fix resolved it : 3300706 πŸ› Context exception when trying to create url (Drupal 10 is broken!) RTBC

    However it is connected somehow with CTools as described in #12 so the best way for you is to go to Admin > extend > Chaos Tools and see which of your contrib modules use it (Required by:) and I am sure that one of this modules have to be updated as they are not ready for D10.

  • πŸ‡§πŸ‡·Brazil fadonascimento

    Thanks @Webbeh β†’ #12 Helps me a lot!

  • First commit to issue fork.
  • πŸ‡ͺπŸ‡ΈSpain javitan

    For some reason the after upgrading the core and module it didn't update my pattern files, so you will need to change them manually (pathauto.pattern.YOURNODE.yml).

    So just change the id from this:

    selection_criteria:
      xxxxxxxxxxxxxxx:
        id: node_type
    

    Into this:

    selection_criteria:
      xxxxxxxxxxxxxxx:
        id: 'entity_bundle:node'
    
  • πŸ‡«πŸ‡·France othmen

    Thanks @javitan.

    #23 πŸ’¬ PluginNotFoundException: The "node_type" plugin does not exist Fixed resolved my problem.

  • πŸ‡¨πŸ‡¦Canada earthangelconsulting

    #23 worked for me too. thanks!

  • πŸ‡¦πŸ‡ͺUnited Arab Emirates ThirstySix

    after update, it works well.

    config sync file: pathauto.pattern.workshop.yml
    from
    id: node_type
    to
    id: entity_bundle:node

    run drush cim
    solved! Thanks #23

Production build 0.71.5 2024