Problem/Motivation

Let's assume you have

a) REST enabled for nodes
b) a hook_node_grants() implementation running on your site

You'll get gazillions of The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: %s. in your logs.

Proposed resolution

#2626298: REST module must cache only responses to GET requests would solve many of those cases for a).

On top of that there is a general problem. Everytime you load an entity via ::loadByProperties() (which happens in validation and saving of an entity) it adds cache contexts to the render context.

Let's not add those access query tags in ::loadByProperties(). It doesn't make sense from a conceptual point of view.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#3 2729137.patch707 bytescatch

Comments

dawehner created an issue. See original summary.

dawehner’s picture

Issue summary: View changes
catch’s picture

Status: Active » Needs review
StatusFileSize
new707 bytes

Is this all it needs?

dawehner’s picture

Theoretically yes, but @berdir argued that existing code might already rely on the access checking.
I disagree fundamentally though. For me loadByProperties is NOT a wrapper for entity query. For me this is just an implementation detail.

catch’s picture

Yes I agree with #4, it's an implementation detail and skipping the access check was forgotten in the implementation.

We probably want a change record, but I think it's far more likely that people are running into data issues (not finding nodes or users they should be then creating duplicates or similar) than relying on the access check.

Status: Needs review » Needs work

The last submitted patch, 3: 2729137.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests

This was a random failure. Ideally we would backup this with a test.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

catch’s picture

Status: Needs review » Closed (duplicate)