The bug I ran into looks an awful lot like #2887562-8: Filename not applied when downloading cached export. however the patch from this previous issue has already been applied to 8.x-1.0-beta3 so I am opening a new issue.
Adding a token to the filename causes the following error to be thrown:
Uncaught PHP Exception 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. Returned object class: Drupal\Core\Cache\CacheableResponse." at web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php line 154
Removing the token from the filename cases the data export to work as expected.
Comments
Comment #2
sokru commentedFaced the same problem. Everything worked fine when I first time created the view with token in filename, but when I exported the views (config) to another site it gave this same error message.
Comment #3
tunaman commentedHad this problem. It was to do with one of the date tokens. I changed it to use a custom date format instead [date:custom:Ymd] then it worked again.
Comment #4
santimg commentedHi all, just had the same problem. I fixed it applying this workaround:
I placed this bit of code into a hook_views_post_render() and it worked for me. Hope it helps!
Comment #5
colanSwitched to d.o markup for the related issue link.
Comment #6
steven jones commentedSeems like this is the same as the error in #3194967: Export using date tokens is not working - cache metadata error?
If you can give the steps for reproducing, then we can take a look.