Problem/Motivation
Recently a new method named isAvailableForRegistration was added to the HostEntityInterface. This method is very useful, but has one drawback in that it is sensitive to the registration count for a given host entity through its HasRoom validator, and has to do a count query on the registration table, which is relatively expensive. Thus it is not suitable for use in access control where performance is paramount.
Introducing a new method isOpenForRegistration can do all the same checks as isAvailable except the HasRoom and AllowedRegistrant checks. This new method can be used in access control and various field formatters to simplify the code.
Note: The doc block for this and isAvailable will need to reference each other via @see and be very clear about when to use which one and how they differ.
This method allows the "set and forget" feature to be deprecated, since access checking that automatically recalculates based on settings open and close dates makes it unnecessary.
Steps to reproduce
Proposed resolution
Add the new method and use it in access control and various field formatters where applicable.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork registration-3505948
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
Comment #2
john.oltman commentedComment #3
jonathanshawYes, if we use this for the access it makes sense to have it.
Comment #6
john.oltman commentedComment #7
john.oltman commented