Problem/Motivation

With Drupal 9, after upgrading to version 4.0.11, this error in the PHP logs:
NOTICE: PHP message: PHP Fatal error: Trait 'Drupal\Core\Entity\BundlePermissionHandlerTrait' not found in /var/www/html/docroot/modules/contrib/environment_indicator/src/EnvironmentIndicatorPermissions.php on line 12

And admin pages do not load (WSOD).

The trait BundlePermissionHandlerTrait class does not exist for Drupal 9 and was not introduced until Drupal core 10.1.x.

Steps to reproduce

  1. Install Drupal 9
  2. Install Version 4.0.11 or above of this module.
  3. Browse to /admin/modules

Proposed resolution

Starting from 4.0.11, create a new minor or major version of the module that is only compatible with 10.1+

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tekNorah created an issue. See original summary.

teknorah’s picture

Issue summary: View changes

teknorah’s picture

I think a minor release (or two) may need to be created, one for the D10 version and one for the D9 version. At that point, merge requests could be pointed to each one, or something?

teknorah’s picture

Status: Active » Needs review
teknorah’s picture

I take that back... it was introduced prior to 10.1.x

For whatever reason, it didn't come up before when searching the repo on gitlab, but I see looking at the code this trait was released for Drupal 9.3.x with commit: cffb02aad63664e7930a3d2ec798a8feb054af82

teknorah’s picture

For the 3341093-drupal9-version branch, it is sufficient to set core_version_requirement: ^9.2? or would could I set core_version_requirement: ~9.2.0 to specify is only for Drupal core 9.2.x?

gngn’s picture

Title: Version 4.0.11 and above require Drupal core 10.1.x » Version 4.0.11 and above require Drupal core 9.3.x / 10.1.x
Related issues: +#3301118: Drupal 10 compatibility

Like @tekNorah wrote in #6 the trait BundlePermissionHandlerTrait class does exist for Drupal 9.
It was introduced in 9.3.0 (so I am adjusting the issue title).

Current 4.0.14 announces compatibility with 9.2 (issue #3301118: Drupal 10 compatibility):
core_version_requirement: ^9.2 || ^10.

So I think we should raise that to 9.3
core_version_requirement: ^9.3 || ^10.

Btw: Using above posted repo searches show:

Advanced search is disabled since 9.5.x is not the default branch

I think that's the reason for not finding "trait BundlePermissionHandlerTrait".

joegraduate’s picture

Title: Version 4.0.11 and above require Drupal core 9.3.x / 10.1.x » Version 4.0.11 and above require Drupal core 9.3.x / 10.x
devkinetic’s picture

Status: Needs review » Reviewed & tested by the community

This looks good, it should be bumped up.

isholgueras made their first commit to this issue’s fork.

  • isholgueras committed 286a7b59 on 4.x authored by tekNorah
    Issue #3341093: Version 4.0.11 and above require Drupal core 9.3.x / 10....
isholgueras’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the work

isholgueras’s picture

Status: Fixed » Closed (fixed)