DynamicPluginConfigWithCsrfTokenUrlTrait
trait DynamicPluginConfigWithCsrfTokenUrlTrait (View source)
| internal |
Provides a trait for CKEditor 5 with dynamically generated CSRF token URLs.
The Text Editor module's APIs predate the concept of bubbleable metadata. To prevent URLs with CSRF tokens from breaking cacheability, placeholders are used for those CSRF tokens since https://drupal.org/i/2512132. Placeholders are designed to be attached to the data in which they exist, so they can be replaced at the last possible moment, without interfering with cacheability. Unfortunately, because it is not possible to associate bubbleable metadata with a Text Editor's JS settings, we have to manually process these. This is acceptable only because a text editor's JS settings are not cacheable anyway (just like forms are not cacheable).