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

Command icon 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

john.oltman created an issue. See original summary.

john.oltman’s picture

Assigned: john.oltman » Unassigned
Status: Active » Fixed
jonathanshaw’s picture

Shouldn'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.

john.oltman’s picture

Assigned: Unassigned » john.oltman
Status: Fixed » Needs work

Shouldn't src/RegistrationValidationResult.php be implementing RefineableCacheableDependencyInterface not CacheableDependencyInterface?

I'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.

Your change to the behavior of RegistrationValidationEventSubscriber::getCacheableMetadata looks like it break the behavior of registration_admin_overrides\EventSubscriber\RegistrationValidationEventSubscriber

Indeed, good catch. I will fix and add a test for this code path.
Edited: no test as the condition is difficult to isolate.

john.oltman’s picture

Assigned: john.oltman » Unassigned
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.