Skip to content
Snippets Groups Projects

Add cache context and cachable dependency.

1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
@@ -81,14 +81,14 @@ class ReorderChildrenAccess implements AccessCheckInterface {
if (!$entity) {
// At this point we can't proceed so we err on the side of caution and
// deny access to the tab.
return AccessResult::forbidden();
return AccessResult::forbidden()->addCacheableDependency($entity);
}
}
if ($entity && $this->parentCandidate->getCandidateFields($entity)) {
return AccessResult::allowed()->setCacheMaxAge(0);
return AccessResult::allowed()->addCacheableDependency($entity);
}
return AccessResult::forbidden();
return AccessResult::forbidden()->addCacheableDependency($entity);
}
}
Loading