From cdb3e7b21446d3863cb19385d2cf496f5acb234e Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Tue, 16 Mar 2021 21:11:09 +0100 Subject: [PATCH] Merge pull request #42276 from elpaso/bugfix-gh42275-wfs3-string-fids-template Fix wfs3 template with string fids --- src/server/qgsserverogcapihandler.cpp | 2 +- tests/src/python/test_qgsserver_api.py | 9 + ...ons_items_testlayer_\303\250\303\251.html" | 175 ++++++++++++++++++ 3 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 "tests/testdata/qgis_server/api/test_wfs3_collections_items_testlayer_\303\250\303\251.html" diff --git a/src/server/qgsserverogcapihandler.cpp b/src/server/qgsserverogcapihandler.cpp index 05301dba73cc..cef5c1a1c38d 100644 --- a/src/server/qgsserverogcapihandler.cpp +++ b/src/server/qgsserverogcapihandler.cpp @@ -313,7 +313,7 @@ void QgsServerOgcApiHandler::htmlDump( const json &data, const QgsServerApiConte { fName.chop( 1 ); } - fName += '/' + QString::number( args.at( 0 )->get( ) ); + fName += '/' + QString::fromStdString( args.at( 0 )->get( ) ); if ( !suffix.isEmpty() ) { fName += '.' + suffix; diff --git a/tests/src/python/test_qgsserver_api.py b/tests/src/python/test_qgsserver_api.py index 3adb2a5aae41..69fdc700f669 100644 --- a/tests/src/python/test_qgsserver_api.py +++ b/tests/src/python/test_qgsserver_api.py @@ -527,6 +527,15 @@ def test_wfs3_collection_items(self): self.compareApi(request, project, 'test_wfs3_collections_items_testlayer_èé.json') + def test_wfs3_collection_items_html(self): + """Test WFS3 API items""" + project = QgsProject() + project.read(unitTestDataPath('qgis_server') + '/test_project_api.qgs') + request = QgsBufferServerRequest( + 'http://server.qgis.org/wfs3/collections/testlayer%20èé/items.html') + self.compareApi(request, project, + 'test_wfs3_collections_items_testlayer_èé.html') + def test_wfs3_collection_items_crs(self): """Test WFS3 API items with CRS""" project = QgsProject() diff --git "a/tests/testdata/qgis_server/api/test_wfs3_collections_items_testlayer_\303\250\303\251.html" "b/tests/testdata/qgis_server/api/test_wfs3_collections_items_testlayer_\303\250\303\251.html" new file mode 100644 index 000000000000..9f99d1521003 --- /dev/null +++ "b/tests/testdata/qgis_server/api/test_wfs3_collections_items_testlayer_\303\250\303\251.html" @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Features in layer A test vector layer èé + + + +
+ + + +
+ +
+ +
+
+

Features in layer A test vector layer èé

+ + +

A test vector layer èé 0

+
+ +
id
+
1
+ +
name
+
one
+ +
utf8nameè
+
one èé
+ +
+ +

A test vector layer èé 1

+
+ +
id
+
2
+ +
name
+
two
+ +
utf8nameè
+
two àò
+ +
+ +

A test vector layer èé 2

+
+ +
id
+
3
+ +
name
+
three
+ +
utf8nameè
+
three èé↓
+ +
+ +
+ + +
+
+ + +
+ + +
+ + +
+ + + + + + + + + + + + +