# HG changeset patch # User wilde@azure1.rgb.intevation.de # Date 1605088642 -3600 # Node ID 4bc14bea3fc99814637bb073d09a0d868107cad4 # Parent 3872f3bd1a082d3a49c5cceb17051515ed2a0758 Fixed check for bottleneck existence in fa import. The contains() function for bottleneck lists (slice) is build upon sort.SearchStrings() which in turn requires the slice to be sorted. Until now the bottleneck list was sorted by ordering in the database request, which depends on LC_COLLATE and might not meet the sort packages expectations. Therefor we now use sort.Strings() to sort it based on the same semantics as expected by SearchStrings(). diff -r 3872f3bd1a08 -r 4bc14bea3fc9 pkg/imports/fa.go --- a/pkg/imports/fa.go Thu Jul 09 17:26:53 2020 +0200 +++ b/pkg/imports/fa.go Wed Nov 11 10:57:22 2020 +0100 @@ -4,7 +4,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // License-Filename: LICENSES/AGPL-3.0.txt // -// Copyright (C) 2018,2019 by via donau +// Copyright (C) 2018,2019,2020 by via donau // – Österreichische Wasserstraßen-Gesellschaft mbH // Software engineering by Intevation GmbH // @@ -58,7 +58,6 @@ SELECT country FROM users.list_users WHERE username = current_user) AND staging_done = true AND validity && $1 -ORDER BY bottleneck_id ` latestMeasureDateSQL = ` @@ -235,6 +234,9 @@ return nil, err } + // bottlenecks MUST be sorted according to the sort packages + // expectations for contains() to work + sort.Strings(bns) return bns, nil }