diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js index 9cefaf132f..2476c3f942 100644 --- a/apps/settings/js/federationsettingsview.js +++ b/apps/settings/js/federationsettingsview.js @@ -43,7 +43,14 @@ if (!scopeOnly) { self._config.set(field, $('#' + field).val()); } - self._config.set(field + 'Scope', $('#' + field + 'scope').val()); + // A scope could have been stored as null due to a previous bug. + // Null values should be kept as such until the user explicitly + // sets the right value, but they will be returned as empty + // strings in the template (which would overwrite the null value + // if sent). Due to this an extra class is needed to + // differentiate them. + var initialScopeValue = $('#' + field + 'scope').hasClass('corrupted-scope-value') ? undefined : $('#' + field + 'scope').val(); + self._config.set(field + 'Scope', initialScopeValue); // Set inputs whenever model values change if (!scopeOnly) { @@ -219,6 +226,12 @@ $icon.addClass('icon-link'); $icon.removeClass('hidden'); break; + case '': + case null: + case undefined: + $icon.addClass('icon-error'); + $icon.removeClass('hidden'); + break; } } }); diff --git a/apps/settings/templates/settings/personal/personal.info.php b/apps/settings/templates/settings/personal/personal.info.php index 1524403611..ea56b00bbd 100644 --- a/apps/settings/templates/settings/personal/personal.info.php +++ b/apps/settings/templates/settings/personal/personal.info.php @@ -70,7 +70,7 @@ script('settings', [ - + class="corrupted-scope-value">
@@ -124,7 +124,7 @@ script('settings', [ - + class="corrupted-scope-value">
@@ -172,7 +172,7 @@ script('settings', [ t('For password reset and notifications')); ?> - + class="corrupted-scope-value">
@@ -193,7 +193,7 @@ script('settings', [ placeholder="t('Your phone number')); ?>" autocomplete="on" autocapitalize="none" autocorrect="off" /> - + class="corrupted-scope-value"> @@ -215,7 +215,7 @@ script('settings', [ value="" autocomplete="on" autocapitalize="none" autocorrect="off" /> - + class="corrupted-scope-value"> @@ -268,7 +268,7 @@ script('settings', [ } ?> /> - + class="corrupted-scope-value"> @@ -321,7 +321,7 @@ script('settings', [ } ?> /> - + class="corrupted-scope-value">