core/modules/media/src/Form/MediaSettingsForm.php | 7 ++++++- core/modules/system/system.install | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/modules/media/src/Form/MediaSettingsForm.php b/core/modules/media/src/Form/MediaSettingsForm.php index 6d90e36ee4..b70aa19d24 100644 --- a/core/modules/media/src/Form/MediaSettingsForm.php +++ b/core/modules/media/src/Form/MediaSettingsForm.php @@ -117,8 +117,13 @@ public function buildForm(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { + $iframe_domain = $form_state->getValue('iframe_domain'); + // The empty string is not a valid URI, but NULL is allowed. + if ($iframe_domain === '') { + $iframe_domain = NULL; + } $this->config('media.settings') - ->set('iframe_domain', $form_state->getValue('iframe_domain')) + ->set('iframe_domain', $iframe_domain) ->set('standalone_url', $form_state->getValue('standalone_url')) ->save(); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index d5c4921f07..fae06ecc27 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1843,4 +1843,5 @@ function system_update_10101(&$sandbox = NULL) { 'not null' => TRUE, ]); } + }