Custom theme - url.resourcesCommonPath references wrong theme

closes #20085
This commit is contained in:
Douglas Palmer 2023-06-08 13:39:13 -07:00 committed by Marek Posolda
parent 4fcb154d36
commit 59e1a5d992
2 changed files with 3 additions and 2 deletions

View file

@ -126,6 +126,7 @@ Theme properties are set in the file `<THEME TYPE>/theme.properties` in the them
* parent - Parent theme to extend * parent - Parent theme to extend
* import - Import resources from another theme * import - Import resources from another theme
* common - Override the common resource path. The default value is `common/keycloak` when not specified. This value would be used as value of suffix of `${url.resourcesCommonPath}`, which is used typically in freemarker templates (prefix of `${url.resoucesCommonPath}` value is theme root uri).
* styles - Space-separated list of styles to include * styles - Space-separated list of styles to include
* locales - Comma-separated list of supported locales * locales - Comma-separated list of supported locales

View file

@ -132,12 +132,12 @@ public class UrlBean {
URI uri = getThemeRootUri(); URI uri = getThemeRootUri();
String commonPath = ""; String commonPath = "";
try { try {
commonPath = theme.getProperties().getProperty("import"); commonPath = theme.getProperties().getProperty("common");
} catch (IOException ex) { } catch (IOException ex) {
logger.warn("Failed to load properties", ex); logger.warn("Failed to load properties", ex);
} }
if (commonPath == null || commonPath.isEmpty()) { if (commonPath == null || commonPath.isEmpty()) {
commonPath = "/common/keycloak"; commonPath = "common/keycloak";
} }
return uri.getPath() + "/" + commonPath; return uri.getPath() + "/" + commonPath;
} }