Type not found : "Invalid specifier 'type'" with non node entities

Created on 21 July 2024, 5 months ago

Problem/Motivation

It's ok for node types but here's the problem with other entity types.

Drupal\Core\Entity\Query\QueryException: 'type' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 369 of /var/www/html/test/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).
Warning: Undefined array key "limit_type" in Drupal\entity_limit_extend\EntityLimitInspector->getRoleLimitPeriod() (line 245 of /var/www/html/test/web/modules/contrib/entity_limit_extend/src/EntityLimitInspector.php)

The same problem solved with patch also exists in the entity_limit module.

The checkAccess() method of both the roleLimit and userLimit assumes that the bundle key is always 'type' This is fine for nodes but most other entities are using 'bundle' (for example, with media entities) But this can be anything in a custom entity type.

https://www.drupal.org/project/entity_limit/issues/3347700 🐛 checkAccess() throws an exception "Invalid specifier 'type'" with non node entities Needs review

🐛 Bug report
Status

Active

Version

1.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.71.5 2024