Problem/Motivation
This was originally suggested by @jonathanshaw. It will simplify code and provide more consistency between access results and validation results, which will be helpful for other developers.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork registration-3505336
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 #5
john.oltman commentedComment #6
jonathanshawShouldn't src/RegistrationValidationResult.php be implementing RefineableCacheableDependencyInterface not CacheableDependencyInterface?
Your change to the behavior of RegistrationValidationEventSubscriber::getCacheableMetadata looks like it break the behavior of registration_admin_overrides\EventSubscriber\RegistrationValidationEventSubscriber
I'm also not sure what that change does to the way the validator and constraint validators handle cacheability, but I imagine we have test coverage there.
Comment #7
john.oltman commentedI've seen it done both ways, and it works as-is because I am using the trait, but AccessResult in core does what you suggest, and that is my model, so I will fix.
Indeed, good catch. I will fix
and add a test for this code path.Edited: no test as the condition is difficult to isolate.
Comment #10
john.oltman commented