Install
Works with Drupal: ^9.3 || ^10 || ^11 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Drupal 12 compatibility
#3597716 The module now declares compatibility with Drupal 12. core_version_requirement is ^9.3 || ^10 || ^11 || ^12. Upgrade Status reports no known issues for the module on Drupal 11.4, and the test suite passes there. The module has not been run on a Drupal 12 site yet, so please report anything you find.
The errors that Upgrade Status still listed after the automated fixes are resolved: the list builder no longer injects the entity storage directly and follows the getDefaultOperations() signature of Drupal 11.3, and EntityLimitAddForm::save() returns the save status.
API changes
The hook implementations moved to Drupal\entity_limit\Hook\EntityLimitHooks, which is registered as a service and receives its dependencies through the constructor. The functions in entity_limit.module remain as #[LegacyHook] wrappers for core versions without object oriented hooks.
Added the Drupal\entity_limit\Attribute\EntityLimit plugin attribute. On Drupal 10.2 and later EntityLimitPluginManager discovers plugins by attribute and by annotation, on older core versions by annotation only. The @EntityLimit annotation keeps working, so custom plugins need no change. RoleLimit and UserLimit keep their annotations on this branch.
EntityLimitListBuilder no longer overrides the constructor and createInstance(), and EntityLimitPluginBase no longer overrides the constructor. All three only repeated their parent, so classes that extend them and call the parent keep working.
EntityLimitListBuilder::getDefaultOperations() accepts the optional CacheableMetadata parameter and adds the user.permissions cache context to it.
Known limitations
Three deprecations remain, all of them for Drupal 13: the @EntityType annotation on the entity type and the @EntityLimit annotation on the two plugins that ship with the module. They cannot be replaced on 3.0.x without dropping the older core versions and are left for 3.1.x.
The limitation tracked in #3620956 is unchanged in this release: limits are only enforced on entity types whose creation path checks entity create access.
Plans for 3.1.x
A 3.1.x branch is planned and has not been opened yet. It is meant to support Drupal 11 and 12, and Drupal 13 once it is available, to merge the two plugin interfaces into EntityLimitPluginInterface again, and to declare the plugins and the entity type with attributes. Drupal 9 and 10 stay on 3.0.x. See README.md for details.
Upgrading
This release adds no database updates. Rebuild caches after upgrading, because the hook implementations are now provided by a new service. Sites upgrading from a release older than 3.0.0-beta4 still need to run database updates for the post updates introduced there.