Merge pull request #4415 from nscuro/issue-4410

This commit is contained in:
Niklas 2024-11-28 18:18:26 +01:00 committed by GitHub
commit 9b015c3e28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 157 additions and 65 deletions

View file

@ -182,7 +182,7 @@ final class ProjectQueryManager extends QueryManager implements IQueryManager {
public List<Project> getAllProjects(boolean excludeInactive) {
final Query<Project> query = pm.newQuery(Project.class);
if (excludeInactive) {
query.setFilter("active == true || active == null");
query.setFilter("active");
}
query.setOrdering("id asc");
return query.executeList();
@ -473,9 +473,6 @@ final class ProjectQueryManager extends QueryManager implements IQueryManager {
if (project.getParent() != null && !Boolean.TRUE.equals(project.getParent().isActive())){
throw new IllegalArgumentException("An inactive Parent cannot be selected as parent");
}
if (project.isActive() == null) {
project.setActive(Boolean.TRUE);
}
final Project oldLatestProject = project.isLatest() ? getLatestProjectVersion(project.getName()) : null;
final Project result = callInTransaction(() -> {
// Remove isLatest flag from current latest project version, if the new project will be the latest