- π¦πΉAustria aurelianzaha
Patch https://www.drupal.org/project/drupal/issues/3080634#comment-14357338 π Catch EarlyRendering Exception for REST-Resources Needs work applies to 10.2 as well and working fine
There are some issue where people always have the same issue running in a LogicException "The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early" when extending ResourceBase.
See #3052553: Entity query alter with cacheable metadata leaks and triggers LogicException β , #2876258: Add a way to pass Access Cacheability of EntityQuery β . π Exception in EarlyRenderingControllerWrapperSubscriber is a DX nightmare, remove it Needs work
Specially in π Exception in EarlyRenderingControllerWrapperSubscriber is a DX nightmare, remove it Needs work starting from comment 17 there are people discussing a lot of workarounds for different situations.
These are so far:
If a query alter happens (node_query_node_access_alter) then the correct solution would be β¨ Enable an entity query's return value to carry cacheability Active .
For the other cases there is currently no other issue I'm aware of.
So my proposed solution would be that the RequestHandler executes the controller inside a context and add the cache metadata from there to the response. This would help a lot of developers not running into this issue and would relate to CR https://www.drupal.org/node/2513810 β to not have to do this "workaround" so much.
none.
Bubble metadata inside REST requests will now automaticcly attached to the response.
none.
Needs work
11.0 π₯
Last updated
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Patch https://www.drupal.org/project/drupal/issues/3080634#comment-14357338 π Catch EarlyRendering Exception for REST-Resources Needs work applies to 10.2 as well and working fine