Error: Class "Drupal\rng\Drupal\user\Entity\Role" on D11

Created on 2 May 2025, 8 days ago

Problem/Motivation

When installing the RNG module on a clean Drupal 11 install, the following error is thrown:

Error: Class "Drupal\rng\Drupal\user\Entity\Role"

This indicates an issue with an incorrect or outdated class reference in the RNG module.

Steps to Reproduce

  1. Set up a clean Drupal 11.1.x site.
  2. Require the following composer packages:
    composer require mglaman/composer-drupal-lenient
    composer require cweagans/composer-patches
    composer require "drupal/dynamic_entity_reference:^4.0@alpha"
  3. Add the following modules to the extra.drupal-lenient.allowed-packages section in your composer.json:
    "drupal/rng",
    "drupal/courier",
    "drupal/dynamic_entity_reference"
  4. Add patches:
    "drupal/rng": {
      "Add Drupal 11 support (3521717)": "https://www.drupal.org/files/issues/2025-04-29/3521717-add-d11-support-4.patch"
    },
    "drupal/courier": {
      "Add Drupal 11 support (3521717)": "https://www.drupal.org/files/issues/2024-06-02/courier.2.1.x-dev.rector_0.patch"
    }
  5. Attempt to enable the RNG module.

Proposed resolution

TODO

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇧🇪Belgium Jonasanne

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

Comments & Activities

  • Issue created by @Jonasanne
  • 🇧🇪Belgium Jonasanne

    This is my mistake.
    I was to quick assuming it was a different issue but it's the fault of the D11 patch.
    Closing this issue again since it's a duplicate.

Production build 0.71.5 2024