In EntityTypeRepository.php line 115: The Drupal\config_pages\Entity\ConfigPagesType class does not correspond to an entity type.

After upgrading from version 2.19 to 2.20, when I try to clean the cache "drush cr" that error is returned in the console.

CommentFileSizeAuthor
#19 d10upgrade.png240.83 KBshumer
#13 d10run.png83.53 KBshumer
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

altercat created an issue. See original summary.

altercat’s picture

Issue summary: View changes
shumer’s picture

Hey @altercat I don't see such message. Can you please share Drupal core version + PHP ( maybe screenshot with the issue) ?

shumer’s picture

The #[ConfigEntityType] and #[ContentEntityType] PHP attributes were introduced in **Drupal 10.2**. In version 2.20, the module migrated entity type definitions from annotations (@ConfigEntityType / @ContentEntityType in docblocks) to PHP attributes.

On Drupal 10.0 / 10.1:

  • The attribute class Drupal\Core\Entity\Attribute\ConfigEntityType does not exist - PHP 8 silently ignores unknown attributes .
  • The old @ConfigEntityType annotation was removed from the docblock during the migration.
  • As a result, the entity type discovery finds **no definition** for config_pages_type, which causes the error.

That's what comes into my mind now, but would be nice if you can confirm my theory.

kovalevm’s picture

I have the same problem.
And it makes Fatal Error.

Drupal core 10.6.5
PHP 8.4.11

altercat’s picture

Hi @shumer, thanks for the answer. I forgot to mention these details:

Drupal 10.6.5
PHP 8.3.30

joegl’s picture

I am seeing a similar issue, possibly related. In the entity_type_alter hook below it's reporting $entity_type is NULL after upgrading to 2.20.

function config_pages_overrides_entity_type_alter(array &$entity_types) {
  /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */
  $entity_type = $entity_types['config_pages_type'];
  $entity_type->setFormClass('config-override-form', ConfigPagesOverridesForm::class);
  $entity_type->setFormClass('config-override-add-form', ConfigPagesOverridesAddForm::class);
}

We are also on Drupal 10 (10.5.8). It seems there might be an issue with discoverability of the entity type on Drupal 10?

joegl’s picture

PHP Attribute definition support was added in Drupal 10.2, but only for specific plugins: https://www.drupal.org/node/3395575

Support for plugins added in 10.2 is listed here: https://www.drupal.org/node/3229001
Support for plugins added in 11.1 is listed here: https://www.drupal.org/node/3505422

The ConfigEntityType and ContentEntityType support was not added until 11.1.

The 2.20 release claims to support drupal Versions ^8 || ^9 || ^10 || ^11. This release should probably be unpublished and republished with only support for ^11.1, or the previous annotation should be added back with the addition of PHP attributes (have both) if it's going to retain support for older versions.

shumer’s picture

Assigned: Unassigned » shumer
joegl’s picture

I have edited my previous comment with better info. The support for PHP attributes is confusing because only certain plugins were supported in specific releases. The ConfigEntityType and ContentEntityType support was not added until 11.1.

joegl’s picture

I saw the merge request go up and quickly patched our install with the diff: https://git.drupalcode.org/project/config_pages/-/merge_requests/65.diff . It appears to be working correctly now. Apologies if this is premature.

shumer’s picture

StatusFileSize
new83.53 KB

Right, it was too aggressive to remove old annotations. Unfortunately I've missed to run the tests on D10 core.
We can add those annotation back and support both, while D10 still alive.
D10 run

  • shumer committed be1e0f80 on 8.x-2.x
    feat: #3577600 The Drupal\config_pages\Entity\ConfigPagesType class does...
joegl’s picture

Awesome, thanks for the swift action shumer

shumer’s picture

Thanks all for the report and the details - this helped pinpoint the issue quickly!

Fixed in 8.x-2.21 by restoring annotations alongside attributes in all 7 affected files. On Drupal 11 the attribute takes priority; on older versions annotation discovery picks up the fallback.

I'll try to make releases more frequently so fundamental things like this don't slip through unnoticed. :)

kovalevm’s picture

I still have this issue:

composer update
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 9 updates, 0 removals
  - Upgrading drupal/backup_migrate (5.1.3 => 5.1.4)
  - Upgrading drupal/config_pages (2.19.0 => 2.21.0)
  - Upgrading drupal/ds (3.36.0 => 3.37.0)
  - Upgrading drupal/masquerade (2.0.0 => 2.1.0)
  - Upgrading drupal/monitoring (1.20.0 => 1.21.0)
  - Upgrading drupal/unused_modules (1.5.0 => 1.6.0)
  - Upgrading laravel/prompts (v0.3.12 => v0.3.13)
  - Upgrading league/commonmark (2.8.0 => 2.8.1)
  - Upgrading psy/psysh (v0.12.19 => v0.12.20)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 9 updates, 0 removals
  - Downloading drupal/config_pages (2.21.0)
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Upgrading drupal/backup_migrate (5.1.3 => 5.1.4): Extracting archive
  - Upgrading drupal/config_pages (2.19.0 => 2.21.0): Extracting archive
  - Upgrading drupal/ds (3.36.0 => 3.37.0): Extracting archive
  - Upgrading drupal/masquerade (2.0.0 => 2.1.0): Extracting archive
  - Upgrading psy/psysh (v0.12.19 => v0.12.20): Extracting archive
  - Upgrading laravel/prompts (v0.3.12 => v0.3.13): Extracting archive
  - Upgrading drupal/monitoring (1.20.0 => 1.21.0): Extracting archive
  - Upgrading drupal/unused_modules (1.5.0 => 1.6.0): Extracting archive
  - Upgrading league/commonmark (2.8.0 => 2.8.1): Extracting archive
Package pear/console_getopt is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
110 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
> DrupalProject\composer\ScriptHandler::createRequiredFiles
No security vulnerability advisories found.
┌──newsite@host──[~/www/site.com]
└─(06.03.2026 22:23:50)❕drush updatedb
 [success] No pending updates.

In EntityTypeRepository.php line 115:

  The Drupal\config_pages\Entity\ConfigPagesType class does not correspond to
   an entity type.


┌──newsite@host──[~/www/site.com]
└─(06.03.2026 22:24:07)❕drush cr

In EntityTypeRepository.php line 115:

  The Drupal\config_pages\Entity\ConfigPagesType class does not correspond to
   an entity type.
joegl’s picture

I have not yet had an opportunity to test the new version (2.21) however it does appear the changes made in the merge request did not make it into the 2.21 version:

https://git.drupalcode.org/project/config_pages/-/blob/8.x-2.21/src/Enti...
https://git.drupalcode.org/project/config_pages/-/compare/8.x-2.20...8.x...

shumer’s picture

StatusFileSize
new240.83 KB

OMG, looks like I've created tag on wrong commit :(

shumer’s picture

https://git.drupalcode.org/project/config_pages/-/compare/8.x-2.20...8.x...
Now it should be good.

Haste makes waste. Lesson learned I hope.
@kovalevm can you please try?

kovalevm’s picture

Thank you very much, everything is fine now!

shumer’s picture

Great news. Hope we can close this issue then!

shumer’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

shumer’s picture

altercat’s picture

Many thanks, shumer! It works great now!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.