Fixed a bug when deleting content items

pull/20/head
Jens Pelzetter 2022-02-26 17:24:55 +01:00
parent 4024355838
commit 35ce5479fd
2 changed files with 19 additions and 4 deletions

View File

@ -30,6 +30,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
@ -509,15 +510,29 @@ public class FolderManager {
}
Collections.reverse(tokens);
final String path = String.join("/", tokens);
final String path = tokens
.stream()
.filter(token -> !"/".equals(token))
.collect(
Collectors.joining("/")
);
//final String path = String.join("/", tokens);
if (withContentSection) {
final String sectionName = folder.getSection().getDisplayName();
if (path.isEmpty()) {
return String.format("%s:/", sectionName);
} else {
return String.format("%s:/%s/", sectionName, path);
}
} else {
if (path.isEmpty()) {
return "/";
} else {
return String.format("/%s/", path);
}
}
}
/**
* Creates list with a parent folders of the provided folder.

View File

@ -815,7 +815,7 @@ public class DocumentController {
}
return String.format(
"redirect:/%s/documentfolders/%s",
"redirect:/%s/documentfolders%s",
sectionIdentifier,
folderPath
);