Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300243

content_moderation_entity_access() wrongly adds uncacheable dependencies

$
0
0

Problem/Motivation

This problem was pointed out by @Berdir:

content_moderation_entity_access() adds the $account object as a cacheable dependency, which is an uncacheable AccountProxy object.

Additionally, it also adds each \Drupal\workflows\Transition returned by \Drupal\content_moderation\StateTransitionValidation::getValidTransitions() object as a cacheable dependency, which are uncacheable objects as well.

The initial purpose for adding those dependencies was based on @Wim Leers's feedback from #2725533-64: Add experimental content_moderation module (point 10), but they were implemented wrongly by me :/

Proposed resolution

Since \Drupal\content_moderation\StateTransitionValidation::getValidTransitions() returns a list of transitions based on user permissions, that's the only cacheable dependency we need to use.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.


Viewing all articles
Browse latest Browse all 300243

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>