Commit 99269891 authored by Matija Obreza's avatar Matija Obreza
Browse files

Fixed #25 article edit in selected locale

parent 08bfc37a
......@@ -93,7 +93,7 @@ public class ContentServiceImpl implements ContentService {
}
@Override
@Cacheable(value = "contentcache", key = "'globalarticle-' + #slug + '-' + #locale.language")
@Cacheable(value = "contentcache", key = "'globalarticle-' + #slug + '-' + #locale.language + '-' + #useDefault")
public Article getGlobalArticle(String slug, Locale locale, boolean useDefault) {
return getArticle(Article.class, null, slug, locale, useDefault);
}
......@@ -114,7 +114,7 @@ public class ContentServiceImpl implements ContentService {
}
@Override
@Cacheable(value = "contentcache", key = "'article-' + #clazz.name + '-' + #id + '-' + #slug + '-' + #locale.language")
@Cacheable(value = "contentcache", key = "'article-' + #clazz.name + '-' + #id + '-' + #slug + '-' + #locale.language + '-' + #useDefault")
public Article getArticle(Class<?> clazz, Long id, String slug, Locale locale, boolean useDefault) {
Article article = articleRepository.findByClassPkAndTargetIdAndSlugAndLang(getClassPk(clazz), id, slug, locale.getLanguage());
if (article == null && useDefault && !locale.getLanguage().equals(getDefaultLocale().getLanguage())) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment