Skip to content

Commit 1b783df

Browse files
committed
Fix missing folders from db after copy operation
1 parent 3d3d5e8 commit 1b783df

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/main/java/org/craftercms/studio/impl/v2/repository/GitContentRepositoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ public void createEmptyFiles(String siteId, Collection<String> paths) {
886886
private void addEmptyFile(Repository repo, String siteId, String path) throws ServiceLayerException {
887887
try {
888888
File file = new File(repo.getDirectory().getParent(), path);
889-
if (!file.createNewFile()) {
889+
if (!file.exists() && !file.createNewFile()) {
890890
logger.error("Failed to create file to site '{}' path '{}'", siteId, path);
891891
throw new ServiceLayerException(format("Failed to create file to site '%s' path '%s'", siteId, path));
892892
}

src/main/java/org/craftercms/studio/impl/v2/service/content/internal/ContentServiceInternalImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,6 @@ protected Set<String> getMissingFolders(final String siteId, final Map<String, L
11301130
*/
11311131
protected Set<String> getMissingFoldersForCopyOrMove(String siteId, Collection<ContentLifecycleItem> lifecycleItems) {
11321132
return lifecycleItems.stream()
1133-
.filter(item -> item.sourcePath() == null)
11341133
.flatMap(item -> calculateMissingFolders(siteId, item.repoPath()).stream())
11351134
.collect(toSet());
11361135
}

0 commit comments

Comments
 (0)