Skip to content
Permalink
Browse files

Merge pull request #41335 from elpaso/bugfix-gh41292-server-cascading…

…-namespace-double-colon

Replace colon in typenames
  • Loading branch information
elpaso committed Feb 6, 2021
2 parents 20a066d + 65b272d commit 97a5237f1d6dd973ad4ade3c8feb29911297570c
Showing with 6 additions and 5 deletions.
  1. +2 −2 src/server/services/wfs/qgswfsgetfeature.cpp
  2. +4 −3 src/server/services/wfs/qgswfsutils.cpp
@@ -201,7 +201,7 @@ namespace QgsWfs
getFeatureQuery &query = *qIt;
QString typeName = query.typeName;

if ( !mapLayerMap.keys().contains( typeName ) )
if ( !mapLayerMap.contains( typeName ) )
{
throw QgsRequestNotWellFormedException( QStringLiteral( "TypeName '%1' unknown" ).arg( typeName ) );
}
@@ -333,7 +333,7 @@ namespace QgsWfs
accessControl->filterFeatures( vlayer, featureRequest );

QStringList attributes = QStringList();
for ( int idx : attrIndexes )
for ( int idx : qgis::as_const( attrIndexes ) )
{
attributes.append( vlayer->fields().field( idx ).name() );
}
@@ -56,7 +56,8 @@ namespace QgsWfs
href = request.originalUrl();
QUrlQuery q( href );

for ( auto param : q.queryItems() )
const auto constQueryItems = q.queryItems();
for ( const auto &param : constQueryItems )
{
if ( sFilter.contains( param.first.toUpper() ) )
q.removeAllQueryItems( param.first );
@@ -73,14 +74,14 @@ namespace QgsWfs
QString name = layer->name();
if ( !layer->shortName().isEmpty() )
name = layer->shortName();
name = name.replace( ' ', '_' );
name = name.replace( ' ', '_' ).replace( ':', '-' );
return name;
}

QgsVectorLayer *layerByTypeName( const QgsProject *project, const QString &typeName )
{
QStringList layerIds = QgsServerProjectUtils::wfsLayerIds( *project );
for ( const QString &layerId : layerIds )
for ( const QString &layerId : qgis::as_const( layerIds ) )
{
QgsMapLayer *layer = project->mapLayer( layerId );
if ( !layer )

0 comments on commit 97a5237

Please sign in to comment.