diff --git a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php index 41b9e837c7e1c..ec266f7098784 100644 --- a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php +++ b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php @@ -138,7 +138,12 @@ public function getForm() { $value = array_merge($defaultValue, $value); break; case 'ai.translation_provider_preferences': - $value += array_diff($defaultValue, $value); // Add entries from $defaultValue that are not in $value to the end of $value + // Only show entries from $value (saved pref list) that are in $defaultValue (enabled providers) + // and add all providers that are enabled but not in the pref list + if (!is_array($defaultValue)) { + break; + } + $value = array_values(array_unique(array_merge(array_intersect($value, $defaultValue), $defaultValue), SORT_STRING)); break; default: break;