.../media/js/plugins/drupalmedia/plugin.es6.js | 2 ++ .../modules/media/js/plugins/drupalmedia/plugin.js | 2 ++ .../CKEditorIntegrationTest.php | 22 +--------------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/core/modules/media/js/plugins/drupalmedia/plugin.es6.js b/core/modules/media/js/plugins/drupalmedia/plugin.es6.js index d9723095ef..d741dbb2e3 100644 --- a/core/modules/media/js/plugins/drupalmedia/plugin.es6.js +++ b/core/modules/media/js/plugins/drupalmedia/plugin.es6.js @@ -486,6 +486,8 @@ const dataToHash = CKEDITOR.tools.clone(data); // The caption does not need rendering. delete dataToHash.attributes['data-caption']; + // The media entity's label is server-side data and cannot be modified by the content author. + delete dataToHash.label; // Changed link destinations do not affect the visual preview. if (dataToHash.link) { delete dataToHash.link.href; diff --git a/core/modules/media/js/plugins/drupalmedia/plugin.js b/core/modules/media/js/plugins/drupalmedia/plugin.js index 9178bd995c..01df58af58 100644 --- a/core/modules/media/js/plugins/drupalmedia/plugin.js +++ b/core/modules/media/js/plugins/drupalmedia/plugin.js @@ -318,6 +318,8 @@ delete dataToHash.attributes['data-caption']; + delete dataToHash.label; + if (dataToHash.link) { delete dataToHash.link.href; } diff --git a/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php b/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php index 068378b001..caa4b29507 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php +++ b/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php @@ -249,7 +249,7 @@ public function testPreviewUsesDefaultThemeAndIsClientCacheable() { // a second request is sent. This second request should have transferred 0 // bytes: the browser should have cached the response, thus resulting in a // much better user experience. - $this->assertGreaterThan(500, $this->getInitialPreviewRequestTransferSize()); + $this->assertGreaterThan(500, $this->getLastPreviewRequestTransferSize()); $this->pressEditorButton('source'); $this->assertNotEmpty($assert_session->waitForElement('css', 'textarea.cke_source')); $this->pressEditorButton('source'); @@ -1363,26 +1363,6 @@ protected function closeDialog() { $this->assertTrue($result); } - /** - * Gets the transfer size of the initial preview request. - * - * @return int - * The size of the bytes transferred. - */ - protected function getInitialPreviewRequestTransferSize() { - $this->getSession()->switchToIFrame(); - $javascript = <<getSession()->evaluateScript($javascript); - } - /** * Gets the transfer size of the last preview request. *