Fixed a bug when deleting content items
parent
4024355838
commit
35ce5479fd
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -815,7 +815,7 @@ public class DocumentController {
|
|||
}
|
||||
|
||||
return String.format(
|
||||
"redirect:/%s/documentfolders/%s",
|
||||
"redirect:/%s/documentfolders%s",
|
||||
sectionIdentifier,
|
||||
folderPath
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue