Skip to content

Commit

Permalink
fix : Enable to create a news with title contains a '.' character fol…
Browse files Browse the repository at this point in the history
…lowed by special character - EXO-66277 (#928)


Prior to this change, the news mosaic view articles were displayed like the mobile view on the extra-large screen. This issue was due to the incorrect check of the width based on the screen width. This change will display the news articles in the correct viewing mode .
  • Loading branch information
sofyenne committed Sep 22, 2023
1 parent 1f4fed2 commit a5fef78
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.services.security.ConversationState;
import org.exoplatform.services.wcm.core.NodeLocation;
import org.exoplatform.services.wcm.core.NodetypeConstant;
import org.exoplatform.services.wcm.extensions.publication.PublicationManager;
import org.exoplatform.services.wcm.extensions.publication.lifecycle.authoring.AuthoringPublicationConstant;
import org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig.Lifecycle;
Expand Down Expand Up @@ -207,7 +208,7 @@ public News createNews(News news) throws Exception {
}
String newsNodeName = !news.getTitle().equals("") ? news.getTitle() : "Untitled";
Node newsFolderNode = dataDistributionType.getOrCreateDataNode(spaceNewsRootNode, getNodeRelativePath(creationCalendar));
Node newsDraftNode = newsFolderNode.addNode(Utils.cleanName(newsNodeName).trim(), "exo:news");
Node newsDraftNode = newsFolderNode.addNode(Utils.cleanName(newsNodeName, NodetypeConstant.EXO_NEWS).trim(), NodetypeConstant.EXO_NEWS);
newsDraftNode.addMixin("exo:datetime");
newsDraftNode.setProperty("exo:title", news.getTitle());
newsDraftNode.setProperty("exo:summary", news.getSummary());
Expand Down Expand Up @@ -609,7 +610,7 @@ private void updateNewsName(Session session, Node newsNode, News news) throws Re
String srcPath = newsNode.getPath();
String destPath = (newsNode.getParent().getPath().equals("/") ? org.apache.commons.lang.StringUtils.EMPTY
: newsNode.getParent().getPath())
+ "/" + Utils.cleanName(news.getTitle()).trim();
+ "/" + Utils.cleanName(news.getTitle(), NodetypeConstant.EXO_NEWS).trim();
session.getWorkspace().move(srcPath, destPath);
}
}
Expand Down

0 comments on commit a5fef78

Please sign in to comment.