diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java b/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java index cd4d881cf4..2b796c54e0 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java @@ -319,7 +319,7 @@ public class AdminConsole { @Path("messages.json") @Produces(MediaType.APPLICATION_JSON) public Properties getMessages(@QueryParam("lang") String lang) { - return AdminRoot.getMessages(session, realm, "admin-messages", lang); + return AdminRoot.getMessages(session, realm, lang, "admin-messages"); } } diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java b/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java index b7dcddf90f..5db1ea4475 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java @@ -288,7 +288,16 @@ public class AdminRoot { } } - public static Properties getMessages(KeycloakSession session, RealmModel realm, String bundle, String lang) { + public static Properties getMessages(KeycloakSession session, RealmModel realm, String lang, String... bundles) { + Properties compound = new Properties(); + for (String bundle : bundles) { + Properties current = getMessages(session, realm, lang, bundle); + compound.putAll(current); + } + return compound; + } + + private static Properties getMessages(KeycloakSession session, RealmModel realm, String lang, String bundle) { try { Theme theme = getTheme(session, realm); Locale locale = lang != null ? Locale.forLanguageTag(lang) : Locale.ENGLISH; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java index 56c7ce74fd..d3ac358f46 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java @@ -188,7 +188,7 @@ public class ComponentResource { } private Response localizedErrorResponse(ComponentValidationException cve) { - Properties messages = AdminRoot.getMessages(session, realm, "admin-messages", auth.getAuth().getToken().getLocale()); + Properties messages = AdminRoot.getMessages(session, realm, auth.getAuth().getToken().getLocale(), "admin-messages", "messages"); Object[] localizedParameters = cve.getParameters()==null ? null : Arrays.asList(cve.getParameters()).stream().map((Object parameter) -> { diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js index 8725539020..36b432fd7c 100755 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js @@ -1728,6 +1728,7 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio } $scope.changed = false; + $scope.lastVendor = instance.config['vendor'][0]; } initUserStorageSettings(); @@ -1740,7 +1741,7 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio } if (!angular.equals($scope.instance.config['vendor'][0], $scope.lastVendor)) { - console.log("LDAP vendor changed"); + console.log("LDAP vendor changed. Previous=" + $scope.lastVendor + " New=" + $scope.instance.config['vendor'][0]); $scope.lastVendor = $scope.instance.config['vendor'][0]; if ($scope.lastVendor === "ad") { @@ -1787,8 +1788,8 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio $scope.save = function() { $scope.changed = false; - if (!parseInt($scope.instance.config['batchSizeForSync'[0]])) { - $scope.instance.config['batchSizeForSync'][0] = DEFAULT_BATCH_SIZE; + if (!parseInt($scope.instance.config['batchSizeForSync'][0])) { + $scope.instance.config['batchSizeForSync'] = [ DEFAULT_BATCH_SIZE ]; } else { $scope.instance.config['batchSizeForSync'][0] = parseInt($scope.instance.config.batchSizeForSync).toString(); }