Mon, 09 Aug 2021 16:25:50 +0200
#156 fixes auto-selection overriding issue data
--- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Mon Aug 09 16:22:56 2021 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Mon Aug 09 16:25:50 2021 +0200 @@ -484,6 +484,7 @@ eta = getDate("eta") } + //language=SQL fun versionQuery(table: String) = """ select versionid, project, name, status, ordinal, node
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Mon Aug 09 16:22:56 2021 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Mon Aug 09 16:25:50 2021 +0200 @@ -460,15 +460,18 @@ project, ) - // pre-select component, if available in the path info - issue.component = component + // for new issues set some defaults + if (issue.id < 0) { + // pre-select component, if available in the path info + issue.component = component - // pre-select version, if available in the path info - if (version != null) { - if (version.status.isReleased) { - issue.affectedVersions = listOf(version) - } else { - issue.resolvedVersions = listOf(version) + // pre-select version, if available in the path info + if (version != null) { + if (version.status.isReleased) { + issue.affectedVersions = listOf(version) + } else { + issue.resolvedVersions = listOf(version) + } } }