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.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
@ -509,13 +510,27 @@ public class FolderManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
Collections.reverse(tokens);
|
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) {
|
if (withContentSection) {
|
||||||
final String sectionName = folder.getSection().getDisplayName();
|
final String sectionName = folder.getSection().getDisplayName();
|
||||||
return String.format("%s:/%s/", sectionName, path);
|
if (path.isEmpty()) {
|
||||||
|
return String.format("%s:/", sectionName);
|
||||||
|
} else {
|
||||||
|
return String.format("%s:/%s/", sectionName, path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return String.format("/%s/", path);
|
if (path.isEmpty()) {
|
||||||
|
return "/";
|
||||||
|
} else {
|
||||||
|
return String.format("/%s/", path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -815,7 +815,7 @@ public class DocumentController {
|
||||||
}
|
}
|
||||||
|
|
||||||
return String.format(
|
return String.format(
|
||||||
"redirect:/%s/documentfolders/%s",
|
"redirect:/%s/documentfolders%s",
|
||||||
sectionIdentifier,
|
sectionIdentifier,
|
||||||
folderPath
|
folderPath
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue