From cf39d3e97ec2696a989d8f46134646e002293f09 Mon Sep 17 00:00:00 2001 From: amandine-sahl Date: Tue, 7 May 2024 15:03:11 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[FIX]=20=20v=5Ftreks=20view=20#4?= =?UTF-8?q?099?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.rst | 3 +++ geotrek/trekking/templates/trekking/sql/post_30_views.sql | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index f9881b79fa..5662fdf498 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,6 +10,9 @@ CHANGELOG - Improve information about upgrading geotrek-admin version with debian - Remove obsolete SHOW_SENSITIVE_AREAS_ON_MAP_SCREENSHOT parameter +**Bug fixes** +- Fix view `v_treks` (fixes #4099) + 2.106.0 (2024-05-15) -------------------- diff --git a/geotrek/trekking/templates/trekking/sql/post_30_views.sql b/geotrek/trekking/templates/trekking/sql/post_30_views.sql index 044c0364ac..f5c44f08c7 100644 --- a/geotrek/trekking/templates/trekking/sql/post_30_views.sql +++ b/geotrek/trekking/templates/trekking/sql/post_30_views.sql @@ -170,11 +170,12 @@ LEFT JOIN GROUP BY topo_object_id) h_{{lang}} ON a.topo_object_id = h_{{lang}}.topo_object_id {% endfor %} LEFT JOIN - (SELECT a.name, + (SELECT array_to_string(ARRAY_AGG (a.name ORDER BY a.id), ',', '_') as name, topo_object_id FROM common_recordsource a JOIN trekking_trek_source b ON a.id = b.recordsource_id - JOIN trekking_trek c ON b.trek_id = c.topo_object_id) i ON a.topo_object_id = i.topo_object_id + JOIN trekking_trek c ON b.trek_id = c.topo_object_id + GROUP BY topo_object_id) i ON a.topo_object_id = i.topo_object_id LEFT JOIN (SELECT array_to_string(ARRAY_AGG (a.url ORDER BY a.id), ',', '_') url, d.topo_object_id