Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
media system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jun 2018 at 11:04 UTC
Updated:
17 Jul 2018 at 15:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
marcoscanoHere is a patch just with the renaming.
Should we add a test for this as well, or it's not worth on this kind of obvious typo?
Comment #3
seanbLooks good to me. Tested it with the stark theme. Also added a test for this.
Comment #5
catchIs the drupal_flush_all_caches() necessary?
Comment #6
seanbYes, the test does not fail without clearing the cache. Which makes sense since it will use the cached result for the page otherwise.
Comment #7
phenaproximaExcellent. Thank you.
Comment #8
phenaproximaComment #9
phenaproximaShowed this to @alexpott in Slack and he wondered if there is any way we can have the test do something a little less heavy-handed than flushing call caches. Maybe just clearing the render cache will do the trick here?
Comment #10
alexpottSo the test passes without this so we need to have asserts that would cause the test to fail. I.e some asserts either side of this that can determine which template was used. Also let's call
$this->resetAll();so the test container is correctly updated.Comment #11
catchThe way I came across this was a php error/warning building the theme registry iirc.
Comment #12
seanbIn the end it was the cached http response that we should clear. Changed the patch to just invalidate that.
Comment #14
chr.fritschThis looks good to me.
Comment #15
alexpottThis points to an bigger issue. Patch incoming.
Comment #16
alexpottThe iframe response should have the
renderedcache tag because it is something produced by the render system but because it is a special response it's not feed through \Drupal\Core\Render\MainContent\HtmlRenderer::renderResponse() so it doesn't get this cache tag. If it did then \Drupal\system\EventSubscriber\ConfigCacheTag::onSave() would clear it automatically for us. So we need to change \Drupal\media\Controller\OEmbedIframeController to add this cache tag. Looking at that code it is apparent that we need to merge the final render array with the response cache data so we get anything added by the render system. Also this allows us to add the missing cache tags.Also I've improved the test to actually assert on which templates are being used by turning on twig debug. This means the test fails even if the file is correctly named but the cache tag is not added by OEmbedIframeController.
Comment #18
seanbLooks good to me! Probably need someone else to RTBC though.
Comment #19
chr.fritschThis is pretty neat. I like it
Patch looks good to me.
Comment #20
catchCommitted 2dc41c8 and pushed to 8.6.x. Thanks!