Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
c7063ef4
Commit
c7063ef4
authored
Mar 11, 2022
by
Matija Obreza
Browse files
CMS: Use now() if `Article.publishDate` not provided
parent
87f81ebd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/ContentServiceImpl.java
View file @
c7063ef4
...
...
@@ -26,7 +26,6 @@ import java.util.List;
import
java.util.Locale
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.velocity.VelocityContext
;
...
...
@@ -269,10 +268,10 @@ public class ContentServiceImpl implements ContentService {
article
.
setLang
(
locale
.
getLanguage
());
}
article
.
setPublishDate
(
publishDate
);
article
.
setPublishDate
(
publishDate
==
null
?
new
Date
()
:
publishDate
);
article
.
setExpirationDate
(
expirationDate
);
updateArticleContent
(
article
,
slug
,
title
,
summary
,
body
);
return
articleRepository
.
save
(
article
);
}
...
...
@@ -294,7 +293,9 @@ public class ContentServiceImpl implements ContentService {
@CacheEvict
(
value
=
"contentcache"
,
allEntries
=
true
)
public
Article
updateGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
summary
,
String
body
,
Date
publishDate
,
Date
expirationDate
)
throws
CRMException
{
Article
article
=
updateGlobalArticleInternal
(
slug
,
locale
,
title
,
summary
,
body
);
article
.
setPublishDate
(
publishDate
);
if
(
publishDate
!=
null
)
{
article
.
setPublishDate
(
publishDate
);
}
article
.
setExpirationDate
(
expirationDate
);
return
articleRepository
.
save
(
article
);
}
...
...
@@ -793,7 +794,7 @@ public class ContentServiceImpl implements ContentService {
}
article
.
setLang
(
locale
.
getLanguage
());
article
.
setPublishDate
(
publishDate
);
article
.
setPublishDate
(
publishDate
==
null
?
new
Date
()
:
publishDate
);
article
.
setExpirationDate
(
expirationDate
);
updateArticleContent
(
article
,
slug
,
title
,
summary
,
body
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment