Closed (works as designed)
Project:
Wysiwyg
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2018 at 18:13 UTC
Updated:
8 Aug 2019 at 20:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ebremner commentedPatch to fix.
Comment #3
liam morlandComment #4
twodThis is currently by design. It needs to do a new request to itself to get a clean page with just the stylesheets loaded and prime the cache read on the next line.
Removing that requests simply breaks all in-editor stylesheet loading.
It was added as part of #2289683: Select in-editor theme and get all stylesheets. If you want something to sink your teeth into, figure out how to force the client to make that request instead, before stylesheets have actually been loaded into the editing area. ;)
We could force admins to trigger the "cache-warning" via the GUI after changing editor configs (or whenever you expect some stylesheets have been added/removed) but you'd easily forget to do this for all themes. Best would be if it was completely transparent to admins and visitors, without the first person who loads an editor ending up without stylesheets in the editing area because the caches were cold .
I have at least one idea on how to do it. Instead of doing that request it could return the path to a single stylesheet, which actually points to the page callback currently handling that request. It would do pretty much the same thing it does now, but instead of only returning "OK" and prepping the cache with the stylesheet list it would dynamically build a temporary stylesheet with
@importstatements for each of the files.@importstatements weren't well supported a few years ago but now it should be fine...That way you'd both warm the cache and have the first editor load get all stylesheets, by forcing it to take an extra step.
(A similar method could perhaps be used to include multiple stylesheets for editors which only support loading a single one.)
Comment #5
liam morlandThe call to drupal_http_request() was removed in #2884450: Theme CSS not added correctly when PHP can't make HTTP requests to the site itself.