- Issue created by @jonathanshaw
Working on 📌 Replace HostEntity::isEnabledForRegistration Active and src/Plugin/Block/RegistrationStatus.php we identified that:
We call $host_entity->isAvailableForRegistration() 3 times in various places of the code of this block. When rendering the block we therefore call it 3 times. Which means the registration validation event is going to be fired 3 times on that request by this block alone.
it's registered as a callback. For an enabled block it is called once, and then a second time that I added. In theory I think what you are suggesting is correct, but in reality it seems the constructor is getting called more often than the build function, at least in a debugging session. Let's leave as is for now and address in a performance follow up. We may want to cache inside the host entity, if we can do that safely.
In theory we should be able to use a memory cache to safely cache validation results at the level of the validator.
Active
3.3
Registration Core